-
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2106,13 +2106,19 @@ object SQLConf { | |
| .booleanConf | ||
| .createWithDefault(false) | ||
|
|
||
| val LEGACY_CTE_PRECEDENCE_ENABLED = buildConf("spark.sql.legacy.ctePrecedence.enabled") | ||
| object LegacyBehaviorPolicy extends Enumeration { | ||
| val EXCEPTION, LEGACY, NEW_BEHAVIOR = Value | ||
|
||
| } | ||
|
|
||
| val LEGACY_CTE_PRECEDENCE_POLICY = buildConf("spark.sql.legacy.ctePrecedencePolicy") | ||
| .internal() | ||
| .doc("When true, outer CTE definitions takes precedence over inner definitions. If set to " + | ||
| "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 " + | ||
| "NEW_BEHAVIOR, inner CTE definitions take precedence. The default value is EXCEPTION, " + | ||
| "AnalysisException is thrown while name conflict is detected in nested CTE.") | ||
|
||
| .booleanConf | ||
| .createOptional | ||
| .stringConf | ||
| .transform(_.toUpperCase(Locale.ROOT)) | ||
| .checkValues(LegacyBehaviorPolicy.values.map(_.toString)) | ||
| .createWithDefault(LegacyBehaviorPolicy.EXCEPTION.toString) | ||
|
|
||
| val LEGACY_ARRAY_EXISTS_FOLLOWS_THREE_VALUED_LOGIC = | ||
| buildConf("spark.sql.legacy.arrayExistsFollowsThreeValuedLogic") | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| --SET spark.sql.legacy.ctePrecedence.enabled = false | ||
| --SET spark.sql.legacy.ctePrecedencePolicy = new_behavior | ||
|
||
| --IMPORT cte.sql | ||
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.