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:
parent
60367a287e
commit
726ae5da6a
@ -278,7 +278,7 @@ class ReturnBodyContext : public HierarchicalTreeVisitor {
|
|||||||
|
|
||||||
#define VISIT_BINARY_OPERATOR(BinaryOperator) \
|
#define VISIT_BINARY_OPERATOR(BinaryOperator) \
|
||||||
bool PostVisit(BinaryOperator &op) override { \
|
bool PostVisit(BinaryOperator &op) override { \
|
||||||
CHECK(has_aggregation_.size() >= 2U) \
|
CHECK(has_aggregation_.size() >= 2U) \
|
||||||
<< "Expected at least 2 has_aggregation_ flags."; \
|
<< "Expected at least 2 has_aggregation_ flags."; \
|
||||||
/* has_aggregation_ stack is reversed, last result is from the 2nd */ \
|
/* has_aggregation_ stack is reversed, last result is from the 2nd */ \
|
||||||
/* expression. */ \
|
/* expression. */ \
|
||||||
@ -350,6 +350,15 @@ class ReturnBodyContext : public HierarchicalTreeVisitor {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool PostVisit(RegexMatch ®ex_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.
|
||||||
|
Loading…
Reference in New Issue
Block a user