| 1 | #include "DictionaryBlockInputStreamBase.h" |
|---|---|
| 2 | |
| 3 | namespace DB |
| 4 | { |
| 5 | DictionaryBlockInputStreamBase::DictionaryBlockInputStreamBase(size_t rows_count_, size_t max_block_size_) |
| 6 | : rows_count(rows_count_), max_block_size(max_block_size_) |
| 7 | { |
| 8 | } |
| 9 | |
| 10 | Block DictionaryBlockInputStreamBase::readImpl() |
| 11 | { |
| 12 | if (next_row == rows_count) |
| 13 | return Block(); |
| 14 | |
| 15 | size_t block_size = std::min(max_block_size, rows_count - next_row); |
| 16 | Block block = getBlock(next_row, block_size); |
| 17 | next_row += block_size; |
| 18 | return block; |
| 19 | } |
| 20 | |
| 21 | Block DictionaryBlockInputStreamBase::getHeader() const |
| 22 | { |
| 23 | return getBlock(0, 0); |
| 24 | } |
| 25 | |
| 26 | } |
| 27 |