Home | About | Sematext search-lucene.com search-hadoop.com
 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 ;"*

why is it so, pls suggest and help

Yogesh Kumar