jzhuge commented on a change in pull request #24741: [SPARK-27322][SQL] DataSourceV2 table relation URL: https://github.com/apache/spark/pull/24741#discussion_r293121394
########## File path: sql/catalyst/src/main/java/org/apache/spark/sql/catalog/v2/utils/CatalogV2Util.scala ########## @@ -149,4 +153,11 @@ object CatalogV2Util { new StructType(newFields) } + + def loadTable(catalog: CatalogPlugin, ident: Identifier): Option[Table] = + try { + Option(catalog.asTableCatalog.loadTable(ident)) + } catch { + case _: NoSuchTableException => None Review comment: Yes. BTW, I don't think TableCatalog.loadTable throws CatalogNotFoundException because catalog plugin has already been found. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org