ClickHouse/src/Interpreters/GatherFunctionQuantileVisitor.h

35 lines
788 B
C++
Raw Normal View History

#pragma once
#include <Parsers/ASTFunction.h>
#include <Parsers/IAST.h>
#include <Interpreters/InDepthNodeVisitor.h>
#include <AggregateFunctions/AggregateFunctionQuantile.h>
namespace DB
{
2021-08-25 08:24:53 +00:00
/// Gather all the `quantile*` functions
class GatherFunctionQuantileData
{
public:
struct FuseQuantileAggregatesData
{
2021-08-25 08:24:53 +00:00
std::unordered_map<String, std::vector<ASTPtr *>> arg_map_function;
void addFuncNode(ASTPtr & ast);
};
using TypeToVisit = ASTFunction;
std::unordered_map<String, FuseQuantileAggregatesData> fuse_quantile;
2021-08-25 08:24:53 +00:00
void visit(ASTFunction & function, ASTPtr & ast);
static String getFusedName(const String & func_name);
};
using GatherFunctionQuantileVisitor = InDepthNodeVisitor<OneTypeMatcher<GatherFunctionQuantileData>, true>;
}