I am trying to work with a nested GroupBy but having issues finding the right syntax to populate the accumulator and the documentation doesn’t show a clear example of this, any help?
CREATE DISTRIBUTED QUERY vert_stats (
STRING from_vtype, STRING etype, STRING to_vtype)
FOR GRAPH my_graph {
//nested GroupBy not working
//vertex/edge stats grouped by multiple attributes, i.e. make/model but can be extended to type/source or even make/model/source
GroupByAccum<STRING mk_type,
GroupByAccum<STRING mdl_type, STRING from_vtype,STRING etype,STRING to_vtype , SumAccum<INT> nodeWithEdgeCount, SumAccum<INT> edgeCount, MinAccum<INT> minDegree , MaxAccum<INT> maxDegree, AvgAccum avgDegree> mdl_stats>@@_stat_metrics2;
Result = SELECT s
FROM Start:s-(etype:e)->to_vtype:t
POST-ACCUM
ERROR>> @@_stat_metrics2 += (s.make_id-> (s.model_id-> from_vtype, etype, to_vtype, 1,s.outdegree(etype),s.outdegree(etype),s.outdegree(etype),s.outdegree(etype) ));
FOREACH g IN @@_stat_metrics DO
PRINT g.x_type , g.from_vtype, g.etype, g.to_vtype, g.nodeWithEdgeCount, g.edgeCount, g.minDegree, g.maxDegree,g.avgDegree;
END;
}
The error message is:
Incompatible operand types GroupByAccum<string mk_type, GroupByAccum<string mdl_type, string from_vtype, string etype, string to_vtype, SumAccum<int> nodeWithEdgeCount, SumAccum<int> edgeCount, MinAccum<int> minDegree, MaxAccum<int> maxDegree, AvgAccum avgDegree> mdl_stats> and List<int, List<int, string, string, string, int, int, int, int, int>> for the operator +=