Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
Hive >> mail # user >> Date Comparisons. in Hive


Copy link to this message
-
Date Comparisons. in Hive
I have this below query from which I am trying to find out those records
that fall between midnight and 2 A.M on 18th September.
And *SojTimestampToDate *function will give me date in this format *yyyy/MM/dd
HH:mm:ss*
*
*
I am not sure whether the date comparison I did is right or not. And it
will give me all those records between midnight and 2 AM.

*SELECT event.app_payload ['n'] AS changed_cguid*
* FROM soj_session_container a LATERAL VIEW explode(a.events) t AS event*
* WHERE a.dt = '20120918'*
* AND SojTimestampToDate(event.event_timestamp) >= '2012/09/18 00:00:00'*
* AND SojTimestampToDate(event.event_timestamp) <= '2012/09/18 02:00:00'*

Can anyone shed some light on this whether I am doing right or not?

*Raihan Jamal*
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB