jonvex commented on code in PR #13711:
URL: https://github.com/apache/hudi/pull/13711#discussion_r2353097916
##########
hudi-common/src/main/java/org/apache/hudi/avro/processors/Parser.java:
##########
@@ -46,21 +48,19 @@ public Pair<Boolean, Object> handleStringValue(String
value) {
public static class DateParser extends Parser {
- private static final long MILLI_SECONDS_PER_DAY = 86400000;
-
@Override
public Pair<Boolean, Object> handleNumberValue(Number value) {
- return Pair.of(true, new java.sql.Date(value.intValue() *
MILLI_SECONDS_PER_DAY));
+ return Pair.of(true, LocalDate.ofEpochDay(value.intValue()));
Review Comment:
ok, I was able to figure this out finally
I think this is what happened:
I had to change the row processing for local timestamp because we added
timestamp ntz to the schema converters so timestamp ntz now is a type instead
of just a long. So anyways, I must have run the entire class and saw that this
test was failing as well and fixed it.
So why was this test failing? It actually also fails on master when I run it
on my machine?
Why is that? It's because of timezones!!
This is what happens when I run this test on master with my default timezone
(new york):
<img width="1710" height="940" alt="image"
src="https://github.com/user-attachments/assets/b46d3546-f6d1-48bb-9440-1f85ba2ad6e1"
/>
Now I configure the test with UTC timezone:
<img width="1253" height="695" alt="image"
src="https://github.com/user-attachments/assets/88e819fd-0bef-45dd-a2cb-2fbe01b3f7ad"
/>
And it passes:
<img width="1715" height="912" alt="image"
src="https://github.com/user-attachments/assets/3aa9e332-864f-4f74-9e7d-92b12da27880"
/>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]