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

Method buildQueryPlan

src/Interpreters/InterpreterSelectQuery.cpp:1204–1228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1202}
1203
1204void InterpreterSelectQuery::buildQueryPlan(QueryPlan & query_plan)
1205{
1206 executeImpl(query_plan, std::move(input_pipe));
1207
1208 /// We must guarantee that result structure is the same as in getSampleBlock()
1209 if (!blocksHaveEqualStructure(*query_plan.getCurrentHeader(), *result_header))
1210 {
1211 auto convert_actions_dag = ActionsDAG::makeConvertingActions(
1212 query_plan.getCurrentHeader()->getColumnsWithTypeAndName(),
1213 result_header->getColumnsWithTypeAndName(),
1214 ActionsDAG::MatchColumnsMode::Name,
1215 context,
1216 true);
1217
1218 auto converting = std::make_unique<ExpressionStep>(query_plan.getCurrentHeader(), std::move(convert_actions_dag));
1219 query_plan.addStep(std::move(converting));
1220 }
1221
1222 /// Extend lifetime of context, table lock, storage.
1223 query_plan.addInterpreterContext(context);
1224 if (table_lock)
1225 query_plan.addTableLock(std::move(table_lock));
1226 if (storage)
1227 query_plan.addStorageHolder(storage);
1228}
1229
1230BlockIO InterpreterSelectQuery::execute()
1231{

Callers 12

readMethod · 0.45
readImplMethod · 0.45
createPlanForTableMethod · 0.45
getFilterFromQueryFunction · 0.45
runMethod · 0.45
buildSelectQueryPlanFunction · 0.45
createLocalPlanFunction · 0.45
buildJoinedPlanFunction · 0.45
makeSetMethod · 0.45
executeFetchColumnsMethod · 0.45
addExternalStorageMethod · 0.45
executeImplMethod · 0.45

Calls 6

blocksHaveEqualStructureFunction · 0.85
executeImplFunction · 0.50
addStepMethod · 0.45
addInterpreterContextMethod · 0.45
addTableLockMethod · 0.45
addStorageHolderMethod · 0.45

Tested by

no test coverage detected