MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / cloneSubdagWithInputs

Function cloneSubdagWithInputs

src/Processors/QueryPlan/JoinStepLogical.cpp:1498–1515  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1496}
1497
1498static ActionsDAG cloneSubdagWithInputs(const SharedHeader & stream_header, ActionsDAG::NodeRawConstPtrs & keys)
1499{
1500 ActionsDAG dag(stream_header->getColumnsWithTypeAndName(), /* duplicate_const_columns */ false);
1501
1502 ActionsDAG::NodeMapping node_map;
1503 auto second_dag = ActionsDAG::cloneSubDAG(keys, node_map, false);
1504
1505 remapNodes(keys, node_map);
1506 node_map.clear();
1507
1508 dag.mergeInplace(std::move(second_dag), node_map, true);
1509 remapNodes(keys, node_map);
1510
1511 dag.getOutputs() = dag.getInputs();
1512 dag.getOutputs().append_range(keys | std::views::filter([&](const auto * node) { return node->type != ActionsDAG::ActionType::INPUT; }));
1513
1514 return dag;
1515}
1516
1517std::optional<std::pair<JoinStepLogical::ActionsDAGWithKeys, JoinStepLogical::ActionsDAGWithKeys>>
1518JoinStepLogical::preCalculateKeys(const SharedHeader & left_header, const SharedHeader & right_header)

Callers 1

preCalculateKeysMethod · 0.85

Calls 3

mergeInplaceMethod · 0.80
remapNodesFunction · 0.70
clearMethod · 0.45

Tested by

no test coverage detected