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

 ##########
 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:
   Can we have a test case for duplicated extension names? Done
   Can we have a negative test case for function name conflicts? 
MyExtension2.myFunction and MyExtension3.myFunction? Done
   
   I added documentation for the behavior.
   I added a warning message if a registered function is replaced.
   I added a test case for the ordering.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to