This is an automated email from the ASF dual-hosted git repository. lancelly pushed a commit to branch support_exists_and_correlate in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 143689af8c47315cb5326f81ead6a67c171c848c Author: lancelly <[email protected]> AuthorDate: Fri Jan 10 21:31:54 2025 +0800 correct check in pushpredicate --- .../it/db/it/IoTDBMultiTAGsWithAttributesTableIT.java | 12 ++++++------ .../plan/relational/planner/optimizations/JoinUtils.java | 4 ++-- .../planner/optimizations/PushPredicateIntoTableScan.java | 7 +++---- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/integration-test/src/test/java/org/apache/iotdb/relational/it/db/it/IoTDBMultiTAGsWithAttributesTableIT.java b/integration-test/src/test/java/org/apache/iotdb/relational/it/db/it/IoTDBMultiTAGsWithAttributesTableIT.java index 7090b2b6ea3..d9650267e4e 100644 --- a/integration-test/src/test/java/org/apache/iotdb/relational/it/db/it/IoTDBMultiTAGsWithAttributesTableIT.java +++ b/integration-test/src/test/java/org/apache/iotdb/relational/it/db/it/IoTDBMultiTAGsWithAttributesTableIT.java @@ -36,7 +36,7 @@ import java.util.Arrays; import static org.apache.iotdb.db.it.utils.TestUtils.tableAssertTestFail; import static org.apache.iotdb.db.it.utils.TestUtils.tableResultSetEqualTest; -import static org.apache.iotdb.db.queryengine.plan.relational.planner.optimizations.JoinUtils.FULL_JOIN_ONLY_SUPPORT_EQUI_JOIN; +import static org.apache.iotdb.db.queryengine.plan.relational.planner.optimizations.JoinUtils.ONLY_SUPPORT_EQUI_JOIN; import static org.junit.Assert.fail; /** In this IT, table has more than one TAGs and Attributes. */ @@ -2098,27 +2098,27 @@ public class IoTDBMultiTAGsWithAttributesTableIT { public void exceptionTest() { tableAssertTestFail( "select * from table0 t0 full join table1 t1 on t0.num>t1.num", - FULL_JOIN_ONLY_SUPPORT_EQUI_JOIN, + ONLY_SUPPORT_EQUI_JOIN, DATABASE_NAME); tableAssertTestFail( "select * from table0 t0 full join table1 t1 on t0.num!=t1.num", - FULL_JOIN_ONLY_SUPPORT_EQUI_JOIN, + ONLY_SUPPORT_EQUI_JOIN, DATABASE_NAME); tableAssertTestFail( "select * from table0 t0 full join table1 t1 on t0.device=t1.device AND t0.num>t1.num", - FULL_JOIN_ONLY_SUPPORT_EQUI_JOIN, + ONLY_SUPPORT_EQUI_JOIN, DATABASE_NAME); tableAssertTestFail( "select * from table0 t0 full join table1 t1 on t0.device=t1.device OR t0.num>t1.num", - FULL_JOIN_ONLY_SUPPORT_EQUI_JOIN, + ONLY_SUPPORT_EQUI_JOIN, DATABASE_NAME); tableAssertTestFail( "select * from table0 t0 full join table1 t1 on t0.device=t1.device OR t0.time=t1.time", - FULL_JOIN_ONLY_SUPPORT_EQUI_JOIN, + ONLY_SUPPORT_EQUI_JOIN, DATABASE_NAME); } diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/optimizations/JoinUtils.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/optimizations/JoinUtils.java index 83ac24ff9b6..8d317cc09d8 100644 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/optimizations/JoinUtils.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/optimizations/JoinUtils.java @@ -48,8 +48,8 @@ import static org.apache.iotdb.db.queryengine.plan.relational.planner.node.JoinN import static org.apache.iotdb.db.queryengine.plan.relational.sql.ast.BooleanLiteral.TRUE_LITERAL; public class JoinUtils { - public static final String FULL_JOIN_ONLY_SUPPORT_EQUI_JOIN = - "Full outer join only support equiJoinClauses"; + public static final String ONLY_SUPPORT_EQUI_JOIN = + "For now, FullOuterJoin and LeftJoin only support EquiJoinClauses"; private JoinUtils() {} 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 ba9487c2ba9..286c53d91b7 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 @@ -100,9 +100,8 @@ import static org.apache.iotdb.db.queryengine.plan.relational.planner.ir.GlobalT import static org.apache.iotdb.db.queryengine.plan.relational.planner.ir.IrUtils.combineConjuncts; import static org.apache.iotdb.db.queryengine.plan.relational.planner.ir.IrUtils.extractConjuncts; import static org.apache.iotdb.db.queryengine.plan.relational.planner.ir.IrUtils.filterDeterministicConjuncts; -import static org.apache.iotdb.db.queryengine.plan.relational.planner.node.JoinNode.JoinType.FULL; import static org.apache.iotdb.db.queryengine.plan.relational.planner.node.JoinNode.JoinType.INNER; -import static org.apache.iotdb.db.queryengine.plan.relational.planner.optimizations.JoinUtils.FULL_JOIN_ONLY_SUPPORT_EQUI_JOIN; +import static org.apache.iotdb.db.queryengine.plan.relational.planner.optimizations.JoinUtils.ONLY_SUPPORT_EQUI_JOIN; import static org.apache.iotdb.db.queryengine.plan.relational.planner.optimizations.JoinUtils.extractJoinPredicate; import static org.apache.iotdb.db.queryengine.plan.relational.planner.optimizations.JoinUtils.joinEqualityExpression; import static org.apache.iotdb.db.queryengine.plan.relational.planner.optimizations.JoinUtils.processInnerJoin; @@ -628,8 +627,8 @@ public class PushPredicateIntoTableScan implements PlanOptimizer { equiJoinClauses.add(new JoinNode.EquiJoinClause(leftSymbol, rightSymbol)); } else { - if (node.getJoinType() == FULL) { - throw new UnsupportedOperationException(FULL_JOIN_ONLY_SUPPORT_EQUI_JOIN); + if (node.getJoinType() != INNER) { + throw new UnsupportedOperationException(ONLY_SUPPORT_EQUI_JOIN); } joinFilterBuilder.add(conjunct); }
