Commit ba0c2bb
authored
feat(query): Interval kin support iw and hh24 (#18114)
`iw` is ISOWeek.
`hh24` is hour.
In main will return parse err:
```sql
SELECT TRUNC(DATE '2024-01-01', 'IW');
select TRUNC('2025-06-09 10:11:12'::Datetime, 'HH24');
```
In pr:
```sql
query T
SELECT TRUNC('2024-01-01'::Date, 'IW');
----
2024-01-01
query T
select TRUNC('2025-06-09 10:11:12'::Datetime, 'HH24');
----
2025-06-09 10:00:00.000000
```1 parent 30c41b5 commit ba0c2bb
File tree
7 files changed
+52
-0
lines changed- src/query
- ast/src
- ast
- parser
- functions
- src/scalars/timestamp/src
- tests/it/scalars/testdata
- sql/src/planner/semantic
- tests/sqllogictests/suites/query/functions
7 files changed
+52
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
896 | 896 | | |
897 | 897 | | |
898 | 898 | | |
| 899 | + | |
899 | 900 | | |
900 | 901 | | |
901 | 902 | | |
| |||
921 | 922 | | |
922 | 923 | | |
923 | 924 | | |
| 925 | + | |
924 | 926 | | |
925 | 927 | | |
926 | 928 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1866 | 1866 | | |
1867 | 1867 | | |
1868 | 1868 | | |
| 1869 | + | |
1869 | 1870 | | |
1870 | 1871 | | |
1871 | 1872 | | |
| |||
1925 | 1926 | | |
1926 | 1927 | | |
1927 | 1928 | | |
| 1929 | + | |
1928 | 1930 | | |
1929 | 1931 | | |
1930 | 1932 | | |
| |||
1991 | 1993 | | |
1992 | 1994 | | |
1993 | 1995 | | |
| 1996 | + | |
| 1997 | + | |
| 1998 | + | |
| 1999 | + | |
| 2000 | + | |
1994 | 2001 | | |
1995 | 2002 | | |
1996 | 2003 | | |
| |||
2037 | 2044 | | |
2038 | 2045 | | |
2039 | 2046 | | |
| 2047 | + | |
2040 | 2048 | | |
2041 | 2049 | | |
2042 | 2050 | | |
| |||
2055 | 2063 | | |
2056 | 2064 | | |
2057 | 2065 | | |
| 2066 | + | |
2058 | 2067 | | |
2059 | 2068 | | |
2060 | 2069 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
763 | 763 | | |
764 | 764 | | |
765 | 765 | | |
| 766 | + | |
| 767 | + | |
766 | 768 | | |
767 | 769 | | |
768 | 770 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2324 | 2324 | | |
2325 | 2325 | | |
2326 | 2326 | | |
| 2327 | + | |
2327 | 2328 | | |
2328 | 2329 | | |
2329 | 2330 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| 78 | + | |
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3226 | 3226 | | |
3227 | 3227 | | |
3228 | 3228 | | |
| 3229 | + | |
| 3230 | + | |
| 3231 | + | |
| 3232 | + | |
3229 | 3233 | | |
3230 | 3234 | | |
3231 | 3235 | | |
| |||
3312 | 3316 | | |
3313 | 3317 | | |
3314 | 3318 | | |
| 3319 | + | |
| 3320 | + | |
| 3321 | + | |
| 3322 | + | |
| 3323 | + | |
| 3324 | + | |
| 3325 | + | |
3315 | 3326 | | |
3316 | 3327 | | |
3317 | 3328 | | |
| |||
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
295 | 321 | | |
296 | 322 | | |
297 | 323 | | |
| |||
0 commit comments