ClickHouse/dbms/include/DB/DataStreams/RowInputStreamFromBlockInputStream.h
2013-05-04 04:05:15 +00:00

31 lines
675 B
C++

#pragma once
#include <DB/DataStreams/IBlockInputStream.h>
#include <DB/DataStreams/IRowInputStream.h>
namespace DB
{
/** Преобразует поток для чтения данных по блокам в поток для чтения данных по строкам.
*/
class RowInputStreamFromBlockInputStream : public IRowInputStream
{
public:
explicit RowInputStreamFromBlockInputStream(BlockInputStreamPtr block_input_);
bool read(Row & row);
void readPrefix() { block_input->readPrefix(); };
void readSuffix() { block_input->readSuffix(); };
private:
BlockInputStreamPtr block_input;
size_t pos;
size_t current_rows;
Block current_block;
};
}