You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2019/10/05 04:38:48 UTC

[GitHub] [calcite] hsyuan commented on a change in pull request #1485: [CALCITE-2792] Stackoverflow while evaluating filter with large number of OR conditions

hsyuan commented on a change in pull request #1485: [CALCITE-2792] Stackoverflow while evaluating filter with large number of OR conditions
URL: https://github.com/apache/calcite/pull/1485#discussion_r331732423
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/rel/rel2sql/SqlImplementor.java
 ##########
 @@ -677,8 +677,8 @@ public SqlNode toSql(RexProgram program, RexNode rex) {
         }
         if (op instanceof SqlBinaryOperator && nodeList.size() > 2) {
           // In RexNode trees, OR and AND have any number of children;
-          // SqlCall requires exactly 2. So, convert to a left-deep binary tree.
-          return createLeftCall(op, nodeList);
+          // SqlCall requires exactly 2. So, convert to a balanced binary tree.
+          return createBinaryCall(op, nodeList, 0, nodeList.size());
 
 Review comment:
   Not sure if I should apply balanced binary tree to AND/OR operators only, for operators that are not associative, we may still need left-deep tree. But is there any other operator that can have more than 2 children and not associative?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services