brkyvz commented on a change in pull request #25747: [SPARK-29039][SQL] 
centralize the catalog and table lookup logic
URL: https://github.com/apache/spark/pull/25747#discussion_r323861149
 
 

 ##########
 File path: 
sql/catalyst/src/main/java/org/apache/spark/sql/catalog/v2/utils/CatalogV2Util.scala
 ##########
 @@ -214,12 +217,52 @@ object CatalogV2Util {
     new StructType(newFields)
   }
 
-  def loadTable(catalog: CatalogPlugin, ident: Identifier): Option[Table] =
+  def loadV2Table(catalog: CatalogPlugin, ident: Identifier): Option[Table] =
     try {
-      Option(catalog.asTableCatalog.loadTable(ident))
+      
Option(catalog.asTableCatalog.loadTable(ident)).filterNot(_.isInstanceOf[V1Table])
 
 Review comment:
   while this does seem to simplify code a little bit, I think it's going to 
hamper the small incremental work that we can do to migrate to V2 from V1. 
Having this one centralized thing would cause PRs to have humongous changes 
when we want ALTER TABLE ADD COLUMNS behavior go fully through V2SessionCatalog 
for example

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to