Commit 74df94d
Fix DateTimeFormatter to set weekDateFormat only if it has week and day of week along with year. (facebookincubator#12456)
Summary:
This is a targeted fix that ensures that date_parse formats which contain %a but without additional specifiers like %v does not set weekDateFormat. An example of such a format is '%d-%b-%Y (%a)' which when parsing a string like '11-Mar-2024 (Mon)' will incorrectly ignore the month and day and instead return a date like '2024-01-01' .
There are likely other cases where additional or inconsistent specifiers are handled incorrectly. A full fix of DateTimeFormatter is beyond scope of this PR, but I will send out additional PR's in the future to address these issues.
Mitigates S493660.
Reviewed By: pedroerp
Differential Revision: D702536241 parent 6983c4b commit 74df94d
File tree
2 files changed
+14
-3
lines changed- velox/functions
- lib
- prestosql/tests
2 files changed
+14
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
| |||
870 | 871 | | |
871 | 872 | | |
872 | 873 | | |
873 | | - | |
874 | | - | |
875 | | - | |
| 874 | + | |
876 | 875 | | |
877 | 876 | | |
878 | 877 | | |
| |||
1095 | 1094 | | |
1096 | 1095 | | |
1097 | 1096 | | |
| 1097 | + | |
1098 | 1098 | | |
1099 | 1099 | | |
1100 | 1100 | | |
| |||
1107 | 1107 | | |
1108 | 1108 | | |
1109 | 1109 | | |
| 1110 | + | |
1110 | 1111 | | |
1111 | 1112 | | |
1112 | 1113 | | |
| |||
1637 | 1638 | | |
1638 | 1639 | | |
1639 | 1640 | | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
1640 | 1645 | | |
1641 | 1646 | | |
1642 | 1647 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4530 | 4530 | | |
4531 | 4531 | | |
4532 | 4532 | | |
| 4533 | + | |
| 4534 | + | |
| 4535 | + | |
| 4536 | + | |
| 4537 | + | |
| 4538 | + | |
4533 | 4539 | | |
4534 | 4540 | | |
4535 | 4541 | | |
| |||
0 commit comments