Commit b9dbf8b
[SPARK-51419][SQL][FOLLOWUP] Making hour function to accept any precision of TIME type
### What changes were proposed in this pull request?
This is followup PR of [SPARK-51419 ](#50355)
### Why are the changes needed?
This Followup PR allows any precision in the range of [0,6] for the hour function
### Does this PR introduce _any_ user-facing change?
Yes. This changes allows User to execute below query
```
spark.sql("select hour(cast('12:00:01.123' as time(3)))").show(false)
```
### How was this patch tested?
We tested by running sample query as below
```
spark.sql("select hour(cast('12:00:01.123' as time(3)))").show(false)
```
Output:
```
+-----------------------------------+
|hour(CAST(12:00:01.123 AS TIME(3)))|
+-----------------------------------+
|12 |
+-----------------------------------+
```
### Was this patch authored or co-authored using generative AI tooling?
No
Closes #50554 from senthh/SPARK-51419_followup.
Authored-by: senthh <[email protected]>
Signed-off-by: Max Gekk <[email protected]>1 parent adc42b4 commit b9dbf8b
File tree
2 files changed
+14
-1
lines changed- sql/catalyst/src
- main/scala/org/apache/spark/sql/catalyst/expressions
- test/scala/org/apache/spark/sql/catalyst/expressions
2 files changed
+14
-1
lines changedLines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
254 | | - | |
| 254 | + | |
| 255 | + | |
255 | 256 | | |
256 | 257 | | |
257 | 258 | | |
| |||
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
78 | 90 | | |
79 | 91 | | |
80 | 92 | | |
| |||
0 commit comments