ClickHouse/dbms/include/DB/DataStreams/LimitBlockInputStream.h
2011-09-04 21:23:19 +00:00

32 lines
545 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"; }
private:
BlockInputStreamPtr input;
size_t limit;
size_t offset;
size_t pos;
};
}