mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-16 20:53:27 +00:00
33 lines
757 B
C++
33 lines
757 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_);
|
|
Row read();
|
|
|
|
void readPrefix() { block_input->readPrefix(); };
|
|
void readSuffix() { block_input->readSuffix(); };
|
|
|
|
RowInputStreamPtr clone() { return new RowInputStreamFromBlockInputStream(block_input); }
|
|
|
|
private:
|
|
BlockInputStreamPtr block_input;
|
|
|
|
size_t pos;
|
|
size_t current_rows;
|
|
Block current_block;
|
|
};
|
|
|
|
}
|