-
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
Conversation
|
Test build #110171 has finished for PR 25693 at commit
|
e563977 to
58cc6db
Compare
|
Test build #110173 has finished for PR 25693 at commit
|
|
I am not sure about removing them... Shall we just use this config to set them, but leave the other configs for finer tuning? |
|
Test build #110174 has finished for PR 25693 at commit
|
|
Test build #110175 has finished for PR 25693 at commit
|
|
@mgaido91 in practice it's a bad idea to have tons of flags that can change query result. When debugging a Spark query that returns unexpected result, it's very annoying if you need to check a lot of flags. The legacy configs are ok as we clearly show the preference and these configs will be removed evetually, so not many people would set them. |
mgaido91
left a comment
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.
shall we also add a note in the migration guide?
| .createOptional | ||
|
|
||
| val ANSI_ENABLED = buildConf("spark.sql.ansi.enabled") | ||
| .doc("When true, tries to conform to the ANSI SQL specification. For example, Spark will " + |
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.
Instead of reporting as examples, shall we list clearly all the changes here?
|
Test build #110176 has finished for PR 25693 at commit
|
maropu
left a comment
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.
This change looks reasonable to me.
|
Hi, @gatorsmile , @gengliangwang , @cloud-fan . |
|
@dongjoon-hyun There are features specified in ANSI SQL, such as throw error on numeric value overflow. We can switch these features with the option ANSI SQL only specified high-level syntax and rules. There are "implementation-defined" behaviors, such as the result type of division of two exact number. We cant switch these detail behaviors via the option |
|
I will do more investigations and see if I can find a better solution for the configuration. Mark this as WIP for now. |
spark.sql.ansi.enabledspark.sql.ansi.enabled
|
I will continue this one after the bug fix of #25804 is merged |
spark.sql.ansi.enabledspark.sql.ansi.enabled
13c36a5 to
7c32fee
Compare
|
Test build #110904 has finished for PR 25693 at commit
|
|
Test build #110906 has finished for PR 25693 at commit
|
|
This is ready for review. |
dongjoon-hyun
left a comment
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.
LGTM.
cc @rxin , @gatorsmile
|
Looks ok to me, too. |
spark.sql.ansi.enabledspark.sql.ansi.enabled
|
LGTM Thanks! Merged to master. |
spark.sql.ansi.enabled
What changes were proposed in this pull request?
Currently, there are new configurations for compatibility with ANSI SQL:
spark.sql.parser.ansi.enabledspark.sql.decimalOperations.nullOnOverflowspark.sql.failOnIntegralTypeOverflowThis PR is to add new configuration
spark.sql.ansi.enabledand remove the 3 options above. When the configuration is true, Spark tries to conform to the ANSI SQL specification. It will be disabled by default.Why are the changes needed?
Make it simple and straightforward.
Does this PR introduce any user-facing change?
The new features for ANSI compatibility will be set via one configuration
spark.sql.ansi.enabled.How was this patch tested?
Existing unit tests.