-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Small cleanup in TeradataDateFunctions #10946
Small cleanup in TeradataDateFunctions #10946
Conversation
da93775
to
5ad7b7c
Compare
{ | ||
try { | ||
long millis = parseMillis(session, dateTime, formatString); | ||
return (long) castToDate.invokeExact(session, millis); | ||
long millis = parseMillis(UTC_KEY, session.getLocale(), dateTime, formatString); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't passing UTC_KEY/session zone
depend on legacy timestamp flag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No new tests are needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't passing UTC_KEY/session zone depend on legacy timestamp flag?
DATEs have just one semantics (no legacy here)
No new tests are needed?
Tests exists and implementation was working correctly. This just simplifies.
@@ -152,7 +147,7 @@ private void assertDate(String projection, int year, int month, int day) | |||
assertFunction( | |||
projection, | |||
DateType.DATE, | |||
sqlDate(new DateTime(year, month, day, 0, 0, DateTimeZone.UTC))); | |||
new SqlDate(toIntExact(LocalDate.of(year, month, day).toEpochDay()))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't commit message be:
Fix TestTeradataDateFunctions to work with non-legacy dates and in zones with negative offset
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so.
extracted from #10128