-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-37896][SQL][FOLLOWUP] Fix NPE in ConstantColumnVector.close() #35324
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
|
|
||
| @Override | ||
| public void close() { | ||
| stringData = null; |
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.
This change is not related to the NPE fix, but it's good to have. We should release the memory for UTF8String as well.
|
cc @cloud-fan and @Yaohua628 |
|
thanks for the fix! |
Yaohua628
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, thanks!
|
thanks, merging to master! |
|
Thank you @cloud-fan and @Yaohua628 for review! |
### What changes were proposed in this pull request? This PR is a followup of apache#35068 to fix the null pointer exception when calling `ConstantColumnVector.close()`. `ConstantColumnVector.childData` can be null for e.g. non-struct data type. ### Why are the changes needed? Fix the exception when cleaning up column vector. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Modified unit test in `ConstantColumnVectorSuite.scala` to exercise the code path of `ConstantColumnVector.close()` for every tested data type. Without the fix, the unit test throws NPE. Closes apache#35324 from c21/constant-fix. Authored-by: Cheng Su <[email protected]> Signed-off-by: Wenchen Fan <[email protected]>
What changes were proposed in this pull request?
This PR is a followup of #35068 to fix the null pointer exception when calling
ConstantColumnVector.close().ConstantColumnVector.childDatacan be null for e.g. non-struct data type.Why are the changes needed?
Fix the exception when cleaning up column vector.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Modified unit test in
ConstantColumnVectorSuite.scalato exercise the code path ofConstantColumnVector.close()for every tested data type. Without the fix, the unit test throws NPE.