Commit 76a1413
[SPARK-51462][SQL] Support typed literals of the TIME data type
### What changes were proposed in this pull request?
In the PR, I propose to support typed literals of the TIME data type, for example: `time'7:36'`. The format of time string value should match to:
```
[h]h:[m]m:[s]s.[ms][ms][ms][us][us][us]
```
### Why are the changes needed?
To improve user experience with Spark SQL, and simplify migrations from other systems where such typed literals are supported.
### Does this PR introduce _any_ user-facing change?
Yes, after the changes users can construct new typed literals.
### How was this patch tested?
By running the new test:
```
$ build/sbt "test:testOnly *ExpressionParserSuite"
```
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #50228 from MaxGekk/time-literal-constructor.
Authored-by: Max Gekk <max.gekk@gmail.com>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>1 parent 0deb4cb commit 76a1413
File tree
3 files changed
+19
-2
lines changed- sql
- api/src/main/antlr4/org/apache/spark/sql/catalyst/parser
- catalyst/src
- main/scala/org/apache/spark/sql/catalyst/parser
- test/scala/org/apache/spark/sql/catalyst/parser
3 files changed
+19
-2
lines changedLines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1190 | 1190 | | |
1191 | 1191 | | |
1192 | 1192 | | |
| 1193 | + | |
1193 | 1194 | | |
1194 | 1195 | | |
1195 | 1196 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
3347 | 3347 | | |
3348 | 3348 | | |
3349 | 3349 | | |
| 3350 | + | |
3350 | 3351 | | |
3351 | 3352 | | |
3352 | 3353 | | |
| |||
Lines changed: 16 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
1238 | 1238 | | |
1239 | 1239 | | |
1240 | 1240 | | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
1241 | 1256 | | |
0 commit comments