执行查询并将结果保存到hivevar

时间:2018-04-10 22:00:43

标签: sql hive hiveql

我的查询是select count(1) from db.table;。如何在hiveql脚本中执行此查询并将其设置为hivevar:hive_count

有些事情......

> set hivevar:hive_count=(select count(1) from db.table);
> ! echo ${hivevar:hive_count}
43

现在发生这种情况......

> set hivevar:hive_count=(select count(1) from db.table);
> ! echo ${hivevar:hive_count}
(select count(1) from db.table)

未执行查询。我希望能够将查询结果保存到hivevar,我可以稍后回复

0 个答案:

没有答案