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.

Impala Timestamp - non-zero padded issue

Solved Go to solution
Highlighted

Impala Timestamp - non-zero padded issue

Contributor

Hey Guys - we have data, where the timestamp field is of datatype string, the values are non-zero padded timestamps. 

 

For Example:

1/1/2015 1:34:45 PM

1/10/2014 1:02:45 AM

11/1/2014 11:04:45 AM

 

When we do a cast as timestamp, we get NULL result - reason begin, impala expects the day and month values to be 2 digit, that is zero-padded. Is there a Regex function that will allow me to parse these non-zero padded timestamp to zero-padded and then convert to timestamp datatype?

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Impala Timestamp - non-zero padded issue

Contributor

Thanks! We wrote a UDF, to handle this date convertion. It worked out well.

 

Thanks,

Krishna

2 REPLIES 2

Re: Impala Timestamp - non-zero padded issue

Cloudera Employee

When Hive stores a timestamp value into Parquet format, it converts local time into UTC time, and when it reads data out, it converts back to local time.

Re: Impala Timestamp - non-zero padded issue

Contributor

Thanks! We wrote a UDF, to handle this date convertion. It worked out well.

 

Thanks,

Krishna

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