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

Function describeJoinActions

src/Processors/QueryPlan/JoinStep.cpp:29–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27{
28
29std::vector<std::pair<String, String>> describeJoinActions(const JoinPtr & join, const ExplainFormatSettings & settings)
30{
31 std::vector<std::pair<String, String>> description;
32 const auto & table_join = join->getTableJoin();
33
34 auto to_lower = [](String & s)
35 {
36 std::transform(s.begin(), s.end(), s.begin(),
37 [](unsigned char c) { return std::tolower(c); });
38 };
39
40 String kind = toString(table_join.kind());
41 String strictness = toString(table_join.strictness());
42
43 if (settings.pretty)
44 {
45 to_lower(kind);
46 to_lower(strictness);
47 }
48
49 description.emplace_back("Type", kind);
50 description.emplace_back("Strictness", strictness);
51 description.emplace_back("Algorithm", join->getName());
52
53 if (table_join.strictness() == JoinStrictness::Asof)
54 description.emplace_back("ASOF inequality", toString(table_join.getAsofInequality()));
55
56 if (!table_join.getClauses().empty())
57 {
58 if (settings.pretty)
59 description.emplace_back("Join conditions", TableJoin::formatClausesPretty(table_join.getClauses(), settings));
60 else
61 description.emplace_back("Clauses", TableJoin::formatClauses(table_join.getClauses(), true /*short_format*/));
62 }
63
64 if (const auto & mixed_expression = table_join.getMixedJoinExpression())
65 description.emplace_back("Residual filter", mixed_expression->getSampleBlock().dumpNames());
66
67 return description;
68}
69
70std::vector<size_t> getPermutationForBlock(
71 const Block & block,

Callers 1

describeActionsMethod · 0.85

Calls 12

transformFunction · 0.85
kindMethod · 0.80
strictnessMethod · 0.80
toStringFunction · 0.70
beginMethod · 0.45
endMethod · 0.45
emplace_backMethod · 0.45
getNameMethod · 0.45
getAsofInequalityMethod · 0.45
emptyMethod · 0.45
dumpNamesMethod · 0.45
getSampleBlockMethod · 0.45

Tested by

no test coverage detected