-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-42568][CONNECT] Fix SparkConnectStreamHandler to handle configs properly while planning #40165
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
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grundprinzip
approved these changes
Feb 24, 2023
HyukjinKwon
approved these changes
Feb 25, 2023
Member
|
Merged to master and branch-3.4. |
HyukjinKwon
pushed a commit
that referenced
this pull request
Feb 25, 2023
…s properly while planning ### What changes were proposed in this pull request? Fixes `SparkConnectStreamHandler` to handle configs properly while planning. The whole process should be done in `session.withActive` to take the proper `SQLConf` into account. ### Why are the changes needed? Some components for planning need to check configs in `SQLConf.get` while building the plan, but currently it's unavailable. For example, `spark.sql.legacy.allowNegativeScaleOfDecimal` needs to check when construct `DecimalType` but it's not set while planning, thus it causes an error when trying to cast to `DecimalType(1, -1)` with the config set to `"true"`: ``` [INTERNAL_ERROR] Negative scale is not allowed: -1. Set the config "spark.sql.legacy.allowNegativeScaleOfDecimal" to "true" to allow it. ``` ### Does this PR introduce _any_ user-facing change? The configs will take effect while planning. ### How was this patch tested? Enabled a related test. Closes #40165 from ueshin/issues/SPARK-42568/withActive. Authored-by: Takuya UESHIN <ueshin@databricks.com> Signed-off-by: Hyukjin Kwon <gurwls223@apache.org> (cherry picked from commit b994353) Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
zhengruifeng
pushed a commit
that referenced
this pull request
Mar 3, 2023
…e withActive ### What changes were proposed in this pull request? Fix `SparkConnectAnalyzeHandler` to use `withActive`. ### Why are the changes needed? Similar to #40165, `SQLConf.get` is necessary when transforming the proto to plans. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Existing tests. Closes #40261 from ueshin/issues/SPARK-42615/withActive. Authored-by: Takuya UESHIN <ueshin@databricks.com> Signed-off-by: Ruifeng Zheng <ruifengz@apache.org>
zhengruifeng
pushed a commit
that referenced
this pull request
Mar 3, 2023
…e withActive ### What changes were proposed in this pull request? Fix `SparkConnectAnalyzeHandler` to use `withActive`. ### Why are the changes needed? Similar to #40165, `SQLConf.get` is necessary when transforming the proto to plans. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Existing tests. Closes #40261 from ueshin/issues/SPARK-42615/withActive. Authored-by: Takuya UESHIN <ueshin@databricks.com> Signed-off-by: Ruifeng Zheng <ruifengz@apache.org> (cherry picked from commit 58f2897) Signed-off-by: Ruifeng Zheng <ruifengz@apache.org>
snmvaughan
pushed a commit
to snmvaughan/spark
that referenced
this pull request
Jun 20, 2023
…s properly while planning ### What changes were proposed in this pull request? Fixes `SparkConnectStreamHandler` to handle configs properly while planning. The whole process should be done in `session.withActive` to take the proper `SQLConf` into account. ### Why are the changes needed? Some components for planning need to check configs in `SQLConf.get` while building the plan, but currently it's unavailable. For example, `spark.sql.legacy.allowNegativeScaleOfDecimal` needs to check when construct `DecimalType` but it's not set while planning, thus it causes an error when trying to cast to `DecimalType(1, -1)` with the config set to `"true"`: ``` [INTERNAL_ERROR] Negative scale is not allowed: -1. Set the config "spark.sql.legacy.allowNegativeScaleOfDecimal" to "true" to allow it. ``` ### Does this PR introduce _any_ user-facing change? The configs will take effect while planning. ### How was this patch tested? Enabled a related test. Closes apache#40165 from ueshin/issues/SPARK-42568/withActive. Authored-by: Takuya UESHIN <ueshin@databricks.com> Signed-off-by: Hyukjin Kwon <gurwls223@apache.org> (cherry picked from commit b994353) Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
snmvaughan
pushed a commit
to snmvaughan/spark
that referenced
this pull request
Jun 20, 2023
…e withActive ### What changes were proposed in this pull request? Fix `SparkConnectAnalyzeHandler` to use `withActive`. ### Why are the changes needed? Similar to apache#40165, `SQLConf.get` is necessary when transforming the proto to plans. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Existing tests. Closes apache#40261 from ueshin/issues/SPARK-42615/withActive. Authored-by: Takuya UESHIN <ueshin@databricks.com> Signed-off-by: Ruifeng Zheng <ruifengz@apache.org> (cherry picked from commit 58f2897) Signed-off-by: Ruifeng Zheng <ruifengz@apache.org>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Fixes
SparkConnectStreamHandlerto handle configs properly while planning.The whole process should be done in
session.withActiveto take the properSQLConfinto account.Why are the changes needed?
Some components for planning need to check configs in
SQLConf.getwhile building the plan, but currently it's unavailable.For example,
spark.sql.legacy.allowNegativeScaleOfDecimalneeds to check when constructDecimalTypebut it's not set while planning, thus it causes an error when trying to cast toDecimalType(1, -1)with the config set to"true":Does this PR introduce any user-facing change?
The configs will take effect while planning.
How was this patch tested?
Enabled a related test.