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

33 lines
757 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
Row read();
2011-10-31 06:37:12 +00:00
void readPrefix() { block_input->readPrefix(); };
void readSuffix() { block_input->readSuffix(); };
2011-10-24 12:10:59 +00:00
RowInputStreamPtr clone() { return new RowInputStreamFromBlockInputStream(block_input); }
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;
};
}