/**
   * Copy columns from srcrow into destrow, or insert ROW_NUMBER.
   *
   * <p><b>FIXME</b> This is temporary. Window function treatment needs to generalized to work for
   * other window functions.
   *
   * @exception StandardException thrown on failure to open
   */
  public void populateFromSourceRow(ExecRow srcrow, ExecRow destrow) throws StandardException {
    int srcindex = 1;

    try {
      DataValueDescriptor[] columns = destrow.getRowArray();
      for (int index = 0; index < columns.length; index++) {

        if (referencedColumns != null && !referencedColumns.get(index)) {
          columns[index].setValue((long) this.rownumber);
        } else {
          destrow.setColumn(index + 1, srcrow.getColumn(srcindex));
          srcindex++;
        }
      }
    } catch (StandardException se) {
      throw se;
    } catch (Throwable t) {
      throw StandardException.unexpectedUserException(t);
    }
  }