/**
 * Autogenerated by Thrift Compiler (0.16.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package org.apache.hadoop.hive.metastore.api;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.16.0)")
@org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public class StorageDescriptor implements org.apache.thrift.TBase<StorageDescriptor, StorageDescriptor._Fields>, java.io.Serializable, Cloneable, Comparable<StorageDescriptor> {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("StorageDescriptor");

  private static final org.apache.thrift.protocol.TField COLS_FIELD_DESC = new org.apache.thrift.protocol.TField("cols", org.apache.thrift.protocol.TType.LIST, (short)1);
  private static final org.apache.thrift.protocol.TField LOCATION_FIELD_DESC = new org.apache.thrift.protocol.TField("location", org.apache.thrift.protocol.TType.STRING, (short)2);
  private static final org.apache.thrift.protocol.TField INPUT_FORMAT_FIELD_DESC = new org.apache.thrift.protocol.TField("inputFormat", org.apache.thrift.protocol.TType.STRING, (short)3);
  private static final org.apache.thrift.protocol.TField OUTPUT_FORMAT_FIELD_DESC = new org.apache.thrift.protocol.TField("outputFormat", org.apache.thrift.protocol.TType.STRING, (short)4);
  private static final org.apache.thrift.protocol.TField COMPRESSED_FIELD_DESC = new org.apache.thrift.protocol.TField("compressed", org.apache.thrift.protocol.TType.BOOL, (short)5);
  private static final org.apache.thrift.protocol.TField NUM_BUCKETS_FIELD_DESC = new org.apache.thrift.protocol.TField("numBuckets", org.apache.thrift.protocol.TType.I32, (short)6);
  private static final org.apache.thrift.protocol.TField SERDE_INFO_FIELD_DESC = new org.apache.thrift.protocol.TField("serdeInfo", org.apache.thrift.protocol.TType.STRUCT, (short)7);
  private static final org.apache.thrift.protocol.TField BUCKET_COLS_FIELD_DESC = new org.apache.thrift.protocol.TField("bucketCols", org.apache.thrift.protocol.TType.LIST, (short)8);
  private static final org.apache.thrift.protocol.TField SORT_COLS_FIELD_DESC = new org.apache.thrift.protocol.TField("sortCols", org.apache.thrift.protocol.TType.LIST, (short)9);
  private static final org.apache.thrift.protocol.TField PARAMETERS_FIELD_DESC = new org.apache.thrift.protocol.TField("parameters", org.apache.thrift.protocol.TType.MAP, (short)10);
  private static final org.apache.thrift.protocol.TField SKEWED_INFO_FIELD_DESC = new org.apache.thrift.protocol.TField("skewedInfo", org.apache.thrift.protocol.TType.STRUCT, (short)11);
  private static final org.apache.thrift.protocol.TField STORED_AS_SUB_DIRECTORIES_FIELD_DESC = new org.apache.thrift.protocol.TField("storedAsSubDirectories", org.apache.thrift.protocol.TType.BOOL, (short)12);

  private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new StorageDescriptorStandardSchemeFactory();
  private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new StorageDescriptorTupleSchemeFactory();

  private @org.apache.thrift.annotation.Nullable java.util.List<FieldSchema> cols; // required
  private @org.apache.thrift.annotation.Nullable java.lang.String location; // required
  private @org.apache.thrift.annotation.Nullable java.lang.String inputFormat; // required
  private @org.apache.thrift.annotation.Nullable java.lang.String outputFormat; // required
  private boolean compressed; // required
  private int numBuckets; // required
  private @org.apache.thrift.annotation.Nullable SerDeInfo serdeInfo; // required
  private @org.apache.thrift.annotation.Nullable java.util.List<java.lang.String> bucketCols; // required
  private @org.apache.thrift.annotation.Nullable java.util.List<Order> sortCols; // required
  private @org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,java.lang.String> parameters; // required
  private @org.apache.thrift.annotation.Nullable SkewedInfo skewedInfo; // optional
  private boolean storedAsSubDirectories; // optional

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    COLS((short)1, "cols"),
    LOCATION((short)2, "location"),
    INPUT_FORMAT((short)3, "inputFormat"),
    OUTPUT_FORMAT((short)4, "outputFormat"),
    COMPRESSED((short)5, "compressed"),
    NUM_BUCKETS((short)6, "numBuckets"),
    SERDE_INFO((short)7, "serdeInfo"),
    BUCKET_COLS((short)8, "bucketCols"),
    SORT_COLS((short)9, "sortCols"),
    PARAMETERS((short)10, "parameters"),
    SKEWED_INFO((short)11, "skewedInfo"),
    STORED_AS_SUB_DIRECTORIES((short)12, "storedAsSubDirectories");

    private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();

    static {
      for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
        byName.put(field.getFieldName(), field);
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, or null if its not found.
     */
    @org.apache.thrift.annotation.Nullable
    public static _Fields findByThriftId(int fieldId) {
      switch(fieldId) {
        case 1: // COLS
          return COLS;
        case 2: // LOCATION
          return LOCATION;
        case 3: // INPUT_FORMAT
          return INPUT_FORMAT;
        case 4: // OUTPUT_FORMAT
          return OUTPUT_FORMAT;
        case 5: // COMPRESSED
          return COMPRESSED;
        case 6: // NUM_BUCKETS
          return NUM_BUCKETS;
        case 7: // SERDE_INFO
          return SERDE_INFO;
        case 8: // BUCKET_COLS
          return BUCKET_COLS;
        case 9: // SORT_COLS
          return SORT_COLS;
        case 10: // PARAMETERS
          return PARAMETERS;
        case 11: // SKEWED_INFO
          return SKEWED_INFO;
        case 12: // STORED_AS_SUB_DIRECTORIES
          return STORED_AS_SUB_DIRECTORIES;
        default:
          return null;
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, throwing an exception
     * if it is not found.
     */
    public static _Fields findByThriftIdOrThrow(int fieldId) {
      _Fields fields = findByThriftId(fieldId);
      if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
      return fields;
    }

    /**
     * Find the _Fields constant that matches name, or null if its not found.
     */
    @org.apache.thrift.annotation.Nullable
    public static _Fields findByName(java.lang.String name) {
      return byName.get(name);
    }

    private final short _thriftId;
    private final java.lang.String _fieldName;

    _Fields(short thriftId, java.lang.String fieldName) {
      _thriftId = thriftId;
      _fieldName = fieldName;
    }

    public short getThriftFieldId() {
      return _thriftId;
    }

    public java.lang.String getFieldName() {
      return _fieldName;
    }
  }

  // isset id assignments
  private static final int __COMPRESSED_ISSET_ID = 0;
  private static final int __NUMBUCKETS_ISSET_ID = 1;
  private static final int __STOREDASSUBDIRECTORIES_ISSET_ID = 2;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.SKEWED_INFO,_Fields.STORED_AS_SUB_DIRECTORIES};
  public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.COLS, new org.apache.thrift.meta_data.FieldMetaData("cols", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
            new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, FieldSchema.class))));
    tmpMap.put(_Fields.LOCATION, new org.apache.thrift.meta_data.FieldMetaData("location", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.INPUT_FORMAT, new org.apache.thrift.meta_data.FieldMetaData("inputFormat", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.OUTPUT_FORMAT, new org.apache.thrift.meta_data.FieldMetaData("outputFormat", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.COMPRESSED, new org.apache.thrift.meta_data.FieldMetaData("compressed", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.NUM_BUCKETS, new org.apache.thrift.meta_data.FieldMetaData("numBuckets", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.SERDE_INFO, new org.apache.thrift.meta_data.FieldMetaData("serdeInfo", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, SerDeInfo.class)));
    tmpMap.put(_Fields.BUCKET_COLS, new org.apache.thrift.meta_data.FieldMetaData("bucketCols", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
    tmpMap.put(_Fields.SORT_COLS, new org.apache.thrift.meta_data.FieldMetaData("sortCols", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
            new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Order.class))));
    tmpMap.put(_Fields.PARAMETERS, new org.apache.thrift.meta_data.FieldMetaData("parameters", org.apache.thrift.TFieldRequirementType.DEFAULT, 
        new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
    tmpMap.put(_Fields.SKEWED_INFO, new org.apache.thrift.meta_data.FieldMetaData("skewedInfo", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, SkewedInfo.class)));
    tmpMap.put(_Fields.STORED_AS_SUB_DIRECTORIES, new org.apache.thrift.meta_data.FieldMetaData("storedAsSubDirectories", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(StorageDescriptor.class, metaDataMap);
  }

  public StorageDescriptor() {
  }

  public StorageDescriptor(
    java.util.List<FieldSchema> cols,
    java.lang.String location,
    java.lang.String inputFormat,
    java.lang.String outputFormat,
    boolean compressed,
    int numBuckets,
    SerDeInfo serdeInfo,
    java.util.List<java.lang.String> bucketCols,
    java.util.List<Order> sortCols,
    java.util.Map<java.lang.String,java.lang.String> parameters)
  {
    this();
    this.cols = cols;
    this.location = org.apache.hadoop.hive.metastore.utils.StringUtils.intern(location);
    this.inputFormat = org.apache.hadoop.hive.metastore.utils.StringUtils.intern(inputFormat);
    this.outputFormat = org.apache.hadoop.hive.metastore.utils.StringUtils.intern(outputFormat);
    this.compressed = compressed;
    setCompressedIsSet(true);
    this.numBuckets = numBuckets;
    setNumBucketsIsSet(true);
    this.serdeInfo = serdeInfo;
    this.bucketCols = org.apache.hadoop.hive.metastore.utils.StringUtils.intern(bucketCols);
    this.sortCols = sortCols;
    this.parameters = org.apache.hadoop.hive.metastore.utils.StringUtils.intern(parameters);
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public StorageDescriptor(StorageDescriptor other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetCols()) {
      java.util.List<FieldSchema> __this__cols = new java.util.ArrayList<FieldSchema>(other.cols.size());
      for (FieldSchema other_element : other.cols) {
        __this__cols.add(new FieldSchema(other_element));
      }
      this.cols = __this__cols;
    }
    if (other.isSetLocation()) {
      this.location = org.apache.hadoop.hive.metastore.utils.StringUtils.intern(other.location);
    }
    if (other.isSetInputFormat()) {
      this.inputFormat = org.apache.hadoop.hive.metastore.utils.StringUtils.intern(other.inputFormat);
    }
    if (other.isSetOutputFormat()) {
      this.outputFormat = org.apache.hadoop.hive.metastore.utils.StringUtils.intern(other.outputFormat);
    }
    this.compressed = other.compressed;
    this.numBuckets = other.numBuckets;
    if (other.isSetSerdeInfo()) {
      this.serdeInfo = new SerDeInfo(other.serdeInfo);
    }
    if (other.isSetBucketCols()) {
      java.util.List<java.lang.String> __this__bucketCols = new java.util.ArrayList<java.lang.String>(other.bucketCols);
      this.bucketCols = __this__bucketCols;
    }
    if (other.isSetSortCols()) {
      java.util.List<Order> __this__sortCols = new java.util.ArrayList<Order>(other.sortCols.size());
      for (Order other_element : other.sortCols) {
        __this__sortCols.add(new Order(other_element));
      }
      this.sortCols = __this__sortCols;
    }
    if (other.isSetParameters()) {
      java.util.Map<java.lang.String,java.lang.String> __this__parameters = new java.util.HashMap<java.lang.String,java.lang.String>(other.parameters);
      this.parameters = __this__parameters;
    }
    if (other.isSetSkewedInfo()) {
      this.skewedInfo = new SkewedInfo(other.skewedInfo);
    }
    this.storedAsSubDirectories = other.storedAsSubDirectories;
  }

  public StorageDescriptor deepCopy() {
    return new StorageDescriptor(this);
  }

  @Override
  public void clear() {
    this.cols = null;
    this.location = null;
    this.inputFormat = null;
    this.outputFormat = null;
    setCompressedIsSet(false);
    this.compressed = false;
    setNumBucketsIsSet(false);
    this.numBuckets = 0;
    this.serdeInfo = null;
    this.bucketCols = null;
    this.sortCols = null;
    this.parameters = null;
    this.skewedInfo = null;
    setStoredAsSubDirectoriesIsSet(false);
    this.storedAsSubDirectories = false;
  }

  public int getColsSize() {
    return (this.cols == null) ? 0 : this.cols.size();
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.Iterator<FieldSchema> getColsIterator() {
    return (this.cols == null) ? null : this.cols.iterator();
  }

  public void addToCols(FieldSchema elem) {
    if (this.cols == null) {
      this.cols = new java.util.ArrayList<FieldSchema>();
    }
    this.cols.add(elem);
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.List<FieldSchema> getCols() {
    return this.cols;
  }

  public void setCols(@org.apache.thrift.annotation.Nullable java.util.List<FieldSchema> cols) {
    this.cols = cols;
  }

  public void unsetCols() {
    this.cols = null;
  }

  /** Returns true if field cols is set (has been assigned a value) and false otherwise */
  public boolean isSetCols() {
    return this.cols != null;
  }

  public void setColsIsSet(boolean value) {
    if (!value) {
      this.cols = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public java.lang.String getLocation() {
    return this.location;
  }

  public void setLocation(@org.apache.thrift.annotation.Nullable java.lang.String location) {
    this.location = org.apache.hadoop.hive.metastore.utils.StringUtils.intern(location);
  }

  public void unsetLocation() {
    this.location = null;
  }

  /** Returns true if field location is set (has been assigned a value) and false otherwise */
  public boolean isSetLocation() {
    return this.location != null;
  }

  public void setLocationIsSet(boolean value) {
    if (!value) {
      this.location = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public java.lang.String getInputFormat() {
    return this.inputFormat;
  }

  public void setInputFormat(@org.apache.thrift.annotation.Nullable java.lang.String inputFormat) {
    this.inputFormat = org.apache.hadoop.hive.metastore.utils.StringUtils.intern(inputFormat);
  }

  public void unsetInputFormat() {
    this.inputFormat = null;
  }

  /** Returns true if field inputFormat is set (has been assigned a value) and false otherwise */
  public boolean isSetInputFormat() {
    return this.inputFormat != null;
  }

  public void setInputFormatIsSet(boolean value) {
    if (!value) {
      this.inputFormat = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public java.lang.String getOutputFormat() {
    return this.outputFormat;
  }

  public void setOutputFormat(@org.apache.thrift.annotation.Nullable java.lang.String outputFormat) {
    this.outputFormat = org.apache.hadoop.hive.metastore.utils.StringUtils.intern(outputFormat);
  }

  public void unsetOutputFormat() {
    this.outputFormat = null;
  }

  /** Returns true if field outputFormat is set (has been assigned a value) and false otherwise */
  public boolean isSetOutputFormat() {
    return this.outputFormat != null;
  }

  public void setOutputFormatIsSet(boolean value) {
    if (!value) {
      this.outputFormat = null;
    }
  }

  public boolean isCompressed() {
    return this.compressed;
  }

  public void setCompressed(boolean compressed) {
    this.compressed = compressed;
    setCompressedIsSet(true);
  }

  public void unsetCompressed() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __COMPRESSED_ISSET_ID);
  }

  /** Returns true if field compressed is set (has been assigned a value) and false otherwise */
  public boolean isSetCompressed() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __COMPRESSED_ISSET_ID);
  }

  public void setCompressedIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __COMPRESSED_ISSET_ID, value);
  }

  public int getNumBuckets() {
    return this.numBuckets;
  }

  public void setNumBuckets(int numBuckets) {
    this.numBuckets = numBuckets;
    setNumBucketsIsSet(true);
  }

  public void unsetNumBuckets() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __NUMBUCKETS_ISSET_ID);
  }

  /** Returns true if field numBuckets is set (has been assigned a value) and false otherwise */
  public boolean isSetNumBuckets() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __NUMBUCKETS_ISSET_ID);
  }

  public void setNumBucketsIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __NUMBUCKETS_ISSET_ID, value);
  }

  @org.apache.thrift.annotation.Nullable
  public SerDeInfo getSerdeInfo() {
    return this.serdeInfo;
  }

  public void setSerdeInfo(@org.apache.thrift.annotation.Nullable SerDeInfo serdeInfo) {
    this.serdeInfo = serdeInfo;
  }

  public void unsetSerdeInfo() {
    this.serdeInfo = null;
  }

  /** Returns true if field serdeInfo is set (has been assigned a value) and false otherwise */
  public boolean isSetSerdeInfo() {
    return this.serdeInfo != null;
  }

  public void setSerdeInfoIsSet(boolean value) {
    if (!value) {
      this.serdeInfo = null;
    }
  }

  public int getBucketColsSize() {
    return (this.bucketCols == null) ? 0 : this.bucketCols.size();
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.Iterator<java.lang.String> getBucketColsIterator() {
    return (this.bucketCols == null) ? null : this.bucketCols.iterator();
  }

  public void addToBucketCols(java.lang.String elem) {
    if (this.bucketCols == null) {
      this.bucketCols = new java.util.ArrayList<java.lang.String>();
    }
    this.bucketCols.add(elem);
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.List<java.lang.String> getBucketCols() {
    return this.bucketCols;
  }

  public void setBucketCols(@org.apache.thrift.annotation.Nullable java.util.List<java.lang.String> bucketCols) {
    this.bucketCols = org.apache.hadoop.hive.metastore.utils.StringUtils.intern(bucketCols);
  }

  public void unsetBucketCols() {
    this.bucketCols = null;
  }

  /** Returns true if field bucketCols is set (has been assigned a value) and false otherwise */
  public boolean isSetBucketCols() {
    return this.bucketCols != null;
  }

  public void setBucketColsIsSet(boolean value) {
    if (!value) {
      this.bucketCols = null;
    }
  }

  public int getSortColsSize() {
    return (this.sortCols == null) ? 0 : this.sortCols.size();
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.Iterator<Order> getSortColsIterator() {
    return (this.sortCols == null) ? null : this.sortCols.iterator();
  }

  public void addToSortCols(Order elem) {
    if (this.sortCols == null) {
      this.sortCols = new java.util.ArrayList<Order>();
    }
    this.sortCols.add(elem);
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.List<Order> getSortCols() {
    return this.sortCols;
  }

  public void setSortCols(@org.apache.thrift.annotation.Nullable java.util.List<Order> sortCols) {
    this.sortCols = sortCols;
  }

  public void unsetSortCols() {
    this.sortCols = null;
  }

  /** Returns true if field sortCols is set (has been assigned a value) and false otherwise */
  public boolean isSetSortCols() {
    return this.sortCols != null;
  }

  public void setSortColsIsSet(boolean value) {
    if (!value) {
      this.sortCols = null;
    }
  }

  public int getParametersSize() {
    return (this.parameters == null) ? 0 : this.parameters.size();
  }

  public void putToParameters(java.lang.String key, java.lang.String val) {
    if (this.parameters == null) {
      this.parameters = new java.util.HashMap<java.lang.String,java.lang.String>();
    }
    this.parameters.put(org.apache.hadoop.hive.metastore.utils.StringUtils.intern(key), org.apache.hadoop.hive.metastore.utils.StringUtils.intern(val));
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.Map<java.lang.String,java.lang.String> getParameters() {
    return this.parameters;
  }

  public void setParameters(@org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,java.lang.String> parameters) {
    this.parameters = org.apache.hadoop.hive.metastore.utils.StringUtils.intern(parameters);
  }

  public void unsetParameters() {
    this.parameters = null;
  }

  /** Returns true if field parameters is set (has been assigned a value) and false otherwise */
  public boolean isSetParameters() {
    return this.parameters != null;
  }

  public void setParametersIsSet(boolean value) {
    if (!value) {
      this.parameters = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public SkewedInfo getSkewedInfo() {
    return this.skewedInfo;
  }

  public void setSkewedInfo(@org.apache.thrift.annotation.Nullable SkewedInfo skewedInfo) {
    this.skewedInfo = skewedInfo;
  }

  public void unsetSkewedInfo() {
    this.skewedInfo = null;
  }

  /** Returns true if field skewedInfo is set (has been assigned a value) and false otherwise */
  public boolean isSetSkewedInfo() {
    return this.skewedInfo != null;
  }

  public void setSkewedInfoIsSet(boolean value) {
    if (!value) {
      this.skewedInfo = null;
    }
  }

  public boolean isStoredAsSubDirectories() {
    return this.storedAsSubDirectories;
  }

  public void setStoredAsSubDirectories(boolean storedAsSubDirectories) {
    this.storedAsSubDirectories = storedAsSubDirectories;
    setStoredAsSubDirectoriesIsSet(true);
  }

  public void unsetStoredAsSubDirectories() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __STOREDASSUBDIRECTORIES_ISSET_ID);
  }

  /** Returns true if field storedAsSubDirectories is set (has been assigned a value) and false otherwise */
  public boolean isSetStoredAsSubDirectories() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __STOREDASSUBDIRECTORIES_ISSET_ID);
  }

  public void setStoredAsSubDirectoriesIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __STOREDASSUBDIRECTORIES_ISSET_ID, value);
  }

  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
    switch (field) {
    case COLS:
      if (value == null) {
        unsetCols();
      } else {
        setCols((java.util.List<FieldSchema>)value);
      }
      break;

    case LOCATION:
      if (value == null) {
        unsetLocation();
      } else {
        setLocation((java.lang.String)value);
      }
      break;

    case INPUT_FORMAT:
      if (value == null) {
        unsetInputFormat();
      } else {
        setInputFormat((java.lang.String)value);
      }
      break;

    case OUTPUT_FORMAT:
      if (value == null) {
        unsetOutputFormat();
      } else {
        setOutputFormat((java.lang.String)value);
      }
      break;

    case COMPRESSED:
      if (value == null) {
        unsetCompressed();
      } else {
        setCompressed((java.lang.Boolean)value);
      }
      break;

    case NUM_BUCKETS:
      if (value == null) {
        unsetNumBuckets();
      } else {
        setNumBuckets((java.lang.Integer)value);
      }
      break;

    case SERDE_INFO:
      if (value == null) {
        unsetSerdeInfo();
      } else {
        setSerdeInfo((SerDeInfo)value);
      }
      break;

    case BUCKET_COLS:
      if (value == null) {
        unsetBucketCols();
      } else {
        setBucketCols((java.util.List<java.lang.String>)value);
      }
      break;

    case SORT_COLS:
      if (value == null) {
        unsetSortCols();
      } else {
        setSortCols((java.util.List<Order>)value);
      }
      break;

    case PARAMETERS:
      if (value == null) {
        unsetParameters();
      } else {
        setParameters((java.util.Map<java.lang.String,java.lang.String>)value);
      }
      break;

    case SKEWED_INFO:
      if (value == null) {
        unsetSkewedInfo();
      } else {
        setSkewedInfo((SkewedInfo)value);
      }
      break;

    case STORED_AS_SUB_DIRECTORIES:
      if (value == null) {
        unsetStoredAsSubDirectories();
      } else {
        setStoredAsSubDirectories((java.lang.Boolean)value);
      }
      break;

    }
  }

  @org.apache.thrift.annotation.Nullable
  public java.lang.Object getFieldValue(_Fields field) {
    switch (field) {
    case COLS:
      return getCols();

    case LOCATION:
      return getLocation();

    case INPUT_FORMAT:
      return getInputFormat();

    case OUTPUT_FORMAT:
      return getOutputFormat();

    case COMPRESSED:
      return isCompressed();

    case NUM_BUCKETS:
      return getNumBuckets();

    case SERDE_INFO:
      return getSerdeInfo();

    case BUCKET_COLS:
      return getBucketCols();

    case SORT_COLS:
      return getSortCols();

    case PARAMETERS:
      return getParameters();

    case SKEWED_INFO:
      return getSkewedInfo();

    case STORED_AS_SUB_DIRECTORIES:
      return isStoredAsSubDirectories();

    }
    throw new java.lang.IllegalStateException();
  }

  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
  public boolean isSet(_Fields field) {
    if (field == null) {
      throw new java.lang.IllegalArgumentException();
    }

    switch (field) {
    case COLS:
      return isSetCols();
    case LOCATION:
      return isSetLocation();
    case INPUT_FORMAT:
      return isSetInputFormat();
    case OUTPUT_FORMAT:
      return isSetOutputFormat();
    case COMPRESSED:
      return isSetCompressed();
    case NUM_BUCKETS:
      return isSetNumBuckets();
    case SERDE_INFO:
      return isSetSerdeInfo();
    case BUCKET_COLS:
      return isSetBucketCols();
    case SORT_COLS:
      return isSetSortCols();
    case PARAMETERS:
      return isSetParameters();
    case SKEWED_INFO:
      return isSetSkewedInfo();
    case STORED_AS_SUB_DIRECTORIES:
      return isSetStoredAsSubDirectories();
    }
    throw new java.lang.IllegalStateException();
  }

  @Override
  public boolean equals(java.lang.Object that) {
    if (that instanceof StorageDescriptor)
      return this.equals((StorageDescriptor)that);
    return false;
  }

  public boolean equals(StorageDescriptor that) {
    if (that == null)
      return false;
    if (this == that)
      return true;

    boolean this_present_cols = true && this.isSetCols();
    boolean that_present_cols = true && that.isSetCols();
    if (this_present_cols || that_present_cols) {
      if (!(this_present_cols && that_present_cols))
        return false;
      if (!this.cols.equals(that.cols))
        return false;
    }

    boolean this_present_location = true && this.isSetLocation();
    boolean that_present_location = true && that.isSetLocation();
    if (this_present_location || that_present_location) {
      if (!(this_present_location && that_present_location))
        return false;
      if (!this.location.equals(that.location))
        return false;
    }

    boolean this_present_inputFormat = true && this.isSetInputFormat();
    boolean that_present_inputFormat = true && that.isSetInputFormat();
    if (this_present_inputFormat || that_present_inputFormat) {
      if (!(this_present_inputFormat && that_present_inputFormat))
        return false;
      if (!this.inputFormat.equals(that.inputFormat))
        return false;
    }

    boolean this_present_outputFormat = true && this.isSetOutputFormat();
    boolean that_present_outputFormat = true && that.isSetOutputFormat();
    if (this_present_outputFormat || that_present_outputFormat) {
      if (!(this_present_outputFormat && that_present_outputFormat))
        return false;
      if (!this.outputFormat.equals(that.outputFormat))
        return false;
    }

    boolean this_present_compressed = true;
    boolean that_present_compressed = true;
    if (this_present_compressed || that_present_compressed) {
      if (!(this_present_compressed && that_present_compressed))
        return false;
      if (this.compressed != that.compressed)
        return false;
    }

    boolean this_present_numBuckets = true;
    boolean that_present_numBuckets = true;
    if (this_present_numBuckets || that_present_numBuckets) {
      if (!(this_present_numBuckets && that_present_numBuckets))
        return false;
      if (this.numBuckets != that.numBuckets)
        return false;
    }

    boolean this_present_serdeInfo = true && this.isSetSerdeInfo();
    boolean that_present_serdeInfo = true && that.isSetSerdeInfo();
    if (this_present_serdeInfo || that_present_serdeInfo) {
      if (!(this_present_serdeInfo && that_present_serdeInfo))
        return false;
      if (!this.serdeInfo.equals(that.serdeInfo))
        return false;
    }

    boolean this_present_bucketCols = true && this.isSetBucketCols();
    boolean that_present_bucketCols = true && that.isSetBucketCols();
    if (this_present_bucketCols || that_present_bucketCols) {
      if (!(this_present_bucketCols && that_present_bucketCols))
        return false;
      if (!this.bucketCols.equals(that.bucketCols))
        return false;
    }

    boolean this_present_sortCols = true && this.isSetSortCols();
    boolean that_present_sortCols = true && that.isSetSortCols();
    if (this_present_sortCols || that_present_sortCols) {
      if (!(this_present_sortCols && that_present_sortCols))
        return false;
      if (!this.sortCols.equals(that.sortCols))
        return false;
    }

    boolean this_present_parameters = true && this.isSetParameters();
    boolean that_present_parameters = true && that.isSetParameters();
    if (this_present_parameters || that_present_parameters) {
      if (!(this_present_parameters && that_present_parameters))
        return false;
      if (!this.parameters.equals(that.parameters))
        return false;
    }

    boolean this_present_skewedInfo = true && this.isSetSkewedInfo();
    boolean that_present_skewedInfo = true && that.isSetSkewedInfo();
    if (this_present_skewedInfo || that_present_skewedInfo) {
      if (!(this_present_skewedInfo && that_present_skewedInfo))
        return false;
      if (!this.skewedInfo.equals(that.skewedInfo))
        return false;
    }

    boolean this_present_storedAsSubDirectories = true && this.isSetStoredAsSubDirectories();
    boolean that_present_storedAsSubDirectories = true && that.isSetStoredAsSubDirectories();
    if (this_present_storedAsSubDirectories || that_present_storedAsSubDirectories) {
      if (!(this_present_storedAsSubDirectories && that_present_storedAsSubDirectories))
        return false;
      if (this.storedAsSubDirectories != that.storedAsSubDirectories)
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    int hashCode = 1;

    hashCode = hashCode * 8191 + ((isSetCols()) ? 131071 : 524287);
    if (isSetCols())
      hashCode = hashCode * 8191 + cols.hashCode();

    hashCode = hashCode * 8191 + ((isSetLocation()) ? 131071 : 524287);
    if (isSetLocation())
      hashCode = hashCode * 8191 + location.hashCode();

    hashCode = hashCode * 8191 + ((isSetInputFormat()) ? 131071 : 524287);
    if (isSetInputFormat())
      hashCode = hashCode * 8191 + inputFormat.hashCode();

    hashCode = hashCode * 8191 + ((isSetOutputFormat()) ? 131071 : 524287);
    if (isSetOutputFormat())
      hashCode = hashCode * 8191 + outputFormat.hashCode();

    hashCode = hashCode * 8191 + ((compressed) ? 131071 : 524287);

    hashCode = hashCode * 8191 + numBuckets;

    hashCode = hashCode * 8191 + ((isSetSerdeInfo()) ? 131071 : 524287);
    if (isSetSerdeInfo())
      hashCode = hashCode * 8191 + serdeInfo.hashCode();

    hashCode = hashCode * 8191 + ((isSetBucketCols()) ? 131071 : 524287);
    if (isSetBucketCols())
      hashCode = hashCode * 8191 + bucketCols.hashCode();

    hashCode = hashCode * 8191 + ((isSetSortCols()) ? 131071 : 524287);
    if (isSetSortCols())
      hashCode = hashCode * 8191 + sortCols.hashCode();

    hashCode = hashCode * 8191 + ((isSetParameters()) ? 131071 : 524287);
    if (isSetParameters())
      hashCode = hashCode * 8191 + parameters.hashCode();

    hashCode = hashCode * 8191 + ((isSetSkewedInfo()) ? 131071 : 524287);
    if (isSetSkewedInfo())
      hashCode = hashCode * 8191 + skewedInfo.hashCode();

    hashCode = hashCode * 8191 + ((isSetStoredAsSubDirectories()) ? 131071 : 524287);
    if (isSetStoredAsSubDirectories())
      hashCode = hashCode * 8191 + ((storedAsSubDirectories) ? 131071 : 524287);

    return hashCode;
  }

  @Override
  public int compareTo(StorageDescriptor other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetCols(), other.isSetCols());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCols()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cols, other.cols);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetLocation(), other.isSetLocation());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLocation()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.location, other.location);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetInputFormat(), other.isSetInputFormat());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetInputFormat()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.inputFormat, other.inputFormat);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetOutputFormat(), other.isSetOutputFormat());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetOutputFormat()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.outputFormat, other.outputFormat);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetCompressed(), other.isSetCompressed());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCompressed()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.compressed, other.compressed);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetNumBuckets(), other.isSetNumBuckets());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetNumBuckets()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.numBuckets, other.numBuckets);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetSerdeInfo(), other.isSetSerdeInfo());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSerdeInfo()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serdeInfo, other.serdeInfo);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetBucketCols(), other.isSetBucketCols());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetBucketCols()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bucketCols, other.bucketCols);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetSortCols(), other.isSetSortCols());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSortCols()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sortCols, other.sortCols);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetParameters(), other.isSetParameters());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetParameters()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parameters, other.parameters);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetSkewedInfo(), other.isSetSkewedInfo());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSkewedInfo()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.skewedInfo, other.skewedInfo);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetStoredAsSubDirectories(), other.isSetStoredAsSubDirectories());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStoredAsSubDirectories()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.storedAsSubDirectories, other.storedAsSubDirectories);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

  @org.apache.thrift.annotation.Nullable
  public _Fields fieldForId(int fieldId) {
    return _Fields.findByThriftId(fieldId);
  }

  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    scheme(iprot).read(iprot, this);
  }

  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
    scheme(oprot).write(oprot, this);
  }

  @Override
  public java.lang.String toString() {
    java.lang.StringBuilder sb = new java.lang.StringBuilder("StorageDescriptor(");
    boolean first = true;

    sb.append("cols:");
    if (this.cols == null) {
      sb.append("null");
    } else {
      sb.append(this.cols);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("location:");
    if (this.location == null) {
      sb.append("null");
    } else {
      sb.append(this.location);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("inputFormat:");
    if (this.inputFormat == null) {
      sb.append("null");
    } else {
      sb.append(this.inputFormat);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("outputFormat:");
    if (this.outputFormat == null) {
      sb.append("null");
    } else {
      sb.append(this.outputFormat);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("compressed:");
    sb.append(this.compressed);
    first = false;
    if (!first) sb.append(", ");
    sb.append("numBuckets:");
    sb.append(this.numBuckets);
    first = false;
    if (!first) sb.append(", ");
    sb.append("serdeInfo:");
    if (this.serdeInfo == null) {
      sb.append("null");
    } else {
      sb.append(this.serdeInfo);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("bucketCols:");
    if (this.bucketCols == null) {
      sb.append("null");
    } else {
      sb.append(this.bucketCols);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("sortCols:");
    if (this.sortCols == null) {
      sb.append("null");
    } else {
      sb.append(this.sortCols);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("parameters:");
    if (this.parameters == null) {
      sb.append("null");
    } else {
      sb.append(this.parameters);
    }
    first = false;
    if (isSetSkewedInfo()) {
      if (!first) sb.append(", ");
      sb.append("skewedInfo:");
      if (this.skewedInfo == null) {
        sb.append("null");
      } else {
        sb.append(this.skewedInfo);
      }
      first = false;
    }
    if (isSetStoredAsSubDirectories()) {
      if (!first) sb.append(", ");
      sb.append("storedAsSubDirectories:");
      sb.append(this.storedAsSubDirectories);
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    // check for sub-struct validity
    if (serdeInfo != null) {
      serdeInfo.validate();
    }
    if (skewedInfo != null) {
      skewedInfo.validate();
    }
  }

  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
    try {
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
    try {
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
      __isset_bitfield = 0;
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private static class StorageDescriptorStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public StorageDescriptorStandardScheme getScheme() {
      return new StorageDescriptorStandardScheme();
    }
  }

  private static class StorageDescriptorStandardScheme extends org.apache.thrift.scheme.StandardScheme<StorageDescriptor> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, StorageDescriptor struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true)
      {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (schemeField.id) {
          case 1: // COLS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list164 = iprot.readListBegin();
                struct.cols = new java.util.ArrayList<FieldSchema>(_list164.size);
                @org.apache.thrift.annotation.Nullable FieldSchema _elem165;
                for (int _i166 = 0; _i166 < _list164.size; ++_i166)
                {
                  _elem165 = new FieldSchema();
                  _elem165.read(iprot);
                  struct.cols.add(_elem165);
                }
                iprot.readListEnd();
              }
              struct.setColsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // LOCATION
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.location = iprot.readString();
              struct.setLocationIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // INPUT_FORMAT
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.inputFormat = iprot.readString();
              struct.setInputFormatIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // OUTPUT_FORMAT
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.outputFormat = iprot.readString();
              struct.setOutputFormatIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // COMPRESSED
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.compressed = iprot.readBool();
              struct.setCompressedIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // NUM_BUCKETS
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.numBuckets = iprot.readI32();
              struct.setNumBucketsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // SERDE_INFO
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.serdeInfo = new SerDeInfo();
              struct.serdeInfo.read(iprot);
              struct.setSerdeInfoIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 8: // BUCKET_COLS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list167 = iprot.readListBegin();
                struct.bucketCols = new java.util.ArrayList<java.lang.String>(_list167.size);
                @org.apache.thrift.annotation.Nullable java.lang.String _elem168;
                for (int _i169 = 0; _i169 < _list167.size; ++_i169)
                {
                  _elem168 = iprot.readString();
                  struct.bucketCols.add(_elem168);
                }
                iprot.readListEnd();
              }
              struct.setBucketColsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 9: // SORT_COLS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list170 = iprot.readListBegin();
                struct.sortCols = new java.util.ArrayList<Order>(_list170.size);
                @org.apache.thrift.annotation.Nullable Order _elem171;
                for (int _i172 = 0; _i172 < _list170.size; ++_i172)
                {
                  _elem171 = new Order();
                  _elem171.read(iprot);
                  struct.sortCols.add(_elem171);
                }
                iprot.readListEnd();
              }
              struct.setSortColsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 10: // PARAMETERS
            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map173 = iprot.readMapBegin();
                struct.parameters = new java.util.HashMap<java.lang.String,java.lang.String>(2*_map173.size);
                @org.apache.thrift.annotation.Nullable java.lang.String _key174;
                @org.apache.thrift.annotation.Nullable java.lang.String _val175;
                for (int _i176 = 0; _i176 < _map173.size; ++_i176)
                {
                  _key174 = iprot.readString();
                  _val175 = iprot.readString();
                  struct.parameters.put(_key174, _val175);
                }
                iprot.readMapEnd();
              }
              struct.parameters = org.apache.hadoop.hive.metastore.utils.StringUtils.intern(struct.parameters); struct.setParametersIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 11: // SKEWED_INFO
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.skewedInfo = new SkewedInfo();
              struct.skewedInfo.read(iprot);
              struct.setSkewedInfoIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 12: // STORED_AS_SUB_DIRECTORIES
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.storedAsSubDirectories = iprot.readBool();
              struct.setStoredAsSubDirectoriesIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();
      struct.validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot, StorageDescriptor struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.cols != null) {
        oprot.writeFieldBegin(COLS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.cols.size()));
          for (FieldSchema _iter177 : struct.cols)
          {
            _iter177.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.location != null) {
        oprot.writeFieldBegin(LOCATION_FIELD_DESC);
        oprot.writeString(struct.location);
        oprot.writeFieldEnd();
      }
      if (struct.inputFormat != null) {
        oprot.writeFieldBegin(INPUT_FORMAT_FIELD_DESC);
        oprot.writeString(struct.inputFormat);
        oprot.writeFieldEnd();
      }
      if (struct.outputFormat != null) {
        oprot.writeFieldBegin(OUTPUT_FORMAT_FIELD_DESC);
        oprot.writeString(struct.outputFormat);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(COMPRESSED_FIELD_DESC);
      oprot.writeBool(struct.compressed);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(NUM_BUCKETS_FIELD_DESC);
      oprot.writeI32(struct.numBuckets);
      oprot.writeFieldEnd();
      if (struct.serdeInfo != null) {
        oprot.writeFieldBegin(SERDE_INFO_FIELD_DESC);
        struct.serdeInfo.write(oprot);
        oprot.writeFieldEnd();
      }
      if (struct.bucketCols != null) {
        oprot.writeFieldBegin(BUCKET_COLS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.bucketCols.size()));
          for (java.lang.String _iter178 : struct.bucketCols)
          {
            oprot.writeString(_iter178);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.sortCols != null) {
        oprot.writeFieldBegin(SORT_COLS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.sortCols.size()));
          for (Order _iter179 : struct.sortCols)
          {
            _iter179.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.parameters != null) {
        oprot.writeFieldBegin(PARAMETERS_FIELD_DESC);
        {
          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.parameters.size()));
          for (java.util.Map.Entry<java.lang.String, java.lang.String> _iter180 : struct.parameters.entrySet())
          {
            oprot.writeString(_iter180.getKey());
            oprot.writeString(_iter180.getValue());
          }
          oprot.writeMapEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.skewedInfo != null) {
        if (struct.isSetSkewedInfo()) {
          oprot.writeFieldBegin(SKEWED_INFO_FIELD_DESC);
          struct.skewedInfo.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetStoredAsSubDirectories()) {
        oprot.writeFieldBegin(STORED_AS_SUB_DIRECTORIES_FIELD_DESC);
        oprot.writeBool(struct.storedAsSubDirectories);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class StorageDescriptorTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public StorageDescriptorTupleScheme getScheme() {
      return new StorageDescriptorTupleScheme();
    }
  }

  private static class StorageDescriptorTupleScheme extends org.apache.thrift.scheme.TupleScheme<StorageDescriptor> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, StorageDescriptor struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet optionals = new java.util.BitSet();
      if (struct.isSetCols()) {
        optionals.set(0);
      }
      if (struct.isSetLocation()) {
        optionals.set(1);
      }
      if (struct.isSetInputFormat()) {
        optionals.set(2);
      }
      if (struct.isSetOutputFormat()) {
        optionals.set(3);
      }
      if (struct.isSetCompressed()) {
        optionals.set(4);
      }
      if (struct.isSetNumBuckets()) {
        optionals.set(5);
      }
      if (struct.isSetSerdeInfo()) {
        optionals.set(6);
      }
      if (struct.isSetBucketCols()) {
        optionals.set(7);
      }
      if (struct.isSetSortCols()) {
        optionals.set(8);
      }
      if (struct.isSetParameters()) {
        optionals.set(9);
      }
      if (struct.isSetSkewedInfo()) {
        optionals.set(10);
      }
      if (struct.isSetStoredAsSubDirectories()) {
        optionals.set(11);
      }
      oprot.writeBitSet(optionals, 12);
      if (struct.isSetCols()) {
        {
          oprot.writeI32(struct.cols.size());
          for (FieldSchema _iter181 : struct.cols)
          {
            _iter181.write(oprot);
          }
        }
      }
      if (struct.isSetLocation()) {
        oprot.writeString(struct.location);
      }
      if (struct.isSetInputFormat()) {
        oprot.writeString(struct.inputFormat);
      }
      if (struct.isSetOutputFormat()) {
        oprot.writeString(struct.outputFormat);
      }
      if (struct.isSetCompressed()) {
        oprot.writeBool(struct.compressed);
      }
      if (struct.isSetNumBuckets()) {
        oprot.writeI32(struct.numBuckets);
      }
      if (struct.isSetSerdeInfo()) {
        struct.serdeInfo.write(oprot);
      }
      if (struct.isSetBucketCols()) {
        {
          oprot.writeI32(struct.bucketCols.size());
          for (java.lang.String _iter182 : struct.bucketCols)
          {
            oprot.writeString(_iter182);
          }
        }
      }
      if (struct.isSetSortCols()) {
        {
          oprot.writeI32(struct.sortCols.size());
          for (Order _iter183 : struct.sortCols)
          {
            _iter183.write(oprot);
          }
        }
      }
      if (struct.isSetParameters()) {
        {
          oprot.writeI32(struct.parameters.size());
          for (java.util.Map.Entry<java.lang.String, java.lang.String> _iter184 : struct.parameters.entrySet())
          {
            oprot.writeString(_iter184.getKey());
            oprot.writeString(_iter184.getValue());
          }
        }
      }
      if (struct.isSetSkewedInfo()) {
        struct.skewedInfo.write(oprot);
      }
      if (struct.isSetStoredAsSubDirectories()) {
        oprot.writeBool(struct.storedAsSubDirectories);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, StorageDescriptor struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet incoming = iprot.readBitSet(12);
      if (incoming.get(0)) {
        {
          org.apache.thrift.protocol.TList _list185 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT);
          struct.cols = new java.util.ArrayList<FieldSchema>(_list185.size);
          @org.apache.thrift.annotation.Nullable FieldSchema _elem186;
          for (int _i187 = 0; _i187 < _list185.size; ++_i187)
          {
            _elem186 = new FieldSchema();
            _elem186.read(iprot);
            struct.cols.add(_elem186);
          }
        }
        struct.setColsIsSet(true);
      }
      if (incoming.get(1)) {
        struct.location = iprot.readString();
        struct.setLocationIsSet(true);
      }
      if (incoming.get(2)) {
        struct.inputFormat = iprot.readString();
        struct.setInputFormatIsSet(true);
      }
      if (incoming.get(3)) {
        struct.outputFormat = iprot.readString();
        struct.setOutputFormatIsSet(true);
      }
      if (incoming.get(4)) {
        struct.compressed = iprot.readBool();
        struct.setCompressedIsSet(true);
      }
      if (incoming.get(5)) {
        struct.numBuckets = iprot.readI32();
        struct.setNumBucketsIsSet(true);
      }
      if (incoming.get(6)) {
        struct.serdeInfo = new SerDeInfo();
        struct.serdeInfo.read(iprot);
        struct.setSerdeInfoIsSet(true);
      }
      if (incoming.get(7)) {
        {
          org.apache.thrift.protocol.TList _list188 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING);
          struct.bucketCols = new java.util.ArrayList<java.lang.String>(_list188.size);
          @org.apache.thrift.annotation.Nullable java.lang.String _elem189;
          for (int _i190 = 0; _i190 < _list188.size; ++_i190)
          {
            _elem189 = iprot.readString();
            struct.bucketCols.add(_elem189);
          }
        }
        struct.setBucketColsIsSet(true);
      }
      if (incoming.get(8)) {
        {
          org.apache.thrift.protocol.TList _list191 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT);
          struct.sortCols = new java.util.ArrayList<Order>(_list191.size);
          @org.apache.thrift.annotation.Nullable Order _elem192;
          for (int _i193 = 0; _i193 < _list191.size; ++_i193)
          {
            _elem192 = new Order();
            _elem192.read(iprot);
            struct.sortCols.add(_elem192);
          }
        }
        struct.setSortColsIsSet(true);
      }
      if (incoming.get(9)) {
        {
          org.apache.thrift.protocol.TMap _map194 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING); 
          struct.parameters = new java.util.HashMap<java.lang.String,java.lang.String>(2*_map194.size);
          @org.apache.thrift.annotation.Nullable java.lang.String _key195;
          @org.apache.thrift.annotation.Nullable java.lang.String _val196;
          for (int _i197 = 0; _i197 < _map194.size; ++_i197)
          {
            _key195 = iprot.readString();
            _val196 = iprot.readString();
            struct.parameters.put(_key195, _val196);
          }
        }
        struct.parameters = org.apache.hadoop.hive.metastore.utils.StringUtils.intern(struct.parameters); struct.setParametersIsSet(true);
      }
      if (incoming.get(10)) {
        struct.skewedInfo = new SkewedInfo();
        struct.skewedInfo.read(iprot);
        struct.setSkewedInfoIsSet(true);
      }
      if (incoming.get(11)) {
        struct.storedAsSubDirectories = iprot.readBool();
        struct.setStoredAsSubDirectoriesIsSet(true);
      }
    }
  }

  private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
    return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
  }
}

