I have two timestamps in epoch format in two columns in hive table T1. They actually represent the job start time and end time. I want to calculate the time duration for which the job ran. Hence I am casting the epoch times into timestamp datatype and subtracting them. This is giving me the output in terms of 'dd hh:mm:ss:ms'. Lets say the output is going into column 'duration' in table T2 which is of timestamp data type in the ddl. But when I am writing this data into the table T2, the job gives an error when half way through the mapreduce phase saying 'unknown data type: interval_day_time'. I am not able to use the 'interval_day_time' datatype in the ddl as even that is giving me an error.
Is there any other way around?
Well I couldn't get around it. So I created my own macro which calculates the time in hours, minutes and seconds using mathematical formula and outputs the value in string.