Compare commits

...

1 Commits

Author SHA1 Message Date
antoniofilipovic
b7c8dc8ae7 add files modified with hook 2022-07-15 11:02:46 +02:00
2 changed files with 8 additions and 1 deletions
src/query

View File

@ -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) {

View File

@ -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: