-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-28989][SQL] Introduce ANSI SQL Dialect #25693
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
Closed
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
87f4ed0
Add spark.sql.ansi.enabled
gengliangwang e41fca3
update comments
gengliangwang 63643df
fix sql files
gengliangwang da014fb
update sql/sql.out
gengliangwang 7c32fee
update
gengliangwang 342ce1c
revise
gengliangwang 3a07455
a typo
gatorsmile File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
Add spark.sql.ansi.enabled
- Loading branch information
commit 87f4ed0a5782717c776f118ebff0a1d06641447a
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -411,12 +411,6 @@ object SQLConf { | |
| .booleanConf | ||
| .createWithDefault(true) | ||
|
|
||
| val ANSI_SQL_PARSER = | ||
| buildConf("spark.sql.parser.ansi.enabled") | ||
| .doc("When true, tries to conform to ANSI SQL syntax.") | ||
| .booleanConf | ||
| .createWithDefault(false) | ||
|
|
||
| val ESCAPED_STRING_LITERALS = buildConf("spark.sql.parser.escapedStringLiterals") | ||
| .internal() | ||
| .doc("When true, string literals (including regex patterns) remain escaped in our SQL " + | ||
|
|
@@ -1557,16 +1551,6 @@ object SQLConf { | |
| .booleanConf | ||
| .createWithDefault(true) | ||
|
|
||
| val DECIMAL_OPERATIONS_NULL_ON_OVERFLOW = | ||
| buildConf("spark.sql.decimalOperations.nullOnOverflow") | ||
| .internal() | ||
| .doc("When true (default), if an overflow on a decimal occurs, then NULL is returned. " + | ||
| "Spark's older versions and Hive behave in this way. If turned to false, SQL ANSI 2011 " + | ||
| "specification will be followed instead: an arithmetic exception is thrown, as most " + | ||
| "of the SQL databases do.") | ||
| .booleanConf | ||
| .createWithDefault(true) | ||
|
|
||
| val LITERAL_PICK_MINIMUM_PRECISION = | ||
| buildConf("spark.sql.legacy.literal.pickMinimumPrecision") | ||
| .internal() | ||
|
|
@@ -1723,6 +1707,14 @@ object SQLConf { | |
| .checkValues(StoreAssignmentPolicy.values.map(_.toString)) | ||
| .createOptional | ||
|
|
||
| val ANSI_ENABLED = buildConf("spark.sql.ansi.enabled") | ||
| .doc("When true, tries to conform to the ANSI SQL specification. For example, Spark will " + | ||
|
||
| "throw an runtime exception if an overflow occurs in any operation on integral/decimal " + | ||
| "field. For another example, Spark will forbid using the reserved keywords of ANSI SQL " + | ||
| "as identifiers in the SQL parser.") | ||
| .booleanConf | ||
| .createWithDefault(false) | ||
|
|
||
| val SORT_BEFORE_REPARTITION = | ||
| buildConf("spark.sql.execution.sortBeforeRepartition") | ||
| .internal() | ||
|
|
@@ -1886,15 +1878,6 @@ object SQLConf { | |
| .booleanConf | ||
| .createWithDefault(false) | ||
|
|
||
| val FAIL_ON_INTEGRAL_TYPE_OVERFLOW = | ||
| buildConf("spark.sql.failOnIntegralTypeOverflow") | ||
| .doc("If it is set to true, all operations on integral fields throw an " + | ||
| "exception if an overflow occurs. If it is false (default), in case of overflow a wrong " + | ||
| "result is returned.") | ||
| .internal() | ||
| .booleanConf | ||
| .createWithDefault(false) | ||
|
|
||
| val LEGACY_HAVING_WITHOUT_GROUP_BY_AS_WHERE = | ||
| buildConf("spark.sql.legacy.parser.havingWithoutGroupByAsWhere") | ||
| .internal() | ||
|
|
@@ -2195,8 +2178,6 @@ class SQLConf extends Serializable with Logging { | |
|
|
||
| def constraintPropagationEnabled: Boolean = getConf(CONSTRAINT_PROPAGATION_ENABLED) | ||
|
|
||
| def ansiParserEnabled: Boolean = getConf(ANSI_SQL_PARSER) | ||
|
|
||
| def escapedStringLiterals: Boolean = getConf(ESCAPED_STRING_LITERALS) | ||
|
|
||
| def fileCompressionFactor: Double = getConf(FILE_COMPRESSION_FACTOR) | ||
|
|
@@ -2418,10 +2399,6 @@ class SQLConf extends Serializable with Logging { | |
|
|
||
| def decimalOperationsAllowPrecisionLoss: Boolean = getConf(DECIMAL_OPERATIONS_ALLOW_PREC_LOSS) | ||
|
|
||
| def decimalOperationsNullOnOverflow: Boolean = getConf(DECIMAL_OPERATIONS_NULL_ON_OVERFLOW) | ||
|
|
||
| def failOnIntegralTypeOverflow: Boolean = getConf(FAIL_ON_INTEGRAL_TYPE_OVERFLOW) | ||
|
|
||
| def literalPickMinimumPrecision: Boolean = getConf(LITERAL_PICK_MINIMUM_PRECISION) | ||
|
|
||
| def continuousStreamingEpochBacklogQueueSize: Int = | ||
|
|
@@ -2454,6 +2431,8 @@ class SQLConf extends Serializable with Logging { | |
| def storeAssignmentPolicy: Option[StoreAssignmentPolicy.Value] = | ||
| getConf(STORE_ASSIGNMENT_POLICY).map(StoreAssignmentPolicy.withName) | ||
|
|
||
| def ansiEnabled: Boolean = getConf(ANSI_ENABLED) | ||
|
|
||
| def nestedSchemaPruningEnabled: Boolean = getConf(NESTED_SCHEMA_PRUNING_ENABLED) | ||
|
|
||
| def serializerNestedSchemaPruningEnabled: Boolean = | ||
|
|
||
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.