code: func (fs *FileSorter) Output() ([]types.Datum, []types.Datum, int64, error) {
  	if fs.closed {
  		return nil, nil, 0, errors.New("FileSorter has been closed")
  	}
  	if len(fs.files) == 0 {
  		// No external files generated.
  		// Perform full in-memory sort directly.
  		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
  		}
  	}
  	r, err := fs.externalSort()
  	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.