Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

what is difference between from_unixtime vs from_timestamp

what is difference between from_unixtime vs from_timestamp

New Contributor

Hi Team,

 

Can someone please help to understand basic difference between date format functions available in Impala. 

Just to understand 

from_unixtime vs from_timestamp

which one is betetter form_unixtime or from_timestap   when fetching than a million rows .

 

Thanks

Ramesh Alluri

 

1 REPLY 1

Re: what is difference between from_unixtime vs from_timestamp

Guru
Hi Ramesh,

FROM_UNIXTIME accepts BIGINT as its argument, while FROM_TIMESTAMP accepts TIMESTAMP as its argument.

Documentation is available here:
https://www.cloudera.com/documentation/enterprise/latest/topics/impala_datetime_functions.html#datet...

https://www.cloudera.com/documentation/enterprise/latest/topics/impala_datetime_functions.html#datet...

So it depends on the data returned from your table. If you store your data as BIGINT, then use FROM_UNIXTIME, if you store data as TIMESTAMP or STRING, like "2019-05-01 12:00:00", then FROM_TIMESTAMP should be used.

Hope this helps.