This is an automated email from the ASF dual-hosted git repository.

jackietien pushed a commit to branch ty/TableModelGrammar
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/ty/TableModelGrammar by this 
push:
     new 55e012dfaa7 fix logical and in PushPredicateIntoTableScan
55e012dfaa7 is described below

commit 55e012dfaa74689ffa7097fb05037a99d64f9550
Author: Beyyes <[email protected]>
AuthorDate: Wed Jul 24 12:23:27 2024 +0800

    fix logical and in PushPredicateIntoTableScan
---
 .../planner/optimizations/PushPredicateIntoTableScan.java         | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/optimizations/PushPredicateIntoTableScan.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/optimizations/PushPredicateIntoTableScan.java
index 6dfec749d5d..4d4c6152493 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/optimizations/PushPredicateIntoTableScan.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/optimizations/PushPredicateIntoTableScan.java
@@ -169,7 +169,13 @@ public class PushPredicateIntoTableScan implements 
PlanOptimizer {
           tableScanNode.setTimePredicate(resultPair.left);
         }
         if (Boolean.TRUE.equals(resultPair.right)) {
-          tableScanNode.setPushDownPredicate(pushDownPredicate);
+          if (pushDownPredicate instanceof LogicalExpression
+              && ((LogicalExpression) pushDownPredicate).getTerms().size() == 
1) {
+            tableScanNode.setPushDownPredicate(
+                ((LogicalExpression) pushDownPredicate).getTerms().get(0));
+          } else {
+            tableScanNode.setPushDownPredicate(pushDownPredicate);
+          }
         }
       } else {
         tableScanNode.setPushDownPredicate(null);

Reply via email to