2018-11-28 11:37:12 +00:00
|
|
|
#include "DictionaryBlockInputStreamBase.h"
|
2017-04-28 18:33:31 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
2019-08-03 11:02:40 +00:00
|
|
|
DictionaryBlockInputStreamBase::DictionaryBlockInputStreamBase(size_t rows_count_, size_t max_block_size_)
|
|
|
|
: rows_count(rows_count_), max_block_size(max_block_size_)
|
2017-05-26 16:08:56 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2017-04-28 18:33:31 +00:00
|
|
|
Block DictionaryBlockInputStreamBase::readImpl()
|
|
|
|
{
|
2017-05-26 16:08:56 +00:00
|
|
|
if (next_row == rows_count)
|
2017-04-28 18:33:31 +00:00
|
|
|
return Block();
|
|
|
|
|
2019-02-18 18:51:46 +00:00
|
|
|
size_t block_size = std::min(max_block_size, rows_count - next_row);
|
2017-05-26 16:08:56 +00:00
|
|
|
Block block = getBlock(next_row, block_size);
|
|
|
|
next_row += block_size;
|
2017-04-28 18:33:31 +00:00
|
|
|
return block;
|
|
|
|
}
|
|
|
|
|
2018-02-18 03:23:48 +00:00
|
|
|
Block DictionaryBlockInputStreamBase::getHeader() const
|
2018-01-06 18:10:44 +00:00
|
|
|
{
|
2018-01-09 00:19:58 +00:00
|
|
|
return getBlock(0, 0);
|
2018-01-06 18:10:44 +00:00
|
|
|
}
|
|
|
|
|
2017-05-26 16:08:56 +00:00
|
|
|
}
|