[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 <senmiaoliu@trip.com>
Signed-off-by: Cheng Pan <chengpan@apache.org>
This commit is contained in:
senmiaoliu 2023-08-04 09:58:11 +08:00 committed by Cheng Pan
parent ba99744b09
commit 007fc477b7
No known key found for this signature in database
GPG Key ID: 8001952629BCC75D

View File

@ -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] = {