Returns the max hash build spill level by 'task'.
| 171 | |
| 172 | // Returns the max hash build spill level by 'task'. |
| 173 | int32_t maxHashBuildSpillLevel(const exec::Task& task) { |
| 174 | int32_t maxSpillLevel = -1; |
| 175 | for (auto& pipelineStat : task.taskStats().pipelineStats) { |
| 176 | for (auto& operatorStat : pipelineStat.operatorStats) { |
| 177 | if (operatorStat.operatorType == "HashBuild") { |
| 178 | if (operatorStat.runtimeStats.count("maxSpillLevel") == 0) { |
| 179 | continue; |
| 180 | } |
| 181 | maxSpillLevel = std::max<int32_t>( |
| 182 | maxSpillLevel, operatorStat.runtimeStats["maxSpillLevel"].max); |
| 183 | } |
| 184 | } |
| 185 | } |
| 186 | return maxSpillLevel; |
| 187 | } |
| 188 | |
| 189 | std::pair<int32_t, int32_t> numTaskSpillFiles(const exec::Task& task) { |
| 190 | int32_t numBuildFiles = 0; |