yaooqinn commented on a change in pull request #1476:
URL: https://github.com/apache/incubator-kyuubi/pull/1476#discussion_r759801632



##########
File path: 
externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/shim/CatalogShim_v2_4.scala
##########
@@ -125,7 +126,12 @@ class CatalogShim_v2_4 extends SparkCatalogShim {
     databases.flatMap { db =>
       val identifiers = catalog.listTables(db, tablePattern, 
includeLocalTempViews = true)
       catalog.getTablesByName(identifiers).flatMap { t =>
-        t.schema.zipWithIndex.filter(f => 
columnPattern.matcher(f._1.name).matches())
+        var tableSchema: StructType = null;
+        tableSchema = t.schema
+        if (t.provider.getOrElse("") == "delta") {
+          tableSchema = spark.table(t.identifier.table).schema
+        }
+        tableSchema.zipWithIndex.filter(f => 
columnPattern.matcher(f._1.name).matches())

Review comment:
       
   How about
   
   ``` scala
   val tableSchema = if (t.provider.getOrElse("") == "delta") {
     spark.table(t.identifier.table).schema
   } else {
     t.schema
   }
   ```
   
   BTW, is 'delta' here case-sensitive?




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to