Repository navigation
[GLUTEN-13340][VL] Fix regr_r2's intermediate field order - #13343
Open
LuciferYang wants to merge 6 commits into
Open
LuciferYang wants to merge 6 commits into
LuciferYang wants to merge 6 commits into
Conversation
Contributor
|
This PR currently has merge conflicts with |
# Conflicts: # backends-velox/src/test/scala/org/apache/gluten/execution/VeloxAggregateFunctionsSuite.scala
Contributor
Author
|
Thanks, merged the latest main and resolved the conflict. It was only the aggregate import line in VeloxAggregateFunctionsSuite, which #13350 also changed. |
Contributor
Author
|
@jackylee-ch The conflict is resolved. Could you take another look? |
This branch has not been deployed
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.
What changes are proposed in this pull request?
VeloxIntermediateDatamaps regr_r2's Velox intermediate row to Spark's buffer attributes with Corr's order, becauseRegrR2extendsPearsonCorrelation. Velox's regr_r2 has a different layout, (c2, count, m2X, meanX, meanY, m2Y) with X being the second argument, and Spark'sRegrR2(y, x)passes its arguments toPearsonCorrelation(y, x), so Spark'sxAvgandxMkdescribe y. Plans that run one regr_r2 phase in Velox and another in vanilla Spark returned wrong results. When every phase runs in Velox, the two directions of the mapping cancel out.This adds a RegrR2 order,
ck, n, yMk, yAvg, xAvg, xMk, matched before the PearsonCorrelation case. The intermediate types are the same for both functions, so the type mapping is unchanged.The Bolt backend has the same mapping in
BoltIntermediateData. It is left for a follow-up because no CI job runs the Bolt tests.How was this patch tested?
Added two tests to
VeloxAggregateFunctionsSuite. Both fail without this change, and both check that the plan has a Velox aggregation and a vanilla Spark aggregation computing regr_r2.histogram_numeric(distinct z, 3)is not offloaded, so the last two of the four aggregations Spark plans for a single DISTINCT run in vanilla Spark and merge the buffer Velox produced.Was this patch authored or co-authored using generative AI tooling?
Yes. Generated-by: Claude Opus.
Related issue: #13340.