I would like to use something like:
set hivevar:average = select avg(nvl(val,0)) as average from table;
and Then use on another table like:
select * from table2 where value>=${average}
Is this possible in hive? if not how is the correct way on doing