Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Drill, mail # dev - Review Request 19706: DRILL-449 : Throw exception when ANTLR expression parser detects a parsing error. Stop execution immediately.


Copy link to this message
-
Re: Review Request 19706: DRILL-449 : Throw exception when ANTLR expression parser detects a parsing error. Stop execution immediately.
Jinfeng Ni 2014-03-27, 04:01

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

(Updated March 26, 2014, 9:01 p.m.)
Review request for drill.
Repository: drill-git
Description (updated)

This patch fixes the issue in the ANTLR expression parser used by Drill. When the parser sees parsing error in the expression in serialized logical plan/physical plan, it only will display the error message in the console, and continue the execution. The result logical expression will be either invalid or incomplete, which eventually hit error in Drill's run-time phase. This makes debuggging the error more difficulty.

Modify the ANTLR parser, such that it will catch the RecognitionException thrown by parser, and stop the execution.

For expr "less than (1,2)", Drill now will throw the following exception.

error_type: 0
message: "Failure while setting up Foreman. < ExpressionParsingException:[ Expression has syntax error! line 1:0:no viable alternative at input \'less\' ]"
]
Diffs

  common/src/main/antlr3/org/apache/drill/common/expression/parser/ExprParser.g edb8507
  exec/java-exec/src/test/java/org/apache/drill/exec/expr/ExpressionTest.java 3491e7a
  pom.xml c4bc9c9

Diff: https://reviews.apache.org/r/19706/diff/
Testing

Add two unit tests in ExpressionTest.java. One will raise the exception. The other one is a valid expression.
Thanks,

Jinfeng Ni