Query:: COUNT(*) added to logical planning and execution

Reviewers: mislav.bradac, buda, teon.banek

Reviewed By: mislav.bradac, teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D353
This commit is contained in:
florijan
2017-05-06 17:57:39 +02:00
parent 871b81656b
commit 0866fdcb0c
3 changed files with 37 additions and 18 deletions

View File

@@ -1059,7 +1059,17 @@ void Aggregate::AggregateCursor::Update(
auto agg_elem_it = self_.aggregations_.begin();
for (; count_it < agg_value.counts_.end();
count_it++, value_it++, agg_elem_it++) {
std::get<0>(*agg_elem_it)->Accept(evaluator);
// COUNT(*) is the only case where input expression is optional
// handle it here
auto input_expr_ptr = std::get<0>(*agg_elem_it);
if (!input_expr_ptr) {
*count_it += 1;
*value_it = *count_it;
continue;
}
input_expr_ptr->Accept(evaluator);
TypedValue input_value = evaluator.PopBack();
// Aggregations skip Null input values.