Uh oh!
There was an error while loading. Please reload this page.
[SPARK-18022][SQL] java.lang.NullPointerException instead of real exception when saving DF to MySQL - #15599
[SPARK-18022][SQL] java.lang.NullPointerException instead of real exception when saving DF to MySQL#15599srowen wants to merge 1 commit into
Conversation
SparkQA
commented
Oct 22, 2016
Test build #67381 has finished for PR 15599 at commit
|
gatorsmile
commented
Oct 22, 2016
If we do not have a test case, could you post the exception before the fix and the exception output after the fix? Thanks! |
maver1ck
commented
Oct 22, 2016
I can try this fix on Monday. |
srowen
commented
Oct 23, 2016
I think we don't know exactly what the real exception is. The NPE occurs while handling the exception. |
srowen
commented
Oct 25, 2016
@maver1ck@gatorsmile are you OK with this change, at least? I feel like I'm missing the additional change you have in mind. I think the purpose here is just to avoid the NPE during exception handling. |
gatorsmile
commented
Oct 25, 2016
@maver1ck Could you please try to run the fix? Thank you! |
| case e: SQLException => | ||
| val cause = e.getNextException | ||
| if (e.getCause != cause) { | ||
| if (cause != null && e.getCause != cause) { |
There was a problem hiding this comment.
This looks correct as addSuppressed(null) will throw NPE. However, it might be hard to create a test for it...
srowen
commented
Oct 26, 2016
Merged to master, and to 2.0 as a small clear fix. If there is a follow-on problem involving whatever exception this suppressed, I think that's separate. |
…eption when saving DF to MySQL ## What changes were proposed in this pull request? On null next exception in JDBC, don't init it as cause or suppressed ## How was this patch tested? Existing tests Author: Sean Owen <sowen@cloudera.com> Closes#15599 from srowen/SPARK-18022. (cherry picked from commit 6c7d094) Signed-off-by: Sean Owen <sowen@cloudera.com>
…eption when saving DF to MySQL ## What changes were proposed in this pull request? On null next exception in JDBC, don't init it as cause or suppressed ## How was this patch tested? Existing tests Author: Sean Owen <sowen@cloudera.com> Closesapache#15599 from srowen/SPARK-18022.
…eption when saving DF to MySQL ## What changes were proposed in this pull request? On null next exception in JDBC, don't init it as cause or suppressed ## How was this patch tested? Existing tests Author: Sean Owen <sowen@cloudera.com> Closesapache#15599 from srowen/SPARK-18022.
…eption when saving DF to MySQL ## What changes were proposed in this pull request? On null next exception in JDBC, don't init it as cause or suppressed ## How was this patch tested? Existing tests Author: Sean Owen <sowen@cloudera.com> Closesapache#15599 from srowen/SPARK-18022.
shatestest
commented
Oct 29, 2018
@uzadude sir I am getting same error in spark-sql 2.3.1 version https://gist.github.com/shatestest/86ae9559c6114999e13a6eec3c80ec2b#file-driver-scala is there anything wrong am doing here ... |
I don't think you meant to approach me.. |
gatorsmile
commented
Nov 2, 2018
@shatestest Your problem is different from the issue this PR tries to resolve. If you can provide a test case to reproduce it, feel free to open a JIRA |
What changes were proposed in this pull request?
On null next exception in JDBC, don't init it as cause or suppressed
How was this patch tested?
Existing tests