lance-namespace-impls 0.1.2__tar.gz → 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {lance_namespace_impls-0.1.2 → lance_namespace_impls-0.2.0}/PKG-INFO +1 -1
- {lance_namespace_impls-0.1.2 → lance_namespace_impls-0.2.0}/pyproject.toml +1 -1
- {lance_namespace_impls-0.1.2 → lance_namespace_impls-0.2.0}/src/lance_namespace_impls/hive2.py +27 -3
- {lance_namespace_impls-0.1.2 → lance_namespace_impls-0.2.0}/src/lance_namespace_impls/hive3.py +28 -0
- {lance_namespace_impls-0.1.2 → lance_namespace_impls-0.2.0}/.gitignore +0 -0
- {lance_namespace_impls-0.1.2 → lance_namespace_impls-0.2.0}/README.md +0 -0
- {lance_namespace_impls-0.1.2 → lance_namespace_impls-0.2.0}/src/lance_namespace_impls/__init__.py +0 -0
- {lance_namespace_impls-0.1.2 → lance_namespace_impls-0.2.0}/src/lance_namespace_impls/glue.py +0 -0
- {lance_namespace_impls-0.1.2 → lance_namespace_impls-0.2.0}/src/lance_namespace_impls/iceberg.py +0 -0
- {lance_namespace_impls-0.1.2 → lance_namespace_impls-0.2.0}/src/lance_namespace_impls/polaris.py +0 -0
- {lance_namespace_impls-0.1.2 → lance_namespace_impls-0.2.0}/src/lance_namespace_impls/rest_client.py +0 -0
- {lance_namespace_impls-0.1.2 → lance_namespace_impls-0.2.0}/src/lance_namespace_impls/schema.py +0 -0
- {lance_namespace_impls-0.1.2 → lance_namespace_impls-0.2.0}/src/lance_namespace_impls/unity.py +0 -0
- {lance_namespace_impls-0.1.2 → lance_namespace_impls-0.2.0}/tests/__init__.py +0 -0
- {lance_namespace_impls-0.1.2 → lance_namespace_impls-0.2.0}/tests/test_glue.py +0 -0
- {lance_namespace_impls-0.1.2 → lance_namespace_impls-0.2.0}/tests/test_glue_integration.py +0 -0
- {lance_namespace_impls-0.1.2 → lance_namespace_impls-0.2.0}/tests/test_hive2.py +0 -0
- {lance_namespace_impls-0.1.2 → lance_namespace_impls-0.2.0}/tests/test_hive2_integration.py +0 -0
- {lance_namespace_impls-0.1.2 → lance_namespace_impls-0.2.0}/tests/test_hive3.py +0 -0
- {lance_namespace_impls-0.1.2 → lance_namespace_impls-0.2.0}/tests/test_hive3_integration.py +0 -0
- {lance_namespace_impls-0.1.2 → lance_namespace_impls-0.2.0}/tests/test_iceberg.py +0 -0
- {lance_namespace_impls-0.1.2 → lance_namespace_impls-0.2.0}/tests/test_iceberg_integration.py +0 -0
- {lance_namespace_impls-0.1.2 → lance_namespace_impls-0.2.0}/tests/test_namespace.py +0 -0
- {lance_namespace_impls-0.1.2 → lance_namespace_impls-0.2.0}/tests/test_polaris.py +0 -0
- {lance_namespace_impls-0.1.2 → lance_namespace_impls-0.2.0}/tests/test_polaris_integration.py +0 -0
- {lance_namespace_impls-0.1.2 → lance_namespace_impls-0.2.0}/tests/test_schema.py +0 -0
- {lance_namespace_impls-0.1.2 → lance_namespace_impls-0.2.0}/tests/test_unity.py +0 -0
- {lance_namespace_impls-0.1.2 → lance_namespace_impls-0.2.0}/tests/test_unity_integration.py +0 -0
{lance_namespace_impls-0.1.2 → lance_namespace_impls-0.2.0}/src/lance_namespace_impls/hive2.py
RENAMED
|
@@ -72,6 +72,8 @@ from lance_namespace_urllib3_client.models import (
|
|
|
72
72
|
CreateNamespaceResponse,
|
|
73
73
|
DropNamespaceRequest,
|
|
74
74
|
DropNamespaceResponse,
|
|
75
|
+
DropTableRequest,
|
|
76
|
+
DropTableResponse,
|
|
75
77
|
ListTablesRequest,
|
|
76
78
|
ListTablesResponse,
|
|
77
79
|
DeclareTableRequest,
|
|
@@ -397,6 +399,31 @@ class Hive2Namespace(LanceNamespace):
|
|
|
397
399
|
logger.error(f"Failed to describe table {request.id}: {e}")
|
|
398
400
|
raise
|
|
399
401
|
|
|
402
|
+
def drop_table(self, request: DropTableRequest) -> DropTableResponse:
|
|
403
|
+
"""Drop a table from the Hive Metastore and delete its data."""
|
|
404
|
+
try:
|
|
405
|
+
database, table_name = self._normalize_identifier(request.id)
|
|
406
|
+
|
|
407
|
+
with self.client as client:
|
|
408
|
+
table = client.get_table(database, table_name)
|
|
409
|
+
|
|
410
|
+
if not table.parameters:
|
|
411
|
+
raise ValueError(f"Table {request.id} is not a Lance table")
|
|
412
|
+
table_type = table.parameters.get(TABLE_TYPE_KEY, "").lower()
|
|
413
|
+
if table_type != LANCE_TABLE_FORMAT:
|
|
414
|
+
raise ValueError(f"Table {request.id} is not a Lance table")
|
|
415
|
+
|
|
416
|
+
location = table.sd.location if table.sd else None
|
|
417
|
+
|
|
418
|
+
client.drop_table(database, table_name, deleteData=True)
|
|
419
|
+
|
|
420
|
+
return DropTableResponse(location=location)
|
|
421
|
+
except Exception as e:
|
|
422
|
+
if NoSuchObjectException and isinstance(e, NoSuchObjectException):
|
|
423
|
+
raise ValueError(f"Table {request.id} does not exist")
|
|
424
|
+
logger.error(f"Failed to drop table {request.id}: {e}")
|
|
425
|
+
raise
|
|
426
|
+
|
|
400
427
|
def deregister_table(
|
|
401
428
|
self, request: DeregisterTableRequest
|
|
402
429
|
) -> DeregisterTableResponse:
|
|
@@ -405,10 +432,8 @@ class Hive2Namespace(LanceNamespace):
|
|
|
405
432
|
database, table_name = self._normalize_identifier(request.id)
|
|
406
433
|
|
|
407
434
|
with self.client as client:
|
|
408
|
-
# Get table to check if it's a Lance table
|
|
409
435
|
table = client.get_table(database, table_name)
|
|
410
436
|
|
|
411
|
-
# Check if it's a Lance table (case insensitive)
|
|
412
437
|
if not table.parameters:
|
|
413
438
|
raise ValueError(f"Table {request.id} is not a Lance table")
|
|
414
439
|
table_type = table.parameters.get(TABLE_TYPE_KEY, "").lower()
|
|
@@ -417,7 +442,6 @@ class Hive2Namespace(LanceNamespace):
|
|
|
417
442
|
|
|
418
443
|
location = table.sd.location if table.sd else None
|
|
419
444
|
|
|
420
|
-
# Drop the table metadata only (don't delete data)
|
|
421
445
|
client.drop_table(database, table_name, deleteData=False)
|
|
422
446
|
|
|
423
447
|
return DeregisterTableResponse(location=location)
|
{lance_namespace_impls-0.1.2 → lance_namespace_impls-0.2.0}/src/lance_namespace_impls/hive3.py
RENAMED
|
@@ -74,6 +74,8 @@ from lance_namespace_urllib3_client.models import (
|
|
|
74
74
|
CreateNamespaceResponse,
|
|
75
75
|
DropNamespaceRequest,
|
|
76
76
|
DropNamespaceResponse,
|
|
77
|
+
DropTableRequest,
|
|
78
|
+
DropTableResponse,
|
|
77
79
|
ListTablesRequest,
|
|
78
80
|
ListTablesResponse,
|
|
79
81
|
DeclareTableRequest,
|
|
@@ -477,6 +479,32 @@ class Hive3Namespace(LanceNamespace):
|
|
|
477
479
|
logger.error(f"Failed to describe table {request.id}: {e}")
|
|
478
480
|
raise
|
|
479
481
|
|
|
482
|
+
def drop_table(self, request: DropTableRequest) -> DropTableResponse:
|
|
483
|
+
"""Drop a table and delete its data."""
|
|
484
|
+
try:
|
|
485
|
+
catalog, database, table_name = self._normalize_identifier(request.id)
|
|
486
|
+
|
|
487
|
+
with self.client as client:
|
|
488
|
+
table = client.get_table(database, table_name)
|
|
489
|
+
|
|
490
|
+
if not table.parameters:
|
|
491
|
+
raise ValueError(f"Table {request.id} is not a Lance table")
|
|
492
|
+
table_type = table.parameters.get(TABLE_TYPE_KEY, "").lower()
|
|
493
|
+
if table_type != LANCE_TABLE_FORMAT:
|
|
494
|
+
raise ValueError(f"Table {request.id} is not a Lance table")
|
|
495
|
+
|
|
496
|
+
location = table.sd.location if table.sd else None
|
|
497
|
+
|
|
498
|
+
client.drop_table(database, table_name, deleteData=True)
|
|
499
|
+
|
|
500
|
+
return DropTableResponse(location=location)
|
|
501
|
+
|
|
502
|
+
except Exception as e:
|
|
503
|
+
if NoSuchObjectException and isinstance(e, NoSuchObjectException):
|
|
504
|
+
raise ValueError(f"Table {request.id} does not exist")
|
|
505
|
+
logger.error(f"Failed to drop table {request.id}: {e}")
|
|
506
|
+
raise
|
|
507
|
+
|
|
480
508
|
def deregister_table(
|
|
481
509
|
self, request: DeregisterTableRequest
|
|
482
510
|
) -> DeregisterTableResponse:
|
|
File without changes
|
|
File without changes
|
{lance_namespace_impls-0.1.2 → lance_namespace_impls-0.2.0}/src/lance_namespace_impls/__init__.py
RENAMED
|
File without changes
|
{lance_namespace_impls-0.1.2 → lance_namespace_impls-0.2.0}/src/lance_namespace_impls/glue.py
RENAMED
|
File without changes
|
{lance_namespace_impls-0.1.2 → lance_namespace_impls-0.2.0}/src/lance_namespace_impls/iceberg.py
RENAMED
|
File without changes
|
{lance_namespace_impls-0.1.2 → lance_namespace_impls-0.2.0}/src/lance_namespace_impls/polaris.py
RENAMED
|
File without changes
|
{lance_namespace_impls-0.1.2 → lance_namespace_impls-0.2.0}/src/lance_namespace_impls/rest_client.py
RENAMED
|
File without changes
|
{lance_namespace_impls-0.1.2 → lance_namespace_impls-0.2.0}/src/lance_namespace_impls/schema.py
RENAMED
|
File without changes
|
{lance_namespace_impls-0.1.2 → lance_namespace_impls-0.2.0}/src/lance_namespace_impls/unity.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lance_namespace_impls-0.1.2 → lance_namespace_impls-0.2.0}/tests/test_iceberg_integration.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lance_namespace_impls-0.1.2 → lance_namespace_impls-0.2.0}/tests/test_polaris_integration.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|