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 Plain View
Hive >> mail # user >> Re: How to check for year condition in hive


Copy link to this message
-
Re: How to check for year condition in hive
that should work provided your columns are in 'yyyy-mm-dd' format and you
are ok to leave out leap years :)

also its a good idea to have all the mathematical operations in a bracketed
manner so u can have it like where round(datediff(date,dob)/365) >=18

On Mon, Apr 2, 2012 at 1:04 PM, Bhavesh Shah <[EMAIL PROTECTED]>wrote:

> Hello all,
> I am trying to check age in hive.
> select * from tbl_name where datediff(date,dob)/365 >= 18;
>
> Is it right to check date condition in hive?
> Or do I need to do something else.
> Pls suggest me as soon as possible
>
>
> --
> Thanks and Regards,
> Bhavesh Shah
>
>
--
Nitin Pawar
+
Bhavesh Shah 2012-04-02, 08:34
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