From 5de05764e4a5685c12fadae8275a721c1e806e94 Mon Sep 17 00:00:00 2001 From: swordy_zhao Date: Thu, 18 Jan 2024 23:22:36 +0800 Subject: [PATCH 1/4] fix 5991--kyuubi failed to read atlas.rest.address --- .../plugin/lineage/dispatcher/atlas/AtlasClientConf.scala | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/extensions/spark/kyuubi-spark-lineage/src/main/scala/org/apache/kyuubi/plugin/lineage/dispatcher/atlas/AtlasClientConf.scala b/extensions/spark/kyuubi-spark-lineage/src/main/scala/org/apache/kyuubi/plugin/lineage/dispatcher/atlas/AtlasClientConf.scala index 03b1a83e0e3..37fff890b33 100644 --- a/extensions/spark/kyuubi-spark-lineage/src/main/scala/org/apache/kyuubi/plugin/lineage/dispatcher/atlas/AtlasClientConf.scala +++ b/extensions/spark/kyuubi-spark-lineage/src/main/scala/org/apache/kyuubi/plugin/lineage/dispatcher/atlas/AtlasClientConf.scala @@ -21,12 +21,18 @@ import org.apache.atlas.ApplicationProperties import org.apache.commons.configuration.Configuration import org.apache.spark.kyuubi.lineage.SparkContextHelper +import java.util + + + class AtlasClientConf(configuration: Configuration) { def get(entry: ConfigEntry): String = { configuration.getProperty(entry.key) match { case s: String => s case l: List[_] => l.mkString(",") + case jl: util.List[_] => val jlString = jl.toString + jlString.substring(1, jlString.length - 1) case o if o != null => o.toString case _ => entry.defaultValue } From 7b000e94a158e50032d33409bd8357c04af4acc9 Mon Sep 17 00:00:00 2001 From: swordy_zhao Date: Thu, 18 Jan 2024 23:26:02 +0800 Subject: [PATCH 2/4] fix 5991--kyuubi failed to read atlas.rest.address --- .../plugin/lineage/dispatcher/atlas/AtlasClientConf.scala | 2 -- 1 file changed, 2 deletions(-) diff --git a/extensions/spark/kyuubi-spark-lineage/src/main/scala/org/apache/kyuubi/plugin/lineage/dispatcher/atlas/AtlasClientConf.scala b/extensions/spark/kyuubi-spark-lineage/src/main/scala/org/apache/kyuubi/plugin/lineage/dispatcher/atlas/AtlasClientConf.scala index 37fff890b33..a909931ddad 100644 --- a/extensions/spark/kyuubi-spark-lineage/src/main/scala/org/apache/kyuubi/plugin/lineage/dispatcher/atlas/AtlasClientConf.scala +++ b/extensions/spark/kyuubi-spark-lineage/src/main/scala/org/apache/kyuubi/plugin/lineage/dispatcher/atlas/AtlasClientConf.scala @@ -23,8 +23,6 @@ import org.apache.spark.kyuubi.lineage.SparkContextHelper import java.util - - class AtlasClientConf(configuration: Configuration) { def get(entry: ConfigEntry): String = { From 600363dd92745895ec45d2141cf18b7f7307ac31 Mon Sep 17 00:00:00 2001 From: swordy_zhao Date: Mon, 29 Jan 2024 19:19:22 +0800 Subject: [PATCH 3/4] delete scala.List,Convert a java.List to scala.List --- .../plugin/lineage/dispatcher/atlas/AtlasClientConf.scala | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/extensions/spark/kyuubi-spark-lineage/src/main/scala/org/apache/kyuubi/plugin/lineage/dispatcher/atlas/AtlasClientConf.scala b/extensions/spark/kyuubi-spark-lineage/src/main/scala/org/apache/kyuubi/plugin/lineage/dispatcher/atlas/AtlasClientConf.scala index a909931ddad..0b47229b92f 100644 --- a/extensions/spark/kyuubi-spark-lineage/src/main/scala/org/apache/kyuubi/plugin/lineage/dispatcher/atlas/AtlasClientConf.scala +++ b/extensions/spark/kyuubi-spark-lineage/src/main/scala/org/apache/kyuubi/plugin/lineage/dispatcher/atlas/AtlasClientConf.scala @@ -20,6 +20,7 @@ package org.apache.kyuubi.plugin.lineage.dispatcher.atlas import org.apache.atlas.ApplicationProperties import org.apache.commons.configuration.Configuration import org.apache.spark.kyuubi.lineage.SparkContextHelper +import scala.collection.JavaConverters._ import java.util @@ -28,9 +29,7 @@ class AtlasClientConf(configuration: Configuration) { def get(entry: ConfigEntry): String = { configuration.getProperty(entry.key) match { case s: String => s - case l: List[_] => l.mkString(",") - case jl: util.List[_] => val jlString = jl.toString - jlString.substring(1, jlString.length - 1) + case jl: util.List[_] => jl.asScala.mkString(",") case o if o != null => o.toString case _ => entry.defaultValue } From 827007d0637d4c955a2438ccdf24dbd2e2cae61f Mon Sep 17 00:00:00 2001 From: swordy_zhao Date: Fri, 2 Feb 2024 15:33:38 +0800 Subject: [PATCH 4/4] run dev/reformat fix code style. --- .../plugin/lineage/dispatcher/atlas/AtlasClientConf.scala | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/extensions/spark/kyuubi-spark-lineage/src/main/scala/org/apache/kyuubi/plugin/lineage/dispatcher/atlas/AtlasClientConf.scala b/extensions/spark/kyuubi-spark-lineage/src/main/scala/org/apache/kyuubi/plugin/lineage/dispatcher/atlas/AtlasClientConf.scala index 0b47229b92f..65063fbeb66 100644 --- a/extensions/spark/kyuubi-spark-lineage/src/main/scala/org/apache/kyuubi/plugin/lineage/dispatcher/atlas/AtlasClientConf.scala +++ b/extensions/spark/kyuubi-spark-lineage/src/main/scala/org/apache/kyuubi/plugin/lineage/dispatcher/atlas/AtlasClientConf.scala @@ -17,12 +17,13 @@ package org.apache.kyuubi.plugin.lineage.dispatcher.atlas +import java.util + +import scala.collection.JavaConverters._ + import org.apache.atlas.ApplicationProperties import org.apache.commons.configuration.Configuration import org.apache.spark.kyuubi.lineage.SparkContextHelper -import scala.collection.JavaConverters._ - -import java.util class AtlasClientConf(configuration: Configuration) {