Skip to content
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

Merged
merged 2 commits into from
Jul 9, 2018

Conversation

findepi
Copy link
Contributor

@findepi findepi commented Jun 29, 2018

extracted from #10128

@findepi findepi force-pushed the epic/timestampp/tera-date branch from da93775 to 5ad7b7c Compare June 29, 2018 06:45
@sopel39 sopel39 requested a review from haozhun July 2, 2018 09:53
{
try {
long millis = parseMillis(session, dateTime, formatString);
return (long) castToDate.invokeExact(session, millis);
long millis = parseMillis(UTC_KEY, session.getLocale(), dateTime, formatString);
Copy link
Contributor

@sopel39 sopel39 Jul 2, 2018

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?

Copy link
Contributor

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?

Copy link
Contributor Author

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())));
Copy link
Contributor

@sopel39 sopel39 Jul 2, 2018

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?

Copy link
Contributor Author

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.

@findepi findepi merged commit a74f754 into prestodb:master Jul 9, 2018
@findepi findepi deleted the epic/timestampp/tera-date branch July 9, 2018 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants