code: func (d *HashAggIntermData) getPartialResultBatch(sc *stmtctx.StatementContext, prs [][]aggfuncs.PartialResult, aggFuncs []aggfuncs.AggFunc, maxChunkSize int) (_ [][]aggfuncs.PartialResult, groupKeys []string, reachEnd bool) {
  	keyStart := d.cursor
  	for ; d.cursor < len(d.groupKeys) && len(prs) < maxChunkSize; d.cursor++ {
  		prs = append(prs, d.partialResultMap[d.groupKeys[d.cursor]])
  	}
  	if d.cursor == len(d.groupKeys) {
  		reachEnd = true
  	}
  	return prs, d.groupKeys[keyStart:d.cursor], reachEnd
  }
docs: // getPartialResultBatch fetches a batch of partial results from HashAggIntermData.