Use table_join->getAllNames in HashJoin.cpp

This commit is contained in:
vdimir 2021-09-13 12:33:25 +03:00 committed by Ilya Golshtein
parent 71b6c9414c
commit f8e8f6da14
2 changed files with 3 additions and 8 deletions

View File

@ -758,13 +758,7 @@ bool HashJoin::addJoinedBlock(const Block & source_block, bool check_limits)
Block block = materializeBlock(source_block);
size_t rows = block.rows();
ColumnRawPtrMap all_key_columns;
{
Names all_key_names_right;
for (const auto & clause : table_join->getClauses())
all_key_names_right.insert(all_key_names_right.end(), clause.key_names_right.begin(), clause.key_names_right.end());
all_key_columns = JoinCommon::materializeColumnsInplaceMap(block, all_key_names_right);
}
ColumnRawPtrMap all_key_columns = JoinCommon::materializeColumnsInplaceMap(block, table_join->getAllNames(JoinTableSide::Right));
Block structured_block = structureRightBlock(block);
size_t total_rows = 0;

View File

@ -71,7 +71,8 @@ bool forAllKeys(OnExpr & expressions, Func callback)
if constexpr (std::is_same_v<SideTag, BothSidesTag>)
assert(expr.key_names_left.size() == expr.key_names_right.size());
for (size_t i = 0; i < expr.key_names_left.size(); ++i)
size_t sz = !std::is_same_v<SideTag, RightSideTag> ? expr.key_names_left.size() : expr.key_names_right.size();
for (size_t i = 0; i < sz; ++i)
{
bool cont;
if constexpr (std::is_same_v<SideTag, BothSidesTag>)