2011-08-14 00:49:30 +00:00
|
|
|
#pragma once
|
|
|
|
|
2017-04-01 09:19:00 +00:00
|
|
|
#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:
|
2017-04-01 07:20:54 +00:00
|
|
|
using ExpressionActionsPtr = std::shared_ptr<ExpressionActions>;
|
2013-05-03 10:20:53 +00:00
|
|
|
|
2016-01-13 00:32:59 +00:00
|
|
|
public:
|
2017-09-08 03:47:27 +00:00
|
|
|
ExpressionBlockInputStream(const BlockInputStreamPtr & input, const ExpressionActionsPtr & expression_);
|
2013-09-08 08:27:06 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
String getName() const override;
|
2018-02-23 10:43:24 +00:00
|
|
|
Block getTotals() override;
|
2018-02-18 03:23:48 +00:00
|
|
|
Block getHeader() const override;
|
2013-09-08 08:27:06 +00:00
|
|
|
|
2012-10-20 02:10:47 +00:00
|
|
|
protected:
|
2017-04-01 07:20:54 +00:00
|
|
|
Block readImpl() override;
|
2011-08-14 00:49:30 +00:00
|
|
|
|
|
|
|
private:
|
2017-04-01 07:20:54 +00:00
|
|
|
ExpressionActionsPtr expression;
|
2011-08-14 00:49:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|