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 2022/08/11 04:16:52 UTC

[GitHub] [spark] seunggabi opened a new pull request, #37478: feat: config(key, value); value by Object

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

   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://spark.apache.org/contributing.html
     2. Ensure you have added or run the appropriate tests for your PR: https://spark.apache.org/developer-tools.html
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][SPARK-XXXX] Your PR title ...'.
     4. Be sure to keep the PR description updated to reflect all changes.
     5. Please write your PR title to summarize what this PR proposes.
     6. If possible, provide a concise example to reproduce the issue for a faster review.
     7. If you want to add a new configuration, please read the guideline first for naming configurations in
        'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
     8. If you want to add or modify an error type or message, please read the guideline first in
        'core/src/main/resources/error/README.md'.
   -->
   
   ### What changes were proposed in this pull request?
   - as-is
   ```
       private fun config(builder: SparkSession.Builder): SparkSession.Builder {
           val map = YamlUtils.read(this::class.java, "spark", Extension.YAML)
   
           var b = builder
           map.keys.forEach {
               val k = it
               val v = map[k]
   
               b = when (v) {
                   is Long -> b.config(k, v)
                   is String -> b.config(k, v)
                   is Double -> b.config(k, v)
                   is Boolean -> b.config(k, v)
                   else -> b
               }
           }
   
           return b
       }
   }
   ```
   - to-be
   ```
       private fun config(builder: SparkSession.Builder): SparkSession.Builder {
           val map = YamlUtils.read(this::class.java, "spark", Extension.YAML)
   
           var b = builder
           map.keys.forEach {
               b = b.config(it, map[it])
           }
   
           return b
       }
   }
   ```
   <!--
   Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue. 
   If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
     1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
     2. If you fix some SQL features, you can provide some references of other DBMSes.
     3. If there is design documentation, please add the link.
     4. If there is a discussion in the mailing list, please add the link.
   -->
   
   
   ### Why are the changes needed?
   - string, boolean, long, double -> toString
   - so this is simple code!
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you propose a new API, clarify the use case for a new API.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   
   
   ### Does this PR introduce _any_ user-facing change?
   <!--
   Note that it means *any* user-facing change including all aspects such as the documentation fix.
   If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
   If possible, please also clarify if this is a user-facing change compared to the released Spark versions or within the unreleased branches such as master.
   If no, write 'No'.
   -->
   
   
   ### How was this patch tested?
   - simple code, tested by origin test code.
   <!--
   If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
   If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
   If tests were not added, please describe why they were not added and/or why it was difficult to add.
   If benchmark tests were added, please run the benchmarks in GitHub Actions for the consistent environment, and the instructions could accord to: https://spark.apache.org/developer-tools.html#github-workflow-benchmarks.
   -->
   


-- 
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] seunggabi commented on a diff in pull request #37478: [SPARK][SQL] feat: conf(String, Any)

Posted by GitBox <gi...@apache.org>.
seunggabi commented on code in PR #37478:
URL: https://github.com/apache/spark/pull/37478#discussion_r947184577


##########
sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala:
##########
@@ -821,6 +821,7 @@ object SparkSession extends Logging {
      *
      * @since 2.0.0
      */
+    @deprecated("use conf", "3.3.1")

Review Comment:
   @srowen 
   thx for your comment.
   
   I will change `3.4.0`.
   I think, `config` method deprecated is better than or not.
   because same method `conf`.
   conf method is extended from `config`.
   
   but, you don't like, I will remove `deprecated`
   can you give me answer?



-- 
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] seunggabi commented on a diff in pull request #37478: [SPARK][SQL] feat: conf(String, Any)

Posted by GitBox <gi...@apache.org>.
seunggabi commented on code in PR #37478:
URL: https://github.com/apache/spark/pull/37478#discussion_r947031828


##########
sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala:
##########
@@ -854,11 +857,23 @@ object SparkSession extends Logging {
      *
      * @since 2.0.0
      */
+    @deprecated("use conf", "3.3.1")
     def config(key: String, value: Boolean): Builder = synchronized {
       options += key -> value.toString
       this
     }
 
+    /**
+     * Sets a config option. Options set using this method are automatically propagated to
+     * both `SparkConf` and SparkSession's own configuration.
+     *
+     * @since 3.3.1
+     */
+    def conf(key: String, value: Any): Builder = synchronized {

Review Comment:
   @srowen 
   yes. it is works!
   
   this method is simple code.
   but, I afraid another type of args into this (without boolean, long, double, string)



##########
sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala:
##########
@@ -854,11 +857,23 @@ object SparkSession extends Logging {
      *
      * @since 2.0.0
      */
+    @deprecated("use conf", "3.3.1")
     def config(key: String, value: Boolean): Builder = synchronized {
       options += key -> value.toString
       this
     }
 
+    /**
+     * Sets a config option. Options set using this method are automatically propagated to
+     * both `SparkConf` and SparkSession's own configuration.
+     *
+     * @since 3.3.1
+     */
+    def conf(key: String, value: Any): Builder = synchronized {

Review Comment:
   @srowen 
   yes. it is works!
   
   this method is simple code.
   but, I afraid another type of args into this.
   (without boolean, long, double, string)



-- 
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] seunggabi commented on a diff in pull request #37478: [SPARK][SQL] feat: conf(String, Any)

Posted by GitBox <gi...@apache.org>.
seunggabi commented on code in PR #37478:
URL: https://github.com/apache/spark/pull/37478#discussion_r947031828


##########
sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala:
##########
@@ -854,11 +857,23 @@ object SparkSession extends Logging {
      *
      * @since 2.0.0
      */
+    @deprecated("use conf", "3.3.1")
     def config(key: String, value: Boolean): Builder = synchronized {
       options += key -> value.toString
       this
     }
 
+    /**
+     * Sets a config option. Options set using this method are automatically propagated to
+     * both `SparkConf` and SparkSession's own configuration.
+     *
+     * @since 3.3.1
+     */
+    def conf(key: String, value: Any): Builder = synchronized {

Review Comment:
   @srowen 
   yes. it is works!
   
   this method is simple code.
   but, I afraid another type of args into this.
   (except boolean, long, double, string)



-- 
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] seunggabi commented on a diff in pull request #37478: [SPARK][SQL] feat: conf(String, Any)

Posted by GitBox <gi...@apache.org>.
seunggabi commented on code in PR #37478:
URL: https://github.com/apache/spark/pull/37478#discussion_r947151059


##########
sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala:
##########
@@ -854,11 +857,23 @@ object SparkSession extends Logging {
      *
      * @since 2.0.0
      */
+    @deprecated("use conf", "3.3.1")
     def config(key: String, value: Boolean): Builder = synchronized {
       options += key -> value.toString
       this
     }
 
+    /**
+     * Sets a config option. Options set using this method are automatically propagated to
+     * both `SparkConf` and SparkSession's own configuration.
+     *
+     * @since 3.3.1
+     */
+    def conf(key: String, value: Any): Builder = synchronized {

Review Comment:
   @srowen 
   I added test code. (java) https://github.com/apache/spark/pull/37478/commits/14b6fe1349ab477546a30e99449e7a8359bd3d3b
   
   we will check github workflows. (build - 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] seunggabi commented on a diff in pull request #37478: [SPARK][SQL] feat: conf(String, Any)

Posted by GitBox <gi...@apache.org>.
seunggabi commented on code in PR #37478:
URL: https://github.com/apache/spark/pull/37478#discussion_r948829018


##########
sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala:
##########
@@ -859,6 +859,31 @@ object SparkSession extends Logging {
       this
     }
 
+    /**
+     * Sets a config option. Options set using this method are automatically propagated to
+     * both `SparkConf` and SparkSession's own configuration.
+     *
+     * @since 3.4.0
+     */
+    def config(map: Map[String, Any]): Builder = synchronized {
+      map.foreach {
+        kv: (String, Any) => {
+          options += kv._1 -> kv._2.toString

Review Comment:
   ### choose
   1. type check -> config(String, type) method
   2. foreach -> options += key -> value
   
   ---
   
   I chose 2.
   because it is simple code.



-- 
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] seunggabi commented on a diff in pull request #37478: [SPARK][SQL] feat: conf(String, Any)

Posted by GitBox <gi...@apache.org>.
seunggabi commented on code in PR #37478:
URL: https://github.com/apache/spark/pull/37478#discussion_r944655317


##########
sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala:
##########
@@ -819,42 +819,9 @@ object SparkSession extends Logging {
      * Sets a config option. Options set using this method are automatically propagated to
      * both `SparkConf` and SparkSession's own configuration.
      *
-     * @since 2.0.0
-     */
-    def config(key: String, value: String): Builder = synchronized {

Review Comment:
   @HyukjinKwon 
   I am done.
   
   if you have a free time, please check!
   don't want this code. please close pr.
   thx.



-- 
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] seunggabi commented on pull request #37478: [SPARK][SQL] feat: SparkSession.confing(Map)

Posted by GitBox <gi...@apache.org>.
seunggabi commented on PR #37478:
URL: https://github.com/apache/spark/pull/37478#issuecomment-1221500804

   @srowen 
   thx for guide, I changed title & attach link!


-- 
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] seunggabi commented on a diff in pull request #37478: [SPARK][SQL] feat: conf(String, Any)

Posted by GitBox <gi...@apache.org>.
seunggabi commented on code in PR #37478:
URL: https://github.com/apache/spark/pull/37478#discussion_r947031828


##########
sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala:
##########
@@ -854,11 +857,23 @@ object SparkSession extends Logging {
      *
      * @since 2.0.0
      */
+    @deprecated("use conf", "3.3.1")
     def config(key: String, value: Boolean): Builder = synchronized {
       options += key -> value.toString
       this
     }
 
+    /**
+     * Sets a config option. Options set using this method are automatically propagated to
+     * both `SparkConf` and SparkSession's own configuration.
+     *
+     * @since 3.3.1
+     */
+    def conf(key: String, value: Any): Builder = synchronized {

Review Comment:
   @srowen 
   yes. it is works!
   
   this method is simple code.
   but, I afraid another type of args into this (without boolean, long, string)



-- 
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] srowen commented on a diff in pull request #37478: [SPARK][SQL] feat: conf(String, Any)

Posted by GitBox <gi...@apache.org>.
srowen commented on code in PR #37478:
URL: https://github.com/apache/spark/pull/37478#discussion_r947065747


##########
sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala:
##########
@@ -854,11 +857,23 @@ object SparkSession extends Logging {
      *
      * @since 2.0.0
      */
+    @deprecated("use conf", "3.3.1")
     def config(key: String, value: Boolean): Builder = synchronized {
       options += key -> value.toString
       this
     }
 
+    /**
+     * Sets a config option. Options set using this method are automatically propagated to
+     * both `SparkConf` and SparkSession's own configuration.
+     *
+     * @since 3.3.1
+     */
+    def conf(key: String, value: Any): Builder = synchronized {

Review Comment:
   I don't quite understand. The type in the bytecode is Object right? So I can't pass a long in Java. Scala figures it out with boxing 



-- 
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] srowen commented on a diff in pull request #37478: [SPARK][SQL] feat: conf(String, Any)

Posted by GitBox <gi...@apache.org>.
srowen commented on code in PR #37478:
URL: https://github.com/apache/spark/pull/37478#discussion_r947167327


##########
sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala:
##########
@@ -821,6 +821,7 @@ object SparkSession extends Logging {
      *
      * @since 2.0.0
      */
+    @deprecated("use conf", "3.3.1")

Review Comment:
   We wouldn't introduce this change in 3.3.1, I think. 3.4.0 at best. But why do we need to deprecate these? won't most invocations bind to these anyway and then users get deprecation warnings?



-- 
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] srowen commented on pull request #37478: [SPARK][SQL] feat: SparkSession.confing(Map)

Posted by GitBox <gi...@apache.org>.
srowen commented on PR #37478:
URL: https://github.com/apache/spark/pull/37478#issuecomment-1221412559

   Please edit the title to link to the JIRA


-- 
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] seunggabi commented on pull request #37478: [SPARK][SQL] feat: conf(String, Any)

Posted by GitBox <gi...@apache.org>.
seunggabi commented on PR #37478:
URL: https://github.com/apache/spark/pull/37478#issuecomment-1218000689

   @srowen 
   yes. you're right.
   `as-is` is works every case.
   
   but, I suggested for flexible code.
   worth is flexible code? <- it may be my own idea.
   
   if this pr is closed, I'm OK!
   please make a decision (destiny of this PR)
   
   ---
   
   ### as-is
   ```kotlin
               b = when (v) {
                   is Long -> b.config(k, v)
                   is String -> b.config(k, v)
                   is Double -> b.config(k, v)
                   is Boolean -> b.config(k, v)
                   else -> b
               }
   ```
   ### to-be
   ```kotlin
               b = b.conf(it, map[it])
   ```


-- 
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] srowen commented on pull request #37478: [SPARK-40163][SQL] feat: SparkSession.config(Map)

Posted by GitBox <gi...@apache.org>.
srowen commented on PR #37478:
URL: https://github.com/apache/spark/pull/37478#issuecomment-1221606814

   Merged to master


-- 
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] seunggabi commented on pull request #37478: [SPARK][SQL] feat: conf(String, Any)

Posted by GitBox <gi...@apache.org>.
seunggabi commented on PR #37478:
URL: https://github.com/apache/spark/pull/37478#issuecomment-1217083958

   > This also lacks a JIRA, but, don't bother until we decide whether this can move forward even
   
   yes I am ready for create JIRA.
   If you say to me `create JIRA`, I create JIRA.


-- 
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] AmplabJenkins commented on pull request #37478: feat: config(key, value); value by Object

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on PR #37478:
URL: https://github.com/apache/spark/pull/37478#issuecomment-1212558054

   Can one of the admins verify this patch?


-- 
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] seunggabi commented on a diff in pull request #37478: feat: config(key, value); value by Object

Posted by GitBox <gi...@apache.org>.
seunggabi commented on code in PR #37478:
URL: https://github.com/apache/spark/pull/37478#discussion_r943701910


##########
sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala:
##########
@@ -819,42 +819,9 @@ object SparkSession extends Logging {
      * Sets a config option. Options set using this method are automatically propagated to
      * both `SparkConf` and SparkSession's own configuration.
      *
-     * @since 2.0.0
-     */
-    def config(key: String, value: String): Builder = synchronized {

Review Comment:
   @HyukjinKwon 
   thx to comment!
   
   so it is possible..?
   
   ```scala
       def conf(key: String, value: Any): Builder = synchronized {
         options += key -> value.toString
         this
       }
   ```



-- 
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] srowen commented on pull request #37478: [SPARK][SQL] feat: conf(String, Any)

Posted by GitBox <gi...@apache.org>.
srowen commented on PR #37478:
URL: https://github.com/apache/spark/pull/37478#issuecomment-1218015512

   I see your point, OK. Hm, maybe a more useful overload is a "put all" method that takes a Map?


-- 
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] seunggabi commented on pull request #37478: [SPARK][SQL] feat: SparkSession.confing(Map)

Posted by GitBox <gi...@apache.org>.
seunggabi commented on PR #37478:
URL: https://github.com/apache/spark/pull/37478#issuecomment-1221408944

   thx @srowen 
   have a nice weekend.!


-- 
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] srowen commented on pull request #37478: [SPARK][SQL] feat: SparkSession.confing(Map)

Posted by GitBox <gi...@apache.org>.
srowen commented on PR #37478:
URL: https://github.com/apache/spark/pull/37478#issuecomment-1221325756

   Last thing, I'd go ahead and make a JIRA for this. It's minor but non trivial


-- 
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] srowen commented on pull request #37478: [SPARK][SQL] feat: SparkSession.confing(Map)

Posted by GitBox <gi...@apache.org>.
srowen commented on PR #37478:
URL: https://github.com/apache/spark/pull/37478#issuecomment-1221452645

   You can file a JIRA, please


-- 
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] srowen commented on pull request #37478: [SPARK-40163][SPARK][SQL] feat: SparkSession.confing(Map)

Posted by GitBox <gi...@apache.org>.
srowen commented on PR #37478:
URL: https://github.com/apache/spark/pull/37478#issuecomment-1221542669

   It goes in the title, I added it. (https://spark.apache.org/contributing.html) LGTM


-- 
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] seunggabi commented on pull request #37478: [SPARK-40163][SPARK][SQL] feat: SparkSession.config(Map)

Posted by GitBox <gi...@apache.org>.
seunggabi commented on PR #37478:
URL: https://github.com/apache/spark/pull/37478#issuecomment-1221551330

   @srowen 
   I forget, to click title edit update buttion.
   I edited code. (JIRA -> test code comment). https://github.com/apache/spark/pull/37478/commits/caee621ac1d0dfc762afc5135d0985bbb0293243
   
   Thank you for spending a lot of time for me as a beginner.
   I learned a lot, and I think I can become a better contributor in the future. 🚀 


-- 
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] srowen commented on pull request #37478: [SPARK][SQL] feat: conf(String, Any)

Posted by GitBox <gi...@apache.org>.
srowen commented on PR #37478:
URL: https://github.com/apache/spark/pull/37478#issuecomment-1217990773

   What would the new method bind to now? wouldn't it just bind to the existing methods in almost all cases? so what is the value of the new one?


-- 
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] srowen closed pull request #37478: [SPARK-40163][SQL] feat: SparkSession.config(Map)

Posted by GitBox <gi...@apache.org>.
srowen closed pull request #37478: [SPARK-40163][SQL] feat: SparkSession.config(Map)
URL: https://github.com/apache/spark/pull/37478


-- 
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 #37478: feat: config(key, value); value by Object

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on code in PR #37478:
URL: https://github.com/apache/spark/pull/37478#discussion_r943415695


##########
sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala:
##########
@@ -819,42 +819,9 @@ object SparkSession extends Logging {
      * Sets a config option. Options set using this method are automatically propagated to
      * both `SparkConf` and SparkSession's own configuration.
      *
-     * @since 2.0.0
-     */
-    def config(key: String, value: String): Builder = synchronized {

Review Comment:
   This breaks binary compatibility so we can't simply do this.



-- 
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] srowen commented on a diff in pull request #37478: [SPARK][SQL] feat: conf(String, Any)

Posted by GitBox <gi...@apache.org>.
srowen commented on code in PR #37478:
URL: https://github.com/apache/spark/pull/37478#discussion_r947186675


##########
sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala:
##########
@@ -821,6 +821,7 @@ object SparkSession extends Logging {
      *
      * @since 2.0.0
      */
+    @deprecated("use conf", "3.3.1")

Review Comment:
   Right. But then there just isn't much point in this change. I'd leave it all as is 



-- 
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] srowen commented on pull request #37478: [SPARK][SQL] feat: conf(String, Any)

Posted by GitBox <gi...@apache.org>.
srowen commented on PR #37478:
URL: https://github.com/apache/spark/pull/37478#issuecomment-1217930382

   Same question as above - isn't this working by just binding to deprecated methods? I don't think this is worth deprecating all the calls apps make now.


-- 
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] srowen commented on a diff in pull request #37478: [SPARK][SQL] feat: conf(String, Any)

Posted by GitBox <gi...@apache.org>.
srowen commented on code in PR #37478:
URL: https://github.com/apache/spark/pull/37478#discussion_r946784170


##########
sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala:
##########
@@ -854,11 +857,23 @@ object SparkSession extends Logging {
      *
      * @since 2.0.0
      */
+    @deprecated("use conf", "3.3.1")
     def config(key: String, value: Boolean): Builder = synchronized {
       options += key -> value.toString
       this
     }
 
+    /**
+     * Sets a config option. Options set using this method are automatically propagated to
+     * both `SparkConf` and SparkSession's own configuration.
+     *
+     * @since 3.3.1
+     */
+    def conf(key: String, value: Any): Builder = synchronized {

Review Comment:
   Hm, does this work from Java? I'm concerned that this method becomes harder to use outside Scala



-- 
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] seunggabi commented on pull request #37478: [SPARK][SQL] feat: conf(String, Any)

Posted by GitBox <gi...@apache.org>.
seunggabi commented on PR #37478:
URL: https://github.com/apache/spark/pull/37478#issuecomment-1217968177

   > 
   Same question as above - isn't this working by just binding to deprecated methods? I don't think this is worth deprecating all the calls apps make now.
   
   right, so I removed `@deprecated`. I add just new `conf` method. (vs `config`).
   maybe I don't understand your last comment. 
   would you show me `to-be` ?


-- 
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] seunggabi commented on pull request #37478: [SPARK][SQL] feat: conf(String, Any)

Posted by GitBox <gi...@apache.org>.
seunggabi commented on PR #37478:
URL: https://github.com/apache/spark/pull/37478#issuecomment-1218021260

   @srowen 
   Thx, I will make map conf method this week.
   
   Please wait for me


-- 
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] seunggabi commented on a diff in pull request #37478: [SPARK][SQL] feat: conf(String, Any)

Posted by GitBox <gi...@apache.org>.
seunggabi commented on code in PR #37478:
URL: https://github.com/apache/spark/pull/37478#discussion_r947184577


##########
sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala:
##########
@@ -821,6 +821,7 @@ object SparkSession extends Logging {
      *
      * @since 2.0.0
      */
+    @deprecated("use conf", "3.3.1")

Review Comment:
   @srowen 
   thx for your comment.
   
   I will change `3.4.0`.
   I think, `config` method deprecated is better than or not.
   because same method `conf`.
   conf method is extended from `config`.
   (more useful)
   
   but, you don't like, I will remove `deprecated`
   can you give me answer?



-- 
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] seunggabi commented on pull request #37478: feat: config(key, value); value by Object

Posted by GitBox <gi...@apache.org>.
seunggabi commented on PR #37478:
URL: https://github.com/apache/spark/pull/37478#issuecomment-1212734843

   I will add `.conf` test code today.


-- 
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] srowen commented on a diff in pull request #37478: [SPARK][SQL] feat: conf(String, Any)

Posted by GitBox <gi...@apache.org>.
srowen commented on code in PR #37478:
URL: https://github.com/apache/spark/pull/37478#discussion_r947167705


##########
sql/core/src/test/java/test/org/apache/spark/sql/JavaSparkSessionSuite.java:
##########
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package test.org.apache.spark.sql;
+
+import org.apache.spark.sql.*;
+import org.junit.Test;
+
+public class JavaSparkSessionSuite {
+
+  @Test
+  public void conf() {
+    SparkSession session = SparkSession.builder()
+      .master("local")
+      .conf("string", "")

Review Comment:
   I think this 'works' because it binds to existing deprecated methods, and I think that's an issue if it is generating deprecation warnings



-- 
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] srowen commented on pull request #37478: [SPARK][SQL] feat: conf(String, Any)

Posted by GitBox <gi...@apache.org>.
srowen commented on PR #37478:
URL: https://github.com/apache/spark/pull/37478#issuecomment-1217058476

   This also lacks a JIRA, but, don't bother until we decide whether this can move forward even


-- 
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] seunggabi commented on pull request #37478: [SPARK][SQL] feat: SparkSession.confing(Map)

Posted by GitBox <gi...@apache.org>.
seunggabi commented on PR #37478:
URL: https://github.com/apache/spark/pull/37478#issuecomment-1221420102

   @srowen 
   You mean, 
   A: I will make JIRA, and change title and attach link.
   B: you give to JIRA, and change title and attach link.
   
   A or B?
   
   I maybe think B.
   I will change title and attach link.
   B right?


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