在Hive中,我想动态地从一个表中提取信息,将其保存在变量中并进一步使用。考虑以下示例,在该示例中,我检索列var的最大值,并希望在后续查询中将其用作条件。
set maximo=select max(var) from table;
select
*
from
table
where
var=${hiveconf:maximo}
尽管已经尝试,但它仍然无法正常工作。
set maximo=select max(var) from table;
${hiveconf:maximo}
shows me the intended result.
Doing:
select '${hiveconf:maximo}'
提供
"select max(var) from table"
though.
Best