| 302 | } |
| 303 | |
| 304 | void OperatorCtx::traverseOpToGetRowCount( |
| 305 | uint64_t& totalRowCount, |
| 306 | uint64_t& processedRowCount) { |
| 307 | auto numDrivers = task()->numDrivers(driverCtx()); |
| 308 | |
| 309 | if (numDrivers == 1) { |
| 310 | const auto& operators = driver()->operators(); |
| 311 | |
| 312 | VLOG(5) << "operators.size()=" << operators.size() |
| 313 | << ", operatorId=" << operatorId(); |
| 314 | |
| 315 | for (auto i = operatorId() - 1; i >= 0; --i) { |
| 316 | auto metricValueStr = operators[i]->getRuntimeMetric( |
| 317 | OperatorMetricKey::kCanUsedToEstimateHashBuildPartitionNum, "false"); |
| 318 | auto metricValue = folly::to<bool>(metricValueStr); |
| 319 | |
| 320 | VLOG(5) << "OperatorIndex=" << i << ", operator is " |
| 321 | << operators[i]->toString() |
| 322 | << ", kCanUsedToEstimateHashBuildPartitionNum=" |
| 323 | << (metricValue ? "true" : "false"); |
| 324 | |
| 325 | if (metricValue) { |
| 326 | auto totalRowCountStr = |
| 327 | operators[i]->getRuntimeMetric(OperatorMetricKey::kTotalRowCount); |
| 328 | auto hasBeenProcessedRowCountStr = operators[i]->getRuntimeMetric( |
| 329 | OperatorMetricKey::kHasBeenProcessedRowCount); |
| 330 | |
| 331 | BOLT_CHECK_NE(totalRowCountStr, "", "totalRowCountStr can't be empty"); |
| 332 | BOLT_CHECK_NE( |
| 333 | hasBeenProcessedRowCountStr, |
| 334 | "", |
| 335 | "hasBeenProcessedRowCountStr can't be empty, operator {}", |
| 336 | operators[i]->toString()); |
| 337 | |
| 338 | totalRowCount = folly::to<uint64_t>(totalRowCountStr); |
| 339 | processedRowCount = folly::to<uint64_t>(hasBeenProcessedRowCountStr); |
| 340 | |
| 341 | LOG(INFO) << toString() << " totalRowCountStr = " << totalRowCountStr |
| 342 | << ", hasBeenProcessedRowCountStr = " |
| 343 | << hasBeenProcessedRowCountStr |
| 344 | << ", numDrivers = " << numDrivers; |
| 345 | break; |
| 346 | } |
| 347 | } |
| 348 | } |
| 349 | } |
| 350 | |
| 351 | void OperatorCtx::adjustSpillCompressionKind( |
| 352 | common::SpillConfig*& spillConfig) { |
no test coverage detected