-
Notifications
You must be signed in to change notification settings - Fork 28.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-46393][SQL][FOLLOWUP] Classify exceptions in JDBCTableCatalog.loadTable and Fix UT #46912
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -131,13 +131,16 @@ class JDBCTableCatalog extends TableCatalog | |
checkNamespace(ident.namespace()) | ||
val optionsWithTableName = new JDBCOptions( | ||
options.parameters + (JDBCOptions.JDBC_TABLE_NAME -> getTableName(ident))) | ||
try { | ||
JdbcUtils.classifyException( | ||
errorClass = "FAILED_JDBC.LOAD_TABLE", | ||
messageParameters = Map( | ||
"url" -> options.getRedactUrl(), | ||
"tableName" -> toSQLId(ident)), | ||
dialect, | ||
description = s"Failed to load table: $ident" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @cloud-fan @yaooqinn There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm fine to add catalog info. Let's do it in a separated PR, as not only There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, Let me to do it in a separated PR. |
||
) { | ||
val schema = JDBCRDD.resolveTable(optionsWithTableName) | ||
JDBCTable(ident, schema, optionsWithTableName) | ||
} catch { | ||
case e: SQLException => | ||
logWarning("Failed to load table", e) | ||
throw QueryCompilationErrors.noSuchTableError(ident) | ||
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be
LOAD_TABLE
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 placeThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that we should correct it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If necessary, I handle it together with the prefix logic above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM