Created on 06-30-2017 11:49 PM
Here is a simple example
--Running a Select count inside Beeline for a table by name patb
0: jdbc:hive2://node1:10000> select * from patb;
| patb.ida | patb.name | patb.month |
| 5 | Ujjain | 6 |
1 row selected (0.388 seconds)
Now we go ahead and set a variable.
0: jdbc:hive2://node1:10000> set hivevar:tablename=patb;
No rows affected (0.005 seconds)
0: jdbc:hive2://node1:10000> select * from ${hivevar:tablename};
1 row selected (0.14 seconds)
Resolution: Please set the variable as set hivevar:tablename=patb;