Skip to content

Commit

Permalink
[native] Rename two Presto operators in operator stats.
Browse files Browse the repository at this point in the history
  • Loading branch information
spershin committed Nov 17, 2022
1 parent ac3e41e commit 3deb0b4
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion presto-native-execution/presto_cpp/main/PrestoTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,21 @@ protocol::RuntimeUnit toPrestoRuntimeUnit(RuntimeCounter::Unit unit) {
}
}

// Presto has certain query stats logic depending on the operator names.
// To leverage this logic we need to supply Presto's operator names.
std::string toPrestoOperatorType(const std::string& operatorType) {
if (operatorType == "MergeExchange") {
return "MergeOperator";
}
if (operatorType == "Exchange") {
return "ExchangeOperator";
}
if (operatorType == "TableScan") {
return "TableScanOperator";
}
return operatorType;
}

void setTiming(
const CpuWallTiming& timing,
int64_t& count,
Expand Down Expand Up @@ -260,7 +275,7 @@ protocol::TaskInfo PrestoTask::updateInfoLocked() {
opOut.pipelineId = i;
opOut.planNodeId = op.planNodeId;
opOut.operatorId = op.operatorId;
opOut.operatorType = op.operatorType;
opOut.operatorType = toPrestoOperatorType(op.operatorType);

opOut.totalDrivers = op.numDrivers;
opOut.inputPositions = op.inputPositions;
Expand Down

0 comments on commit 3deb0b4

Please sign in to comment.