Hi Siva, Yes, that's pretty much correct -- TO_DATE is returning a Date value, which has millisecond granularity -- the fact that you're only seeing a date (with no time component) is due to the way in which the Date is formatted, and not it's internal value.
- Gabriel On Sun, May 3, 2015 at 5:27 AM Siva <[email protected]> wrote: > Any help on TO_DATE function? > > Thanks > > On Fri, May 1, 2015 at 2:49 AM, Siva <[email protected]> wrote: > >> Hi, >> >> Phoenix TO_DATE is truncating the time portion from date while converting >> the date. Do I need to change the syntax? As per the documentation syntax >> seems to be correct. >> >> 0: jdbc:phoenix::/hbase> select "createdate", to_date("createdate", >> 'yyyy-MM-dd HH:mm:ss') from "lead" limit 5; >> >> +------------------------------------------+------------------------+ >> | createdate | TO_DATE(cf.createdate) | >> +------------------------------------------+------------------------+ >> | 2015-03-17 00:00:00.000 | 2015-03-16 | >> | 2014-04-28 13:31:22.687 | 2014-04-28 | >> | 2014-04-29 08:42:09.317 | 2014-04-29 | >> | 2014-04-29 08:42:18.167 | 2014-04-29 | >> | 2014-04-29 08:42:31.963 | 2014-04-29 | >> +------------------------------------------+------------------------+ >> 5 rows selected (0.056 seconds) >> >> >> Thanks, >> Siva. >> > >
