You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "wangyum (via GitHub)" <gi...@apache.org> on 2023/07/18 02:48:32 UTC

[GitHub] [spark] wangyum opened a new pull request, #42049: [SPARK-44466][SQL] Update initialSessionOptions to the value after supplementation

wangyum opened a new pull request, #42049:
URL: https://github.com/apache/spark/pull/42049

   ### What changes were proposed in this pull request?
   
   This PR updates `initialSessionOptions` to the value [after supplementation](https://github.com/apache/spark/blob/caa3df48d94ff2e7c824a87acf51ab4978e18098/core/src/main/scala/org/apache/spark/SparkContext.scala#L422-L423).
   
   ### Why are the changes needed?
   
   To make `SQL / DataFrame Properties` excluding these properties:
   ![image](https://github.com/apache/spark/assets/5399861/02fd5557-ddb2-44c2-a6c3-15a7ad37e5d0)
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   Unit test.


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [spark] wangyum commented on pull request #42049: [SPARK-44466][SQL] Exclude configs starting with `SPARK_DRIVER_PREFIX` and `SPARK_EXECUTOR_PREFIX` from modifiedConfigs

Posted by "wangyum (via GitHub)" <gi...@apache.org>.
wangyum commented on PR #42049:
URL: https://github.com/apache/spark/pull/42049#issuecomment-1648932809

   Merged to master and branch-3.5.


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [spark] HyukjinKwon commented on a diff in pull request #42049: [SPARK-44466][SQL] Exclude configs starting with `SPARK_DRIVER_PREFIX` and `SPARK_EXECUTOR_PREFIX` from modifiedConfigs

Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on code in PR #42049:
URL: https://github.com/apache/spark/pull/42049#discussion_r1271770630


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/SQLExecution.scala:
##########
@@ -97,7 +98,11 @@ object SQLExecution {
 
       val globalConfigs = sparkSession.sharedState.conf.getAll.toMap
       val modifiedConfigs = sparkSession.sessionState.conf.getAllConfs
-        .filterNot(kv => globalConfigs.get(kv._1).contains(kv._2))
+        .filterNot { case (key, value) =>
+          key.startsWith(SPARK_DRIVER_PREFIX) ||
+            key.startsWith(SPARK_EXECUTOR_PREFIX) ||
+            globalConfigs.get(key).contains(value)

Review Comment:
   I think the fix is fine.



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [spark] wangyum commented on a diff in pull request #42049: [SPARK-44466][SQL] Exclude configs starting with `SPARK_DRIVER_PREFIX` and `SPARK_EXECUTOR_PREFIX` from modifiedConfigs

Posted by "wangyum (via GitHub)" <gi...@apache.org>.
wangyum commented on code in PR #42049:
URL: https://github.com/apache/spark/pull/42049#discussion_r1269468209


##########
sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala:
##########
@@ -1103,7 +1103,9 @@ object SparkSession extends Logging {
         loadExtensions(extensions)
         applyExtensions(sparkContext, extensions)
 
-        session = new SparkSession(sparkContext, None, None, extensions, options.toMap)
+        // Some config might supplemented. For example: spark.driver.extraJavaOptions.
+        val supplementedOptions = options.map { case (k, _) => k -> sparkContext.conf.get(k) }

Review Comment:
   Makes it exclude configs starting with `SPARK_DRIVER_PREFIX` and `SPARK_EXECUTOR_PREFIX`.



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [spark] ulysses-you commented on a diff in pull request #42049: [SPARK-44466][SQL] Update initialSessionOptions to the value after supplementation

Posted by "ulysses-you (via GitHub)" <gi...@apache.org>.
ulysses-you commented on code in PR #42049:
URL: https://github.com/apache/spark/pull/42049#discussion_r1266263559


##########
sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala:
##########
@@ -1103,7 +1103,9 @@ object SparkSession extends Logging {
         loadExtensions(extensions)
         applyExtensions(sparkContext, extensions)
 
-        session = new SparkSession(sparkContext, None, None, extensions, options.toMap)
+        // Some config might supplemented. For example: spark.driver.extraJavaOptions.
+        val supplementedOptions = options.map { case (k, _) => k -> sparkContext.conf.get(k) }

Review Comment:
   Does `sparkContext.conf` contain all entries in options ? What if there is an active SparkContext before creating SparkSession.



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [spark] wangyum commented on pull request #42049: [SPARK-44466][SQL] Exclude configs starting with `SPARK_DRIVER_PREFIX` and `SPARK_EXECUTOR_PREFIX` from modifiedConfigs

Posted by "wangyum (via GitHub)" <gi...@apache.org>.
wangyum commented on PR #42049:
URL: https://github.com/apache/spark/pull/42049#issuecomment-1647153851

   cc @cloud-fan @HyukjinKwon 


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [spark] ulysses-you commented on a diff in pull request #42049: [SPARK-44466][SQL] Exclude configs starting with `SPARK_DRIVER_PREFIX` and `SPARK_EXECUTOR_PREFIX` from modifiedConfigs

Posted by "ulysses-you (via GitHub)" <gi...@apache.org>.
ulysses-you commented on code in PR #42049:
URL: https://github.com/apache/spark/pull/42049#discussion_r1270153264


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/SQLExecution.scala:
##########
@@ -97,7 +98,11 @@ object SQLExecution {
 
       val globalConfigs = sparkSession.sharedState.conf.getAll.toMap
       val modifiedConfigs = sparkSession.sessionState.conf.getAllConfs
-        .filterNot(kv => globalConfigs.get(kv._1).contains(kv._2))
+        .filterNot { case (key, value) =>
+          key.startsWith(SPARK_DRIVER_PREFIX) ||
+            key.startsWith(SPARK_EXECUTOR_PREFIX) ||
+            globalConfigs.get(key).contains(value)

Review Comment:
   make sense to me as these configs are kind of static configs, but cc @HyukjinKwon I'm not sure if python side depends on any configs with these prefix at runtime



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [spark] wangyum commented on pull request #42049: [SPARK-44466][SQL] Update initialSessionOptions to the value after supplementation

Posted by "wangyum (via GitHub)" <gi...@apache.org>.
wangyum commented on PR #42049:
URL: https://github.com/apache/spark/pull/42049#issuecomment-1639214033

   cc @ulysses-you @gengliangwang 


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


[GitHub] [spark] wangyum closed pull request #42049: [SPARK-44466][SQL] Exclude configs starting with `SPARK_DRIVER_PREFIX` and `SPARK_EXECUTOR_PREFIX` from modifiedConfigs

Posted by "wangyum (via GitHub)" <gi...@apache.org>.
wangyum closed pull request #42049: [SPARK-44466][SQL] Exclude configs starting with `SPARK_DRIVER_PREFIX` and `SPARK_EXECUTOR_PREFIX` from modifiedConfigs
URL: https://github.com/apache/spark/pull/42049


-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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