You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by yogesh dhari <yo...@gmail.com> on 2014/01/02 12:56:06 UTC
Setting value into hive varialble
Hello All,
I have a case statement, where I need to check the date passed through
parameter,
If date is 1st date of the month then keep it as it as
else
set the parameter date to 1st date of the month.
and then later opretation are being performed on that date into hive quries,
I have wrote this Hive QL
*select case when as_of_dt = ${hivevar:as_of_dt} then
${hivevar:as_of_dt} else date_sub(${hivevar:as_of_dt} ,
(day(${hivevar:as_of_dt} )) -1 ) end as as_of_dt from TABLE group by
as_of_dt ;*
I want to store the value of this Query int a variable.
like MY_VARIABLE = output of this query;
How to achive that.
Pls suggest,
Thanks in advance
some