----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/49655/#review142247 -----------------------------------------------------------
The patch looks good. Could you add more tests to validate different cases? For instance: select ';' select '";"' select "';'" select "\';\'" select "\";\"" select '\';\'' - Sergio Pena On July 12, 2016, 4:04 a.m., Sahil Takiar wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/49655/ > ----------------------------------------------------------- > > (Updated July 12, 2016, 4:04 a.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 3a204c0 > > itests/hive-unit/src/test/java/org/apache/hive/beeline/TestBeeLineWithArgs.java > ecfeddb > > 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 > >