ajithme commented on a change in pull request #27267: [SPARK-30556][SQL] Copy 
sparkContext.localproperties to child thread inSubqueryExec.executionContext
URL: https://github.com/apache/spark/pull/27267#discussion_r369526228
 
 

 ##########
 File path: 
sql/core/src/test/scala/org/apache/spark/sql/internal/ExecutorSideSQLConfSuite.scala
 ##########
 @@ -125,6 +125,44 @@ class ExecutorSideSQLConfSuite extends SparkFunSuite with 
SQLTestUtils {
     val e = intercept[SparkException](dummyQueryExecution1.toRdd.collect())
     assert(e.getCause.isInstanceOf[NoSuchElementException])
   }
+
+  test("SPARK-30556 propagate local properties to subquery execution thread") {
+    withSQLConf("spark.sql.subquery.maxThreadThreshold" -> "1") {
+      withTempView("l", "m", "n") {
+        Seq(true)
+          .toDF()
+          .createOrReplaceTempView("l")
+        val confKey = "spark.sql.y"
+
+        def createDataframe(confKey: String, confValue: String): 
Dataset[Boolean] = {
+          Seq(true)
+            .toDF()
+            .mapPartitions { _ =>
+              val conf = SQLConf.get
+              conf
+                .isInstanceOf[ReadOnlySQLConf] && conf.getConfString(confKey) 
== confValue match {
+                case true => Iterator(true)
+                case false => Iterator.empty
+              }
+            }
+        }
+
+        // set local configuration and assert
+        val confValue1 = "e"
+        createDataframe(confKey, confValue1)
+          .createOrReplaceTempView("m")
 
 Review comment:
   Yes, i have updated

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