Phoenix let's you cast a BIGINT directly to a DATE, like this:
CAST(1458132989477 as DATE)
or like this if your BIGINT is in a column value:
CAST(my_bigint as DATE)
Thanks,
James
On Tue, Apr 5, 2016 at 6:31 AM, Riesland, Zack <[email protected]>
wrote:
> I have ms-based, GMT timestamps in BigInt columns in one of my phoenix
> tables.
>
>
>
> It’s easy to work with these in Java, but I’m struggling to find the right
> syntax to easily read them in a simple query.
>
>
>
> For example: '1458132989477'
>
>
>
> I know this is Wed, 16 Mar 2016 12:56:29.477 GMT
>
>
>
> But when I do something like this:
>
>
>
> to_char(to_date('1458132989477', 'S'), 'yyyy-MM-dd')
>
>
>
>
>
> I get 1970-01-25
>
>
>
> I looked at the functions page of the Phoenix website:
> https://phoenix.apache.org/language/functions.html
>
> Can someone help me figure out what I’m missing? Is there an official list
> of arguments for to_date()?
>
>
>
> Thanks!
>