[jira] [Commented] (SPARK-26409) SQLConf should be serializable in test sessions

2018-12-20 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/SPARK-26409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16726097#comment-16726097
 ] 

ASF GitHub Bot commented on SPARK-26409:


asfgit closed pull request #23352: [SPARK-26409][SQL][TESTS] SQLConf should be 
serializable in test sessions
URL: https://github.com/apache/spark/pull/23352
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/sql/core/src/main/scala/org/apache/spark/sql/internal/BaseSessionStateBuilder.scala
 
b/sql/core/src/main/scala/org/apache/spark/sql/internal/BaseSessionStateBuilder.scala
index ac07e1f6bb4f8..319c2649592fb 100644
--- 
a/sql/core/src/main/scala/org/apache/spark/sql/internal/BaseSessionStateBuilder.scala
+++ 
b/sql/core/src/main/scala/org/apache/spark/sql/internal/BaseSessionStateBuilder.scala
@@ -309,13 +309,14 @@ private[sql] trait WithTestConf { self: 
BaseSessionStateBuilder =>
   def overrideConfs: Map[String, String]
 
   override protected lazy val conf: SQLConf = {
+val overrideConfigurations = overrideConfs
 val conf = parentState.map(_.conf.clone()).getOrElse {
   new SQLConf {
 clear()
 override def clear(): Unit = {
   super.clear()
   // Make sure we start with the default test configs even after clear
-  overrideConfs.foreach { case (key, value) => setConfString(key, 
value) }
+  overrideConfigurations.foreach { case (key, value) => 
setConfString(key, value) }
 }
   }
 }
diff --git 
a/sql/core/src/test/scala/org/apache/spark/sql/SerializationSuite.scala 
b/sql/core/src/test/scala/org/apache/spark/sql/SerializationSuite.scala
index cd6b2647e0be6..1a1c956aed3d9 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/SerializationSuite.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/SerializationSuite.scala
@@ -27,4 +27,9 @@ class SerializationSuite extends SparkFunSuite with 
SharedSQLContext {
 val spark = SparkSession.builder.getOrCreate()
 new JavaSerializer(new 
SparkConf()).newInstance().serialize(spark.sqlContext)
   }
+
+  test("[SPARK-26409] SQLConf should be serializable") {
+val spark = SparkSession.builder.getOrCreate()
+new JavaSerializer(new 
SparkConf()).newInstance().serialize(spark.sessionState.conf)
+  }
 }


 


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:
us...@infra.apache.org


> SQLConf should be serializable in test sessions
> ---
>
> Key: SPARK-26409
> URL: https://issues.apache.org/jira/browse/SPARK-26409
> Project: Spark
>  Issue Type: Improvement
>  Components: SQL, Tests
>Affects Versions: 2.4.0, 3.0.0
>Reporter: Gengliang Wang
>Assignee: Gengliang Wang
>Priority: Major
> Fix For: 3.0.0
>
>
> `SQLConf` is supposed to be serializable. However, currently it is not  
> serializable in `WithTestConf`. `WithTestConf` uses the method 
> `overrideConfs` in closure, while the classes which implements it 
> (`TestHiveSessionStateBuilder` and `TestSQLSessionStateBuilder`) are not 
> serializable.
> Use a local variable to fix it.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org



[jira] [Commented] (SPARK-26409) SQLConf should be serializable in test sessions

2018-12-19 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/SPARK-26409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16725190#comment-16725190
 ] 

ASF GitHub Bot commented on SPARK-26409:


gengliangwang opened a new pull request #23352: [SPARK-26409][SQL][TESTS] 
SQLConf should be serializable in test sessions
URL: https://github.com/apache/spark/pull/23352
 
 
   ## What changes were proposed in this pull request?
   
   Currently the `SQLConf` in `WithTestConf` is not serializable. It uses the 
method `overrideConfs` in closure, while the class 
`TestHiveSessionStateBuilder` and `TestSQLSessionStateBuilder` are not 
serializable.
   
   This PR is to use a local variable to fix it.
   
   ## How was this patch tested?
   
   Add unit test.


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:
us...@infra.apache.org


> SQLConf should be serializable in test sessions
> ---
>
> Key: SPARK-26409
> URL: https://issues.apache.org/jira/browse/SPARK-26409
> Project: Spark
>  Issue Type: Improvement
>  Components: SQL, Tests
>Affects Versions: 3.0.0
>Reporter: Gengliang Wang
>Priority: Major
>
> Currently the `SQLConf` in `WithTestConf` is not serializable. It uses the 
> method `overrideConfs` in closure, while the class 
> `TestHiveSessionStateBuilder` and `TestSQLSessionStateBuilder` are not 
> serializable.
> This PR is to use a local variable to fix it.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

-
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org