Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleting namespaces and tables of JDBC Catalog #1400

Open
ArijitSinghEDA opened this issue Dec 4, 2024 · 1 comment
Open

Deleting namespaces and tables of JDBC Catalog #1400

ArijitSinghEDA opened this issue Dec 4, 2024 · 1 comment

Comments

@ArijitSinghEDA
Copy link

Question

I have a catalog created with a Postgres+Minio. When I run the function catalog.drop_namespace(), the namespace with its properties (if any), do not get purged from the Postgres. When I run the function catalog.drop_table(), it does the same thing, and the data is not purged from the Minio as well.

Is this a known behaviour?

@kevinjqliu
Copy link
Contributor

drop_namespace and drop_table are metadata operations. in this case, they will remove the specific entries in the postgres database.

for drop_table, some catalog implementations also support removing the underlying files associated with the table. for example

def drop_table(self, identifier: Union[str, Identifier], purge_requested: bool = False) -> None:
identifier_tuple = self._identifier_to_tuple_without_catalog(identifier)
response = self._session.delete(
self.url(
Endpoints.drop_table, prefixed=True, purge=purge_requested, **self._split_identifier_for_path(identifier_tuple)
),
)
try:
response.raise_for_status()
except HTTPError as exc:
self._handle_non_200_response(exc, {404: NoSuchTableError})

for catalogs which subclass MetastoreCatalog like SqlCatalog there is a purge_table function available to remove the files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants