-
Notifications
You must be signed in to change notification settings - Fork 28.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-40163][SQL] feat: SparkSession.config(Map) #37478
[SPARK-40163][SQL] feat: SparkSession.config(Map) #37478
Conversation
sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala
Outdated
Show resolved
Hide resolved
Can one of the admins verify this patch? |
I will add |
sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala
Outdated
Show resolved
Hide resolved
sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala
Outdated
Show resolved
Hide resolved
sql/core/src/test/java/test/org/apache/spark/sql/JavaSparkSessionSuite.java
Outdated
Show resolved
Hide resolved
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. |
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. |
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 |
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? |
@srowen but, I suggested for flexible code. if this pr is closed, I'm OK! as-is 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 b = b.conf(it, map[it]) |
I see your point, OK. Hm, maybe a more useful overload is a "put all" method that takes a Map? |
@srowen Please wait for me |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@srowen
I am done.
please check.
have a nice day.
def config(map: Map[String, Any]): Builder = synchronized { | ||
map.foreach { | ||
kv: (String, Any) => { | ||
options += kv._1 -> kv._2.toString |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
choose
- type check -> config(String, type) method
- foreach -> options += key -> value
I chose 2.
because it is simple code.
Last thing, I'd go ahead and make a JIRA for this. It's minor but non trivial |
thx @srowen |
Please edit the title to link to the JIRA |
@srowen A or B? I maybe think B. |
You can file a JIRA, please |
@srowen |
It goes in the title, I added it. (https://spark.apache.org/contributing.html) LGTM |
Merged to master |
… Java `assert` in `JavaSparkSessionSuite.java` ### What changes were proposed in this pull request? This pr is a minor fix of #37478, just change to use Junit api to assert in Java suite. ### Why are the changes needed? In Java suites, should use JUnit API to make assertions. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Pass GitHub Actions Closes #37772 from LuciferYang/SPARK-40163-followup. Authored-by: yangjie01 <yangjie01@baidu.com> Signed-off-by: Sean Owen <srowen@gmail.com>
What changes were proposed in this pull request?
Why are the changes needed?
Does this PR introduce any user-facing change?
How was this patch tested?