code: func (fs *FileSorter) Output() ([]types.Datum, []types.Datum, int64, error) {
  	var (
  		r   *comparableRow
  		err error
  	)
  	if fs.closed {
  		return nil, nil, 0, errors.New("FileSorter has been closed")
  	}
  
  	if fs.external {
  		r, err = fs.externalSort()
  	} else {
  		r, err = fs.internalSort()
  	}
  
  	if err != nil {
  		return nil, nil, 0, errors.Trace(err)
  	} else if r != nil {
  		return r.key, r.val, r.handle, nil
  	} else {
  		return nil, nil, 0, nil
  	}
  }
docs: // Output gets the next sorted row.