hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "cheng xu" <cheng.a...@intel.com>
Subject Re: Review Request 35107: HIVE-6791 Support variable substition for Beeline shell command
Date Fri, 26 Jun 2015 05:48:54 GMT


> On June 25, 2015, 6:21 a.m., Xuefu Zhang wrote:
> > beeline/src/java/org/apache/hive/beeline/Commands.java, line 820
> > <https://reviews.apache.org/r/35107/diff/3/?file=991102#file991102line820>
> >
> >     Does this mean that env and sys variables are not being substituted for shell
command?
> 
> cheng xu wrote:
>     No, this method is only used for retrieving hive configurations. For env and sys
variables, they are subsituted by VariableSubstitution.
> 
> Xuefu Zhang wrote:
>     Not sure if I understand it. Could you outline the process in which the variables
get substituted? Thanks.

The class *VariableSubstitution* handles the case of hive variables. It's overriding the super
class *SystemVariables* who deals with the system variables, env variables and hive conf variables.
The process is as follows:
1. Construct a *VariableSubsitution* instance with the source where you could retrieve the
hive variables
2. Call the method *substitute* from *VariableSubsitution*: 
SystemVariables#substitute(super.substitute) -> SystemVariables#getSubstitute(get the eval
from sys, env and hive conf) -> VariableSubstitution#getSubstitute(get the eval from hive
variables source)


- cheng


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/35107/#review89251
-----------------------------------------------------------


On June 25, 2015, 1:54 p.m., cheng xu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/35107/
> -----------------------------------------------------------
> 
> (Updated June 25, 2015, 1:54 p.m.)
> 
> 
> Review request for hive, chinna and Xuefu Zhang.
> 
> 
> Bugs: HIVE-6791
>     https://issues.apache.org/jira/browse/HIVE-6791
> 
> 
> Repository: hive-git
> 
> 
> Description
> -------
> 
> Summary:
> 1) move the beeline-cli convertor to the place where cli is executed(class **Commands**)
> 2) support substitution for source command
> 3) add some unit test for substitution
> 4) add one way to get the configuration from HS2
> 
> 
> Diffs
> -----
> 
>   beeline/src/java/org/apache/hive/beeline/BeeLine.java b7d2f2e 
>   beeline/src/java/org/apache/hive/beeline/Commands.java a42baa3 
>   beeline/src/test/org/apache/hive/beeline/cli/TestHiveCli.java 6cbb030 
>   cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java d62fd5c 
>   common/src/java/org/apache/hadoop/hive/conf/HiveVariableSource.java PRE-CREATION 
>   common/src/java/org/apache/hadoop/hive/conf/VariableSubstitution.java PRE-CREATION

>   common/src/test/org/apache/hadoop/hive/conf/TestVariableSubstitution.java PRE-CREATION

>   ql/src/java/org/apache/hadoop/hive/ql/Driver.java 338e755 
>   ql/src/java/org/apache/hadoop/hive/ql/parse/ColumnStatsSemanticAnalyzer.java a5f0a7f

>   ql/src/java/org/apache/hadoop/hive/ql/parse/VariableSubstitution.java e8b1d96 
>   ql/src/java/org/apache/hadoop/hive/ql/processors/AddResourceProcessor.java 0558c53

>   ql/src/java/org/apache/hadoop/hive/ql/processors/CompileProcessor.java 25ce168 
>   ql/src/java/org/apache/hadoop/hive/ql/processors/DeleteResourceProcessor.java 9052c82

>   ql/src/java/org/apache/hadoop/hive/ql/processors/DfsProcessor.java cc0414d 
>   ql/src/java/org/apache/hadoop/hive/ql/processors/SetProcessor.java bc9254c 
>   service/src/java/org/apache/hive/service/cli/operation/SQLOperation.java 33ee16b 
> 
> Diff: https://reviews.apache.org/r/35107/diff/
> 
> 
> Testing
> -------
> 
> Unit test passed
> 
> 
> Thanks,
> 
> cheng xu
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message