Reuben Kuhnert created HIVE-10656:
-------------------------------------
Summary: Beeline set var=value not carrying over to queries
Key: HIVE-10656
URL: https://issues.apache.org/jira/browse/HIVE-10656
Project: Hive
Issue Type: Bug
Reporter: Reuben Kuhnert
Priority: Minor
After performing a {{set name=value}} I would expect that the variable name
would carry over to all locations within the session. It appears to work when
querying the value via {{set;}}, but not when trying to do actual sql
statements.
Example:
{code}
0: jdbc:hive2://localhost:10000> set foo;
+----------+--+
| set |
+----------+--+
| foo=bar |
+----------+--+
1 row selected (0.932 seconds)
0: jdbc:hive2://localhost:10000> select * from ${foo};
Error: Error while compiling statement: FAILED: SemanticException [Error
10001]: Line 1:14 Table not found 'bar' (state=42S02,code=10001)
0: jdbc:hive2://localhost:10000> show tables;
+------------+--+
| tab_name |
+------------+--+
| my |
| purchases |
+------------+--+
2 rows selected (0.437 seconds)
0: jdbc:hive2://localhost:10000> set foo=my;
No rows affected (0.017 seconds)
0: jdbc:hive2://localhost:10000> set foo;
+---------+--+
| set |
+---------+--+
| foo=my |
+---------+--+
1 row selected (0.02 seconds)
0: jdbc:hive2://localhost:10000> select * from ${foo};
select * from ${foo};
Error: Error while compiling statement: FAILED: SemanticException [Error
10001]: Line 1:14 Table not found 'bar' (state=42S02,code=10001)
{code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)