geyanggang commented on code in PR #13481:
URL: https://github.com/apache/gravitino/pull/13481#discussion_r4090705421
##########
catalogs/catalog-jdbc-common/src/main/java/org/apache/gravitino/catalog/jdbc/operation/TableOperation.java:
##########
@@ -148,4 +148,26 @@ void alterTable(String databaseName, String tableName,
TableChange... changes)
default JdbcTablePartitionOperations
createJdbcTablePartitionOperations(JdbcTable loadedTable) {
throw new UnsupportedOperationException("Table partition operation is not
supported yet");
}
+
+ /**
+ * Maps a normalized table name to the name under which the table is
physically stored, when the
+ * two can differ for this backend.
+ *
+ * <p>The default returns {@code tableName} unchanged: most backends store a
table under exactly
+ * the normalized name. A backend whose name normalization is not reversible
(for example one that
+ * folds unquoted names to a fixed case while also preserving case-sensitive
names) may override
+ * this to look the real stored name up from its catalog, so a name returned
by {@link
+ * #listTables(String)} round-trips through load/alter/drop.
+ *
+ * <p>Implementations must be side-effect free and reuse the operation's
existing data source
+ * rather than opening new connections.
+ *
+ * @param databaseName The name of the database (schema).
+ * @param tableName The normalized table name.
+ * @return The physically stored table name; {@code tableName} unchanged
when no mapping is
+ * needed.
+ */
+ default String resolveTableName(String databaseName, String tableName) {
Review Comment:
There's now a concrete implementer exercised end-to-end in-repo:
TestCatalogOperations implements the SPI, and TestTableOperationDispatcher
proves the full round-trip — create under one case, then load/alter/drop by a
differently-cased name that resolves to it, with the resolved name driving the
entity store key and no orphan entity left behind — plus exact-match-wins. A
production JDBC backend that opts in (with its own dictionary lookup) is a
separate change.
--
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]