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/30 12:09:33 UTC

[GitHub] [incubator-kyuubi] yaooqinn commented on a change in pull request #1661: [KYUUBI #1477] Use KyuubiHadoopUtils.newHadoopConf instead of new Con…

yaooqinn commented on a change in pull request #1661:
URL: https://github.com/apache/incubator-kyuubi/pull/1661#discussion_r776699005



##########
File path: kyuubi-common/src/test/scala/org/apache/kyuubi/util/KyuubiHadoopUtilsSuite.scala
##########
@@ -59,4 +61,32 @@ class KyuubiHadoopUtilsSuite extends KyuubiFunSuite {
       KyuubiHadoopUtils.encodeCredentials(credentials))
     assert(decoded.getToken(token.getKind) == credentials.getToken(token.getKind))
   }
+
+  test("new hadoop conf with kyuubi conf with loadDefaults") {
+    val abc = "kyuubi.abc"
+    val kyuubiConf = new KyuubiConf()
+      .set(abc, "xyz")
+
+    var hadoopConf = KyuubiHadoopUtils.newHadoopConf(kyuubiConf)
+    assert(StreamSupport.stream(hadoopConf.spliterator(), false)
+      .anyMatch(entry => entry.getKey.startsWith("hadoop") || entry.getKey.startsWith("fs")))
+
+    hadoopConf = KyuubiHadoopUtils.newHadoopConf(kyuubiConf, loadDefaults = false)
+    assert(StreamSupport.stream(hadoopConf.spliterator(), false)
+      .noneMatch(entry => entry.getKey.startsWith("hadoop") || entry.getKey.startsWith("fs")))
+  }
+
+  test("new hadoop conf with kyuubi conf with ignoreConfigs") {
+    val abc = "hadoop.abc"
+    val xyz = "hadoop.xyz"
+    val test = "hadoop.test"
+    val kyuubiConf = new KyuubiConf()
+      .set(abc, "xyz")
+      .set(xyz, "abc")
+      .set(test, "t")
+    val hadoopConf = KyuubiHadoopUtils.newHadoopConf(kyuubiConf, ignoreConfigs = Seq(abc, test))
+    assert(hadoopConf.get(abc) == null)

Review comment:
       === 




-- 
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