Remove nullable_left/right_side flags from Hash/MergeJoin

This commit is contained in:
vdimir 2022-02-15 11:15:50 +00:00
parent 2de6eaf838
commit 510a909d0d
No known key found for this signature in database
GPG Key ID: 6EE4CE2BEDC51862
4 changed files with 0 additions and 28 deletions

View File

@ -232,8 +232,6 @@ HashJoin::HashJoin(std::shared_ptr<TableJoin> table_join_, const Block & right_s
: table_join(table_join_)
, kind(table_join->kind())
, strictness(table_join->strictness())
, nullable_right_side(false)
, nullable_left_side(false)
, any_take_last_row(any_take_last_row_)
, asof_inequality(table_join->getAsofInequality())
, data(std::make_shared<RightTableData>())
@ -273,9 +271,6 @@ HashJoin::HashJoin(std::shared_ptr<TableJoin> table_join_, const Block & right_s
JoinCommon::createMissedColumns(sample_block_with_columns_to_add);
if (nullable_right_side)
JoinCommon::convertColumnsToNullable(sample_block_with_columns_to_add);
size_t disjuncts_num = table_join->getClauses().size();
data->maps.resize(disjuncts_num);
key_sizes.reserve(disjuncts_num);
@ -716,12 +711,6 @@ void HashJoin::initRightBlockStructure(Block & saved_block_sample)
saved_block_sample.insert(column);
}
}
if (nullable_right_side)
{
JoinCommon::convertColumnsToNullable(saved_block_sample, (isFull(kind) && !multiple_disjuncts ? right_table_keys.columns() : 0));
}
}
Block HashJoin::structureRightBlock(const Block & block) const
@ -1473,9 +1462,6 @@ void HashJoin::joinBlockImpl(
if constexpr (jf.right || jf.full)
{
materializeBlockInplace(block);
if (nullable_left_side)
JoinCommon::convertColumnsToNullable(block);
}
/** For LEFT/INNER JOIN, the saved blocks do not contain keys.
@ -1751,8 +1737,6 @@ void HashJoin::joinBlock(Block & block, ExtraBlockPtr & not_processed)
if (kind == ASTTableJoin::Kind::Right || kind == ASTTableJoin::Kind::Full)
{
materializeBlockInplace(block);
if (nullable_left_side)
JoinCommon::convertColumnsToNullable(block);
}
if (overDictionary())

View File

@ -360,8 +360,6 @@ private:
/// This join was created from StorageJoin and it is already filled.
bool from_storage_join = false;
bool nullable_right_side; /// In case of LEFT and FULL joins, if use_nulls, convert right-side columns to Nullable.
bool nullable_left_side; /// In case of RIGHT and FULL joins, if use_nulls, convert left-side columns to Nullable.
bool any_take_last_row; /// Overwrite existing values when encountering the same key again
std::optional<TypeIndex> asof_type;
ASOF::Inequality asof_inequality;

View File

@ -465,8 +465,6 @@ MergeJoin::MergeJoin(std::shared_ptr<TableJoin> table_join_, const Block & right
: table_join(table_join_)
, size_limits(table_join->sizeLimits())
, right_sample_block(right_sample_block_)
, nullable_right_side(false)
, nullable_left_side(false)
, is_any_join(table_join->strictness() == ASTTableJoin::Strictness::Any)
, is_all_join(table_join->strictness() == ASTTableJoin::Strictness::All)
, is_semi_join(table_join->strictness() == ASTTableJoin::Strictness::Semi)
@ -545,9 +543,6 @@ MergeJoin::MergeJoin(std::shared_ptr<TableJoin> table_join_, const Block & right
JoinCommon::createMissedColumns(right_columns_to_add);
if (nullable_right_side)
JoinCommon::convertColumnsToNullable(right_columns_to_add);
makeSortAndMerge(key_names_left, left_sort_description, left_merge_description);
makeSortAndMerge(key_names_right, right_sort_description, right_merge_description);
@ -710,9 +705,6 @@ void MergeJoin::joinBlock(Block & block, ExtraBlockPtr & not_processed)
JoinCommon::convertToFullColumnsInplace(block, key_names_left, false);
sortBlock(block, left_sort_description);
if (nullable_left_side)
JoinCommon::convertColumnsToNullable(block);
}
if (!not_processed && left_blocks_buffer)

View File

@ -102,8 +102,6 @@ private:
SortedBlocksWriter::SortedFiles flushed_right_blocks;
Block totals;
std::atomic<bool> is_in_memory{true};
const bool nullable_right_side;
const bool nullable_left_side;
const bool is_any_join;
const bool is_all_join;
const bool is_semi_join;