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-31234][SQL][2.4] ResetCommand should not affect static SQL Configuration #28262
Conversation
cc @holdenk since she is the release manager of 2.4.6 and the target version of this issue became 2.4.6 today. |
assert(session.sessionState.conf.getConf(GLOBAL_TEMP_DATABASE) === "globalTempDB-SPARK-31234") | ||
session.sql("RESET") | ||
assert(session.sessionState.conf.getConfString("spark.app.name") === "test-app-SPARK-31234") | ||
assert(session.sessionState.conf.getConf(GLOBAL_TEMP_DATABASE) === "globalTempDB-SPARK-31234") |
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.
GLOBAL_TEMP_DATABASE is a typical example. The value is being used at the runtime. See the code
spark/sql/core/src/main/scala/org/apache/spark/sql/execution/command/views.scala
Line 154 in 4381ad5
val db = sparkSession.sessionState.conf.getConf(StaticSQLConf.GLOBAL_TEMP_DATABASE) |
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.
+1, LGTM (Pending Jenkins). Thanks, @gatorsmile .
Test build #121483 has finished for PR 28262 at commit
|
Merged to branch-2.4. |
…figuration ### What changes were proposed in this pull request? This PR is to backport the fix of #28003, add a migration guide, update the PR description and add an end-to-end test case. Before this PR, the SQL `RESET` command will reset the values of static SQL configuration to the default and remove the cached values of Spark Context Configurations in the current session. This PR fixes the bugs. After this PR, the `RESET` command follows its definition and only updates the runtime SQL configuration values to the default. ### Why are the changes needed? When we introduced the feature of Static SQL Configuration, we did not update the implementation of SQL `RESET` command. The static SQL configuration should not be changed by any command at runtime. However, the `RESET` command resets the values to the default. We should fix them. ### Does this PR introduce any user-facing change? Before Spark 2.4.6, the `RESET` command resets both the runtime and static SQL configuration values to the default. It also removes the cached values of Spark Context Configurations in the current session, although these configuration values are for displaying/querying only. ### How was this patch tested? Added an end-to-end test and a unit test Closes #28262 from gatorsmile/spark-31234followup2.4. Authored-by: gatorsmile <gatorsmile@gmail.com> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
Looks fine, thanks, @gatorsmile ! |
What changes were proposed in this pull request?
This PR is to backport the fix of #28003, add a migration guide, update the PR description and add an end-to-end test case.
Before this PR, the SQL
RESET
command will reset the values of static SQL configuration to the default and remove the cached values of Spark Context Configurations in the current session. This PR fixes the bugs. After this PR, theRESET
command follows its definition and only updates the runtime SQL configuration values to the default.Why are the changes needed?
When we introduced the feature of Static SQL Configuration, we did not update the implementation of SQL
RESET
command.The static SQL configuration should not be changed by any command at runtime. However, the
RESET
command resets the values to the default. We should fix them.Does this PR introduce any user-facing change?
Before Spark 2.4.6, the
RESET
command resets both the runtime and static SQL configuration values to the default. It also removes the cached values of Spark Context Configurations in the current session, although these configuration values are for displaying/querying only.How was this patch tested?
Added an end-to-end test and a unit test