Impala - 将 MON-YY 转换为 YYYYMM

Impala - Convert MON-YY to YYYYMM

我在暂存 table 中有一列 Month_year 具有以下数据。请建议查询以获得所需的输出。

输入:

+----------+
month_year
+----------+
Jan-19
Dec-18
+----------+

预期输出:

+----------+
month_year
+----------+
201901
201812
+----------+

提前致谢!

If column's month_year date format is MMM-yy then contact 01 as default date for avoid to null result, however it will not effect expected out because you are going to get output in format yyyyMM.  
Try this:  
select from_unixtime(unix_timestamp(concat('01-',month_year),'dd-MMM-yy'),'yyyyMM')