mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 17:41:59 +00:00
Merge pull request #6019 from yandex/fix-max-rows-to-read-without-uniform-read-distribution
Fixed error with calculating of max_rows_to_read if the setting merge_tree_uniform_read_distribution is set to zero.
This commit is contained in:
commit
b4306c13cd
@ -46,13 +46,13 @@ MergeTreeSelectBlockInputStream::MergeTreeSelectBlockInputStream(
|
||||
for (const auto & range : all_mark_ranges)
|
||||
total_marks_count += range.end - range.begin;
|
||||
|
||||
size_t total_rows = data_part->index_granularity.getTotalRows();
|
||||
size_t total_rows = data_part->index_granularity.getRowsCountInRanges(all_mark_ranges);
|
||||
|
||||
if (!quiet)
|
||||
LOG_TRACE(log, "Reading " << all_mark_ranges.size() << " ranges from part " << data_part->name
|
||||
<< ", approx. " << total_rows
|
||||
<< (all_mark_ranges.size() > 1
|
||||
? ", up to " + toString(data_part->index_granularity.getRowsCountInRanges(all_mark_ranges))
|
||||
? ", up to " + toString(total_rows)
|
||||
: "")
|
||||
<< " rows starting from " << data_part->index_granularity.getMarkStartingRow(all_mark_ranges.front().begin));
|
||||
|
||||
|
@ -0,0 +1,2 @@
|
||||
1000000
|
||||
1000000
|
@ -0,0 +1,22 @@
|
||||
DROP TABLE IF EXISTS merge_tree;
|
||||
CREATE TABLE merge_tree (x UInt8) ENGINE = MergeTree ORDER BY x;
|
||||
INSERT INTO merge_tree SELECT 0 FROM numbers(1000000);
|
||||
|
||||
SET max_threads = 4;
|
||||
SET max_rows_to_read = 1100000;
|
||||
|
||||
SET merge_tree_uniform_read_distribution = 1;
|
||||
SELECT count() FROM merge_tree;
|
||||
|
||||
SET merge_tree_uniform_read_distribution = 0;
|
||||
SELECT count() FROM merge_tree;
|
||||
|
||||
SET max_rows_to_read = 900000;
|
||||
|
||||
SET merge_tree_uniform_read_distribution = 1;
|
||||
SELECT count() FROM merge_tree; -- { serverError 158 }
|
||||
|
||||
SET merge_tree_uniform_read_distribution = 0;
|
||||
SELECT count() FROM merge_tree; -- { serverError 158 }
|
||||
|
||||
DROP TABLE merge_tree;
|
Loading…
Reference in New Issue
Block a user