Reply
Highlighted
Explorer
Posts: 30
Registered: ‎08-29-2017

Hive query to take hours from Time stamp with 2 hours duration range split

 Hi,

 

 

I have a timestamp column in Hbase.

 

I have a table in Hbase and want to process through hive

 

The table has a row key combination of three columns (abcshsk#2017-08-01 00:00:00.0#cpu)

 

Three columns (string,timestamp,string) this is my row key now.

 

I need to calculate in hive the hours from timestamp and its range.

 

i used hour(timestamp) command. but how to calculate ranges?

 

eg:

 

2017-09-04 00:00:00 00:00:00

2017-09-04 02:00:00 00:00:00

2017-09-04 04:00:00 00:00:00

2017-09-04 06:00:00 00:00:00

2017-09-04 08:00:00 00:00:00

2017-09-04 10:00:00 00:00:00

 

 

till 23:00:00 00:00:00

Announcements