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

[Coral-Trino] Migrate FROM_UNIXTIME and FROM_UTC_TIMESTAMP #426

Merged
merged 4 commits into from
Jun 27, 2023

Conversation

aastha25
Copy link
Contributor

Before this PR, FROM_UNIXTIME and FROM_UTC_TIMESTAMPoperators were transformed to trino engine compatible operators in the RelShuttle Calcite2TrinoUDFConverter.
This PR migrates the transformation to SqlShuttles - CoralToTrinoSqlCallConverter and DataTypeDerivedSqlCallConverter respectively.

What changes are proposed in this pull request, and why are they necessary?

How was this patch tested?

./gradlew spotlessApply
./gradlew build
modified UTs
i-tested against production views

@aastha25 aastha25 force-pushed the migrate_from_unixtime branch from 4bcf9c2 to 5908d3b Compare June 22, 2023 23:22
@aastha25 aastha25 force-pushed the migrate_from_unixtime branch from 7af502b to b198ad2 Compare June 26, 2023 16:53

@Override
protected boolean condition(SqlCall sqlCall) {
return sqlCall.getOperator().getName().equalsIgnoreCase(FROM_UNIXTIME);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@findinpath If we make this check not simply based on the name so we make sure it only matches the Hive operator and not the Trino one, would we still need TimestampFromUnixtimeTransformer from #464? Also, can the operator in this case live only in coral-trino?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from_unixtime takes for both Trino and Hive a numeric value, I don't know how to distinguish it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed offline. We can use timestamp_from_unixtime as a different name to disambiguate. @findinpath will try it.

Copy link
Contributor

@findinpath findinpath Oct 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#467

Thank you @wmoustafa for the hint and help in putting together the PR.

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.

4 participants