making gcc happy, minor improvements in ORs in JOIN

This commit is contained in:
Ilya Golshtein 2021-08-07 00:52:34 +03:00
parent b03415bd0e
commit d0990e270a
4 changed files with 6 additions and 25 deletions

View File

@ -36,11 +36,7 @@ void CollectJoinOnKeysMatcher::Data::setDisjuncts(const ASTPtr & or_func_ast)
{
const auto * func = or_func_ast->as<ASTFunction>();
const auto * func_args = func->arguments->as<ASTExpressionList>();
TableJoin::Disjuncts v;
for (const auto & child : func_args->children)
{
v.push_back(child);
}
TableJoin::Disjuncts v = func_args->children;
analyzed_join.setDisjuncts(std::move(v));
}

View File

@ -748,15 +748,8 @@ bool HashJoin::addJoinedBlock(const Block & source_block, bool check_limits)
JoinCommon::convertColumnsToNullable(structured_block.block);
}
std::vector<ColumnPtr> join_mask_col_vector(disjuncts_num);
// std::vector<const ColumnUInt8 &> join_mask_vector(disjuncts_num);
bool use_join_mask_col = false;
for (size_t d = 0; d < disjuncts_num; ++d)
{
join_mask_col_vector[d] = JoinCommon::getColumnAsMask(block, condition_mask_column_name_right[d]);
// join_mask_vector[d] = assert_cast<const ColumnUInt8 &>(*(join_mask_col_vector[d])).getData();
if (join_mask_col_vector[d])
use_join_mask_col = true;
}
std::vector<ConstNullMapPtr> null_map_vector;

View File

@ -115,19 +115,11 @@ void TableJoin::addDisjunct(const ASTPtr & ast)
if (!key_names_left[disjunct_num].empty() || !on_filter_condition_asts_left[disjunct_num].empty() || !on_filter_condition_asts_right[disjunct_num].empty())
{
disjunct_num++;
key_names_left.resize(disjunct_num+1);
key_names_right.resize(disjunct_num+1);
on_filter_condition_asts_left.resize(disjunct_num+1);
on_filter_condition_asts_right.resize(disjunct_num+1);
key_names_left.resize(disjunct_num + 1);
key_names_right.resize(disjunct_num + 1);
on_filter_condition_asts_left.resize(disjunct_num + 1);
on_filter_condition_asts_right.resize(disjunct_num + 1);
}
#ifndef NDEBUG
else
{
/// we already have disjunct #0 ,
/// that is why we are skipping left side of the very first AND
assert(!disjunct_num);
}
#endif
}
}

View File

@ -46,7 +46,7 @@ class TableJoin
public:
using NameToTypeMap = std::unordered_map<String, DataTypePtr>;
using Disjuncts = std::deque<const ASTPtr>;
using Disjuncts = ASTs;
private:
/** Query of the form `SELECT expr(x) AS k FROM t1 ANY LEFT JOIN (SELECT expr(x) AS k FROM t2) USING k`