| 1411 | } |
| 1412 | |
| 1413 | void Scheduler::PopulateFilepathToHostsMapping(const FInstanceScheduleState& finst, |
| 1414 | ScheduleState* state, ByNodeFilepathToHosts* duplicate_check) { |
| 1415 | for (const auto& per_node_ranges : finst.exec_params.per_node_scan_ranges()) { |
| 1416 | const TPlanNode& node = state->GetNode(per_node_ranges.first); |
| 1417 | if (node.node_type != TPlanNodeType::HDFS_SCAN_NODE) continue; |
| 1418 | if (!node.hdfs_scan_node.__isset.deleteFileScanNodeId) continue; |
| 1419 | const TPlanNodeId delete_file_node_id = node.hdfs_scan_node.deleteFileScanNodeId; |
| 1420 | |
| 1421 | for (const auto& scan_ranges : per_node_ranges.second.scan_ranges()) { |
| 1422 | string file_path; |
| 1423 | bool is_relative = false; |
| 1424 | const HdfsFileSplitPB& hdfs_file_split = scan_ranges.scan_range().hdfs_file_split(); |
| 1425 | if (hdfs_file_split.has_relative_path() && |
| 1426 | !hdfs_file_split.relative_path().empty()) { |
| 1427 | file_path = hdfs_file_split.relative_path(); |
| 1428 | is_relative = true; |
| 1429 | } else { |
| 1430 | file_path = hdfs_file_split.absolute_path(); |
| 1431 | } |
| 1432 | DCHECK(!file_path.empty()); |
| 1433 | |
| 1434 | std::unordered_set<NetworkAddressPB>& current_hosts = |
| 1435 | (*duplicate_check)[delete_file_node_id][file_path]; |
| 1436 | if (current_hosts.find(finst.host) != current_hosts.end()) continue; |
| 1437 | current_hosts.insert(finst.host); |
| 1438 | |
| 1439 | auto* by_node_filepath_to_hosts = |
| 1440 | state->query_schedule_pb()->mutable_by_node_filepath_to_hosts(); |
| 1441 | auto* filepath_to_hosts = |
| 1442 | (*by_node_filepath_to_hosts)[delete_file_node_id].mutable_filepath_to_hosts(); |
| 1443 | (*filepath_to_hosts)[file_path].set_is_relative(is_relative); |
| 1444 | auto* hosts = (*filepath_to_hosts)[file_path].add_hosts(); |
| 1445 | *hosts = finst.host; |
| 1446 | } |
| 1447 | } |
| 1448 | } |
| 1449 | |
| 1450 | void Scheduler::ComputeBackendExecParams( |
| 1451 | const ExecutorConfig& executor_config, ScheduleState* state) { |