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 Plain View
Hive >> mail # user >> Need help in Hive


+
Maheedhar Reddy 2013-07-08, 05:43
Copy link to this message
-
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/#
>
>
+
bejoy_ks@... 2013-07-08, 10:28
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