hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: Need help in Hive
Date Mon, 08 Jul 2013 10:28:03 GMT
Hi Maheedhar

As I understand, you are having a column with data of type MM:SS in your input data set.

AFAIK this format is not in the standard java.sql.Timestamp format also it doesn't even have
any date part . Hence you may not be able to use Timestamp data type here.

You can define it as a string and then develop your custom UDFs for any further processing.
Bejoy KS

Sent from remote device, Please excuse typos

-----Original Message-----
From: Matouk IFTISSEN <>
Date: Mon, 8 Jul 2013 09:47:11 
To: <>
Subject: Re: Need help in Hive

Try this function in hive query:
1- transform your data (type integer ) in timestamp (linux),
then do this:
2- from_unixtimeyour_date_timestamp), 'mm:ss') AS time

Hope this,  you will give help.

2013/7/8 Maheedhar Reddy <>

> Hi All,
> I have Hive 0.8.0 version installed in my single node Apache Hadoop
> cluster.
> I have a time column which is in format *MM:SS* (Minutes:seconds). I
> tried the date functions to get the value in MM:SS format. But its not
> working out.
> Below is my column for your reference.
> *Active Time*
> *12:01*
> 0:20
> 2:18
> in the first record 12:01, 12 is the number of minutes and 01 is the
> seconds.
> so when the time i'm creating a table in Hive, i have to give a data type
> for this column Active Time,
> I have tried with various date type columns but none of them worked out
> for me. Please guide me.
> What function should I use, to get the time in *MM:SS* format?
> "You only live once, but if you do it right, once is enough."
> Cheers!!
> Maheedhar Reddy K V

View raw message