Community Articles
Find and share helpful community-sourced technical articles
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.
Labels (1)
New Contributor

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};

| patb.ida | patb.name | patb.month |

| 5 | Ujjain | 6 |

1 row selected (0.14 seconds)

Resolution: Please set the variable as set hivevar:tablename=patb;

1,622 Views
Don't have an account?
Coming from Hortonworks? Activate your account here
Version history
Revision #:
1 of 1
Last update:
‎06-30-2017 11:49 PM
Updated by:
 
Contributors
Top Kudoed Authors