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 2021/11/11 03:26:55 UTC

[GitHub] [calcite] xy2953396112 commented on a change in pull request #2605: [CALCITE-4783] fix RelFieldTrimmer incorrectly drops filter condition

xy2953396112 commented on a change in pull request #2605:
URL: https://github.com/apache/calcite/pull/2605#discussion_r747174723



##########
File path: core/src/main/java/org/apache/calcite/sql2rel/RelFieldTrimmer.java
##########
@@ -371,6 +371,15 @@ public TrimResult trimFields(
     final List<RexNode> projs = Util.transform(rexProgram.getProjectList(),
         rexProgram::expandLocalRef);
 
+    RexNode conditionExpr = null;
+    if (rexProgram.getCondition() != null) {
+      final List<RexNode> filter = Util.transform(
+          ImmutableList.of(
+              rexProgram.getCondition()), rexProgram::expandLocalRef);
+      assert filter.size() == 1;

Review comment:
       Why `filter.size() == 1`?  




-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org