Review fixes

This commit is contained in:
vdimir 2023-01-23 18:09:26 +00:00
parent dac86d48d2
commit 5be2b31e67
No known key found for this signature in database
GPG Key ID: 6EE4CE2BEDC51862
4 changed files with 9 additions and 24 deletions

View File

@ -166,15 +166,15 @@ public:
AccumulatedBlockReader startJoining()
{
LOG_TRACE(log, "Joining file bucket {}", idx);
{
std::unique_lock<std::mutex> left_lock(left_file_mutex);
std::unique_lock<std::mutex> right_lock(right_file_mutex);
std::unique_lock<std::mutex> left_lock(left_file_mutex);
std::unique_lock<std::mutex> right_lock(right_file_mutex);
left_file.finishWriting();
right_file.finishWriting();
state = State::JOINING_BLOCKS;
left_file.finishWriting();
right_file.finishWriting();
state = State::JOINING_BLOCKS;
}
return AccumulatedBlockReader(right_file, right_file_mutex);
}

View File

@ -116,6 +116,7 @@ private:
size_t getNumBuckets() const;
Buckets getCurrentBuckets() const;
/// Structure block to store in the HashJoin according to sample_block.
Block prepareRightBlock(const Block & block);
Poco::Logger * log;

View File

@ -676,20 +676,6 @@ void HashJoin::initRightBlockStructure(Block & saved_block_sample)
}
}
Block HashJoin::structureRightBlock(const Block & block) const
{
Block structured_block;
for (const auto & sample_column : savedBlockSample().getColumnsWithTypeAndName())
{
ColumnWithTypeAndName column = block.getByName(sample_column.name);
if (sample_column.column->isNullable())
JoinCommon::convertColumnToNullable(column);
structured_block.insert(column);
}
return structured_block;
}
Block HashJoin::prepareRightBlock(const Block & block, const Block & saved_block_sample_)
{
Block structured_block;

View File

@ -356,9 +356,7 @@ public:
RightTableDataPtr getJoinedData() const { return data; }
BlocksList releaseJoinedBlocks(bool restructure = false);
Block structureRightBlock(const Block & block) const;
/// Modify (structure) right block to save it in block list
/// Modify right block (update structure according to sample block) to save it in block list
static Block prepareRightBlock(const Block & block, const Block & saved_block_sample_);
Block prepareRightBlock(const Block & block) const;