Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Community Articles

Find and share helpful community-sourced technical articles.
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!
Labels (1)
avatar
New Member

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;

2,976 Views