ClickHouse/dbms/src/DataStreams/ExpressionBlockInputStream.h

36 lines
849 B
C++
Raw Normal View History

2011-08-14 00:49:30 +00:00
#pragma once
#include <DataStreams/IProfilingBlockInputStream.h>
2011-08-14 00:49:30 +00:00
namespace DB
{
2016-01-13 00:32:59 +00:00
class ExpressionActions;
2011-08-14 00:49:30 +00:00
2017-05-13 22:19:04 +00:00
/** 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.
2011-08-14 00:49:30 +00:00
*/
2011-09-04 21:23:19 +00:00
class ExpressionBlockInputStream : public IProfilingBlockInputStream
2011-08-14 00:49:30 +00:00
{
2016-01-13 00:32:59 +00:00
private:
using ExpressionActionsPtr = std::shared_ptr<ExpressionActions>;
2016-01-13 00:32:59 +00:00
public:
ExpressionBlockInputStream(const BlockInputStreamPtr & input, const ExpressionActionsPtr & expression_);
String getName() const override;
Block getTotals() override;
Block getHeader() const override;
2012-10-20 02:10:47 +00:00
protected:
Block readImpl() override;
2011-08-14 00:49:30 +00:00
private:
ExpressionActionsPtr expression;
2011-08-14 00:49:30 +00:00
};
}