Skip to content

[flink] Move materialized table refresh options out of CoreOptions - #11551

Merged
JingsongLi merged 1 commit into
apache:masterfrom
JingsongLi:codex/paimon-flink-materialized-table-options
Nov 30, 2026
Merged

JingsongLi merged 1 commit into
apache:masterfrom
JingsongLi:codex/paimon-flink-materialized-table-options

Conversation

@JingsongLi

Copy link
Copy Markdown
Contributor

Purpose

Move Flink materialized-table freshness and refresh options from CoreOptions to FlinkMaterializedTableOptions. The Flink catalog uses its native enums for the freshness unit, logical and physical refresh modes, and refresh status. The shared query definition remains in CoreOptions.

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

  • Flink 1.20.1: 36 targeted FlinkCatalogTest cases passed.
  • Flink 2.2.0: 36 targeted FlinkCatalogTest cases passed.

@leaves12138 leaves12138 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 via valueOf(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 valueOf conversions in both fillOptionsForMaterializedTable and buildMaterializedTable; a mismatched constant would now fail at compile time against the Flink API rather than at runtime.
  • The new FlinkMaterializedTableOptions lives in paimon-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.

@JingsongLi
JingsongLi merged commit b6f1d4d into apache:master Nov 30, 2026
1 check passed
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.

2 participants