-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-30829][SQL] Define LegacyBehaviorPolicy enumeration as the common value for result change configs #27579
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
Conversation
|
cc @viirya @dongjoon-hyun @cloud-fan |
|
yea this looks clearer, +1 |
|
|
||
| val LEGACY_CTE_PRECEDENCE_ENABLED = buildConf("spark.sql.legacy.ctePrecedence.enabled") | ||
| object LegacyBehaviorPolicy extends Enumeration { | ||
| val EXCEPTION, LEGACY, NEW_BEHAVIOR = Value |
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.
NEW_BEHAVIOR sounds not a good name. INNER_FIRST?
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.
Or INNER_PRECEDENCE?
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.
Thanks for the advice @viirya. Yes, both INNER_FIRST and INNER_PRECEDENCE are more accurate in this PR, but I also want to make this enum as a common config value, which can be reused in other similar issues. WDYT?
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.
how about CORRECTED to indicate that it's the corrected behavior?
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.
ok.
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.
Thanks, change to CORRECTED in 47edd88
|
+1 this is better. |
| s"Please set ${LEGACY_CTE_PRECEDENCE_ENABLED.key} to false so that name defined " + | ||
| "in inner CTE takes precedence. See more details in SPARK-28228.") | ||
| s"Please set ${LEGACY_CTE_PRECEDENCE_POLICY.key} to NEW_BEHAVIOR so that name " + | ||
| "defined in inner CTE takes precedence. See more details in SPARK-28228.") |
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.
since it's enum now, maybe also explain what will happen if set it to legacy.
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.
Sure, done in 47edd88.
|
Test build #118414 has finished for PR 27579 at commit
|
| "false, inner CTE definitions take precedence. The default value is empty, " + | ||
| .doc("When LEGACY, outer CTE definitions takes precedence over inner definitions. If set to " + | ||
| "CORRECTED, inner CTE definitions take precedence. The default value is EXCEPTION, " + | ||
| "AnalysisException is thrown while name conflict is detected in nested CTE.") |
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.
let's add one more sentence: This config will be removed in future versions and CORRECTED will be the only behavior.
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.
Thanks, added in bc70f75.
| @@ -1,2 +1,2 @@ | |||
| --SET spark.sql.legacy.ctePrecedence.enabled = false | |||
| --SET spark.sql.legacy.ctePrecedencePolicy = new_behavior | |||
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.
corrected
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.
Ah yes, done in bc70f75.
|
Test build #118542 has finished for PR 27579 at commit
|
|
Test build #118565 has finished for PR 27579 at commit
|
|
thanks, merging to master/3.0! |
…mon value for result change configs ### What changes were proposed in this pull request? Define a new enumeration `LegacyBehaviorPolicy` in SQLConf, it will be used as the common value for result change configs. ### Why are the changes needed? During API auditing for the 3.0 release, we found several new approaches that will change the results silently. For these features, we need a common three-value config. ### Does this PR introduce any user-facing change? Yes, original config `spark.sql.legacy.ctePrecedence.enabled` change to `spark.sql.legacy.ctePrecedencePolicy`. ### How was this patch tested? Existing UT. Closes #27579 from xuanyuanking/SPARK-30829. Authored-by: Yuanjian Li <[email protected]> Signed-off-by: Wenchen Fan <[email protected]> (cherry picked from commit e4a541b) Signed-off-by: Wenchen Fan <[email protected]>
|
Thanks for the review. |
…l.legacy.ctePrecedencePolicy` ### What changes were proposed in this pull request? Fix the migration guide document for `spark.sql.legacy.ctePrecedence.enabled`, which is introduced in #27579. ### Why are the changes needed? The config value changed. ### Does this PR introduce any user-facing change? No. ### How was this patch tested? Document only. Closes #27782 from xuanyuanking/SPARK-30829-follow. Authored-by: Yuanjian Li <[email protected]> Signed-off-by: HyukjinKwon <[email protected]>
…l.legacy.ctePrecedencePolicy` ### What changes were proposed in this pull request? Fix the migration guide document for `spark.sql.legacy.ctePrecedence.enabled`, which is introduced in #27579. ### Why are the changes needed? The config value changed. ### Does this PR introduce any user-facing change? No. ### How was this patch tested? Document only. Closes #27782 from xuanyuanking/SPARK-30829-follow. Authored-by: Yuanjian Li <[email protected]> Signed-off-by: HyukjinKwon <[email protected]> (cherry picked from commit f7f1948) Signed-off-by: HyukjinKwon <[email protected]>
…mon value for result change configs ### What changes were proposed in this pull request? Define a new enumeration `LegacyBehaviorPolicy` in SQLConf, it will be used as the common value for result change configs. ### Why are the changes needed? During API auditing for the 3.0 release, we found several new approaches that will change the results silently. For these features, we need a common three-value config. ### Does this PR introduce any user-facing change? Yes, original config `spark.sql.legacy.ctePrecedence.enabled` change to `spark.sql.legacy.ctePrecedencePolicy`. ### How was this patch tested? Existing UT. Closes apache#27579 from xuanyuanking/SPARK-30829. Authored-by: Yuanjian Li <[email protected]> Signed-off-by: Wenchen Fan <[email protected]>
…l.legacy.ctePrecedencePolicy` ### What changes were proposed in this pull request? Fix the migration guide document for `spark.sql.legacy.ctePrecedence.enabled`, which is introduced in apache#27579. ### Why are the changes needed? The config value changed. ### Does this PR introduce any user-facing change? No. ### How was this patch tested? Document only. Closes apache#27782 from xuanyuanking/SPARK-30829-follow. Authored-by: Yuanjian Li <[email protected]> Signed-off-by: HyukjinKwon <[email protected]>
What changes were proposed in this pull request?
Define a new enumeration
LegacyBehaviorPolicyin SQLConf, it will be used as the common value for result change configs.Why are the changes needed?
During API auditing for the 3.0 release, we found several new approaches that will change the results silently. For these features, we need a common three-value config.
Does this PR introduce any user-facing change?
Yes, original config
spark.sql.legacy.ctePrecedence.enabledchange tospark.sql.legacy.ctePrecedencePolicy.How was this patch tested?
Existing UT.