[ 
https://issues.apache.org/jira/browse/HIVE-10656?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14548387#comment-14548387
 ] 

Xuefu Zhang commented on HIVE-10656:
------------------------------------

[~sircodesalot], I think hiveconf is default if the name space part of a 
variable is not given. Thus, ${key} is equal to ${hiveconf:key} and "set 
key=value" is equal to "set hiveconf:key=value".

Please refer to documentation 
https://cwiki.apache.org/confluence/display/Hive/LanguageManual+VariableSubstitution.
 To further make sure, please also check Hive CLI's behavior.

> 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)

Reply via email to