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

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -