hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <ashok.sa...@wipro.com>
Subject RE: Date format in Hive
Date Tue, 24 Dec 2013 07:17:40 GMT
Hello Dhari,

Write a hive udf, 
1.which ll take date as argument.
2.extract yr, mon,date from string, create a new string combining them
3. convert it to numeric and multiply 100..
4. return this value from udf.

Thanks,
Ashok
________________________________________
From: yogesh dhari [yogeshhive@gmail.com]
Sent: Tuesday, December 24, 2013 12:24 PM
To: user@hive.apache.org
Subject: Date format in Hive

Hello All,

I have a hive table in which dates are stored in string format.

like

2013-01-01
2013-02-01
2013-03-01


I have a use case where I need this date like
20130101
20130201
20130301

and want to multiply each with 100
like

2013010100
2013020100
2013030100


How can I do it into Hive

pls help.

Thanks & Regards
Yogesh

The information contained in this electronic message and any attachments to this message are
intended for the exclusive use of the addressee(s) and may contain proprietary, confidential
or privileged information. If you are not the intended recipient, you should not disseminate,
distribute or copy this e-mail. Please notify the sender immediately and destroy all copies
of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email
and any attachments for the presence of viruses. The company accepts no liability for any
damage caused by any virus transmitted by this email.

www.wipro.com

Mime
View raw message