Repository: spark
Updated Branches:
  refs/heads/master e07aee216 -> dcaa49ff1


[SPARK-24658][SQL] Remove workaround for ANTLR bug

## What changes were proposed in this pull request?

Issue antlr/antlr4#781 has already been fixed, so the workaround of extracting 
the pattern into a separate rule is no longer needed. The presto already 
removed it: https://github.com/prestodb/presto/pull/10744.

## How was this patch tested?

Existing tests

Author: Yuming Wang <yumw...@ebay.com>

Closes #21641 from wangyum/ANTLR-780.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/dcaa49ff
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/dcaa49ff
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/dcaa49ff

Branch: refs/heads/master
Commit: dcaa49ff1edd7fcf0f000c6f93ae0e30bd5b6464
Parents: e07aee2
Author: Yuming Wang <yumw...@ebay.com>
Authored: Tue Jun 26 14:33:04 2018 -0700
Committer: Xiao Li <gatorsm...@gmail.com>
Committed: Tue Jun 26 14:33:04 2018 -0700

----------------------------------------------------------------------
 .../antlr4/org/apache/spark/sql/catalyst/parser/SqlBase.g4  | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/dcaa49ff/sql/catalyst/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBase.g4
----------------------------------------------------------------------
diff --git 
a/sql/catalyst/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBase.g4 
b/sql/catalyst/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBase.g4
index 3fe00ee..dc95751 100644
--- 
a/sql/catalyst/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBase.g4
+++ 
b/sql/catalyst/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBase.g4
@@ -539,18 +539,11 @@ expression
 booleanExpression
     : NOT booleanExpression                                        #logicalNot
     | EXISTS '(' query ')'                                         #exists
-    | predicated                                                   
#booleanDefault
+    | valueExpression predicate?                                   #predicated
     | left=booleanExpression operator=AND right=booleanExpression  
#logicalBinary
     | left=booleanExpression operator=OR right=booleanExpression   
#logicalBinary
     ;
 
-// workaround for:
-//  https://github.com/antlr/antlr4/issues/780
-//  https://github.com/antlr/antlr4/issues/781
-predicated
-    : valueExpression predicate?
-    ;
-
 predicate
     : NOT? kind=BETWEEN lower=valueExpression AND upper=valueExpression
     | NOT? kind=IN '(' expression (',' expression)* ')'


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to