-
Notifications
You must be signed in to change notification settings - Fork 28.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-48719][SQL] Fix the calculation bug of
RegrSlope
& `RegrInte…
…rcept` when the first parameter is null ### What changes were proposed in this pull request? This PR aims to fix the calculation bug of `RegrSlope`&`RegrIntercept` when the first parameter is null. Regardless of whether the first parameter(y) or the second parameter(x) is null, this tuple should be filtered out. ### Why are the changes needed? Fix bug. ### Does this PR introduce _any_ user-facing change? Yes, the calculation changes when the first value of a tuple is null, but the value is truly correct. ### How was this patch tested? Pass GA and test with `build/sbt "~sql/testOnly org.apache.spark.sql.SQLQueryTestSuite -- -z linear-regression.sql"` ### Was this patch authored or co-authored using generative AI tooling? No. Closes #47105 from wayneguow/SPARK-48719. Authored-by: Wei Guo <[email protected]> Signed-off-by: Wenchen Fan <[email protected]>
- Loading branch information
Showing
4 changed files
with
31 additions
and
19 deletions.
There are no files selected for viewing
This file contains 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
4 changes: 2 additions & 2 deletions
4
sql/core/src/test/resources/sql-tests/analyzer-results/linear-regression.sql.out
This file contains 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
2 changes: 1 addition & 1 deletion
2
sql/core/src/test/resources/sql-tests/inputs/linear-regression.sql
This file contains 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
This file contains 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