How to calculate seconds between two timestamps in Impala?

ADJ picture ADJ · Mar 7, 2016 · Viewed 12.4k times · Source

I do not see an Impala function to subtract two datestamps and return seconds (or minutes) between the two. http://www.cloudera.com/documentation/archive/impala/2-x/2-0-x/topics/impala_datetime_functions.html

Answer

Harper Koo picture Harper Koo · Mar 17, 2016

unix_timestamp(finish_time)-unix_timestamp(start_time) will give you the seconds between them.