Compare commits
1 Commits
master
...
E130-MG-gr
Author | SHA1 | Date | |
---|---|---|---|
|
b7c8dc8ae7 |
src/query
@ -2108,6 +2108,10 @@ antlrcpp::Any CypherMainVisitor::visitFunctionInvocation(MemgraphCypher::Functio
|
||||
return static_cast<Expression *>(
|
||||
storage_->Create<Aggregation>(expressions[0], nullptr, Aggregation::Op::COLLECT_LIST));
|
||||
}
|
||||
if (function_name == Aggregation::kProject) {
|
||||
return static_cast<Expression *>(
|
||||
storage_->Create<Aggregation>(expressions[0], nullptr, Aggregation::Op::PROJECT));
|
||||
}
|
||||
}
|
||||
|
||||
if (expressions.size() == 2U && function_name == Aggregation::kCollect) {
|
||||
|
@ -2608,9 +2608,10 @@ TypedValue DefaultAggregationOpValue(const Aggregate::Element &element, utils::M
|
||||
case Aggregation::Op::AVG:
|
||||
return TypedValue(memory);
|
||||
case Aggregation::Op::COLLECT_LIST:
|
||||
return TypedValue(TypedValue::TVector(memory));
|
||||
case Aggregation::Op::COLLECT_MAP:
|
||||
return TypedValue(TypedValue::TMap(memory));
|
||||
case Aggregation::Op::PROJECT: // add here graph as aggregation value
|
||||
return TypedValue(TypedValue::TVector(memory));
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
@ -2812,6 +2813,7 @@ class AggregateCursor : public Cursor {
|
||||
*value_it = 1;
|
||||
break;
|
||||
case Aggregation::Op::COLLECT_LIST:
|
||||
case Aggregation::Op::PROJECT:
|
||||
value_it->ValueList().push_back(input_value);
|
||||
break;
|
||||
case Aggregation::Op::COLLECT_MAP:
|
||||
@ -2860,6 +2862,7 @@ class AggregateCursor : public Cursor {
|
||||
*value_it = *value_it + input_value;
|
||||
break;
|
||||
case Aggregation::Op::COLLECT_LIST:
|
||||
case Aggregation::Op::PROJECT:
|
||||
value_it->ValueList().push_back(input_value);
|
||||
break;
|
||||
case Aggregation::Op::COLLECT_MAP:
|
||||
|
Loading…
Reference in New Issue
Block a user