2011-08-28 02:22:23 +00:00
|
|
|
#pragma once
|
2010-03-04 19:20:28 +00:00
|
|
|
|
|
|
|
#include <DB/DataStreams/IBlockInputStream.h>
|
|
|
|
#include <DB/DataStreams/IRowInputStream.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
/** Преобразует поток для чтения данных по блокам в поток для чтения данных по строкам.
|
|
|
|
*/
|
|
|
|
class RowInputStreamFromBlockInputStream : public IRowInputStream
|
|
|
|
{
|
|
|
|
public:
|
2011-10-24 12:10:59 +00:00
|
|
|
explicit RowInputStreamFromBlockInputStream(BlockInputStreamPtr block_input_);
|
2010-03-04 19:20:28 +00:00
|
|
|
|
2014-11-08 23:52:18 +00:00
|
|
|
bool read(Row & row) override;
|
|
|
|
|
|
|
|
void readPrefix() override { block_input->readPrefix(); };
|
|
|
|
void readSuffix() override { block_input->readSuffix(); };
|
2011-10-31 06:37:12 +00:00
|
|
|
|
2010-03-04 19:20:28 +00:00
|
|
|
private:
|
2011-10-24 12:10:59 +00:00
|
|
|
BlockInputStreamPtr block_input;
|
2010-03-04 19:20:28 +00:00
|
|
|
|
|
|
|
size_t pos;
|
|
|
|
size_t current_rows;
|
|
|
|
Block current_block;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|