MCPcopy Create free account
hub / github.com/ByConity/ByConity / setStepDetail

Method setStepDetail

src/QueryPlan/PlanPrinter.cpp:1264–1597  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1262}
1263
1264void NodeDescription::setStepDetail(QueryPlanStepPtr step)
1265{
1266 type = step->getType();
1267 step_name = step->getName();
1268 if (step->getType() == IQueryPlanStep::Type::Union)
1269 {
1270 const auto * union_step = dynamic_cast<const UnionStep *>(step.get());
1271 for (const auto & output_to_inputs : union_step->getOutToInputs())
1272 {
1273 step_vector_detail["OutputToInputs"].emplace_back(output_to_inputs.first + " = " + join(output_to_inputs.second, ",", "[", "]"));
1274 }
1275 }
1276
1277 if (step->getType() == IQueryPlanStep::Type::Join)
1278 {
1279 const auto * join_step = dynamic_cast<const JoinStep *>(step.get());
1280 auto get_kind = [](ASTTableJoin::Kind kind) {
1281 switch (kind)
1282 {
1283 case ASTTableJoin::Kind::Inner:
1284 return "Inner";
1285 case ASTTableJoin::Kind::Left:
1286 return "Left";
1287 case ASTTableJoin::Kind::Right:
1288 return "Right";
1289 case ASTTableJoin::Kind::Full:
1290 return "Full";
1291 case ASTTableJoin::Kind::Cross:
1292 return "Cross";
1293 default:
1294 return "";
1295 }
1296 };
1297 auto get_strictness = [](ASTTableJoin::Strictness strictness) {
1298 switch (strictness)
1299 {
1300 case ASTTableJoin::Strictness::RightAny:
1301 return "RightAny ";
1302 case ASTTableJoin::Strictness::Any:
1303 return "Any ";
1304 case ASTTableJoin::Strictness::Asof:
1305 return "Asof ";
1306 case ASTTableJoin::Strictness::Semi:
1307 return "Semi ";
1308 case ASTTableJoin::Strictness::Anti:
1309 return "Anti";
1310 default:
1311 return "";
1312 }
1313 };
1314 step_detail["JoinKind"] = get_kind(join_step->getKind());
1315 step_detail["Strictness"] = get_strictness(join_step->getStrictness());
1316 if (join_step->getJoinAlgorithm() != JoinAlgorithm::AUTO)
1317 step_detail["Algorithm"] = JoinAlgorithmConverter::toString(join_step->getJoinAlgorithm());
1318
1319 String condition;
1320 for (size_t i = 0; i < join_step->getLeftKeys().size(); i++)
1321 step_vector_detail["Condition"].emplace_back(join_step->getLeftKeys()[i] + " == " + join_step->getRightKeys()[i]);

Callers 1

getPlanDescriptionMethod · 0.80

Calls 15

fFunction · 0.85
isIdentityFunction · 0.85
sortFunction · 0.85
convertFieldToTypeFunction · 0.85
getJoinAlgorithmMethod · 0.80
getSampleSizeMethod · 0.80
getMaxChunkSizeMethod · 0.80
getExchangeModeMethod · 0.80
getSchemaMethod · 0.80
getQueryInfoMethod · 0.80
getWhereMethod · 0.80
sampleSizeMethod · 0.80

Tested by

no test coverage detected