I have a row in hive table with Start_Date and End_Date. I need to find out all quarters between Start_Date and End_Date and split the row into multiple rows based on number of quarters and derive Period Column.
Is there are way to achieve this using hive query?
> Source Table:-
> Pid Start_Date End_Date
> Act01 2011-01-01 2012-12-31
>
> Expected Result:-
> Pid Start_Date End_Date Period
> Act01 2011-01-01 2011-03-31 2011Q1
> Act01 2011-04-01 2011-06-30 2011Q2
> Act01 2011-07-01 2011-09-30 2011Q3
> Act01 2011-10-01 2011-12-31 2011Q4
> Act01 2012-01-01 2012-03-31 2012Q1
> Act01 2012-04-01 2012-06-30 2012Q2
> Act01 2012-07-01 2012-09-30 2012Q3
> Act01 2012-10-01 2012-12-31 2012Q4