calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julian Hyde <jh...@apache.org>
Subject Re: A question regarding the INTERVAL_DAY_TIME
Date Wed, 09 Dec 2015 22:18:36 GMT
What would you expect the following to yield?

  VALUES CAST(INTERVAL '3' HOUR AS INTEGER)

Like all intervals (except year-month intervals) the interval is
internally represented in milliseconds, in this case 10,800,000, but
when converted to a string or a numeric it is measured in hours, i.e.
3.

Julian


On Wed, Dec 9, 2015 at 2:05 PM, Pengcheng Xiong <pxiong@apache.org> wrote:
> Hi all,
>
>     While I was trying to debug something in Hive, I found some code in
> RexBuilder which makes me confused.
>
> L527 it says
>
> {code}
>
> final long multiplier =
>
>               literal.getType().getIntervalQualifier().getStartUnit()
>
>                   .multiplier;
> {code}
>
>     I saw it was committed
>
> commit 45b58ab07223cbb94c7cbbb9a1434a2b01a9497f
> Author: julianhyde <julianhyde@gmail.com>
> Date:   Tue Jan 7 14:57:17 2014 -0800
>
>     Reformat org.eigenbase code.
>
>     Could Julian or someone explain how this multiplier is used? It looks
> to me that it is redundant. I do not need that multiplier and "value"
> itself is enough. Thanks!
>
> Best
> Pengcheng

Mime
View raw message