JingsongLi commented on code in PR #8001:
URL: https://github.com/apache/paimon/pull/8001#discussion_r3485025467
##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/lineage/LineageUtils.java:
##########
@@ -122,6 +136,25 @@ public static String getNamespace(Table table, @Nullable
CatalogContext catalogC
return DEFAULT_NAMESPACE;
}
+ @VisibleForTesting
+ static String resolveNameByMetastore(Table table, @Nullable String
defaultName) {
+ CatalogContext ctx = catalogContext(table);
+ if (ctx != null) {
+ Options catalogOptions = ctx.options();
+ // If jdbc metastore is used, use catalog-key as the catalog
identifier.
+ if (JdbcCatalogFactory.IDENTIFIER.equals(
+ catalogOptions.get(CatalogOptions.METASTORE))) {
+ String catalogKeyValue =
catalogOptions.get(JdbcCatalogOptions.CATALOG_KEY);
+ if (!StringUtils.isNullOrWhitespaceOnly(catalogKeyValue)) {
+ return catalogKeyValue + "." + table.fullName();
Review Comment:
Thanks for the context. I still think the explicit `defaultName` should win
in this overload. The Table/SQL providers pass the resolved Flink table
identifier here, so overriding it only for JDBC catalogs changes the existing
table/SQL lineage name even though the catalog-key derivation is only needed
for the new DataStream APIs where no name is available. That makes the same
SQL/table job report a different dataset name after switching the catalog
metastore/config, which is a surprising behavior change for this PR. Please
keep `defaultName` when it is non-null and use `catalog-key + "." +
table.fullName()` only for the null-name DataStream overload (or split the
Table/SQL naming change into a separate documented change with compatibility
discussion and tests).
--
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]