drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Khurram Faraaz <kfar...@maprtech.com>
Subject Re: TO_TIMESTAMP function returns in-correct results
Date Fri, 28 Oct 2016 13:17:08 GMT
Thanks Serhii.

Can you please give me a working example of the usage with "s" for second
of minute and "S" for fraction of second.

I tried with both those symbols, however Drill 1.9.0 (commit: a29f1e29)
does not honor those symbols when used from within the to_date function.

On Thu, Oct 27, 2016 at 6:31 PM, Serhii Harnyk <serhii.harnyk@gmail.com>
wrote:

> Hello, Khurram
>
> http://joda-time.sourceforge.net/apidocs/org/joda/time/
> format/DateTimeFormat.html
>
> s       second of minute             number        55
> S       fraction of second           number        978
>
>
>
> 2016-10-27 13:54 GMT+03:00 Khurram Faraaz <kfaraaz@maprtech.com>:
>
> > All,
> >
> > I am on Drill 1.9.0 git commit ID : a29f1e29 on CentOS
> >
> > TO_TIMESTAMP function does not return correct results, note that the
> > minutes, seconds and milliseconds parts of timestamp are incorrect in the
> > results
> >
> > {noformat}
> > 0: jdbc:drill:schema=dfs.tmp> VALUES(TO_TIMESTAMP('2015-03-30
> 20:49:59.10
> > UTC', 'YYYY-MM-dd HH:mm:ss.s z'));
> > +------------------------+
> > |         EXPR$0         |
> > +------------------------+
> > | 2015-03-30 20:49:10.0  |
> > +------------------------+
> > 1 row selected (0.228 seconds)
> > {noformat}
> >
> > {noformat}
> > 0: jdbc:drill:schema=dfs.tmp> VALUES(CAST(TO_TIMESTAMP('2015-03-30
> > 20:49:59.10 UTC', 'YYYY-MM-dd HH:mm:ss.s z') AS TIMESTAMP));
> > +------------------------+
> > |         EXPR$0         |
> > +------------------------+
> > | 2015-03-30 20:49:10.0  |
> > +------------------------+
> > 1 row selected (0.265 seconds)
> > {noformat}
> >
> > This case returns correct results, when the same string used above is
> given
> > as input to CAST function, note that minutes mm, seconds ss and
> millisecond
> > s parts are honored
> >
> > {noformat}
> > 0: jdbc:drill:schema=dfs.tmp> VALUES(CAST('2015-03-30 20:49:59.10 UTC' AS
> > TIMESTAMP));
> > +------------------------+
> > |         EXPR$0         |
> > +------------------------+
> > | 2015-03-30 20:49:59.1  |
> > +------------------------+
> > 1 row selected (0.304 seconds)
> > {noformat}
> >
> > Thanks,
> > Khurram
> >
>

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