public HCatTable resolve(HCatTable rhs, EnumSet<TableAttribute> attributes) throws HCatException {

    if (rhs == this)
      return this;

    for (TableAttribute attribute : attributes) {

      if (attribute.equals(TableAttribute.COLUMNS)) {
        cols(rhs.cols);
      }

      if (attribute.equals(TableAttribute.INPUT_FORMAT)) {
        inputFileFormat(rhs.getInputFileFormat());
      }

      if (attribute.equals(TableAttribute.OUTPUT_FORMAT)) {
        outputFileFormat(rhs.getOutputFileFormat());
      }

      if (attribute.equals(TableAttribute.SERDE)) {
        serdeLib(rhs.getSerdeLib());
      }

      if (attribute.equals(TableAttribute.SERDE_PROPERTIES)) {
        serdeParams(rhs.getSerdeParams());
      }

      if (attribute.equals(TableAttribute.STORAGE_HANDLER)) {
        storageHandler(rhs.getStorageHandler());
      }

      if (attribute.equals(TableAttribute.TABLE_PROPERTIES)) {
        tblProps(rhs.tblProps);
      }
    }

    return this;
  }
Method to "adopt" the specified attributes from rhs into this HCatTable object.
@param rhs The "source" table from which attributes are to be copied from.
@param attributes The set of attributes to be copied from rhs. Usually the result of {@code this.diff(rhs)}.
@return This HCatTable
@throws HCatException
hcatalog/webhcat/java-client/src/main/java/org/apache/hive/hcatalog/api/HCatTable.java