hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thiruvel Thirumoolan <>
Subject Re: How to add hours/minutes to a timestamp column in Hive Query
Date Thu, 24 Feb 2011 15:16:47 GMT
You can use unix_timestamp(), do the math and convert the result to timestamp. something like
from_unixtime(unix_timestamp(Arrival) + n). Use the proper units though.

Will that not work for you?

On Feb 24, 2011, at 7:57 PM, Bejoy Ks wrote:

Hi Experts
      Could some one please help me out with this? Any similar situations faced by any one
in your real time hive queries?
If I have to go ahead with an User Defined Function for this, then how could I implement and
use the same in Hive?
Does Hive have any plans/JIRAs in progress with this functionality implementation.

Thank You

Bejoy K S

From: Bejoy Ks <<>>
Sent: Wed, February 23, 2011 5:19:10 PM
Subject: How to add hours/minutes to a timestamp column in Hive Query

    Is there any function in hive with which we can add hours/minutes to a given stamp.
Say I have a timestamp oriented column 'Arrival_Time', to do some database oriented calculations
i have to add 4 hours to the 'Arrival_Time' in my Hive Query. How do I accomplish this? I
have see in hive documentation that we can use the date_add(string startdate, int days) method
to add days to a date. Any similar methods for time stamps to add hours?

Bejoy KS

View raw message