drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andries Engelbrecht <aengelbre...@maprtech.com>
Subject Re: date_trunc function results on Drill vs Postgress
Date Thu, 19 May 2016 16:25:07 GMT
Could the -08 refer to timezone PST is UTC-8?

Seems to be correct for both if the last identifier refers to timezone and the test system
is set to PST.

http://www.postgresql.org/docs/9.1/static/functions-datetime.html#FUNCTIONS-DATETIME-TRUNC
<http://www.postgresql.org/docs/9.1/static/functions-datetime.html#FUNCTIONS-DATETIME-TRUNC>



--Andries


> On May 19, 2016, at 8:13 AM, Zelaine Fong <zfong@maprtech.com> wrote:
> 
> 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 <kfaraaz@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
>> 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message