MartijnVisser opened a new pull request, #29367: URL: https://github.com/apache/flink/pull/29367
## What is the purpose of the change - `visitCalc` skips the condition once the input's upsert key satisfies the required determinism, so `WHERE b > UNIX_TIMESTAMP() - 300` on a CDC table into a sink keyed on that key passes `TRY_RESOLVE` without advice, the retraction can be dropped and the sink keeps the stale row. The condition is now checked whenever the input has updates, as `visitJoin` does. - Dropping the upsert key in `FlinkRelMdUpsertKeys` instead would fail such queries on the `ON CONFLICT` validation in the default `IGNORE` mode, change compiled plans and still miss a Calc below `ChangelogNormalize`. ## Brief change log - `visitCalc` checks the condition also when the required determinism is empty; `visitCorrelate` keeps its early return, a Correlate output never carries an upsert key - `NonDeterministicDagTest#testCdcWithNonDeterministicFilter` expects the error under `TRY_RESOLVE` - `NonDeterministicUpdateAnalyzerTest`: a `PLAN_ADVICE` case for the same query, five `TRY_RESOLVE` cases for other Calc placements, one deterministic control - one paragraph in `determinism.md` (EN and ZH) ## Verifying this change This change added tests and can be verified as follows: - the changed Scala case and the six new cases fail on the base commit and pass with the fix, no plan changes under `IGNORE` - a runtime probe with a filter UDF that is true on its first call only keeps the deleted row in the sink under `IGNORE`, `TRY_RESOLVE` now rejects the statement - no `SemanticTestBase` program, `FailingSqlTestStep` only accepts `ValidationException` or `TableRuntimeException` ## 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)`: no - 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? no - If yes, how is the feature documented? not applicable --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes (please specify the tool below) Generated-by: Claude Code (Claude Fable 5.1) -- 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]
