Member since
03-09-2017
2
Posts
0
Kudos Received
0
Solutions
03-21-2017
01:17 AM
If you are using Hive 1.3 you can use quarter() built in function. Since you are using String data type for date looks like you can use em . Reference - https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF int quarter(date/timestamp/string) Returns the quarter of the year for a date, timestamp, or string in the range 1 to 4 (as of Hive 1.3.0) Example: quarter('2015-04-08') = 2.
... View more
03-23-2017
02:37 AM
1 Kudo
In the Hive version prior to 2.2.0 there is no function available, I added support for it recently, see HIVE-16234. Example SELECT trunc('2017-03-15', 'Q');
'2017-01-01'
... View more