We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8c911ad commit ad38533Copy full SHA for ad38533
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcUtils.scala
@@ -653,7 +653,13 @@ object JdbcUtils extends Logging {
653
val cause = e.getNextException
654
if (cause != null && e.getCause != cause) {
655
if (e.getCause == null) {
656
- e.initCause(cause)
+ try {
657
+ e.initCause(cause)
658
+ } catch {
659
+ // cause may have been explicitly initialized to null, in which case this
660
+ // fails. No way to detect it, can only catch the exception.
661
+ case _: IllegalStateException => e.addSuppressed(cause)
662
+ }
663
} else {
664
e.addSuppressed(cause)
665
}
0 commit comments