MCPcopy Create free account
hub / github.com/bytedance/bolt / executeSerial

Method executeSerial

bolt/exec/tests/TaskTest.cpp:483–528  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

481 }
482
483 static std::pair<std::shared_ptr<exec::Task>, std::vector<RowVectorPtr>>
484 executeSerial(
485 core::PlanFragment plan,
486 const std::unordered_map<std::string, std::vector<std::string>>&
487 filePaths = {}) {
488 auto task = Task::create(
489 "single.execution.task.0",
490 plan,
491 0,
492 core::QueryCtx::create(),
493 Task::ExecutionMode::kSerial);
494
495 for (const auto& [nodeId, paths] : filePaths) {
496 for (const auto& path : paths) {
497 task->addSplit(nodeId, exec::Split(makeHiveConnectorSplit(path)));
498 }
499 task->noMoreSplits(nodeId);
500 }
501
502 BOLT_CHECK(task->supportSerialExecutionMode());
503
504 vector_size_t numRows = 0;
505 std::vector<RowVectorPtr> results;
506 for (;;) {
507 auto result = task->next();
508 if (!result) {
509 break;
510 }
511
512 for (auto& child : result->children()) {
513 child->loadedVector();
514 }
515 results.push_back(result);
516 numRows += result->size();
517 }
518
519 BOLT_CHECK(waitForTaskCompletion(task.get()));
520
521 auto planNodeStats = toPlanStats(task->taskStats());
522 BOLT_CHECK(planNodeStats.count(plan.planNode->id()));
523 BOLT_CHECK_EQ(numRows, planNodeStats.at(plan.planNode->id()).outputRows);
524 BOLT_CHECK_EQ(
525 results.size(), planNodeStats.at(plan.planNode->id()).outputVectors);
526
527 return {task, results};
528 }
529};
530
531TEST_F(TaskTest, sparkTaskAttemptId) {

Callers

nothing calls this directly

Calls 15

waitForTaskCompletionFunction · 0.85
toPlanStatsFunction · 0.85
taskStatsMethod · 0.80
createFunction · 0.50
SplitClass · 0.50
addSplitMethod · 0.45
noMoreSplitsMethod · 0.45
nextMethod · 0.45
childrenMethod · 0.45
loadedVectorMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected