You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "MaxGekk (via GitHub)" <gi...@apache.org> on 2023/12/13 16:31:26 UTC

[PR] [WIP][SQL] Classify exceptions in the JDBC table catalog [spark]

MaxGekk opened a new pull request, #44335:
URL: https://github.com/apache/spark/pull/44335

   ### What changes were proposed in this pull request?
   <!--
   Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue. 
   If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
     1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
     2. If you fix some SQL features, you can provide some references of other DBMSes.
     3. If there is design documentation, please add the link.
     4. If there is a discussion in the mailing list, please add the link.
   -->
   
   
   ### Why are the changes needed?
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you propose a new API, clarify the use case for a new API.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   
   
   ### Does this PR introduce _any_ user-facing change?
   <!--
   Note that it means *any* user-facing change including all aspects such as the documentation fix.
   If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
   If possible, please also clarify if this is a user-facing change compared to the released Spark versions or within the unreleased branches such as master.
   If no, write 'No'.
   -->
   
   
   ### How was this patch tested?
   By existing test suites:
   ```
   $ build/sbt "test:testOnly *JDBCV2Suite"
   $ build/sbt "test:testOnly *JDBCTableCatalogSuite"
   ```
   
   ### Was this patch authored or co-authored using generative AI tooling?
   No.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [SPARK-46393][SQL] Classify exceptions in the JDBC table catalog [spark]

Posted by "srielau (via GitHub)" <gi...@apache.org>.
srielau commented on PR #44335:
URL: https://github.com/apache/spark/pull/44335#issuecomment-1854656969

   @MaxGekk 
   Is this just doing:
   /**
      * Gets a dialect exception, classifies it and wraps it by `AnalysisException`.
      * @param message The error message to be placed to the returned exception.
      * @param e The dialect specific exception.
      * @return `AnalysisException` or its sub-class.
      */
     def classifyException(message: String, e: Throwable): AnalysisException = {
       new AnalysisException(
         errorClass = "_LEGACY_ERROR_TEMP_3064",
         messageParameters = Map("msg" -> message),
         cause = Some(e))
     }
     
     Shouldn't we raise proper error classes instead of hiding behind "message" 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [SPARK-46393][SQL] Classify exceptions in the JDBC table catalog [spark]

Posted by "cloud-fan (via GitHub)" <gi...@apache.org>.
cloud-fan commented on PR #44335:
URL: https://github.com/apache/spark/pull/44335#issuecomment-1855106022

   @srielau This seems like a lot of work as we need to understand different errors from different databases. Shall we have a general error class name as the fallback? Each JDBC dialect can override this method and provide more concrete error classes.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [SPARK-46393][SQL] Classify exceptions in the JDBC table catalog [spark]

Posted by "MaxGekk (via GitHub)" <gi...@apache.org>.
MaxGekk commented on PR #44335:
URL: https://github.com/apache/spark/pull/44335#issuecomment-1855358235

   Merging to master. Thank you, all for review.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [SPARK-46393][SQL] Classify exceptions in the JDBC table catalog [spark]

Posted by "srielau (via GitHub)" <gi...@apache.org>.
srielau commented on PR #44335:
URL: https://github.com/apache/spark/pull/44335#issuecomment-1856019413

   Opened: https://issues.apache.org/jira/browse/SPARK-46410 as follow up.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [SPARK-46393][SQL] Classify exceptions in the JDBC table catalog [spark]

Posted by "MaxGekk (via GitHub)" <gi...@apache.org>.
MaxGekk commented on PR #44335:
URL: https://github.com/apache/spark/pull/44335#issuecomment-1855346272

   > At a minimum we could give: _LEGACY_ERROR_TEMP_3064 a proper name and each of these invocations picks a subclass.
   
   There are no tests at all for the cases where JDBC op fails. I believe we should go by the regular way: write tests, update docs, assign names, improve error messages, and so.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [SPARK-46393][SQL] Classify exceptions in the JDBC table catalog [spark]

Posted by "MaxGekk (via GitHub)" <gi...@apache.org>.
MaxGekk commented on PR #44335:
URL: https://github.com/apache/spark/pull/44335#issuecomment-1857582179

   @srielau @cloud-fan The small PR with assigned names is ready: https://github.com/apache/spark/pull/44358


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [SPARK-46393][SQL] Classify exceptions in the JDBC table catalog [spark]

Posted by "srielau (via GitHub)" <gi...@apache.org>.
srielau commented on PR #44335:
URL: https://github.com/apache/spark/pull/44335#issuecomment-1855113908

   > @srielau This seems like a lot of work as we need to understand different errors from different databases. Shall we have a general error class name as the fallback? Each JDBC dialect can override this method and provide more concrete error classes.
   
   I count 8 invocations of classifyException() in this file. Each invocation adds better information using English. Why can't these be error classes?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [SPARK-46393][SQL] Classify exceptions in the JDBC table catalog [spark]

Posted by "MaxGekk (via GitHub)" <gi...@apache.org>.
MaxGekk closed pull request #44335: [SPARK-46393][SQL] Classify exceptions in the JDBC table catalog
URL: https://github.com/apache/spark/pull/44335


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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