You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by GitBox <gi...@apache.org> on 2021/12/01 02:14:05 UTC

[GitHub] [incubator-kyuubi] yaooqinn commented on a change in pull request #1476: [KYUUBI #1458] Delta lake table columns won't show up in DBeaver.

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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org