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

View File

@@ -2108,6 +2108,10 @@ antlrcpp::Any CypherMainVisitor::visitFunctionInvocation(MemgraphCypher::Functio
return static_cast<Expression *>( return static_cast<Expression *>(
storage_->Create<Aggregation>(expressions[0], nullptr, Aggregation::Op::COLLECT_LIST)); 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) { 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: case Aggregation::Op::AVG:
return TypedValue(memory); return TypedValue(memory);
case Aggregation::Op::COLLECT_LIST: case Aggregation::Op::COLLECT_LIST:
return TypedValue(TypedValue::TVector(memory));
case Aggregation::Op::COLLECT_MAP: case Aggregation::Op::COLLECT_MAP:
return TypedValue(TypedValue::TMap(memory)); return TypedValue(TypedValue::TMap(memory));
case Aggregation::Op::PROJECT: // add here graph as aggregation value
return TypedValue(TypedValue::TVector(memory));
} }
} }
} // namespace } // namespace
@@ -2812,6 +2813,7 @@ class AggregateCursor : public Cursor {
*value_it = 1; *value_it = 1;
break; break;
case Aggregation::Op::COLLECT_LIST: case Aggregation::Op::COLLECT_LIST:
case Aggregation::Op::PROJECT:
value_it->ValueList().push_back(input_value); value_it->ValueList().push_back(input_value);
break; break;
case Aggregation::Op::COLLECT_MAP: case Aggregation::Op::COLLECT_MAP:
@@ -2860,6 +2862,7 @@ class AggregateCursor : public Cursor {
*value_it = *value_it + input_value; *value_it = *value_it + input_value;
break; break;
case Aggregation::Op::COLLECT_LIST: case Aggregation::Op::COLLECT_LIST:
case Aggregation::Op::PROJECT:
value_it->ValueList().push_back(input_value); value_it->ValueList().push_back(input_value);
break; break;
case Aggregation::Op::COLLECT_MAP: case Aggregation::Op::COLLECT_MAP: