mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-14 02:12:21 +00:00
38 lines
886 B
C++
38 lines
886 B
C++
#pragma once
|
|
|
|
#include <DataStreams/IBlockInputStream.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
class ExpressionActions;
|
|
|
|
/** Executes a certain expression over the block.
|
|
* The expression consists of column identifiers from the block, constants, common functions.
|
|
* For example: hits * 2 + 3, url LIKE '%yandex%'
|
|
* The expression processes each row independently of the others.
|
|
*/
|
|
class ExpressionBlockInputStream : public IBlockInputStream
|
|
{
|
|
private:
|
|
using ExpressionActionsPtr = std::shared_ptr<ExpressionActions>;
|
|
|
|
public:
|
|
ExpressionBlockInputStream(const BlockInputStreamPtr & input, const ExpressionActionsPtr & expression_);
|
|
|
|
String getName() const override;
|
|
Block getTotals() override;
|
|
Block getHeader() const override;
|
|
|
|
protected:
|
|
Block readImpl() override;
|
|
|
|
private:
|
|
ExpressionActionsPtr expression;
|
|
Block cached_header;
|
|
bool initialized = false;
|
|
};
|
|
|
|
}
|