Repository navigation
Conversation
Reuse the grouped variance, covariance and Pearson kernels while preserving Spark regression state layouts, arithmetic and version-dependent null/error behavior. Add grouped update/merge/emission coverage and focused native and Spark benchmarks for issue apache#6886.
Compare interleaved keys with long same-key runs and exercise all six regression functions in the single-group control. Preserve the existing benchmark names and cardinality/partial-skip checks.
…ps-recovered # Conflicts: # native/spark-expr/benches/aggregate_stats.rs
Composing the grouped variance, covariance and correlation accumulators made grouped regr_* slower than the per-group accumulators when rows of one group arrive together: 9-23% for regr_sxy, regr_slope, regr_intercept and regr_r2 with a single group, and 11% for regr_r2 with 256-row runs. Replace the composition with one accumulator that keeps a state row per group in Spark's partial-buffer layout and folds every moment of a statistic in a single pass. It carries the state in a local while consecutive rows share a group. The arithmetic and its order are those of the per-row accumulators, so results stay bit-identical; the existing grouped tests compare the two. This leaves the shared variance, covariance and correlation kernels as they are on main. Also drop the test assertion that depended on how DataFusion splits a Vec on EmitTo::First, and the benchmark changes that the regr cases do not need.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CI run for the grouped regr_* accumulator branch before it goes to the upstream pull request. Not for merge.