mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-01 12:01:58 +00:00
Fix header for MergeTreeSequentialBlockInputStream.
This commit is contained in:
parent
197afe2eea
commit
197e1cda5d
@ -36,9 +36,6 @@ MergeTreeSequentialBlockInputStream::MergeTreeSequentialBlockInputStream(
|
||||
|
||||
addTotalRowsApprox(data_part->rows_count);
|
||||
|
||||
header = storage.getSampleBlockForColumns(columns_to_read);
|
||||
fixHeader(header);
|
||||
|
||||
/// Add columns because we don't want to read empty blocks
|
||||
injectRequiredColumns(storage, data_part, columns_to_read);
|
||||
NamesAndTypesList columns_for_reader;
|
||||
@ -60,6 +57,18 @@ MergeTreeSequentialBlockInputStream::MergeTreeSequentialBlockInputStream(
|
||||
/* bytes to use AIO (this is hack) */
|
||||
read_with_direct_io ? 1UL : std::numeric_limits<size_t>::max(),
|
||||
DBMS_DEFAULT_BUFFER_SIZE);
|
||||
|
||||
header = storage.getSampleBlockForColumns(columns_to_read);
|
||||
fixHeader(header);
|
||||
|
||||
bool should_reorder = false, should_evaluate_missing_defaults = false;
|
||||
reader->fillMissingColumns(header, should_reorder, should_evaluate_missing_defaults, res.rows());
|
||||
|
||||
if (should_evaluate_missing_defaults)
|
||||
reader->evaluateMissingDefaults(header);
|
||||
|
||||
if (should_reorder)
|
||||
reader->reorderColumns(header, header.getNames(), nullptr);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user