[Coral-Trino] Avoid accidental translation of Trino from_unixtime SQL call#464
[Coral-Trino] Avoid accidental translation of Trino from_unixtime SQL call#464findinpath wants to merge 1 commit intolinkedin:masterfrom
from_unixtime SQL call#464Conversation
|
I think you would want to implement an operator in |
|
I created an alternative PR #465 to follow-up on your request
However, I failed in getting it to work exactly because the function was not mentioned in
I believe that, in the current state of the |
| // Date Functions | ||
| createAddUserDefinedFunction("from_unixtime", FunctionReturnTypes.STRING, | ||
| family(ImmutableList.of(SqlTypeFamily.NUMERIC, SqlTypeFamily.STRING), optionalOrd(1))); | ||
| createAddUserDefinedFunction("trino_from_unixtime", explicit(SqlTypeName.TIMESTAMP), |
There was a problem hiding this comment.
Is it possible to create an operator (e.g., TimestampFromUnixtime) and have its unparse method return to_unixtimestamp and add it to the HiveFunctionRegistry instead of sticking to
the standard way of creating operators through createAddUserDefinedFunction? I think this can save us from having to create TrinoFromUnixtimeOperatorTransformer?
There was a problem hiding this comment.
I've tried adding the operator TimestampFromUnixtime and register it in StaticHiveFunctionRegistry, but still failed to get the tests 🟢 .
The not so good thing about using an operator is that we'd need to define it in coral-hive, so that we can make use of it in StaticHiveFunctionRegistry . This is definitely not the right place for a Trino specific operator.
I still think that, in the current circumstances, using the transformer TimestampFromUnixtimeTransformer is a viable option.
58bc0ee to
01e78f4
Compare
01e78f4 to
364b6dc
Compare
|
Superseded by #467 |
What changes are proposed in this pull request, and why are they necessary?
Avoid the accidental translation of the Trino
from_unixtimeintroduced through #426Context #459 (comment)
Fixes #459
How was this patch tested?
Regular unit tests