String to Date conversion in hive

Requirement:

Generally we receive data from different sources which usually have different types of date formats. When we create a hive table on top of these data, it becomes necessary to convert them into date format which is supported by hive.

Hive support yyyy-MM-dd date format. So output format of all kinds of date should be yyyy-MM-dd. We are assuming input is in string data type but contains date as value .

Please refer below table to convert any date format into fixed format i.e yyyy-MM-dd .

Input column name: dt (String).Replace dt with your column name.

Don’t forget to see all tutorials Keep learning, keep growing .Subscribe us.

Don’t miss the tutorial on Top Big data courses on Udemy you should Buy

Sharing is caring!

Subscribe to our newsletter
Loading

1 Comment

Leave a Reply