1

My query is select count(1) from db.table;. How can I execute this query and set it to hivevar:hive_count within a hiveql script?

Something along the lines of ...

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

Right now this is what happens...

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

The query is NOT executed. I want to be able to save the query result to a hivevar in which I can echo later

Liondancer
  • 15,721
  • 51
  • 149
  • 255

0 Answers0