From 007fc477b7d724851bb555aabf69324e8b1cb53d Mon Sep 17 00:00:00 2001 From: senmiaoliu Date: Fri, 4 Aug 2023 09:58:11 +0800 Subject: [PATCH] [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 Signed-off-by: Cheng Pan --- .../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] = {