Description
Hive has a Date function trunc(string date, string format) that returns date truncated to the unit specified by the format. Supported formats: MONTH/MON/MM, YEAR/YYYY/YY.
Goal here is to extend support to QUARTER/Q.
Example:
SELECT trunc('2017-03-15', 'Q');
'2017-01-01'
SELECT trunc('2017-12-31', 'Q');
'2017-10-01'