| 27 | { |
| 28 | |
| 29 | std::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 | |
| 70 | std::vector<size_t> getPermutationForBlock( |
| 71 | const Block & block, |
no test coverage detected