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

Carl Steinbach commented on HIVE-1096:
--------------------------------------

bq. Where does the ${VARNAME} syntax come from? SCOPE uses @@VARNAME for their 
syntax for a somewhat similar feature. Just curious.

Unix shell command interpreters, Perl, Make, Ant, Eclipse, [Amazon's EMR 
version of Hive 
|http://developer.amazonwebservices.com/connect/entry.jspa?externalID=2856] and 
many templating systems (which is basically what this is) use the unary 
operator $ for string substitution. Eclipse also defines various namespaces, so 
for example it is possible to reference environment variables as 
${env_var:HOME} and system properties as ${system_property:java.home}. MySQL 
and T-SQL both use @ to identify user variables, and @@ to identify system 
variables (see http://dev.mysql.com/doc/refman/5.0/en/user-variables.html), 
which was probably the inspiration for SCOPE's syntax. SQL*Plus apparently uses 
'&'. 

> Hive Variables
> --------------
>
>                 Key: HIVE-1096
>                 URL: https://issues.apache.org/jira/browse/HIVE-1096
>             Project: Hadoop Hive
>          Issue Type: New Feature
>            Reporter: Edward Capriolo
>            Assignee: Edward Capriolo
>         Attachments: 1096-9.diff, hive-1096-2.diff, hive-1096-7.diff, 
> hive-1096-8.diff, hive-1096.diff
>
>
> From mailing list:
> --Amazon Elastic MapReduce version of Hive seems to have a nice feature 
> called "Variables." Basically you can define a variable via command-line 
> while invoking hive with -d DT=2009-12-09 and then refer to the variable via 
> ${DT} within the hive queries. This could be extremely useful. I can't seem 
> to find this feature even on trunk. Is this feature currently anywhere in the 
> roadmap?--
> This could be implemented in many places.
> A simple place to put this is 
> in Driver.compile or Driver.run we can do string substitutions at that level, 
> and further downstream need not be effected. 
> There could be some benefits to doing this further downstream, parser,plan. 
> but based on the simple needs we may not need to overthink this.
> I will get started on implementing in compile unless someone wants to discuss 
> this more.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to