Skip to content

Commit

Permalink
Add physical op virtual function TaskletCount
Browse files Browse the repository at this point in the history
  • Loading branch information
loloxwg committed Dec 26, 2023
1 parent 5057481 commit b27324c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/executor/physical_planner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ UniquePtr<PhysicalOperator> PhysicalPlanner::BuildKnn(const SharedPtr<LogicalNod
logical_operator->load_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<PhysicalMergeKnn>(query_context_ptr_->GetNextNodeID(),
Expand Down
5 changes: 2 additions & 3 deletions src/scheduler/fragment_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<PhysicalTableScan *>(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;
}
Expand Down Expand Up @@ -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<SchedulerException>(
Format("{} should in parallel stream fragment", PhysicalOperatorToString(last_operator->operator_type())));
Error<SchedulerException>(Format("{} should in parallel stream fragment", PhysicalOperatorToString(last_operator->operator_type())));
}

if ((i64)tasks_.size() != parallel_count) {
Expand Down

0 comments on commit b27324c

Please sign in to comment.