[FLINK-38968][table] Add toCatalogTable method to CatalogMaterializedTable interface#27467
Merged
snuyanzin merged 1 commit intoapache:masterfrom Mar 27, 2026
Merged
[FLINK-38968][table] Add toCatalogTable method to CatalogMaterializedTable interface#27467snuyanzin merged 1 commit intoapache:masterfrom
snuyanzin merged 1 commit intoapache:masterfrom
Conversation
Collaborator
Contributor
Author
|
@flinkbot run azure |
featzhang
approved these changes
Jan 27, 2026
| @Nullable | ||
| byte[] getSerializedRefreshHandler(); | ||
|
|
||
| /** Convert this object to a {@link CatalogTable} object for planner optimize query. */ |
Member
There was a problem hiding this comment.
/**
- Converts this materialized table into a {@link CatalogTable} representation
- for planner usage.
-
This conversion preserves schema, options, distribution, partitions and snapshot,
- but intentionally drops materialized-table-specific semantics such as refresh behavior.
*/
| } | ||
|
|
||
| @Test | ||
| void testCatalogMaterializedTableToCatalogTable() { |
Member
There was a problem hiding this comment.
Consider adding a test asserting that materialized-table-specific semantics (e.g. refresh behavior) are intentionally not propagated.
snuyanzin
approved these changes
Mar 27, 2026
Contributor
snuyanzin
left a comment
There was a problem hiding this comment.
Looks like a missing feature while implementation of MT
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the purpose of the change
This pull request adds a default
toCatalogTable()method to theCatalogMaterializedTableinterface, which converts a materialized table to aCatalogTablefor planner query optimization. This extracts the conversion logic to the interface level, allowingResolvedCatalogMaterializedTable.toResolvedCatalogTable()to delegate toorigin.toCatalogTable()instead of duplicating the conversion logic.Brief change log
toCatalogTable()inCatalogMaterializedTableinterface that builds aCatalogTablefrom the materialized table's schema, comment, distribution, partition keys, options, and snapshotResolvedCatalogMaterializedTable.toResolvedCatalogTable()to use the neworigin.toCatalogTable()methodVerifying this change
This change added tests and can be verified as follows:
testCatalogMaterializedTableToCatalogTable()inCatalogBaseTableResolutionTestto verify the newtoCatalogTable()method preserves all properties (schema, comment, partition keys, options, distribution, snapshot)testResolvedCatalogMaterializedTableToResolvedCatalogTable()inCatalogBaseTableResolutionTestto verify the conversion fromResolvedCatalogMaterializedTabletoResolvedCatalogTablepreserves schema and origin propertiesDoes this pull request potentially affect one of the following parts:
@Public(Evolving): yes (CatalogMaterializedTableis@PublicEvolving)Documentation