jsingh-yelp commented on code in PR #8001:
URL: https://github.com/apache/paimon/pull/8001#discussion_r3464964738
##########
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:
@JingsongLi This is by design, the `catalog-key` override for JDBC metastore
on the Table API path is intentional. Flink catalog names are arbitrary
per-job the same physical table can appear under different lineage names
depending on how the job registers its catalog.
`catalog-key` is a more stable cross-job identifier that users can
explicitly configure. This is particularly valuable when the same database and
table exist across different catalogs the `catalog-key` disambiguates them.
For context, this is the follow up ticket to support this in Flink:
https://issues.apache.org/jira/browse/FLINK-39935
##########
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:
@JingsongLi This is by design, the `catalog-key` override for JDBC metastore
on the Table API path is intentional. Catalog names are arbitrary per-job the
same physical table can appear under different lineage names depending on how
the job registers its catalog.
`catalog-key` is a more stable cross-job identifier that users can
explicitly configure. This is particularly valuable when the same database and
table exist across different catalogs the `catalog-key` disambiguates them.
For context, this is the follow up ticket to support this in Flink:
https://issues.apache.org/jira/browse/FLINK-39935
--
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]