Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
Hive >> mail # user >> Need help in Hive


Copy link to this message
-
Re: Need help in Hive
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.
Regards
Bejoy KS

Sent from remote device, Please excuse typos

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

Hello,
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 <[EMAIL PROTECTED]>

> 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
>
>
> http://about.me/maheedhar.kv/#
>
>

NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB