mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 00:30:49 +00:00
fix reading in general case
This commit is contained in:
parent
424e3f12e2
commit
6f484734c2
@ -44,6 +44,8 @@ struct MergeTreeReaderSettings
|
||||
bool enable_multiple_prewhere_read_steps = false;
|
||||
/// If true, try to lower size of read buffer according to granule size and compressed block size.
|
||||
bool adjust_read_buffer_size = true;
|
||||
/// If true, it's allowed to read the whole part without reading marks.
|
||||
bool can_read_part_without_marks = false;
|
||||
};
|
||||
|
||||
struct MergeTreeWriterSettings
|
||||
|
@ -43,7 +43,9 @@ MergeTreeReaderWide::MergeTreeReaderWide(
|
||||
mark_ranges_,
|
||||
settings_,
|
||||
avg_value_size_hints_)
|
||||
, read_whole_part(all_mark_ranges.isOneRangeForWholePart(data_part_info_for_read->getMarksCount()))
|
||||
, read_without_marks(
|
||||
settings.can_read_part_without_marks
|
||||
&& all_mark_ranges.isOneRangeForWholePart(data_part_info_for_read->getMarksCount()))
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -254,7 +256,7 @@ void MergeTreeReaderWide::addStreams(
|
||||
std::move(marks_loader), profile_callback, clock_type);
|
||||
};
|
||||
|
||||
if (read_whole_part)
|
||||
if (read_without_marks)
|
||||
{
|
||||
streams.emplace(*stream_name, create_stream.operator()<MergeTreeReaderStreamSingleColumnWholePart>());
|
||||
}
|
||||
@ -340,7 +342,7 @@ void MergeTreeReaderWide::prefetchForColumn(
|
||||
|
||||
if (stream_name && !prefetched_streams.contains(*stream_name))
|
||||
{
|
||||
bool seek_to_mark = !continue_reading && !read_whole_part;
|
||||
bool seek_to_mark = !continue_reading && !read_without_marks;
|
||||
|
||||
if (ReadBuffer * buf = getStream(false, substream_path, data_part_info_for_read->getChecksums(), streams, name_and_type, from_mark, seek_to_mark, current_task_last_mark, cache))
|
||||
{
|
||||
@ -365,7 +367,7 @@ void MergeTreeReaderWide::readData(
|
||||
|
||||
deserialize_settings.getter = [&](const ISerialization::SubstreamPath & substream_path)
|
||||
{
|
||||
bool seek_to_mark = !was_prefetched && !continue_reading && !read_whole_part;
|
||||
bool seek_to_mark = !was_prefetched && !continue_reading && !read_without_marks;
|
||||
|
||||
return getStream(
|
||||
/* seek_to_start = */false, substream_path,
|
||||
|
@ -73,7 +73,7 @@ private:
|
||||
std::unordered_map<String, ISerialization::SubstreamsCache> caches;
|
||||
std::unordered_set<std::string> prefetched_streams;
|
||||
ssize_t prefetched_from_mark = -1;
|
||||
bool read_whole_part = false;
|
||||
bool read_without_marks = false;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -174,6 +174,7 @@ MergeTreeSequentialSource::MergeTreeSequentialSource(
|
||||
.read_settings = read_settings,
|
||||
.save_marks_in_cache = false,
|
||||
.apply_deleted_mask = apply_deleted_mask,
|
||||
.can_read_part_without_marks = true,
|
||||
};
|
||||
|
||||
if (!mark_ranges)
|
||||
|
Loading…
Reference in New Issue
Block a user