5 #ifndef JODA_AGG_ACTIONS_H
6 #define JODA_AGG_ACTIONS_H
15 #include "../grammar/Grammar.h"
16 #include "../states/States.h"
87 template <
typename Input>
90 std::string
pointer = in.string();
100 auto beforeSize = state.
valprov.size();
103 DCHECK_EQ(beforeSize - 1, state.
valprov.size());
110 template <
typename Input>
113 std::string as = in.string();
120 template <
typename Input>
123 std::unique_ptr<joda::query::IAggregator> agg =
nullptr;
130 agg = std::make_unique<joda::query::AverageAggregator>(
134 agg = std::make_unique<joda::query::CountAggregator>(
138 agg = std::make_unique<joda::query::SumAggregator>(
142 agg = std::make_unique<joda::query::AttributeStatAggregator>(
146 agg = std::make_unique<joda::query::DistinctAggregator>(
150 agg = std::make_unique<joda::query::MinAggregator>(
154 agg = std::make_unique<joda::query::MaxAggregator>(
158 agg = std::make_unique<joda::query::CollectAggregator>(
162 agg = std::make_unique<joda::query::HistogramAggregator>(
166 throw tao::pegtl::parse_error(e.
what(), in);
168 DCHECK(agg !=
nullptr);
170 state.
aggs.push_back(std::move(agg));
172 auto groupAgg = std::make_unique<joda::query::GroupAggregator>(
175 groupAgg->setGroupAs(state.
groupAs);
178 state.
aggs.push_back(std::move(groupAgg));
180 DCHECK(agg ==
nullptr);
Definition: IValueProvider.h:46
virtual const char * what() const
Definition: IValueProvider.h:49
@ COLLECT
Definition: Agg_State.h:20
@ MAX
Definition: Agg_State.h:19
@ HISTOGRAM
Definition: Agg_State.h:21
@ AVG
Definition: Agg_State.h:13
@ MIN
Definition: Agg_State.h:18
@ SUM
Definition: Agg_State.h:15
@ DISTINCT
Definition: Agg_State.h:17
@ COUNT
Definition: Agg_State.h:14
@ ATTSTAT
Definition: Agg_State.h:16
@ NOAGG
Definition: Agg_State.h:12
static void apply(const Input &in, aggState &state)
Definition: Agg_Actions.h:111
static void apply0(aggState &state)
Definition: Agg_Actions.h:97
static void apply0(aggState &state)
Definition: Agg_Actions.h:29
static void apply0(aggState &state)
Definition: Agg_Actions.h:36
static void apply0(aggState &state)
Definition: Agg_Actions.h:64
static void apply0(aggState &state)
Definition: Agg_Actions.h:43
static void apply0(aggState &state)
Definition: Agg_Actions.h:22
static void apply0(aggState &state)
Definition: Agg_Actions.h:79
static void apply0(aggState &state)
Definition: Agg_Actions.h:71
static void apply0(aggState &state)
Definition: Agg_Actions.h:57
static void apply0(aggState &state)
Definition: Agg_Actions.h:50
static void apply(const Input &in, aggState &state)
Definition: Agg_Actions.h:121
static void apply(const Input &in, aggState &state)
Definition: Agg_Actions.h:88
Definition: Agg_State.h:24
std::string groupAs
Definition: Agg_State.h:50
std::vector< std::unique_ptr< joda::query::IValueProvider > > valprov
Definition: Agg_State.h:44
std::vector< std::unique_ptr< joda::query::IAggregator > > aggs
Definition: Agg_State.h:47
std::string toPointer
Definition: Agg_State.h:45
std::unique_ptr< joda::query::IValueProvider > groupedByValue
Definition: Agg_State.h:49
aggFunction aggfun
Definition: Agg_State.h:46
Definition: Literals.h:27