mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 17:41:59 +00:00
ISSUES-2581 get pointer to max_blocls
This commit is contained in:
parent
8c413e3f1f
commit
28102bc3b5
@ -137,7 +137,7 @@ BlockInputStreams MergeTreeDataSelectExecutor::read(
|
||||
const Context & context,
|
||||
const size_t max_block_size,
|
||||
const unsigned num_streams,
|
||||
const PartitionIdToMaxBlock & max_blocks_number_to_read) const
|
||||
const PartitionIdToMaxBlock* max_blocks_number_to_read) const
|
||||
{
|
||||
return readFromParts(
|
||||
data.getDataPartsVector(), column_names_to_return, query_info, context,
|
||||
@ -151,7 +151,7 @@ BlockInputStreams MergeTreeDataSelectExecutor::readFromParts(
|
||||
const Context & context,
|
||||
const size_t max_block_size,
|
||||
const unsigned num_streams,
|
||||
const PartitionIdToMaxBlock & max_blocks_number_to_read) const
|
||||
const PartitionIdToMaxBlock* max_blocks_number_to_read) const
|
||||
{
|
||||
size_t part_index = 0;
|
||||
|
||||
@ -271,9 +271,12 @@ BlockInputStreams MergeTreeDataSelectExecutor::readFromParts(
|
||||
part->minmax_idx.parallelogram, data.minmax_idx_column_types))
|
||||
continue;
|
||||
|
||||
auto blocks_iterator = max_blocks_number_to_read.find(part->info.partition_id);
|
||||
if (blocks_iterator != max_blocks_number_to_read.end() && part->info.max_block > blocks_iterator->second)
|
||||
continue;
|
||||
if (max_blocks_number_to_read)
|
||||
{
|
||||
auto blocks_iterator = max_blocks_number_to_read->find(part->info.partition_id);
|
||||
if (blocks_iterator != max_blocks_number_to_read->end() && part->info.max_block > blocks_iterator->second)
|
||||
continue;
|
||||
}
|
||||
|
||||
parts.push_back(part);
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ public:
|
||||
const Context & context,
|
||||
size_t max_block_size,
|
||||
unsigned num_streams,
|
||||
const PartitionIdToMaxBlock & max_blocks_number_to_read) const;
|
||||
const PartitionIdToMaxBlock* max_blocks_number_to_read = nullptr) const;
|
||||
|
||||
BlockInputStreams readFromParts(
|
||||
MergeTreeData::DataPartsVector parts,
|
||||
@ -39,7 +39,7 @@ public:
|
||||
const Context & context,
|
||||
size_t max_block_size,
|
||||
unsigned num_streams,
|
||||
const PartitionIdToMaxBlock & max_blocks_number_to_read) const;
|
||||
const PartitionIdToMaxBlock* max_blocks_number_to_read = nullptr) const;
|
||||
|
||||
private:
|
||||
MergeTreeData & data;
|
||||
|
@ -27,7 +27,7 @@ public:
|
||||
unsigned num_streams) override
|
||||
{
|
||||
return MergeTreeDataSelectExecutor(part->storage).readFromParts(
|
||||
{part}, column_names, query_info, context, max_block_size, num_streams, {});
|
||||
{part}, column_names, query_info, context, max_block_size, num_streams);
|
||||
}
|
||||
|
||||
bool supportsIndexForIn() const override { return true; }
|
||||
|
@ -114,7 +114,7 @@ BlockInputStreams StorageMergeTree::read(
|
||||
const size_t max_block_size,
|
||||
const unsigned num_streams)
|
||||
{
|
||||
return reader.read(column_names, query_info, context, max_block_size, num_streams, {});
|
||||
return reader.read(column_names, query_info, context, max_block_size, num_streams);
|
||||
}
|
||||
|
||||
BlockOutputStreamPtr StorageMergeTree::write(const ASTPtr & /*query*/, const Settings & /*settings*/)
|
||||
|
@ -2995,7 +2995,10 @@ BlockInputStreams StorageReplicatedMergeTree::read(
|
||||
}
|
||||
}
|
||||
|
||||
return reader.read(column_names, query_info, context, max_block_size, num_streams, max_added_blocks);
|
||||
if (max_added_blocks.empty())
|
||||
return reader.read(column_names, query_info, context, max_block_size, num_streams);
|
||||
else
|
||||
return reader.read(column_names, query_info, context, max_block_size, num_streams, &max_added_blocks);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user