jerryshao commented on code in PR #14715:
URL: https://github.com/apache/gravitino/pull/14715#discussion_r4490976638
##########
catalogs/catalog-jdbc-postgresql/src/main/java/org/apache/gravitino/catalog/postgresql/operation/PostgreSqlTableOperations.java:
##########
@@ -365,6 +365,27 @@ protected String generateDropTableSql(String tableName) {
return "DROP TABLE " + quotedIdentifier(tableName);
}
+ /**
+ * Drops the table by its schema-qualified name. An unqualified name is
resolved through the
+ * search path, and PostgreSQL leaves out a schema the catalog user has no
USAGE privilege on. The
+ * drop would then report the table as missing instead of refusing it with
42501.
+ *
+ * <p>On {@code branch-1.3}, that missing-table result can cause Gravitino
to remove the
Review Comment:
[Nit] This Javadoc describes behavior of `branch-1.3` versus `main` inside
code that lives on one branch, so it will be stale or misleading after
backports. The `main` half is accurate (TableOperationDispatcher preserves the
registration when the connector returns false), but that belongs in the PR
description or commit message. Suggest keeping only the permission/search-path
rationale in the Javadoc.
##########
catalogs/catalog-jdbc-postgresql/src/main/java/org/apache/gravitino/catalog/postgresql/operation/PostgreSqlTableOperations.java:
##########
@@ -365,6 +365,27 @@ protected String generateDropTableSql(String tableName) {
return "DROP TABLE " + quotedIdentifier(tableName);
}
+ /**
+ * Drops the table by its schema-qualified name. An unqualified name is
resolved through the
+ * search path, and PostgreSQL leaves out a schema the catalog user has no
USAGE privilege on. The
+ * drop would then report the table as missing instead of refusing it with
42501.
+ *
+ * <p>On {@code branch-1.3}, that missing-table result can cause Gravitino
to remove the
+ * registration of a table that still exists. On {@code main}, the
registration is already
+ * preserved when the connector returns {@code false}; schema qualification
ensures the permission
+ * failure is reported as 403.
+ */
+ @Override
+ protected void dropTable(String schemaName, String tableName) {
Review Comment:
[Nit] The base `dropTable` logs `Attempting to delete table ...` at INFO;
this override drops that log line, so the PostgreSQL drop path is less
traceable than other JDBC catalogs. (`drop` still logs the attempt and the
success, so the loss is small.) Optionally add a `LOG.info` here for parity.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]