Commit d965217
[SPARK-51488][SQL] Support the TIME keyword as a data type
### What changes were proposed in this pull request?
In the PR, I propose to support `TIME(n)` as a data type in Spark SQL syntax, and convert it to `TimeType(precision)` during parse.
### Why are the changes needed?
To achieve feature parity between Spark SQL and Scala/Java APIs. SQL users can use `TIME` as a data type.
### Does this PR introduce _any_ user-facing change?
Yes, users can refer to `TIME` as a data type, but before they got an error.
### How was this patch tested?
By running new tests:
```
$ build/sbt "test:testOnly *DataTypeParserSuite"
```
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #50250 from MaxGekk/time-type.
Authored-by: Max Gekk <max.gekk@gmail.com>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>1 parent ee37d3a commit d965217
File tree
3 files changed
+23
-2
lines changed- sql
- api/src/main
- antlr4/org/apache/spark/sql/catalyst/parser
- scala/org/apache/spark/sql/catalyst/parser
- catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser
3 files changed
+23
-2
lines changedLines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1280 | 1280 | | |
1281 | 1281 | | |
1282 | 1282 | | |
| 1283 | + | |
1283 | 1284 | | |
1284 | 1285 | | |
1285 | 1286 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
| 83 | + | |
82 | 84 | | |
83 | 85 | | |
84 | 86 | | |
| |||
Lines changed: 19 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 | | |
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
60 | 63 | | |
61 | 64 | | |
62 | 65 | | |
| |||
172 | 175 | | |
173 | 176 | | |
174 | 177 | | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
175 | 193 | | |
0 commit comments