hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dyuti a <hadoop.hiv...@gmail.com>
Subject help in hive
Date Mon, 22 Oct 2012 08:41:11 GMT
Hi all,
 I have a hive table with  235 million records.

SAMPLE INPUT:
receive_year    receive_day     receive_hour       client
         2012                       7                             17
             xyz
         2012                       7                             02
             xyz
         2012                       7                             17
             btn
         2012                       7                             04
             snm
         2012                       7                             05
             btn
         2012                       7                             02
             snm

receive_hour is an int field having values from 01 to 24 (transaction
received hour in 24 hour basis).

EXPECTED OUTPUT:

The transaction received per hour basis i.e., 01 (start_time) t0 02
(end_time) . so that the receive_hour column should be displayed as
start_time and end_time so that every one hour transaction received for
particular client on that day.

client      receive_day      start_time       end_time
   xyz                7                           01
 02
   xyz                7                           02
 03
   xyz                7                           03
 04
  continues up to                     23                         24

like the same for other clients too.

am facing problem in displaying the single column values into two column in
hive. i.e., 1 - 2 , 2- 3 ............. 23 - 24.

I have written the query to display the other details happened in
transaction but got stuck in the above scenario.

Please let me know is this possible in hive, if so then pls guide me.


Thanks for your help in advance!


Regards,
dti

Mime
View raw message