This is an automated email from the ASF dual-hosted git repository. caogaofei pushed a commit to branch beyyes/joinOperator in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 9afbe466f0124b133ec28ec376209345c52768ec Author: Beyyes <[email protected]> AuthorDate: Thu Sep 12 23:39:24 2024 +0800 fix operator --- .../source/relational/InnerJoinOperator.java | 27 +++++++++++++++------- .../plan/planner/TableOperatorGenerator.java | 11 ++++++--- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/relational/InnerJoinOperator.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/relational/InnerJoinOperator.java index 8427cdac3cc..5b470000579 100644 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/relational/InnerJoinOperator.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/relational/InnerJoinOperator.java @@ -257,16 +257,27 @@ public class InnerJoinOperator implements ProcessOperator { leftIndex = 0; } - if ((System.nanoTime() - start < maxRuntime) - && (rightTsBlock == null || rightTsBlock.getPositionCount() == rightIndex)) { - if (rightChild.hasNextWithTimer()) { - rightTsBlock = rightChild.nextWithTimer(); - rightIndex = 0; - if (rightTsBlock != null) { - System.out.println("==="); - } + if ((rightTsBlock == null || rightTsBlock.getPositionCount() == rightIndex) + && rightChild.hasNextWithTimer()) { + rightTsBlock = rightChild.nextWithTimer(); + rightIndex = 0; + if (rightTsBlock != null) { + System.out.println("==="); } } + + // TODO use maxRunTime + // if ((System.nanoTime() - start < maxRuntime) + // && (rightTsBlock == null || rightTsBlock.getPositionCount() == rightIndex)) { + // if (rightChild.hasNextWithTimer()) { + // rightTsBlock = rightChild.nextWithTimer(); + // rightIndex = 0; + // if (rightTsBlock != null) { + // System.out.println("==="); + // } + // } + // } + return tsBlockIsNotEmpty(leftTsBlock, leftIndex) && tsBlockIsNotEmpty(rightTsBlock, rightIndex); } diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/TableOperatorGenerator.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/TableOperatorGenerator.java index 1ee67992575..83b872407a1 100644 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/TableOperatorGenerator.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/TableOperatorGenerator.java @@ -164,9 +164,14 @@ public class TableOperatorGenerator extends PlanVisitor<Operator, LocalExecution sinkHandle.setMaxBytesCanReserve(context.getMaxBytesOneHandleCanReserve()); context.getDriverContext().setSink(sinkHandle); - Operator child = node.getChildren().get(0).accept(this, context); - List<Operator> children = new ArrayList<>(1); - children.add(child); + // Operator child = node.getChildren().get(0).accept(this, context); + // List<Operator> children = new ArrayList<>(1); + // children.add(child); + + List<Operator> children = + node.getChildren().stream() + .map(child -> child.accept(this, context)) + .collect(Collectors.toList()); return new IdentitySinkOperator(operatorContext, children, downStreamChannelIndex, sinkHandle); }
