Skip to content

Conversation

@tomvanbussel
Copy link
Contributor

What changes were proposed in this pull request?

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 nulls.

Why are the changes needed?

This fixes a NullPointerException in 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 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.

@github-actions github-actions bot added the SQL label Nov 19, 2021
Copy link
Contributor

@cloud-fan cloud-fan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch!

@SparkQA
Copy link

SparkQA commented Nov 19, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/49930/

@SparkQA
Copy link

SparkQA commented Nov 19, 2021

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/49930/

@SparkQA
Copy link

SparkQA commented Nov 19, 2021

Test build #145458 has finished for PR 34670 at commit ed96fcc.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

Copy link
Contributor

@c21 c21 left a 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!

@tomvanbussel
Copy link
Contributor Author

Thank you for the review @c21! I will add the additional test case and I have provided answers to your questions.

Copy link
Contributor

@c21 c21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as well.

@SparkQA
Copy link

SparkQA commented Nov 19, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/49938/

@SparkQA
Copy link

SparkQA commented Nov 19, 2021

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/49938/

@SparkQA
Copy link

SparkQA commented Nov 19, 2021

Test build #145466 has finished for PR 34670 at commit 0cba30d.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@HyukjinKwon
Copy link
Member

retest this please

@HyukjinKwon
Copy link
Member

Test failure seems unrelated but mind retriggering for doubly sure, @tomvanbussel? https://github.com/tomvanbussel/spark/actions/runs/1482727001

@SparkQA
Copy link

SparkQA commented Nov 22, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/49959/

@SparkQA
Copy link

SparkQA commented Nov 22, 2021

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/49959/

@SparkQA
Copy link

SparkQA commented Nov 22, 2021

Test build #145487 has finished for PR 34670 at commit 0cba30d.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@cloud-fan
Copy link
Contributor

cloud-fan commented Nov 22, 2021

Seems the GA job OOMed, I'm merging this to master/3.2/3.1, thanks!

@cloud-fan cloud-fan closed this in 77f3974 Nov 22, 2021
cloud-fan pushed a commit that referenced this pull request Nov 22, 2021
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]>
cloud-fan pushed a commit that referenced this pull request Nov 22, 2021
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]>
sunchao pushed a commit to sunchao/spark that referenced this pull request Dec 8, 2021
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]>
fishcus pushed a commit to fishcus/spark that referenced this pull request Jan 12, 2022
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]>
catalinii pushed a commit to lyft/spark that referenced this pull request Feb 22, 2022
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]>
catalinii pushed a commit to lyft/spark that referenced this pull request Mar 4, 2022
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants