I have a table which has the timestamp as below
DataFeedDTTM
------------
2016-10-20 15:57:42.1
But when I query it I need the format as below.
select DataFeedDTTM from atable;
(Data can be huge and hence need a optimal solution as well, but then I'm fine to have any inputs)
DataFeedDTTM
------------
20170209 12:14:54.100000
I have an alternative to do a Case When - Type casting. But then it doesn't seem to be simple.
The reason for it to be simple is, I have to dynamically for this query through a Python code and read the data from Hive and write it into a CSV.
'datetime' module might help your task.
This produces: