You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "panbingkun (via GitHub)" <gi...@apache.org> on 2024/06/07 08:44:59 UTC

Re: [PR] [SPARK-46393][SQL][FOLLOWUP] Classify exceptions in JDBCTableCatalog.loadTable and Fix UT [spark]

panbingkun commented on code in PR #46912:
URL: https://github.com/apache/spark/pull/46912#discussion_r1630859747


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/jdbc/JDBCTableCatalog.scala:
##########
@@ -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"

Review Comment:
   @cloud-fan @yaooqinn 
   Also, do we need `catalogname` as the `prefix` for the table here?
   Although I found this class `[JDBCTableCatalog.scala](https://github.com/apache/spark/pull/46912/files#diff-0418efe237f1e1563f6ff316515e5c564e1919e28d2f4069dd1c40d35691228a)`, similar ones do not have `this prefix` attached.



-- 
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