Check for aggregations when planning RegexMatch

Reviewers: mferencevic, ipaljak, dsantl

Reviewed By: mferencevic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2344
This commit is contained in:
Teon Banek 2019-09-02 16:44:02 +02:00
parent 60367a287e
commit 726ae5da6a

View File

@ -350,6 +350,15 @@ class ReturnBodyContext : public HierarchicalTreeVisitor {
return true; return true;
} }
bool PostVisit(RegexMatch &regex_match) override {
CHECK(has_aggregation_.size() >= 2U)
<< "Expected 2 has_aggregation_ flags for RegexMatch arguments";
bool has_aggr = has_aggregation_.back();
has_aggregation_.pop_back();
has_aggregation_.back() |= has_aggr;
return true;
}
// Creates NamedExpression with an Identifier for each user declared symbol. // Creates NamedExpression with an Identifier for each user declared symbol.
// This should be used when body.all_identifiers is true, to generate // This should be used when body.all_identifiers is true, to generate
// expressions for Produce operator. // expressions for Produce operator.