Q:

UDF to Coverting Date Format in Hive

Hi all i am new to hadoop i need to create hive UDF to convert string datatype Date to date datatype i have one table where date datatype is string
abc 2/9/2017
xyz 2/8/2017
city 2/7/2017
state 2/1/2017

UDF will convert date into yyy-mm-dd and insert into another table where date column datatype is Date 
output like

abc 2017/2/9
xyz 2017/2/8
city 2017/2/7
state 2017/2/1

i have tried with 
TO_DATE(from_unixtime(UNIX_TIMESTAMP(date,'yyyy-mm-dd')))

but got NULL value

A:

dd/MM/yyyy
hive> select TO_DATE(from_unixtime(UNIX_TIMESTAMP('12/9/2017','dd/MM/yyyy')));
OK
_c0
2017-09-12

