The Drill result seems more correct to me.  Not sure why the "08" is there
in the case of Postgres.

-- Zelaine

On Thu, May 19, 2016 at 3:53 AM, Khurram Faraaz <kfar...@maprtech.com>
wrote:

> There is a difference in result seen on Postgres vs Drill for a query that
> uses date_trunc function. Can someone please confirm which one is the
> correct expected behavior ?
>
> From Drill 1.7.0
>
> 0: jdbc:drill:schema=dfs.tmp> SELECT date_trunc('year',
> to_timestamp(292278993)) from sys.version;
> +------------------------+
> |         EXPR$0         |
> +------------------------+
> | 1979-01-01 00:00:00.0  |
> +------------------------+
> 1 row selected (0.288 seconds)
>
> From Postgres 9.3 (note there is *00-08* towards the end in the result)
>
> postgres=# SELECT date_trunc('year', to_timestamp(292278993));
>        date_trunc
> ------------------------
>  1979-01-01 00:00:00-08
> (1 row)
>
> Thanks,
> Khurram
>

Reply via email to