You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by srowen <gi...@git.apache.org> on 2017/04/28 08:16:13 UTC

[GitHub] spark pull request #17800: [SPARK-20459][SQL] JdbcUtils throws IllegalStateE...

GitHub user srowen opened a pull request:

    https://github.com/apache/spark/pull/17800

    [SPARK-20459][SQL] JdbcUtils throws IllegalStateException: Cause already initialized after getting SQLException

    ## What changes were proposed in this pull request?
    
    Avoid failing to initCause on JDBC exception with cause initialized to null
    
    ## How was this patch tested?
    
    Existing tests


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/srowen/spark SPARK-20459

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/17800.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #17800
    
----
commit 3f87babfc3a9a7652b8bd0bfffade174c688a173
Author: Sean Owen <so...@cloudera.com>
Date:   2017-04-28T08:13:01Z

    Avoid failing to initCause on JDBC exception with cause initialized to null

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #17800: [SPARK-20459][SQL] JdbcUtils throws IllegalStateE...

Posted by srowen <gi...@git.apache.org>.
Github user srowen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17800#discussion_r114069693
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcUtils.scala ---
    @@ -653,7 +653,13 @@ object JdbcUtils extends Logging {
             val cause = e.getNextException
             if (cause != null && e.getCause != cause) {
               if (e.getCause == null) {
    -            e.initCause(cause)
    +            try {
    +              e.initCause(cause)
    +            } catch {
    +              // cause may have been explicitly initialized to null, in which case this
    --- End diff --
    
    No the issue is simply whether the cause has been initialized at all. If it has been initialized to `null`, then `e.getCause` returns `null`, but the current code takes that to mean the cause is uninitialized (because it would return `null`) in that case. If it were initialized to an actual exception it already would call `addSuppressed` instead.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #17800: [SPARK-20459][SQL] JdbcUtils throws IllegalStateE...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17800#discussion_r114155804
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcUtils.scala ---
    @@ -653,7 +653,13 @@ object JdbcUtils extends Logging {
             val cause = e.getNextException
             if (cause != null && e.getCause != cause) {
               if (e.getCause == null) {
    -            e.initCause(cause)
    +            try {
    +              e.initCause(cause)
    +            } catch {
    +              // cause may have been explicitly initialized to null, in which case this
    --- End diff --
    
    Yeah. Please update the comment. Thanks!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #17800: [SPARK-20459][SQL] JdbcUtils throws IllegalStateE...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17800#discussion_r113971640
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcUtils.scala ---
    @@ -653,7 +653,13 @@ object JdbcUtils extends Logging {
             val cause = e.getNextException
             if (cause != null && e.getCause != cause) {
               if (e.getCause == null) {
    -            e.initCause(cause)
    +            try {
    +              e.initCause(cause)
    +            } catch {
    +              // cause may have been explicitly initialized to null, in which case this
    --- End diff --
    
    Based on my understanding, `IllegalStateException` is not caused by the value of `cause`. 
    
    ```JAVA
    @throws IllegalStateException if this throwable was
            created with {@link #Throwable(Throwable)} or
            {@link #Throwable(String,Throwable)}, or this method has already
            been called on this throwable.
    ```



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #17800: [SPARK-20459][SQL] JdbcUtils throws IllegalStateE...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/spark/pull/17800


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17800: [SPARK-20459][SQL] JdbcUtils throws IllegalStateExceptio...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/17800
  
    **[Test build #76265 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/76265/testReport)** for PR 17800 at commit [`ad38533`](https://github.com/apache/spark/commit/ad3853336331102ff9e76ef4be09908a1e643a65).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17800: [SPARK-20459][SQL] JdbcUtils throws IllegalStateExceptio...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/17800
  
    Merged build finished. Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17800: [SPARK-20459][SQL] JdbcUtils throws IllegalStateExceptio...

Posted by srowen <gi...@git.apache.org>.
Github user srowen commented on the issue:

    https://github.com/apache/spark/pull/17800
  
    @gatorsmile do you think this should go back into 2.1? seems like a clean fix to a non-trivial problem. I don't particularly care either way; you may have more context about the problem.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17800: [SPARK-20459][SQL] JdbcUtils throws IllegalStateExceptio...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/17800
  
    **[Test build #76354 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/76354/testReport)** for PR 17800 at commit [`f6f2b7a`](https://github.com/apache/spark/commit/f6f2b7a16ce7cc8870d05732b51ef796906db937).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #17800: [SPARK-20459][SQL] JdbcUtils throws IllegalStateE...

Posted by srowen <gi...@git.apache.org>.
Github user srowen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17800#discussion_r114154920
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcUtils.scala ---
    @@ -653,7 +653,13 @@ object JdbcUtils extends Logging {
             val cause = e.getNextException
             if (cause != null && e.getCause != cause) {
               if (e.getCause == null) {
    -            e.initCause(cause)
    +            try {
    +              e.initCause(cause)
    +            } catch {
    +              // cause may have been explicitly initialized to null, in which case this
    --- End diff --
    
    @gatorsmile oh are you suggesting the comment is a bit misleading? yeah I can fix that to be clearer about the scenario


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17800: [SPARK-20459][SQL] JdbcUtils throws IllegalStateExceptio...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/17800
  
    **[Test build #76265 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/76265/testReport)** for PR 17800 at commit [`ad38533`](https://github.com/apache/spark/commit/ad3853336331102ff9e76ef4be09908a1e643a65).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17800: [SPARK-20459][SQL] JdbcUtils throws IllegalStateExceptio...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/17800
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/76354/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17800: [SPARK-20459][SQL] JdbcUtils throws IllegalStateExceptio...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the issue:

    https://github.com/apache/spark/pull/17800
  
    Thanks! Merging to master/2.2


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17800: [SPARK-20459][SQL] JdbcUtils throws IllegalStateExceptio...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/17800
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/76265/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17800: [SPARK-20459][SQL] JdbcUtils throws IllegalStateExceptio...

Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the issue:

    https://github.com/apache/spark/pull/17800
  
    LGTM


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17800: [SPARK-20459][SQL] JdbcUtils throws IllegalStateExceptio...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/17800
  
    **[Test build #76354 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/76354/testReport)** for PR 17800 at commit [`f6f2b7a`](https://github.com/apache/spark/commit/f6f2b7a16ce7cc8870d05732b51ef796906db937).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17800: [SPARK-20459][SQL] JdbcUtils throws IllegalStateExceptio...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/17800
  
    Merged build finished. Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org