Skip to content

Commit

Permalink
Explicitly pass in args.
Browse files Browse the repository at this point in the history
  • Loading branch information
notbdu committed Feb 12, 2019
1 parent 57e5a02 commit afd57db
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions storage/segment_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -457,21 +457,20 @@ func createFilteredGroupByCalcIterator(
fieldIdx++
}

// We require all group by fields be present.
groupByIter := indexfield.NewMultiFieldIntersectIterator(groupByIters)

var (
calcIter *indexfield.MultiFieldUnionIterator
// We require all group by fields be present.
groupByIter = indexfield.NewMultiFieldIntersectIterator(groupByIters)
iters = []index.DocIDSetIterator{
maskingDocIDSetIter,
groupByIter,
}
calcIter *indexfield.MultiFieldUnionIterator
filteredDocIDSetIter *index.InAllDocIDSetIterator
)
// Calculation fields are optional since we could have a COUNT op which requires no fields specified.
if len(calcIters) > 0 {
calcIter = indexfield.NewMultiFieldUnionIterator(calcIters)
iters = append(iters, calcIter)
filteredDocIDSetIter = index.NewInAllDocIDSetIterator(maskingDocIDSetIter, groupByIter, calcIter)
} else {
filteredDocIDSetIter = index.NewInAllDocIDSetIterator(maskingDocIDSetIter, groupByIter)
}
filteredDocIDSetIter := index.NewInAllDocIDSetIterator(iters...)
return filteredDocIDSetIter, groupByIter, calcIter, nil
}

Expand Down

0 comments on commit afd57db

Please sign in to comment.