Repository navigation
[flink] Move materialized table refresh options out of CoreOptions - #11551
JingsongLi merged 1 commit into
Conversation
leaves12138
left a comment
There was a problem hiding this comment.
Reviewed base master at head 4a2c93b. Full file list (4 files): paimon-api/CoreOptions.java, paimon-flink-common (FlinkCatalog.java, new FlinkMaterializedTableOptions.java, FlinkCatalogTest.java).
Core change notice: this removes seven materialized-table.* ConfigOptions and three enums from the shared paimon-api/CoreOptions. They were marked @ExcludeFromDocumentation("Only used internally to support materialized table"); a repo-wide search confirms FlinkCatalog was the only consumer, so no other module or engine reads them. The shared materialized-table.definition-query stays in CoreOptions. This is an internal API relocation, not a format change.
Analysis:
- Persisted compatibility: every moved option keeps its exact key string and string/enum representation. The Flink native enums (
IntervalFreshness.TimeUnit,LogicalRefreshMode,RefreshMode,RefreshStatus) have the same constant names as the removed Paimon mirrors (SECOND/MINUTE/HOUR/DAY, AUTOMATIC/FULL/CONTINUOUS, INITIALIZING/ACTIVATED/SUSPENDED), and the previous code converted viavalueOf(name())in both directions, so stored values are byte-identical. The new catalog test asserts the persisted keys/values on the backing Paimon table directly. - Using Flink enums directly removes the double
valueOfconversions in bothfillOptionsForMaterializedTableandbuildMaterializedTable; a mismatched constant would now fail at compile time against the Flink API rather than at runtime. - The new
FlinkMaterializedTableOptionslives inpaimon-flink-common, which already depends on the Flink catalog API, so no new dependency edge is introduced; option descriptions and exclusions are carried over verbatim.
No findings. The relocation is behavior-preserving for native materialized table creation, alteration, and deletion, verified on both Flink 1.20.1 and 2.2.0 per the description (36 targeted cases each).
CI note: checks are still initializing on this head. Approving without waiting for CI.
LGTM.
Purpose
Move Flink materialized-table freshness and refresh options from
CoreOptionstoFlinkMaterializedTableOptions. The Flink catalog uses its native enums for the freshness unit, logical and physical refresh modes, and refresh status. The shared query definition remains inCoreOptions.Compatibility
Existing materialized tables retain the same persisted property keys and values. The catalog tests verify the stored freshness and refresh options and exercise native table creation, alteration, and deletion.
Tests
FlinkCatalogTestcases passed.FlinkCatalogTestcases passed.