[Coral-Trino] Migrate FROM_UNIXTIME and FROM_UTC_TIMESTAMP#426
Merged
aastha25 merged 4 commits intolinkedin:masterfrom Jun 27, 2023
Merged
[Coral-Trino] Migrate FROM_UNIXTIME and FROM_UTC_TIMESTAMP#426aastha25 merged 4 commits intolinkedin:masterfrom
aastha25 merged 4 commits intolinkedin:masterfrom
Conversation
4bcf9c2 to
5908d3b
Compare
7af502b to
b198ad2
Compare
yiqiangin
reviewed
Jun 26, 2023
yiqiangin
approved these changes
Jun 27, 2023
wmoustafa
reviewed
Oct 20, 2023
|
|
||
| @Override | ||
| protected boolean condition(SqlCall sqlCall) { | ||
| return sqlCall.getOperator().getName().equalsIgnoreCase(FROM_UNIXTIME); |
Contributor
There was a problem hiding this comment.
@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?
Contributor
There was a problem hiding this comment.
from_unixtime takes for both Trino and Hive a numeric value, I don't know how to distinguish it
- Trino reference https://trino.io/docs/current/functions/datetime.html?highlight=from_unixtime#from_unixtime returning timestamp(3) with time zone#
- Hive reference https://cwiki.apache.org/confluence/display/hive/languagemanual+udf returning string type
Contributor
There was a problem hiding this comment.
Discussed offline. We can use timestamp_from_unixtime as a different name to disambiguate. @findinpath will try it.
Contributor
There was a problem hiding this comment.
Thank you @wmoustafa for the hint and help in putting together the PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before this PR,
FROM_UNIXTIMEandFROM_UTC_TIMESTAMPoperators were transformed to trino engine compatible operators in the RelShuttleCalcite2TrinoUDFConverter.This PR migrates the transformation to SqlShuttles -
CoralToTrinoSqlCallConverterandDataTypeDerivedSqlCallConverterrespectively.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