Re: Converting datime formats in Hive - please help

2014-10-26 Thread Vidya Sujeet
oh, great. thanks a lot. works for me as well!! On Sun, Oct 26, 2014 at 4:47 PM, Lefty Leverenz wrote: > The link in the wiki > > to Java documentation for SimpleDateFormat was broken; the new l

Re: Converting datime formats in Hive - please help

2014-10-26 Thread Lefty Leverenz
The link in the wiki to Java documentation for SimpleDateFormat was broken; the new link is: http://docs.oracle.com/javase/tutorial/i18n/format/simpleDateFormat.html. -- Lefty On Sun, Oct 26, 201

Re: Converting datime formats in Hive - please help

2014-10-26 Thread Harpreet Bedi
Hi Vidya, I tried recreating a similar hive table and it worked fine. Here is a snippet from my terminal. I hope it helps. I created a table name “testone” with three columns “name” “todaydate” and “lastname” with the row data as:“Metallica” “-5-FEB

Re: Converting datime formats in Hive - please help

2014-10-26 Thread Vidya Sujeet
yes, this retunrs NULLs.. from_unixtime(unix_timestamp('05-FEB-01', 'dd-MMM-yy ')) On Sun, Oct 26, 2014 at 2:09 PM, Harpreet Bedi wrote: > Hi Vidya, > > Have you tried using this instead? > > select from_unixtime(unix_timestamp('05-FEB-01', 'dd-MMM-yy ')) > > > > On Sunday, October 26, 2014, Vi

Re: Converting datime formats in Hive - please help

2014-10-26 Thread Harpreet Bedi
Hi Vidya, Have you tried using this instead? select from_unixtime(unix_timestamp('05-FEB-01', 'dd-MMM-yy ')) On Sunday, October 26, 2014, Vidya Sujeet wrote: > Hi Harpreet, > > I used the below statement but it doesn't give me the correct time. It > gives me 2000-12-31 instead of 2001/02/05.

Re: Converting datime formats in Hive - please help

2014-10-26 Thread Vidya Sujeet
Hi Harpreet, I used the below statement but it doesn't give me the correct time. It gives me 2000-12-31 instead of 2001/02/05..what am I doing wrong? select from_unixtime(unix_timestamp('05-FEB-01', 'DD-MMM-YY')) thanks, Vidya On Sun, Oct 26, 2014 at 1:06 PM, Harpreet Singh Bedi < harpreet.be.

Re: Converting datime formats in Hive - please help

2014-10-26 Thread Harpreet Singh Bedi
You’ll have to use lowercase “y” and lowercase “d” for year and date of the month. > On Oct 26, 2014, at 15:03, Harpreet Singh Bedi > wrote: > > Yup, that should work! > >> On Oct 26, 2014, at 15:00, Vidya Sujeet > > wrote: >> >> Ok, the pattern should be (DD-

Re: Converting datime formats in Hive - please help

2014-10-26 Thread Harpreet Singh Bedi
Yup, that should work! > On Oct 26, 2014, at 15:00, Vidya Sujeet wrote: > > Ok, the pattern should be (DD-MMM-YY) all in upper case! thanks > > On Sun, Oct 26, 2014 at 12:47 PM, Vidya Sujeet > wrote: > (dd-mmm-yy) returns NULL > > On Sun, Oct 26, 2014 at 12:11

Re: Converting datime formats in Hive - please help

2014-10-26 Thread Vidya Sujeet
Ok, the pattern should be (DD-MMM-YY) all in upper case! thanks On Sun, Oct 26, 2014 at 12:47 PM, Vidya Sujeet wrote: > (dd-mmm-yy) returns NULL > > On Sun, Oct 26, 2014 at 12:11 PM, Vidya Sujeet > wrote: > >> But what should the format be if the source has data coming *"25-FEB-01' ? >> appreci

Re: Converting datime formats in Hive - please help

2014-10-26 Thread Harpreet Bedi
Hi Vidya, This might help you. from_unixtime(unix_timestamp(COLUMN_NAME,'MM/dd/ HH:mm:ss')), On Sunday, October 26, 2014, Vidya Sujeet wrote: > (dd-mmm-yy) returns NULL > > On Sun, Oct 26, 2014 at 12:11 PM, Vidya Sujeet > wrote: > >> But what should the format be if the source has data

Re: Converting datime formats in Hive - please help

2014-10-26 Thread Vidya Sujeet
(dd-mmm-yy) returns NULL On Sun, Oct 26, 2014 at 12:11 PM, Vidya Sujeet wrote: > But what should the format be if the source has data coming *"25-FEB-01' ? > appreciate your help.* > > On Sun, Oct 26, 2014 at 12:01 PM, Nagarjuna Vissarapu < > nagarjuna.v...@gmail.com> wrote: > >> Timestamp class

Re: Converting datime formats in Hive - please help

2014-10-26 Thread Vidya Sujeet
But what should the format be if the source has data coming *"25-FEB-01' ? appreciate your help.* On Sun, Oct 26, 2014 at 12:01 PM, Nagarjuna Vissarapu < nagarjuna.v...@gmail.com> wrote: > Timestamp class is there to do this. > On Oct 27, 2014 12:26 AM, "Vidya Sujeet" wrote: > >> Hi, >> >> The d

Re: Converting datime formats in Hive - please help

2014-10-26 Thread Nagarjuna Vissarapu
Timestamp class is there to do this. On Oct 27, 2014 12:26 AM, "Vidya Sujeet" wrote: > Hi, > > The date time format coming from the source is* "25-FEB-01' .* I want to > convert it to the following format. *'MM/DD/' *. How can we do this > in Hive? > > > I see that as per the documentation >

Converting datime formats in Hive - please help

2014-10-26 Thread Vidya Sujeet
Hi, The date time format coming from the source is* "25-FEB-01' .* I want to convert it to the following format. *'MM/DD/' *. How can we do this in Hive? I see that as per the documentation https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF#LanguageManualUDF-DateFunctions