Skip to content

[Coral-Trino] Migrate FROM_UNIXTIME and FROM_UTC_TIMESTAMP#426

Merged
aastha25 merged 4 commits intolinkedin:masterfrom
aastha25:migrate_from_unixtime
Jun 27, 2023
Merged

[Coral-Trino] Migrate FROM_UNIXTIME and FROM_UTC_TIMESTAMP#426
aastha25 merged 4 commits intolinkedin:masterfrom
aastha25:migrate_from_unixtime

Conversation

@aastha25
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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