You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[SPARK-52634][SQL][DOCS] Update the ANSI compliance page regarding the TIME type
### What changes were proposed in this pull request?
In the PR, I propose to update the doc page https://spark.apache.org/docs/latest/sql-ref-ansi-compliance.html#cast regarding the TIME data type. After the update, the page looks like:
<img width="947" alt="Screenshot 2025-07-04 at 10 32 51" src="https://github.com/user-attachments/assets/f3f55e95-a883-4ae5-bfe5-5f7b72d88350" />
Store assignment rules:
<img width="953" alt="Screenshot 2025-07-04 at 10 33 13" src="https://github.com/user-attachments/assets/6a3f4da2-a9b2-4709-9eaf-d516e000a8b8" />
### Why are the changes needed?
To provide actual information about the TIME data type to Spark SQL users.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Manually by building and checking the page:
```
$ SKIP_API=1 bundle exec jekyll serve --watch
```
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes#51333 from MaxGekk/time-cast-doc.
Authored-by: Max Gekk <max.gekk@gmail.com>
Signed-off-by: Max Gekk <max.gekk@gmail.com>
| Numeric | <spanstyle="color:red">**Y**</span> | <spanstyle="color:red">**Y**</span> | N | <spanstyle="color:red">**Y**</span> | N | <spanstyle="color:red">**Y**</span> | Y | N | N | N | N |
116
-
| String | <spanstyle="color:red">**Y**</span> | Y | <spanstyle="color:red">**Y**</span> | <spanstyle="color:red">**Y**</span> | <spanstyle="color:red">**Y**</span> | <spanstyle="color:red">**Y**</span> | <spanstyle="color:red">**Y**</span> | Y | N | N | N |
117
-
| Date | N | Y | Y | Y | Y | N | N | N | N | N | N |
118
-
| Timestamp | <spanstyle="color:red">**Y**</span> | Y | Y | Y | Y | N | N | N | N | N | N |
119
-
| Timestamp_NTZ | N | Y | Y | Y | Y | N | N | N | N | N | N |
120
-
| Interval | <spanstyle="color:red">**Y**</span> | Y | N | N | N | Y | N | N | N | N | N |
121
-
| Boolean | Y | Y | N | N | N | N | Y | N | N | N | N |
122
-
| Binary | N | Y | N | N | N | N | N | Y | N | N | N |
123
-
| Array | N | Y | N | N | N | N | N | N | <spanstyle="color:red">**Y**</span> | N | N |
124
-
| Map | N | Y | N | N | N | N | N | N | N | <spanstyle="color:red">**Y**</span> | N |
125
-
| Struct | N | Y | N | N | N | N | N | N | N | N | <spanstyle="color:red">**Y**</span> |
| Numeric | <spanstyle="color:red">**Y**</span> | <spanstyle="color:red">**Y**</span> | N | N |<spanstyle="color:red">**Y**</span> | N | <spanstyle="color:red">**Y**</span> | Y | N | N | N | N |
116
+
| String | <spanstyle="color:red">**Y**</span> | Y | <spanstyle="color:red">**Y**</span> | Y |<spanstyle="color:red">**Y**</span> | <spanstyle="color:red">**Y**</span> | <spanstyle="color:red">**Y**</span> | <spanstyle="color:red">**Y**</span> | Y | N | N | N |
117
+
| Date | N | Y | Y | N | Y | Y | N | N | N | N | N | N |
118
+
| Time | N | Y | N | Y | N | N | N | N | N | N | N | N |
119
+
| Timestamp | <spanstyle="color:red">**Y**</span> | Y | Y | N | Y | Y | N | N | N | N | N | N |
120
+
| Timestamp_NTZ | N | Y | Y | N | Y | Y | N | N | N | N | N | N |
121
+
| Interval | <spanstyle="color:red">**Y**</span> | Y | N | N | N | N | Y | N | N | N | N | N |
122
+
| Boolean | Y | Y | N | N | N | N | N | Y | N | N | N | N |
123
+
| Binary | N | Y | N | N | N | N | N | N | Y | N | N | N |
124
+
| Array | N | Y | N | N | N | N | N | N | N | <spanstyle="color:red">**Y**</span> | N | N |
125
+
| Map | N | Y | N | N | N | N | N | N | N | N | <spanstyle="color:red">**Y**</span> | N |
126
+
| Struct | N | Y | N | N | N | N | N | N | N | N | N | <spanstyle="color:red">**Y**</span> |
126
127
127
128
In the table above, all the `CAST`s with new syntax are marked as red <spanstyle="color:red">**Y**</span>:
128
129
* CAST(Numeric AS Numeric): raise an overflow exception if the value is out of the target data type's range.
@@ -198,19 +199,20 @@ While casting of a decimal with a fraction to an interval type with SECOND as th
198
199
### Store assignment
199
200
As mentioned at the beginning, when `spark.sql.storeAssignmentPolicy` is set to `ANSI`(which is the default value), Spark SQL complies with the ANSI store assignment rules on table insertions. The valid combinations of source and target data type in table insertions are given by the following table.
0 commit comments