[SPARK-46393][SQL][FOLLOWUP] Classify exceptions in JDBCTableCatalog.loadTable and Fix UT#46912
[SPARK-46393][SQL][FOLLOWUP] Classify exceptions in JDBCTableCatalog.loadTable and Fix UT#46912panbingkun wants to merge 4 commits into
Conversation
|
Could you cherry-pick 82b4ad2 here to test the CI? |
Okay. |
…loadTable ### What changes were proposed in this pull request? This is a followup of apache#44335 , which missed to handle `loadTable` ### Why are the changes needed? better error message ### Does this PR introduce _any_ user-facing change? no ### How was this patch tested? existing test ### Was this patch authored or co-authored using generative AI tooling? no Closes apache#46905 from cloud-fan/jdbc. Authored-by: Wenchen Fan <wenchen@databricks.com> Signed-off-by: Kent Yao <yao@apache.org>
Done. |
| "url" -> options.getRedactUrl(), | ||
| "tableName" -> toSQLId(ident)), | ||
| dialect, | ||
| description = s"Failed to load table: $ident" |
There was a problem hiding this comment.
@cloud-fan @yaooqinn
Also, do we need catalogname as the prefix for the table here?
Although I found this class JDBCTableCatalog.scala, similar ones do not have this prefix attached.
There was a problem hiding this comment.
I'm fine to add catalog info. Let's do it in a separated PR, as not only loadTable needs to be updated.
There was a problem hiding this comment.
Yeah, Let me to do it in a separated PR.
| def checkErrorFailedLoadTable(e: AnalysisException, tbl: String): Unit = { | ||
| checkError( | ||
| exception = e, | ||
| errorClass = "FAILED_JDBC.UNCLASSIFIED", |
There was a problem hiding this comment.
shouldn't this be LOAD_TABLE?
There was a problem hiding this comment.
spark/sql/core/src/main/scala/org/apache/spark/sql/jdbc/JdbcDialects.scala
Lines 746 to 768 in 87b0f59

It lost the upstream
errorClass in this place
There was a problem hiding this comment.
It seems that we should correct it.
There was a problem hiding this comment.
If necessary, I handle it together with the prefix logic above?
|
thanks, merging to master! |
…ption` throw out the `original` exception ### What changes were proposed in this pull request? The pr aims to make `built-in` JdbcDialect's method classifyException throw out the `original` exception. ### Why are the changes needed? As discussed in #46912 (comment), the following code: https://github.com/apache/spark/blob/df4156aa3217cf0f58b4c6cbf33c967bb43f7155/sql/core/src/main/scala/org/apache/spark/sql/jdbc/JdbcDialects.scala#L746-L751 have lost the original cause of the error, let's correct it. ### Does this PR introduce _any_ user-facing change? Yes, more accurate error conditions for end users. ### How was this patch tested? - Manually test. - Update existed UT & Pass GA. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #46937 from panbingkun/improve_JDBCTableCatalog. Authored-by: panbingkun <panbingkun@baidu.com> Signed-off-by: yangjie01 <yangjie01@baidu.com>
What changes were proposed in this pull request?
This is a followup of #46905, to fix
some UTon GA.Why are the changes needed?
Fix UT.
Does this PR introduce any user-facing change?
No.,
How was this patch tested?
Manually test.
Pass GA
Was this patch authored or co-authored using generative AI tooling?
No.