hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sahil Takiar <takiar.sa...@gmail.com>
Subject Re: Review Request 49655: HIVE-12646: beeline and HIVE CLI do not parse ; in quote properly
Date Tue, 19 Jul 2016 19:46:21 GMT


> On July 14, 2016, 4:42 p.m., Sergio Pena wrote:
> > The patch looks good. Could you add more tests to validate different cases?
> > 
> > For instance:
> > select ';'
> > select '";"'
> > select "';'"
> > select "\';\'"
> > select "\";\""
> > select '\';\''

Added another test to cover these cases as well as the one that Peter mentioned.


- Sahil


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


On July 19, 2016, 7:45 p.m., Sahil Takiar wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/49655/
> -----------------------------------------------------------
> 
> (Updated July 19, 2016, 7:45 p.m.)
> 
> 
> Review request for hive, Sergio Pena and Yongzhi Chen.
> 
> 
> Bugs: HIVE-12646
>     https://issues.apache.org/jira/browse/HIVE-12646
> 
> 
> Repository: hive-git
> 
> 
> Description
> -------
> 
> HIVE-12646: beeline and HIVE CLI do not parse ; in quote properly
> 
> Approach:
> 
>   * Modified the `Commands.execute(...)` command to iterate throught the given input
line character by character
>   * It looks for single and double quotes in order to track when the iterator is inside
a quotation block
>   * If the iterator is inside a quotation block and it finds a semicolon, it ignores
it, otherwise it treats it as it normally would
>   * Moved the logic for parsing the line into a helper method called `getCmList(...)`
which is responsible for returning a `List` of commands that need to be run
> 
> 
> Diffs
> -----
> 
>   beeline/src/java/org/apache/hive/beeline/Commands.java 387861b 
>   itests/hive-unit/src/test/java/org/apache/hive/beeline/TestBeeLineWithArgs.java ecfeddb

>   ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java 2b8d6a7 
> 
> Diff: https://reviews.apache.org/r/49655/diff/
> 
> 
> Testing
> -------
> 
> Add a unit tests which checks that Beeline can successfully run queries that contain
semi-colons inside quotation blocks. Confirmed existing unit tests pass.
> 
> 
> Thanks,
> 
> Sahil Takiar
> 
>


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