You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Babe Ruth <gt...@hotmail.com> on 2012/12/05 21:33:51 UTC

Determining DateDiff By Minutes in Hive

Hello All,
I would like to find the total amount of minutes between two dates.  Not sure if this is possible in hive.  Any help would be great.

Thanks,George 		 	   		  

RE: Determining DateDiff By Minutes in Hive

Posted by Babe Ruth <gt...@hotmail.com>.
this seems to be only for day,  I was wondering how to determine if a record is within 15 minutes of a previous record 

Date: Wed, 5 Dec 2012 12:53:27 -0800
Subject: Re: Determining DateDiff By Minutes in Hive
From: grover.markgrover@gmail.com
To: user@hive.apache.org

George,There is a datediff UDF which will tell you the difference between 2 dates.https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF#LanguageManualUDF-DateFunctions

You can find the number of minutes with simple arithmetic. Keep in mind that this method would not account for lost (or gained) minutes due to day light savings time. If that's important, it will be best to convert precise timestamps to UTC and then subtract them.

Mark
On Wed, Dec 5, 2012 at 12:33 PM, Babe Ruth <gt...@hotmail.com> wrote:





Hello All,
I would like to find the total amount of minutes between two dates.  Not sure if this is possible in hive.  Any help would be great.

Thanks,
George 		 	   		  

 		 	   		  

Re: Determining DateDiff By Minutes in Hive

Posted by Mark Grover <gr...@gmail.com>.
George,
There is a datediff UDF which will tell you the difference between 2 dates.
https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF#LanguageManualUDF-DateFunctions

You can find the number of minutes with simple arithmetic. Keep in mind
that this method would not account for lost (or gained) minutes due to day
light savings time. If that's important, it will be best to convert precise
timestamps to UTC and then subtract them.

Mark

On Wed, Dec 5, 2012 at 12:33 PM, Babe Ruth <gt...@hotmail.com>wrote:

>  Hello All,
>
> I would like to find the total amount of minutes between two dates.  Not
> sure if this is possible in hive.  Any help would be great.
>
>
> Thanks,
> George
>