Time difference in HIVE -


i trying find difference between 2 timestamps in hive. date_time field string, need convert date_time format before finding time difference.

this code using, null.

   select unix_timestamp(to_date("2016-12-30 10:39:46"),'hh:mm:ss') - unix_timestamp(to_date("2016-12-30 10:39:31"),'hh:mm:ss'); 

i need difference 15 seconds.

any suggestions great !!

please try this:

select unix_timestamp('2016-12-30 10:39:46') - unix_timestamp('2016-12-30 10:39:31'); 

it should give time difference in seconds.


Comments

Popular posts from this blog

javascript - Trigger mouseenter when an animated element touches mouse -

json - Zend error Connection -

java - Using Spring @Transactional with a combination of readOnly and write, when does this entity get committed? -