gustavodemorais opened a new pull request, #29040: URL: https://github.com/apache/flink/pull/29040
## What is the purpose of the change A materialized table has no syntax for an explicit `ON CONFLICT` clause, so it always falls back to the implicit `DO DEDUPLICATE` strategy when its primary key differs from its query's upsert key. This adds an opt-in option to default it to `DO ERROR` instead, avoiding the state-heavier deduplicating materializer, applied only when every source already declares a watermark so table creation never fails because of it. ## Brief change log - Add TABLE_EXEC_SINK_MATERIALIZED_TABLE_FORCES_ON_CONFLICT_ERROR, default false. - convertMaterializedTableAsToRel picks ON CONFLICT DO ERROR when the option is enabled and every source has a watermark, otherwise keeps the previous behavior. - Add allSourcesHaveWatermarks, walking the logical input tree to check each source's watermark spec. - Thread getTableConfig through PlannerBase's call to convertMaterializedTableAsToRel. - Tailor the require-on-conflict validation message with a materialized-table-specific hint when the new option is enabled but a source is missing a watermark. - Document the new option and its interaction with require-on-conflict in the INSERT reference docs. ## Verifying this change - ExplainTest ## Does this pull request potentially affect one of the following parts: - Dependencies (does it add or upgrade a dependency): no - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: yes - new option added to ExecutionConfigOptions (`@PublicEvolving`) - The serializers: no - The runtime per-record code paths (performance sensitive): no - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no - The S3 file system connector: no ## Documentation - Does this pull request introduce a new feature? yes - If yes, how is the feature documented? (docs/content/docs/sql/reference/dml/insert.md, docs/content.zh/docs/sql/reference/dml/insert.md, generated config option docs) --- ##### Was generative AI tooling used to co-author this PR? - [x] Yes (please specify the tool below) 2.1.235 (Claude Code) with Sonnet 5 -- 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]
