Commit f3f6dec
authored
feat: Add support for 'isoyear' in date_part function (#19821)
## Which issue does this PR close?
<!--
We generally require a GitHub issue to be filed for all bug fixes and
enhancements and this helps us generate change logs for our releases.
You can link an issue to this PR using the GitHub syntax. For example
`Closes #123` indicates that this PR will close issue #123.
-->
- Closes #19820.
## Rationale for this change
`isoyear` part is available in both PG and Spark EXTRACT functions.
https://www.postgresql.org/docs/current/functions-datetime.html#:~:text=the%20week%20numbering.-,isoyear,-The%20ISO%208601
https://github.com/apache/spark/blob/a03bedb6c1281c5263a42bfd20608d2ee005ab05/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala#L3360
## What changes are included in this PR?
Support for part `isoyear` in date_part function.
## Are these changes tested?
yes in SLT
## Are there any user-facing changes?
yes
<!--
If there are any breaking changes to public APIs, please add the `api
change` label.
-->1 parent 5e893ab commit f3f6dec
File tree
3 files changed
+54
-0
lines changed- datafusion
- functions/src/datetime
- sqllogictest/test_files/datetime
- docs/source/user-guide/sql
3 files changed
+54
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| |||
218 | 219 | | |
219 | 220 | | |
220 | 221 | | |
| 222 | + | |
221 | 223 | | |
222 | 224 | | |
223 | 225 | | |
| |||
Lines changed: 51 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
84 | 101 | | |
85 | 102 | | |
86 | 103 | | |
| |||
228 | 245 | | |
229 | 246 | | |
230 | 247 | | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
231 | 268 | | |
232 | 269 | | |
233 | 270 | | |
| |||
865 | 902 | | |
866 | 903 | | |
867 | 904 | | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
868 | 908 | | |
869 | 909 | | |
870 | 910 | | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
871 | 914 | | |
872 | 915 | | |
873 | 916 | | |
| |||
1062 | 1105 | | |
1063 | 1106 | | |
1064 | 1107 | | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
1065 | 1111 | | |
1066 | 1112 | | |
1067 | 1113 | | |
| |||
1074 | 1120 | | |
1075 | 1121 | | |
1076 | 1122 | | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
1077 | 1128 | | |
1078 | 1129 | | |
1079 | 1130 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2519 | 2519 | | |
2520 | 2520 | | |
2521 | 2521 | | |
| 2522 | + | |
2522 | 2523 | | |
2523 | 2524 | | |
2524 | 2525 | | |
| |||
0 commit comments