code: func (e *WindowExec) Next(ctx context.Context, chk *chunk.RecordBatch) error {
  	if span := opentracing.SpanFromContext(ctx); span != nil && span.Tracer() != nil {
  		span1 := span.Tracer().StartSpan("windowExec.Next", opentracing.ChildOf(span.Context()))
  		defer span1.Finish()
  	}
  	if e.runtimeStats != nil {
  		start := time.Now()
  		defer func() { e.runtimeStats.Record(time.Now().Sub(start), chk.NumRows()) }()
  	}
  	chk.Reset()
  	if e.meetNewGroup && e.remainingRowsInGroup > 0 {
  		err := e.appendResult2Chunk(chk.Chunk)
  		if err != nil {
  			return err
  		}
  	}
  	for !e.executed && (chk.NumRows() == 0 || e.remainingRowsInChunk > 0) {
  		err := e.consumeOneGroup(ctx, chk.Chunk)
  		if err != nil {
  			e.executed = true
  			return errors.Trace(err)
  		}
  	}
  	return nil
  }
docs: // Next implements the Executor Next interface.