rich7420 opened a new pull request, #7194:
URL: https://github.com/apache/datafusion-comet/pull/7194

   ## Which issue does this PR close?
   
   Closes #6886.
   
   ## Rationale for this change
   
   Grouped `regr_*` currently uses DataFusion's per-group adapter, repeatedly 
reordering arrays and visiting accumulator states. Interleaved keys make this 
expensive.
   
   ## What changes are included in this PR?
   
   Add grouped SXX/SYY/SXY/slope/intercept/R² using existing variance, 
covariance and Pearson kernels. Preserve Spark state layouts, arithmetic, 
version-dependent null rules, ANSI errors/context and `corr` behavior.
   
   Add exact FILTER/state/merge/emission coverage and native/Spark benchmarks. 
The native matrix includes interleaved keys, one key, and 256-row clustered 
runs at 1,024 groups.
   
   ## How are these changes tested?
   
   239 native aggregate tests and ten selected tests on each of Spark 
4.1.3/Java 21 and 3.4.3/Java 17 passed; the SQL fixtures contain 40 
regression/eight correlation queries. Production and correctness-test sources 
remain unchanged by the benchmark follow-up. Workspace/all-target Clippy, 
rustfmt, Maven compilation/style and source-tarball RAT pass.
   
   On Apple M3 Pro, 262,144-row native Partial benchmarks with interleaved keys 
without nulls improve 3.4–6.6× at 1,024 groups. Long same-key runs are a 
tradeoff: one-key SXY/slope/intercept/R² take approximately 11–21% longer 
across two runs, relevant to grouping by a partition column. With 256-row runs, 
slope/R² are approximately neutral. Full Spark queries improve 1.9–3.5× with 
interleaved keys; corr stays near 51 ms. No universal crossover is claimed.
   
   For reproduction, copy this benchmark harness into a checkout of base 
`785fdbcb4`, use the same release settings, run there with `--save-baseline 
main`, then here with `--baseline main`. After `cargo bench --locked -p 
datafusion-comet-spark-expr --bench aggregate_stats --`, both runs use 
`regr_partial --sample-size 30 --measurement-time 2 --warm-up-time 1`. 
Clustered slope was repeated with 50 samples/5 seconds after a baseline 
outlier. Set `CARGO_PROFILE_RELEASE_DEBUG=0`, retain default thin LTO, and use 
separate target directories with a shared `CRITERION_HOME`.
   
   Broader CI remains pending: `run-spark-4.1-tests`, `run-all-spark-profiles`, 
`run-benchmark-check`.
   


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to