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.

Trying to rollup by day

Highlighted

Trying to rollup by day

New Contributor

Hi, 

 

We're using Impala to write a few queries. I need to rollup a TIMESTAMP field up to a day level. Is there a way to CAST a TIMESTAMP field in to a DATE field? If not, are there other ways to get the same result? For context, I need to join tables on a time field, but the TIMESTAMP field is too granualr (hours, minutes, seconds) and many of the results from the join are lost. I need the field to be of the format yyyy-mm-dd.  

 

Thanks. 

2 REPLIES 2

Re: Trying to rollup by day

Explorer

Hey,

 

After a quick glance at the Impala built-in functions, I believe the to_date() function is what you need. Let me know if that function solves your problem.

 

Regards,
Jeff

Highlighted

Re: Trying to rollup by day

New Contributor

Exacty what I needed -- bookmarking the page. Thank you! 

 

Don't have an account?
Coming from Hortonworks? Activate your account here