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 >> CASE Statement not working in hive


Copy link to this message
-
CASE Statement not working in hive
Hello all,

I have wrote this query .

*" select*

*case when as_date rlike '2013-05-01' then as_date else '2013-07-04' end as
as_date from table AA ; " *
as the value of as_date i.e  2013-05-01 exists in table AA  it *should
return the value 2013-05-01 *(Which is true in case statement)  but it
always *results value in else condition i.e '2013-07-04'*

*"select as_date from AA ;"*

 2013-05-01
why is it so, pls suggest and help

Regards
Yogesh Kumar
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