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

Switch to Threaded View
Hive >> mail # user >> Dealing with differents date format

Copy link to this message
Re: Dealing with differents date format
not sure i fully understand your dilemma.    have you investigated any of
the date functions listed here?


seems to me you could pull the year and month from a date.  or if you have
an int then do some arithmetic to get the year and month.  eg. year floor( <your int>/10000) and month = cast( <your int> % 100 as int)  [% =modulus operator]

or am i not even answering your question?

On Tue, Jul 2, 2013 at 2:42 AM, Jérôme Verdier

> Hi,
> i trying to translate some PL/SQL script in HiveQL, and dealing with
> unusual date format.
> i added a variable in my hive script : '${hiveconf:in_co_an_mois}' which
> is a year/month date format, like this : 201307 (INT format).
> I would like to transform this in date format, because i have to increment
> this (add one month/one year).
> Is there a way to do this in hive ?
> Thanks.
> --
> *Jérôme*