Skip to content

Commit 2d136ef

Browse files
committed
Merge branch 'master' into SPARK-46393_FOLLOWUP
2 parents b8a40c0 + b7d9c31 commit 2d136ef

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

common/utils/src/main/resources/error/error-conditions.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,11 +1255,6 @@
12551255
"List namespaces."
12561256
]
12571257
},
1258-
"LOAD_TABLE" : {
1259-
"message" : [
1260-
"Load the table <tableName>."
1261-
]
1262-
},
12631258
"NAMESPACE_EXISTS" : {
12641259
"message" : [
12651260
"Check that the namespace <namespace> exists."

sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/jdbc/JDBCTableCatalog.scala

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -131,16 +131,13 @@ class JDBCTableCatalog extends TableCatalog
131131
checkNamespace(ident.namespace())
132132
val optionsWithTableName = new JDBCOptions(
133133
options.parameters + (JDBCOptions.JDBC_TABLE_NAME -> getTableName(ident)))
134-
JdbcUtils.classifyException(
135-
errorClass = "FAILED_JDBC.LOAD_TABLE",
136-
messageParameters = Map(
137-
"url" -> options.getRedactUrl(),
138-
"tableName" -> toSQLId(ident)),
139-
dialect,
140-
description = s"Failed to load table: $ident"
141-
) {
134+
try {
142135
val schema = JDBCRDD.resolveTable(optionsWithTableName)
143136
JDBCTable(ident, schema, optionsWithTableName)
137+
} catch {
138+
case e: SQLException =>
139+
logWarning("Failed to load table", e)
140+
throw QueryCompilationErrors.noSuchTableError(ident)
144141
}
145142
}
146143

0 commit comments

Comments
 (0)