Skip to content

[core] Add catalog name to Catalog and Table fullName#7494

Open
Zouxxyy wants to merge 1 commit intoapache:masterfrom
Zouxxyy:dev/catalog-name1
Open

[core] Add catalog name to Catalog and Table fullName#7494
Zouxxyy wants to merge 1 commit intoapache:masterfrom
Zouxxyy:dev/catalog-name1

Conversation

@Zouxxyy
Copy link
Contributor

@Zouxxyy Zouxxyy commented Mar 20, 2026

Purpose

Add catalog name to Table.fullName() so it returns catalog.database.table format. This helps users identify which catalog a table belongs to in UI and logs, making it easier to diagnose issues in multi-catalog environments.

  • Added Catalog.name(), propagated via CatalogContextCatalogEnvironmentAbstractFileStoreTable.fullName()
  • Spark/Flink entry points pass catalog name into CatalogContext
image

Tests

DescribeTableTestBase, DDLWithHiveCatalogTestBase, V2WriteRequireDistributionTest

API and Format

  • Catalog interface: added @Nullable String name()
  • Table.fullName() may now return 3-part name
  • CatalogEnvironment serialVersionUID bumped to 3

Documentation

No.

Generative AI tooling

Generated-by: Kiro (Claude Opus 4.6)

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds catalog name propagation so Table.fullName() can include the catalog prefix (catalog.database.table), improving clarity in multi-catalog logs/UI while keeping some callers compatible.

Changes:

  • Introduce Catalog.name() and propagate catalog name through CatalogContextCatalogEnvironmentAbstractFileStoreTable.fullName().
  • Update Spark/Flink catalog creation paths to pass catalog name into CatalogContext.
  • Adjust identifier parsing and multiple tests to reflect/handle the new 3-part naming.

Reviewed changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
paimon-spark/paimon-spark-ut/src/test/scala/org/apache/paimon/spark/sql/V2WriteRequireDistributionTest.scala Update plan-string assertions to include catalog prefix in table full name.
paimon-spark/paimon-spark-ut/src/test/scala/org/apache/paimon/spark/sql/DescribeTableTestBase.scala Add test validating FileStoreTable.fullName() includes catalog name.
paimon-spark/paimon-spark-ut/src/test/scala/org/apache/paimon/spark/sql/DDLWithHiveCatalogTestBase.scala Update expectations to catalog.db.table full name.
paimon-spark/paimon-spark-common/src/main/java/org/apache/paimon/spark/SparkCatalog.java Pass Spark catalog name into CatalogContext.
paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/sink/listener/MockCustomPartitionMarkDoneAction.java Switch mock action from fullName() to name() to keep prior behavior.
paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/sink/listener/CustomPartitionMarkDoneActionTest.java Update assertion to match mock using table name only.
paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/action/MarkPartitionDoneActionITCase.java Update expected marked-done payload to use table name variable instead of fullName().
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/FlinkGenericCatalogFactory.java Pass catalog name into CatalogContext for Flink generic catalog.
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/FlinkCatalogFactory.java Pass catalog name into CatalogContext for Flink catalog.
paimon-core/src/test/java/org/apache/paimon/rest/RESTCatalogServer.java Include catalog name when constructing CatalogEnvironment in tests.
paimon-core/src/test/java/org/apache/paimon/operation/PartitionExpireTest.java Update CatalogEnvironment constructor call to include new catalogName parameter.
paimon-core/src/test/java/org/apache/paimon/catalog/CatalogFactoryTest.java Update CatalogContext.create call for new catalogName parameter.
paimon-core/src/main/java/org/apache/paimon/table/Table.java Update fullName() JavaDoc to mention optional catalog prefix.
paimon-core/src/main/java/org/apache/paimon/table/CatalogEnvironment.java Add catalogName field, accessor, copy behavior, and bump serialVersionUID.
paimon-core/src/main/java/org/apache/paimon/table/AbstractFileStoreTable.java Implement fullName() to prefix catalog name when present.
paimon-core/src/main/java/org/apache/paimon/rest/RESTCatalog.java Propagate catalog name into REST catalog context.
paimon-core/src/main/java/org/apache/paimon/partition/actions/HttpReportMarkDoneAction.java Strip catalog prefix from fullName() to preserve old db.table behavior.
paimon-core/src/main/java/org/apache/paimon/catalog/DelegateCatalog.java Delegate Catalog.name() to wrapped catalog.
paimon-core/src/main/java/org/apache/paimon/catalog/CatalogUtils.java Pass catalog.name() into CatalogEnvironment when loading tables.
paimon-core/src/main/java/org/apache/paimon/catalog/Catalog.java Add nullable default name() method to catalog interface.
paimon-core/src/main/java/org/apache/paimon/catalog/AbstractCatalog.java Implement Catalog.name() via CatalogContext.catalogName().
paimon-common/src/main/java/org/apache/paimon/rest/RESTTokenFileIO.java Propagate catalog name into REST token file IO context creation.
paimon-common/src/main/java/org/apache/paimon/fs/ResolvingFileIO.java Preserve catalog name when wrapping catalog context in resolving file IO.
paimon-common/src/main/java/org/apache/paimon/catalog/CatalogContext.java Add catalogName field + overloads/accessor to carry catalog identity.
paimon-api/src/main/java/org/apache/paimon/catalog/Identifier.java Extend Identifier.fromString() to accept 3-part names by ignoring catalog prefix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Zouxxyy Zouxxyy force-pushed the dev/catalog-name1 branch from e82e3db to a3a81a2 Compare March 20, 2026 13:49
@apache apache deleted a comment from Copilot AI Mar 20, 2026
@Zouxxyy Zouxxyy force-pushed the dev/catalog-name1 branch from a3a81a2 to 7740038 Compare March 20, 2026 13:52
@Zouxxyy Zouxxyy force-pushed the dev/catalog-name1 branch from 7740038 to d8df515 Compare March 20, 2026 13:59

/** Full name of the table, default is database.tableName. */
/**
* Full name of the table, default is database.tableName or catalog.database.tableName if
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a bit of a big change. It's not compatible and some systems already rely on it. Can we just modify the Spark side and pass the catalogName?

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

Successfully merging this pull request may close these issues.

3 participants