You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After the timestamp semantics fix (#37), the behavior of the first variant became inconsistent with the second variant. Unix times represent a point in time (vs a wall clock time), so, conceptually, a timestamp(p) first needs to be converted to a timestamp(p) with time zone before the transformation is applied.
Currently, such timestamps are interpreted as being UTC, which is confusing and counter-intuitive, especially in comparison with an invocation that uses an explicit cast:
SELECT
to_unixtime(localtimestamp),
to_unixtime(cast(localtimestamp astimestamp with time zone))
In a way, the function should only be defined for timestamp(p) with time zone and regular coercion rules for timestamp(p) -> timestamp(p) with time zone should apply
This can be fixed simply by removing io.trino.operator.scalar.timestamp.ToUnixTime
The text was updated successfully, but these errors were encountered:
Trino currently has two variants of to_unixtime:
After the timestamp semantics fix (#37), the behavior of the first variant became inconsistent with the second variant. Unix times represent a point in time (vs a wall clock time), so, conceptually, a
timestamp(p)
first needs to be converted to atimestamp(p) with time zone
before the transformation is applied.Currently, such timestamps are interpreted as being UTC, which is confusing and counter-intuitive, especially in comparison with an invocation that uses an explicit cast:
=>
In a way, the function should only be defined for
timestamp(p) with time zone
and regular coercion rules fortimestamp(p)
->timestamp(p) with time zone
should applyThis can be fixed simply by removing io.trino.operator.scalar.timestamp.ToUnixTime
The text was updated successfully, but these errors were encountered: