You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2018/12/28 20:13:14 UTC

[GitHub] dongjoon-hyun commented on a change in pull request #23398: [SPARK-26493][SQL] Allow multiple spark.sql.extensions

dongjoon-hyun commented on a change in pull request #23398: [SPARK-26493][SQL] Allow multiple spark.sql.extensions
URL: https://github.com/apache/spark/pull/23398#discussion_r244399170
 
 

 ##########
 File path: sql/core/src/test/scala/org/apache/spark/sql/SparkSessionExtensionSuite.scala
 ##########
 @@ -114,6 +124,25 @@ class SparkSessionExtensionSuite extends SparkFunSuite {
       stop(session)
     }
   }
+
+  test("use multiple custom class for extensions") {
+    val session = SparkSession.builder()
+      .master("local[1]")
+      .config("spark.sql.extensions", Seq(
+        classOf[MyExtensions].getCanonicalName,
+        classOf[MyExtensions2].getCanonicalName).mkString(","))
+      .getOrCreate()
+    try {
+      assert(session.sessionState.planner.strategies.contains(MySparkStrategy(session)))
+      assert(session.sessionState.analyzer.extendedResolutionRules.contains(MyRule(session)))
+      assert(session.sessionState.functionRegistry
+        .lookupFunction(MyExtensions.myFunction._1).isDefined)
+      assert(session.sessionState.functionRegistry
+        .lookupFunction(MyExtensions2.myFunction._1).isDefined)
 
 Review comment:
   So, now we have multiple extension registrations. The order of extension names might have side-effects.
   - Can we have a test case for duplicated extension names? `MyExtension2` and `MyExtension2`?
   - Can we have a negative test case for function name conflicts? `MyExtension2.myFunction` and `MyExtension3.myFunction`?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org