-Re: Review Request 19706: DRILL-449 : Throw exception when ANTLR expression parser detects a parsing error. Stop execution immediately.
This is an automatically generated e-mail. To reply, visit:
(Updated March 26, 2014, 9:01 p.m.)
Review request for drill.
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.
message: "Failure while setting up Foreman. < ExpressionParsingException:[ Expression has syntax error! line 1:0:no viable alternative at input \'less\' ]"
Add two unit tests in ExpressionTest.java. One will raise the exception. The other one is a valid expression.