Skip to content

Commit

Permalink
Revert "[SPARK-46393][SQL][FOLLOWUP] Classify exceptions in JDBCTable…
Browse files Browse the repository at this point in the history
…Catalog.loadTable"

This reverts commit 82b4ad2.
  • Loading branch information
yaooqinn committed Jun 7, 2024
1 parent 9491292 commit b7d9c31
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
5 changes: 0 additions & 5 deletions common/utils/src/main/resources/error/error-conditions.json
Original file line number Diff line number Diff line change
Expand Up @@ -1255,11 +1255,6 @@
"List namespaces."
]
},
"LOAD_TABLE" : {
"message" : [
"Load the table <tableName>."
]
},
"NAMESPACE_EXISTS" : {
"message" : [
"Check that the namespace <namespace> exists."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,16 +131,13 @@ class JDBCTableCatalog extends TableCatalog
checkNamespace(ident.namespace())
val optionsWithTableName = new JDBCOptions(
options.parameters + (JDBCOptions.JDBC_TABLE_NAME -> getTableName(ident)))
JdbcUtils.classifyException(
errorClass = "FAILED_JDBC.LOAD_TABLE",
messageParameters = Map(
"url" -> options.getRedactUrl(),
"tableName" -> toSQLId(ident)),
dialect,
description = s"Failed to load table: $ident"
) {
try {
val schema = JDBCRDD.resolveTable(optionsWithTableName)
JDBCTable(ident, schema, optionsWithTableName)
} catch {
case e: SQLException =>
logWarning("Failed to load table", e)
throw QueryCompilationErrors.noSuchTableError(ident)
}
}

Expand Down

0 comments on commit b7d9c31

Please sign in to comment.