MCPcopy Index your code
hub / github.com/dgraph-io/dgraph / processGroupBy

Method processGroupBy

query/groupby.go:363–383  ·  view source on GitHub ↗
(doneVars map[string]varValue, path []*SubGraph)

Source from the content-addressed store, hash-verified

361}
362
363func (sg *SubGraph) processGroupBy(doneVars map[string]varValue, path []*SubGraph) error {
364 for _, ul := range sg.uidMatrix {
365 // We need to process groupby for each list as grouping needs to happen for each path of the
366 // tree.
367
368 r, err := sg.formResult(ul)
369 if err != nil {
370 return err
371 }
372 sg.GroupbyRes = append(sg.GroupbyRes, r)
373 }
374
375 if err := sg.fillGroupedVars(doneVars, path); err != nil {
376 return err
377 }
378
379 // All the result that we want to return is in sg.GroupbyRes
380 sg.Children = sg.Children[:0]
381
382 return nil
383}
384
385func groupLess(a, b *groupResult) bool {
386 switch {

Callers 1

valueVarAggregationMethod · 0.95

Calls 2

formResultMethod · 0.95
fillGroupedVarsMethod · 0.95

Tested by

no test coverage detected