yeah...check it out
https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF#LanguageManualUDF-DateFunctions
 
or search google for date function for hive



Debarshi Basak
Tata Consultancy Services
Mailto: debarshi.ba...@tcs.com
Website: http://www.tcs.com
____________________________________________
Experience certainty. IT Services
Business Solutions
Outsourcing
____________________________________________

-----"Ladda, Anand" wrote: -----
To: "user@hive.apache.org" <user@hive.apache.org>
From: "Ladda, Anand" <lan...@microstrategy.com>
Date: 05/28/2012 08:30PM
Subject: RE: FW: Filtering on TIMESTAMP data type

Debarshi

Didn’t quite follow your first comment. I get the write-your-own UDF part but was wondering how others have been transitioning from STRING dates to TIMESTAMP dates and getting filtering, partition pruning, etc to work with constants

-Anand

 

From: Debarshi Basak [mailto:debarshi.ba...@tcs.com]
Sent: Saturday, May 26, 2012 11:54 AM
To: user@hive.apache.org
Subject: Re: FW: Filtering on TIMESTAMP data type

 

I guess it exist gotta check.

btw...You can always go and write a udf


Debarshi Basak
Tata Consultancy Services
Mailto: debarshi.ba...@tcs.com
Website: http://www.tcs.com
____________________________________________
Experience certainty. IT Services
Business Solutions
Outsourcing
____________________________________________

-----"Ladda, Anand" wrote: -----

To: "user@hive.apache.org" <user@hive.apache.org>, "d...@hive.apache.org" <d...@hive.apache.org>
From: "Ladda, Anand" <lan...@microstrategy.com>
Date: 05/26/2012 06:58PM
Subject: FW: Filtering on TIMESTAMP data type

How do I set-up a filter constant for TIMESTAMP datatype. In Hive 0.7 since timestamps were represented as strings a query like this would return data

 

select * from LU_day where day_date ='2010-01-01 00:00:00';

 

But now with day_date as a TIMESTAMP column it doesn’t. Is there some type of a TO_TIMESTAMP function in hive to convert the string constant into a TIMESTAMP one

 

As a workaround I can do

 

select * from LU_DAY where TO_DATE(day_date) = ‘2010-01-01’ but that would be a problem for partitioning pruning, etc

 

 

=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you

Reply via email to