-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-37388][SQL] Fix NPE in WidthBucket in WholeStageCodegenExec #34670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
cloud-fan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch!
|
Kubernetes integration test starting |
|
Kubernetes integration test status failure |
|
Test build #145458 has finished for PR 34670 at commit
|
c21
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @tomvanbussel for the fix!
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala
Show resolved
Hide resolved
...catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/MathExpressionsSuite.scala
Show resolved
Hide resolved
...catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/MathExpressionsSuite.scala
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala
Show resolved
Hide resolved
|
Thank you for the review @c21! I will add the additional test case and I have provided answers to your questions. |
c21
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM as well.
|
Kubernetes integration test starting |
|
Kubernetes integration test status failure |
|
Test build #145466 has finished for PR 34670 at commit
|
|
retest this please |
|
Test failure seems unrelated but mind retriggering for doubly sure, @tomvanbussel? https://github.com/tomvanbussel/spark/actions/runs/1482727001 |
|
Kubernetes integration test starting |
|
Kubernetes integration test status failure |
|
Test build #145487 has finished for PR 34670 at commit
|
|
Seems the GA job OOMed, I'm merging this to master/3.2/3.1, thanks! |
This PR fixes a `NullPointerException` in `WholeStageCodegenExec` caused by the expression `WidthBucket`. The cause of this NPE is that `WidthBucket` calls `WidthBucket.computeBucketNumber`, which can return `null`, but the generated code cannot deal with `null`s. This fixes a `NullPointerException` in Spark SQL. No Added tests to `MathExpressionsSuite`. This suite already had tests for `WidthBucket` with interval inputs, but lacked tests with double inputs. I checked that the tests failed without the fix, and succeed with the fix. Closes #34670 from tomvanbussel/SPARK-37388. Authored-by: Tom van Bussel <[email protected]> Signed-off-by: Wenchen Fan <[email protected]> (cherry picked from commit 77f3974) Signed-off-by: Wenchen Fan <[email protected]>
This PR fixes a `NullPointerException` in `WholeStageCodegenExec` caused by the expression `WidthBucket`. The cause of this NPE is that `WidthBucket` calls `WidthBucket.computeBucketNumber`, which can return `null`, but the generated code cannot deal with `null`s. This fixes a `NullPointerException` in Spark SQL. No Added tests to `MathExpressionsSuite`. This suite already had tests for `WidthBucket` with interval inputs, but lacked tests with double inputs. I checked that the tests failed without the fix, and succeed with the fix. Closes #34670 from tomvanbussel/SPARK-37388. Authored-by: Tom van Bussel <[email protected]> Signed-off-by: Wenchen Fan <[email protected]> (cherry picked from commit 77f3974) Signed-off-by: Wenchen Fan <[email protected]>
This PR fixes a `NullPointerException` in `WholeStageCodegenExec` caused by the expression `WidthBucket`. The cause of this NPE is that `WidthBucket` calls `WidthBucket.computeBucketNumber`, which can return `null`, but the generated code cannot deal with `null`s. This fixes a `NullPointerException` in Spark SQL. No Added tests to `MathExpressionsSuite`. This suite already had tests for `WidthBucket` with interval inputs, but lacked tests with double inputs. I checked that the tests failed without the fix, and succeed with the fix. Closes apache#34670 from tomvanbussel/SPARK-37388. Authored-by: Tom van Bussel <[email protected]> Signed-off-by: Wenchen Fan <[email protected]> (cherry picked from commit 77f3974) Signed-off-by: Wenchen Fan <[email protected]>
This PR fixes a `NullPointerException` in `WholeStageCodegenExec` caused by the expression `WidthBucket`. The cause of this NPE is that `WidthBucket` calls `WidthBucket.computeBucketNumber`, which can return `null`, but the generated code cannot deal with `null`s. This fixes a `NullPointerException` in Spark SQL. No Added tests to `MathExpressionsSuite`. This suite already had tests for `WidthBucket` with interval inputs, but lacked tests with double inputs. I checked that the tests failed without the fix, and succeed with the fix. Closes apache#34670 from tomvanbussel/SPARK-37388. Authored-by: Tom van Bussel <[email protected]> Signed-off-by: Wenchen Fan <[email protected]> (cherry picked from commit 77f3974) Signed-off-by: Wenchen Fan <[email protected]>
This PR fixes a `NullPointerException` in `WholeStageCodegenExec` caused by the expression `WidthBucket`. The cause of this NPE is that `WidthBucket` calls `WidthBucket.computeBucketNumber`, which can return `null`, but the generated code cannot deal with `null`s. This fixes a `NullPointerException` in Spark SQL. No Added tests to `MathExpressionsSuite`. This suite already had tests for `WidthBucket` with interval inputs, but lacked tests with double inputs. I checked that the tests failed without the fix, and succeed with the fix. Closes apache#34670 from tomvanbussel/SPARK-37388. Authored-by: Tom van Bussel <[email protected]> Signed-off-by: Wenchen Fan <[email protected]> (cherry picked from commit 77f3974) Signed-off-by: Wenchen Fan <[email protected]>
This PR fixes a `NullPointerException` in `WholeStageCodegenExec` caused by the expression `WidthBucket`. The cause of this NPE is that `WidthBucket` calls `WidthBucket.computeBucketNumber`, which can return `null`, but the generated code cannot deal with `null`s. This fixes a `NullPointerException` in Spark SQL. No Added tests to `MathExpressionsSuite`. This suite already had tests for `WidthBucket` with interval inputs, but lacked tests with double inputs. I checked that the tests failed without the fix, and succeed with the fix. Closes apache#34670 from tomvanbussel/SPARK-37388. Authored-by: Tom van Bussel <[email protected]> Signed-off-by: Wenchen Fan <[email protected]> (cherry picked from commit 77f3974) Signed-off-by: Wenchen Fan <[email protected]>
What changes were proposed in this pull request?
This PR fixes a
NullPointerExceptioninWholeStageCodegenExeccaused by the expressionWidthBucket. The cause of this NPE is thatWidthBucketcallsWidthBucket.computeBucketNumber, which can returnnull, but the generated code cannot deal withnulls.Why are the changes needed?
This fixes a
NullPointerExceptionin Spark SQL.Does this PR introduce any user-facing change?
No
How was this patch tested?
Added tests to
MathExpressionsSuite. This suite already had tests forWidthBucketwith interval inputs, but lacked tests with double inputs. I checked that the tests failed without the fix, and succeed with the fix.