Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

How to generate the hourly table for a particular date range in Hive?

Highlighted

How to generate the hourly table for a particular date range in Hive?

New Contributor

I would like to generate the hour series for a particular date range in tabular format by passing the start date and end date as arguments.

 

Eg: If I pass start date as 2018-12-01 and end date as 2018-12-03 , it should produce the below result:

date                     Hour

-------------------------------------

2018-12-01          0

2018-12-01          1

2018-12-01          2

.                            .

.                            .

.                            .

.                            .

2018-12-03          23