Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Hive, mail # user - Date format in Hive


Copy link to this message
-
Re: Date format in Hive
Nitin Pawar 2013-12-24, 06:59
easiest way would be something like this  cast ((regexp_replace(column,
'-', '') as int)*100

then you can do datetime conversion and end up doing same magic other way
On Tue, Dec 24, 2013 at 12:24 PM, yogesh dhari <[EMAIL PROTECTED]> wrote:

> 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
>

--
Nitin Pawar