From b27324c8c5aa3301589bc5273e090eafb24eeb25 Mon Sep 17 00:00:00 2001 From: Xwg Date: Tue, 26 Dec 2023 20:41:54 +0800 Subject: [PATCH] Add physical op virtual function TaskletCount --- src/executor/physical_planner.cpp | 2 +- src/scheduler/fragment_context.cpp | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/executor/physical_planner.cpp b/src/executor/physical_planner.cpp index 3c0b35b3b8..ed60458b5b 100644 --- a/src/executor/physical_planner.cpp +++ b/src/executor/physical_planner.cpp @@ -739,7 +739,7 @@ UniquePtr PhysicalPlanner::BuildKnn(const SharedPtrload_metas()); knn_scan_op->PlanWithIndex(query_context_ptr_); - if (knn_scan_op->TaskCount() == 1) { + if (knn_scan_op->TaskletCount() == 1) { return knn_scan_op; } else { return MakeUnique(query_context_ptr_->GetNextNodeID(), diff --git a/src/scheduler/fragment_context.cpp b/src/scheduler/fragment_context.cpp index 329e21072f..7d9ad8f448 100644 --- a/src/scheduler/fragment_context.cpp +++ b/src/scheduler/fragment_context.cpp @@ -497,7 +497,7 @@ void FragmentContext::CreateTasks(i64 cpu_count, i64 operator_count) { switch (first_operator->operator_type()) { case PhysicalOperatorType::kTableScan: { auto *table_scan_operator = static_cast(first_operator); - parallel_count = Min(parallel_count, (i64)(table_scan_operator->BlockEntryCount())); + parallel_count = Min(parallel_count, (i64)(table_scan_operator->TaskletCount())); if (parallel_count == 0) { parallel_count = 1; } @@ -694,8 +694,7 @@ void FragmentContext::CreateTasks(i64 cpu_count, i64 operator_count) { case PhysicalOperatorType::kLimit: case PhysicalOperatorType::kTop: { if (fragment_type_ != FragmentType::kParallelStream) { - Error( - Format("{} should in parallel stream fragment", PhysicalOperatorToString(last_operator->operator_type()))); + Error(Format("{} should in parallel stream fragment", PhysicalOperatorToString(last_operator->operator_type()))); } if ((i64)tasks_.size() != parallel_count) {