I have code that looks like this:
set hivevar:foo=rand();
select ${hivevar:foo} from my_database.my_table;
I think, even with the variable substitution, rand()
is still being called once per row. How do I just set foo
to a random number once per query?
I can think of other solutions, but I'd like to keep everything contained to one hive query instead of patching together something uglier.