-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-30703][SQL][DOCS][FollowUp] Declare the ANSI SQL compliance options as experimental #27590
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 all commits
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 |
|---|---|---|
|
|
@@ -19,19 +19,21 @@ license: | | |
| limitations under the License. | ||
| --- | ||
|
|
||
| Spark SQL has two options to comply with the SQL standard: `spark.sql.ansi.enabled` and `spark.sql.storeAssignmentPolicy` (See a table below for details). | ||
| Since Spark 3.0, Spark SQL introduces two experimental options to comply with the SQL standard: `spark.sql.ansi.enabled` and `spark.sql.storeAssignmentPolicy` (See a table below for details). | ||
|
|
||
| When `spark.sql.ansi.enabled` is set to `true`, Spark SQL follows the standard in basic behaviours (e.g., arithmetic operations, type conversion, and SQL parsing). | ||
| Moreover, Spark SQL has an independent option to control implicit casting behaviours when inserting rows in a table. | ||
| The casting behaviours are defined as store assignment rules in the standard. | ||
| When `spark.sql.storeAssignmentPolicy` is set to `ANSI`, Spark SQL complies with the ANSI store assignment rules. | ||
|
|
||
| When `spark.sql.storeAssignmentPolicy` is set to `ANSI`, Spark SQL complies with the ANSI store assignment rules. This is a separate configuration because its default value is `ANSI`, while the configuration `spark.sql.ansi.enabled` is disabled by default. | ||
|
|
||
| <table class="table"> | ||
| <tr><th>Property Name</th><th>Default</th><th>Meaning</th></tr> | ||
| <tr> | ||
| <td><code>spark.sql.ansi.enabled</code></td> | ||
| <td>false</td> | ||
| <td> | ||
| When true, Spark tries to conform to the ANSI SQL specification: | ||
| (Experimental) When true, Spark tries to conform to the ANSI SQL specification: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does Then, the script adds
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @maropu I was following this one https://spark.apache.org/docs/latest/configuration.html
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yea, I think the fix itself in this pr looks fine. cc: @dongjoon-hyun @cloud-fan @HyukjinKwon
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In general, this changes make sense to me. If we have more experimental public conf, we should consider doing it in a proper way. Regarding the ANSI mode, we need to consider the roadmap of Spark 3.x: which are still missing and what kind of behavior changes we plan to add. |
||
| 1. Spark will throw a runtime exception if an overflow occurs in any operation on integral/decimal field. | ||
| 2. Spark will forbid using the reserved keywords of ANSI SQL as identifiers in the SQL parser. | ||
| </td> | ||
|
|
@@ -40,7 +42,7 @@ When `spark.sql.storeAssignmentPolicy` is set to `ANSI`, Spark SQL complies with | |
| <td><code>spark.sql.storeAssignmentPolicy</code></td> | ||
| <td>ANSI</td> | ||
| <td> | ||
| When inserting a value into a column with different data type, Spark will perform type coercion. | ||
| (Experimental) When inserting a value into a column with different data type, Spark will perform type coercion. | ||
| Currently, we support 3 policies for the type coercion rules: ANSI, legacy and strict. With ANSI policy, | ||
| Spark performs the type coercion as per ANSI SQL. In practice, the behavior is mostly the same as PostgreSQL. | ||
| It disallows certain unreasonable type conversions such as converting string to int or double to boolean. | ||
|
|
||
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.
separate->separated?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.
Separate can be an adjective