I bet the semantics you have in mind makes some reference to the 1970-01-01 
UNIX epoch. The SQL standard makes no mention of that epoch.

Converting numbers to timestamps is “obvious” only in that frame.

I don’t think it’s “obvious” enough for it to be the behavior of CAST. If you 
want to convert, use a conversion function (I’m sure Postgres has one) or 
interval arithmetic:

  Ts = TIMESTAMP ‘1970-01-01 00:00:00’ + m * INTERVAL ‘0.001’ SECOND

Julian


> On Aug 23, 2018, at 5:50 PM, Shuyi Chen <suez1...@gmail.com> wrote:
> 
> Currently, SqlValidator does not allow casting from BIGINT to TIMESTAMP. Is
> there any reason that we don't support such CAST rule, or it is fine that
> we add it in Calcite? Thanks a lot.
> 
> Shuyi
> -- 
> "So you have to trust that the dots will somehow connect in your future."

Reply via email to