Reputation: 15
in Hive table value for one column is like 01/12/17.But I need the value in the format as 12-2017(month-year).How to convert it?
Upvotes: 0
Views: 27
Reputation: 49260
Convert the string to a unix_timestamp
and output the required format using from_unixtime
.
select from_unixtime(unix_timestamp(col_name,'MM/dd/yy'),'MM-yyyy')
Upvotes: 1