ClickHouse/dbms/include/DB/DataStreams/RowInputStreamFromBlockInputStream.h

32 lines
703 B
C
Raw Normal View History

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
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;
};
}