zhztheplayer commented on a change in pull request #1204: [CALCITE-35] Babel 
parser should parse parenthesized joins
URL: https://github.com/apache/calcite/pull/1204#discussion_r283101182
 
 

 ##########
 File path: core/src/main/codegen/templates/Parser.jj
 ##########
 @@ -665,23 +665,33 @@ SqlNode LeafQuery(ExprContext exprContext) :
  */
 SqlNode ParenthesizedExpression(ExprContext exprContext) :
 {
-    SqlNode e;
+    SqlNode e, left;
 }
 {
     <LPAREN>
-    {
-        // we've now seen left paren, so queries inside should
-        // be allowed as sub-queries
-        switch (exprContext) {
-        case ACCEPT_SUB_QUERY:
-            exprContext = ExprContext.ACCEPT_NONCURSOR;
-            break;
-        case ACCEPT_CURSOR:
-            exprContext = ExprContext.ACCEPT_ALL;
-            break;
-        }
-    }
-    e = OrderedQueryOrExpr(exprContext)
+    (
+        LOOKAHEAD(3)
 
 Review comment:
   What happens if we have 3 or more left brackets before a subquery here? For 
example:
   
   ```sql
   SELECT * FROM (((SELECT * FROM tab)))
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to