You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by ch...@apache.org on 2023/08/04 01:58:21 UTC

[kyuubi] branch master updated: [KYUUBI #5105][Bug] getColumns gets duplicate column names when Spark integrates with Iceberg

This is an automated email from the ASF dual-hosted git repository.

chengpan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kyuubi.git


The following commit(s) were added to refs/heads/master by this push:
     new 007fc477b [KYUUBI #5105][Bug] getColumns gets duplicate column names when Spark integrates with Iceberg
007fc477b is described below

commit 007fc477b7d724851bb555aabf69324e8b1cb53d
Author: senmiaoliu <se...@trip.com>
AuthorDate: Fri Aug 4 09:58:11 2023 +0800

    [KYUUBI #5105][Bug] getColumns gets duplicate column names when Spark integrates with Iceberg
    
    ### _Why are the changes needed?_
    
    close #5105
    
    ### _How was this patch tested?_
    - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible
    
    - [ ] Add screenshots for manual tests if appropriate
    
    - [ ] [Run test](https://kyuubi.readthedocs.io/en/master/contributing/code/testing.html#running-tests) locally before make a pull request
    
    Closes #5128 from lsm1/features/kyuubi_5105.
    
    Closes #5105
    
    84be7fd6d [senmiaoliu] distinct default namespace
    
    Authored-by: senmiaoliu <se...@trip.com>
    Signed-off-by: Cheng Pan <ch...@apache.org>
---
 .../scala/org/apache/kyuubi/engine/spark/util/SparkCatalogUtils.scala   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/util/SparkCatalogUtils.scala b/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/util/SparkCatalogUtils.scala
index e05e8731d..18a14494e 100644
--- a/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/util/SparkCatalogUtils.scala
+++ b/externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/util/SparkCatalogUtils.scala
@@ -137,7 +137,7 @@ object SparkCatalogUtils extends Logging {
     listAllNamespaces(catalog).filter { ns =>
       val quoted = ns.map(quoteIfNeeded).mkString(".")
       schemaPattern.r.pattern.matcher(quoted).matches()
-    }.distinct
+    }.map(_.toList).toList.distinct.map(_.toArray).toArray
   }
 
   private def getSchemasWithPattern(catalog: CatalogPlugin, schemaPattern: String): Seq[String] = {