Skip to content

[FLINK-39313][table] Fix NDU analyzer to detect non-deterministic functions in ChangelogNormalize filter conditions#27819

Open
gustavodemorais wants to merge 1 commit intoapache:masterfrom
gustavodemorais:FLINK-39313
Open

[FLINK-39313][table] Fix NDU analyzer to detect non-deterministic functions in ChangelogNormalize filter conditions#27819
gustavodemorais wants to merge 1 commit intoapache:masterfrom
gustavodemorais:FLINK-39313

Conversation

@gustavodemorais
Copy link
Contributor

What is the purpose of the change

The StreamNonDeterministicUpdatePlanVisitor treats StreamPhysicalChangelogNormalize as transparent, never inspecting its filterCondition. When the optimizer pushes a WHERE clause with a non-deterministic function (e.g. NOW()) into ChangelogNormalize on an upsert source, the filter asymmetrically drops -U records while passing +U records, corrupting the retract contract and causing incorrect results downstream.

Brief change log

  • Add ChangelogNormalize to NDU Analyzer

Verifying this change

  • Add negative and positive plan tests

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)

…ctions in ChangelogNormalize filter conditions
@flinkbot
Copy link
Collaborator

flinkbot commented Mar 24, 2026

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

Copy link
Contributor

@rionmonster rionmonster left a comment

Choose a reason for hiding this comment

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

The changes look good on this end conceptually (and implementation-wise), approving! It looks like CI is showing a failure but it seems unrelated to the changes. I'll kick off another one to see if we can get a 🟢 there. Thanks!

@rionmonster
Copy link
Contributor

@flinkbot run azure

@github-actions github-actions bot added the community-reviewed PR has been reviewed by the community. label Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-reviewed PR has been reviewed by the community.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants