Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

returning latest hours worth of data from a view

Highlighted

returning latest hours worth of data from a view

New Contributor
I'm trying to retrieve latest 12 hour data from  a hive view and it runs forever with no result. the same exact query for an underlying table works just fine. Please advise if there is better way to deal with views or getting hours of data.Seems like sub_date funcation works fine but I only need a few hours.

 select * from dsc60084_qlsvo_tz_db.v_qlsvo_eol_new where plant='ktp' and unit_collection_pt_timestamp > FROM_UNIXTIME(UNIX_TIMESTAMP()-43200) limit 5;

before you say adding ( and select to the from_unix statement , this one does not run:

select * from dsc60084_qlsvo_tz_db.v_qlsvo_eol_new where plant='ktp' and unit_collection_pt_timestamp > (( select FROM_UNIXTIME(UNIX_TIMESTAMP()-43200))) limit 5; ERROR select near unixtime ...