Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[native] Switch from old Task::create() API to the new ones #22591

Merged
merged 1 commit into from Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion presto-native-execution/presto_cpp/main/TaskManager.cpp
Expand Up @@ -462,7 +462,11 @@ std::unique_ptr<TaskInfo> TaskManager::createOrUpdateTask(
// task which hasn't been destroyed yet, such as the task pool in query's
// root memory pool.
auto newExecTask = exec::Task::create(
taskId, planFragment, prestoTask->id.id(), std::move(queryCtx));
taskId,
planFragment,
prestoTask->id.id(),
std::move(queryCtx),
exec::Task::ExecutionMode::kParallel);
// TODO: move spill directory creation inside velox task execution
// whenever spilling is triggered. It will reduce the unnecessary file
// operations on remote storage.
Expand Down
Expand Up @@ -59,7 +59,11 @@ class BroadcastTest : public exec::test::OperatorTestBase {
auto queryCtx = std::make_shared<core::QueryCtx>(executor_.get());
core::PlanFragment planFragment{planNode};
return exec::Task::create(
taskId, std::move(planFragment), destination, std::move(queryCtx));
taskId,
std::move(planFragment),
destination,
std::move(queryCtx),
exec::Task::ExecutionMode::kParallel);
}

std::pair<RowTypePtr, std::vector<std::string>> executeBroadcastWrite(
Expand Down
Expand Up @@ -341,7 +341,11 @@ class UnsafeRowShuffleTest : public exec::test::OperatorTestBase {
executor_.get(), core::QueryConfig({}));
core::PlanFragment planFragment{planNode};
return exec::Task::create(
taskId, std::move(planFragment), destination, std::move(queryCtx));
taskId,
std::move(planFragment),
destination,
std::move(queryCtx),
exec::Task::ExecutionMode::kParallel);
}

RowVectorPtr deserialize(
Expand Down
Expand Up @@ -601,7 +601,12 @@ class TaskManagerTest : public testing::Test {
auto queryCtx =
taskManager_->getQueryContextManager()->findOrCreateQueryCtx(
taskId, {});
return exec::Task::create(taskId, planFragment, 0, std::move(queryCtx));
return exec::Task::create(
taskId,
planFragment,
0,
std::move(queryCtx),
exec::Task::ExecutionMode::kParallel);
}

std::unique_ptr<protocol::TaskInfo> createOrUpdateTask(
Expand Down Expand Up @@ -1340,8 +1345,12 @@ TEST_F(TaskManagerTest, testCumulativeMemory) {
.planFragment();
auto queryCtx = std::make_shared<core::QueryCtx>(driverExecutor_.get());
const protocol::TaskId taskId = "scan.0.0.1.0";
auto veloxTask =
Task::create(taskId, std::move(planFragment), 0, std::move(queryCtx));
auto veloxTask = Task::create(
taskId,
std::move(planFragment),
0,
std::move(queryCtx),
Task::ExecutionMode::kParallel);

const uint64_t startTimeMs = velox::getCurrentTimeMs();
auto prestoTask = std::make_unique<PrestoTask>(taskId, "fakeId");
Expand Down