-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-34249][DOCS] Add documentation for ANSI implicit cast rules #33516
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
|
@srielau Thanks for summary the rules. He should be the first author on merging this PR. |
|
Test build #141621 has finished for PR 33516 at commit
|
|
Kubernetes integration test starting |
|
Kubernetes integration test status failure |
docs/sql-ref-ansi-compliance.md
Outdated
| | Decimal | Decimal -> Float* -> Double | | ||
| | Float | Float -> Double | | ||
| | Double | Double | | ||
| | Date | Date-> Timestamp | |
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.
Date-> Timestamp -> Date -> Timestamp
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.
Done
| | String | String | | ||
| | Binary | Binary | | ||
| | Boolean | Boolean | | ||
| | Interval | Interval | |
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.
Should we distinguish year-month and day-time interval types?
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 keep it simple in this section
|
Test build #141649 has finished for PR 33516 at commit
|
|
Kubernetes integration test starting |
|
Kubernetes integration test status failure |
docs/sql-ref-ansi-compliance.md
Outdated
| When `spark.sql.ansi.enabled` is set to `true`, explicit casting by `CAST` syntax throws a runtime exception for illegal cast patterns defined in the standard, e.g. casts from a string to an integer. | ||
| On the other hand, `INSERT INTO` syntax throws an analysis exception when the ANSI mode enabled via `spark.sql.storeAssignmentPolicy=ANSI`. | ||
|
|
||
| The type conversion of Spark ANSI mode follows the syntax rules of section 6.13 "cast specification" in [ISO/IEC 9075-2:2011 Information technology — Database languages - SQL — Part 2: Foundation (SQL/Foundation)](https://www.iso.org/standard/53682.html), except it specially allows the following |
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.
The type conversion -> The explicit cast
| ``` | ||
|
|
||
| ### Type Conversion | ||
| ### Cast |
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.
In this section, it says In future releases, the behaviour of type coercion might change along with the other two type conversion rules.
We should update it.
|
Test build #141706 has finished for PR 33516 at commit
|
|
thanks, merging to master/3.2! |
### What changes were proposed in this pull request? Add documentation for the ANSI implicit cast rules which are introduced from #31349 ### Why are the changes needed? Better documentation. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Build and preview in local:      Closes #33516 from gengliangwang/addDoc. Lead-authored-by: Gengliang Wang <[email protected]> Co-authored-by: Serge Rielau <[email protected]> Signed-off-by: Wenchen Fan <[email protected]> (cherry picked from commit df98d5b) Signed-off-by: Wenchen Fan <[email protected]>
|
Kubernetes integration test starting |
|
Kubernetes integration test status success |
### What changes were proposed in this pull request? Add documentation for the ANSI implicit cast rules which are introduced from apache#31349 ### Why are the changes needed? Better documentation. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Build and preview in local:      Closes apache#33516 from gengliangwang/addDoc. Lead-authored-by: Gengliang Wang <[email protected]> Co-authored-by: Serge Rielau <[email protected]> Signed-off-by: Wenchen Fan <[email protected]> (cherry picked from commit df98d5b) Signed-off-by: Wenchen Fan <[email protected]>
What changes were proposed in this pull request?
Add documentation for the ANSI implicit cast rules which are introduced from #31349
Why are the changes needed?
Better documentation.
Does this PR introduce any user-facing change?
No
How was this patch tested?
Build and preview in local:

