@@ -72,6 +72,19 @@ const std::string kHiveDefaultPartition = "__HIVE_DEFAULT_PARTITION__";
7272
7373} // namespace
7474
75+ namespace {
76+ std::string getVeloxTaskId (const SparkTaskInfo& taskInfo) {
77+ if (taskInfo.executionId != -1 ) {
78+ return fmt::format (" Gluten_Execution_{}" , std::to_string (taskInfo.executionId ));
79+ }
80+ return fmt::format (
81+ " Gluten_Stage_{}_TID_{}_VTID_{}" ,
82+ std::to_string (taskInfo.stageId ),
83+ std::to_string (taskInfo.taskId ),
84+ std::to_string (taskInfo.vId ));
85+ }
86+ } // namespace
87+
7588WholeStageResultIterator::WholeStageResultIterator (
7689 VeloxMemoryManager* memoryManager,
7790 const std::shared_ptr<const facebook::velox::core::PlanNode>& planNode,
@@ -111,11 +124,7 @@ WholeStageResultIterator::WholeStageResultIterator(
111124 velox::core::PlanFragment planFragment{planNode, velox::core::ExecutionStrategy::kUngrouped , 1 , emptySet};
112125 std::shared_ptr<velox::core::QueryCtx> queryCtx = createNewVeloxQueryCtx ();
113126 task_ = velox::exec::Task::create (
114- fmt::format (
115- " Gluten_Stage_{}_TID_{}_VTID_{}" ,
116- std::to_string (taskInfo_.stageId ),
117- std::to_string (taskInfo_.taskId ),
118- std::to_string (taskInfo.vId )),
127+ getVeloxTaskId (taskInfo_),
119128 std::move (planFragment),
120129 0 ,
121130 std::move (queryCtx),
@@ -233,11 +242,7 @@ std::shared_ptr<velox::core::QueryCtx> WholeStageResultIterator::createNewVeloxQ
233242 gluten::VeloxBackend::get ()->getAsyncDataCache (),
234243 memoryManager_->getAggregateMemoryPool (),
235244 spillExecutor_,
236- fmt::format (
237- " Gluten_Stage_{}_TID_{}_VTID_{}" ,
238- std::to_string (taskInfo_.stageId ),
239- std::to_string (taskInfo_.taskId ),
240- std::to_string (taskInfo_.vId )));
245+ getVeloxTaskId (taskInfo_));
241246 return ctx;
242247}
243248
0 commit comments