mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 08:32:02 +00:00
34 lines
635 B
C++
34 lines
635 B
C++
#pragma once
|
|
|
|
#include <Poco/SharedPtr.h>
|
|
|
|
#include <DB/DataStreams/IProfilingBlockInputStream.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
using Poco::SharedPtr;
|
|
|
|
|
|
/** Реализует реляционную операцию LIMIT.
|
|
*/
|
|
class LimitBlockInputStream : public IProfilingBlockInputStream
|
|
{
|
|
public:
|
|
LimitBlockInputStream(BlockInputStreamPtr input_, size_t limit_, size_t offset_ = 0);
|
|
Block readImpl();
|
|
|
|
String getName() const { return "LimitBlockInputStream"; }
|
|
|
|
BlockInputStreamPtr clone() { return new LimitBlockInputStream(input, limit, offset); }
|
|
|
|
private:
|
|
BlockInputStreamPtr input;
|
|
size_t limit;
|
|
size_t offset;
|
|
size_t pos;
|
|
};
|
|
|
|
}
|