#pragma once #include #include namespace DB { /// Reader for compact parts, that uses one buffer for /// all column and doesn't support parallel prefetch of columns. /// It's suitable for compact parts with small size of stripe. class MergeTreeReaderCompactSingleBuffer : public MergeTreeReaderCompact { public: template explicit MergeTreeReaderCompactSingleBuffer(Args &&... args) : MergeTreeReaderCompact{std::forward(args)...} { fillColumnPositions(); } /// Returns the number of rows has been read or zero if there is no columns to read. /// If continue_reading is true, continue reading from last state, otherwise seek to from_mark size_t readRows(size_t from_mark, size_t current_task_last_mark, bool continue_reading, size_t max_rows_to_read, Columns & res_columns) override; private: void init(); bool initialized = false; std::unique_ptr stream; }; }