Skip to content

Conversation

@dylanhz
Copy link
Contributor

@dylanhz dylanhz commented Dec 5, 2025

What is the purpose of the change

Fix catastrophic cancellation in naive algorithm of variance related functions.

Brief change log

  • Introduce Welford's online algorithm for variance related functions.
  • Add a new internal built-in agg function WELFORD_M2.
  • Add new rewrite rule to reuse the intermediate result welford_m2 for all variance related functions.

Verifying this change

New test class: MathAggFunctionITCase.
Update some existing tests using variance related functions.

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)
  • 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 documented)

@dylanhz
Copy link
Contributor Author

dylanhz commented Dec 5, 2025

The first commit will be removed once it is merged.
#27319

@flinkbot
Copy link
Collaborator

flinkbot commented Dec 5, 2025

CI report:

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

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