THiveTableSink.java

/**
 * 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.doris.thrift;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.16.0)", date = "2026-05-14")
public class THiveTableSink implements org.apache.thrift.TBase<THiveTableSink, THiveTableSink._Fields>, java.io.Serializable, Cloneable, Comparable<THiveTableSink> {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("THiveTableSink");

  private static final org.apache.thrift.protocol.TField DB_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("db_name", org.apache.thrift.protocol.TType.STRING, (short)1);
  private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("table_name", org.apache.thrift.protocol.TType.STRING, (short)2);
  private static final org.apache.thrift.protocol.TField COLUMNS_FIELD_DESC = new org.apache.thrift.protocol.TField("columns", org.apache.thrift.protocol.TType.LIST, (short)3);
  private static final org.apache.thrift.protocol.TField PARTITIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("partitions", org.apache.thrift.protocol.TType.LIST, (short)4);
  private static final org.apache.thrift.protocol.TField BUCKET_INFO_FIELD_DESC = new org.apache.thrift.protocol.TField("bucket_info", org.apache.thrift.protocol.TType.STRUCT, (short)5);
  private static final org.apache.thrift.protocol.TField FILE_FORMAT_FIELD_DESC = new org.apache.thrift.protocol.TField("file_format", org.apache.thrift.protocol.TType.I32, (short)6);
  private static final org.apache.thrift.protocol.TField COMPRESSION_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("compression_type", org.apache.thrift.protocol.TType.I32, (short)7);
  private static final org.apache.thrift.protocol.TField LOCATION_FIELD_DESC = new org.apache.thrift.protocol.TField("location", org.apache.thrift.protocol.TType.STRUCT, (short)8);
  private static final org.apache.thrift.protocol.TField HADOOP_CONFIG_FIELD_DESC = new org.apache.thrift.protocol.TField("hadoop_config", org.apache.thrift.protocol.TType.MAP, (short)9);
  private static final org.apache.thrift.protocol.TField OVERWRITE_FIELD_DESC = new org.apache.thrift.protocol.TField("overwrite", org.apache.thrift.protocol.TType.BOOL, (short)10);
  private static final org.apache.thrift.protocol.TField SERDE_PROPERTIES_FIELD_DESC = new org.apache.thrift.protocol.TField("serde_properties", org.apache.thrift.protocol.TType.STRUCT, (short)11);
  private static final org.apache.thrift.protocol.TField BROKER_ADDRESSES_FIELD_DESC = new org.apache.thrift.protocol.TField("broker_addresses", org.apache.thrift.protocol.TType.LIST, (short)12);

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

  public @org.apache.thrift.annotation.Nullable java.lang.String db_name; // optional
  public @org.apache.thrift.annotation.Nullable java.lang.String table_name; // optional
  public @org.apache.thrift.annotation.Nullable java.util.List<THiveColumn> columns; // optional
  public @org.apache.thrift.annotation.Nullable java.util.List<THivePartition> partitions; // optional
  public @org.apache.thrift.annotation.Nullable THiveBucket bucket_info; // optional
  /**
   * 
   * @see org.apache.doris.thrift.TFileFormatType
   */
  public @org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TFileFormatType file_format; // optional
  /**
   * 
   * @see org.apache.doris.thrift.TFileCompressType
   */
  public @org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TFileCompressType compression_type; // optional
  public @org.apache.thrift.annotation.Nullable THiveLocationParams location; // optional
  public @org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,java.lang.String> hadoop_config; // optional
  public boolean overwrite; // optional
  public @org.apache.thrift.annotation.Nullable THiveSerDeProperties serde_properties; // optional
  public @org.apache.thrift.annotation.Nullable java.util.List<org.apache.doris.thrift.TNetworkAddress> broker_addresses; // 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 {
    DB_NAME((short)1, "db_name"),
    TABLE_NAME((short)2, "table_name"),
    COLUMNS((short)3, "columns"),
    PARTITIONS((short)4, "partitions"),
    BUCKET_INFO((short)5, "bucket_info"),
    /**
     * 
     * @see org.apache.doris.thrift.TFileFormatType
     */
    FILE_FORMAT((short)6, "file_format"),
    /**
     * 
     * @see org.apache.doris.thrift.TFileCompressType
     */
    COMPRESSION_TYPE((short)7, "compression_type"),
    LOCATION((short)8, "location"),
    HADOOP_CONFIG((short)9, "hadoop_config"),
    OVERWRITE((short)10, "overwrite"),
    SERDE_PROPERTIES((short)11, "serde_properties"),
    BROKER_ADDRESSES((short)12, "broker_addresses");

    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: // DB_NAME
          return DB_NAME;
        case 2: // TABLE_NAME
          return TABLE_NAME;
        case 3: // COLUMNS
          return COLUMNS;
        case 4: // PARTITIONS
          return PARTITIONS;
        case 5: // BUCKET_INFO
          return BUCKET_INFO;
        case 6: // FILE_FORMAT
          return FILE_FORMAT;
        case 7: // COMPRESSION_TYPE
          return COMPRESSION_TYPE;
        case 8: // LOCATION
          return LOCATION;
        case 9: // HADOOP_CONFIG
          return HADOOP_CONFIG;
        case 10: // OVERWRITE
          return OVERWRITE;
        case 11: // SERDE_PROPERTIES
          return SERDE_PROPERTIES;
        case 12: // BROKER_ADDRESSES
          return BROKER_ADDRESSES;
        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 __OVERWRITE_ISSET_ID = 0;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.DB_NAME,_Fields.TABLE_NAME,_Fields.COLUMNS,_Fields.PARTITIONS,_Fields.BUCKET_INFO,_Fields.FILE_FORMAT,_Fields.COMPRESSION_TYPE,_Fields.LOCATION,_Fields.HADOOP_CONFIG,_Fields.OVERWRITE,_Fields.SERDE_PROPERTIES,_Fields.BROKER_ADDRESSES};
  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.DB_NAME, new org.apache.thrift.meta_data.FieldMetaData("db_name", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("table_name", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("columns", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        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, THiveColumn.class))));
    tmpMap.put(_Fields.PARTITIONS, new org.apache.thrift.meta_data.FieldMetaData("partitions", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        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, THivePartition.class))));
    tmpMap.put(_Fields.BUCKET_INFO, new org.apache.thrift.meta_data.FieldMetaData("bucket_info", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, THiveBucket.class)));
    tmpMap.put(_Fields.FILE_FORMAT, new org.apache.thrift.meta_data.FieldMetaData("file_format", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, org.apache.doris.thrift.TFileFormatType.class)));
    tmpMap.put(_Fields.COMPRESSION_TYPE, new org.apache.thrift.meta_data.FieldMetaData("compression_type", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, org.apache.doris.thrift.TFileCompressType.class)));
    tmpMap.put(_Fields.LOCATION, new org.apache.thrift.meta_data.FieldMetaData("location", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, THiveLocationParams.class)));
    tmpMap.put(_Fields.HADOOP_CONFIG, new org.apache.thrift.meta_data.FieldMetaData("hadoop_config", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        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.OVERWRITE, new org.apache.thrift.meta_data.FieldMetaData("overwrite", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.SERDE_PROPERTIES, new org.apache.thrift.meta_data.FieldMetaData("serde_properties", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, THiveSerDeProperties.class)));
    tmpMap.put(_Fields.BROKER_ADDRESSES, new org.apache.thrift.meta_data.FieldMetaData("broker_addresses", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        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, org.apache.doris.thrift.TNetworkAddress.class))));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(THiveTableSink.class, metaDataMap);
  }

  public THiveTableSink() {
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public THiveTableSink(THiveTableSink other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetDbName()) {
      this.db_name = other.db_name;
    }
    if (other.isSetTableName()) {
      this.table_name = other.table_name;
    }
    if (other.isSetColumns()) {
      java.util.List<THiveColumn> __this__columns = new java.util.ArrayList<THiveColumn>(other.columns.size());
      for (THiveColumn other_element : other.columns) {
        __this__columns.add(new THiveColumn(other_element));
      }
      this.columns = __this__columns;
    }
    if (other.isSetPartitions()) {
      java.util.List<THivePartition> __this__partitions = new java.util.ArrayList<THivePartition>(other.partitions.size());
      for (THivePartition other_element : other.partitions) {
        __this__partitions.add(new THivePartition(other_element));
      }
      this.partitions = __this__partitions;
    }
    if (other.isSetBucketInfo()) {
      this.bucket_info = new THiveBucket(other.bucket_info);
    }
    if (other.isSetFileFormat()) {
      this.file_format = other.file_format;
    }
    if (other.isSetCompressionType()) {
      this.compression_type = other.compression_type;
    }
    if (other.isSetLocation()) {
      this.location = new THiveLocationParams(other.location);
    }
    if (other.isSetHadoopConfig()) {
      java.util.Map<java.lang.String,java.lang.String> __this__hadoop_config = new java.util.HashMap<java.lang.String,java.lang.String>(other.hadoop_config);
      this.hadoop_config = __this__hadoop_config;
    }
    this.overwrite = other.overwrite;
    if (other.isSetSerdeProperties()) {
      this.serde_properties = new THiveSerDeProperties(other.serde_properties);
    }
    if (other.isSetBrokerAddresses()) {
      java.util.List<org.apache.doris.thrift.TNetworkAddress> __this__broker_addresses = new java.util.ArrayList<org.apache.doris.thrift.TNetworkAddress>(other.broker_addresses.size());
      for (org.apache.doris.thrift.TNetworkAddress other_element : other.broker_addresses) {
        __this__broker_addresses.add(new org.apache.doris.thrift.TNetworkAddress(other_element));
      }
      this.broker_addresses = __this__broker_addresses;
    }
  }

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

  @Override
  public void clear() {
    this.db_name = null;
    this.table_name = null;
    this.columns = null;
    this.partitions = null;
    this.bucket_info = null;
    this.file_format = null;
    this.compression_type = null;
    this.location = null;
    this.hadoop_config = null;
    setOverwriteIsSet(false);
    this.overwrite = false;
    this.serde_properties = null;
    this.broker_addresses = null;
  }

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

  public THiveTableSink setDbName(@org.apache.thrift.annotation.Nullable java.lang.String db_name) {
    this.db_name = db_name;
    return this;
  }

  public void unsetDbName() {
    this.db_name = null;
  }

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

  public void setDbNameIsSet(boolean value) {
    if (!value) {
      this.db_name = null;
    }
  }

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

  public THiveTableSink setTableName(@org.apache.thrift.annotation.Nullable java.lang.String table_name) {
    this.table_name = table_name;
    return this;
  }

  public void unsetTableName() {
    this.table_name = null;
  }

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

  public void setTableNameIsSet(boolean value) {
    if (!value) {
      this.table_name = null;
    }
  }

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

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

  public void addToColumns(THiveColumn elem) {
    if (this.columns == null) {
      this.columns = new java.util.ArrayList<THiveColumn>();
    }
    this.columns.add(elem);
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.List<THiveColumn> getColumns() {
    return this.columns;
  }

  public THiveTableSink setColumns(@org.apache.thrift.annotation.Nullable java.util.List<THiveColumn> columns) {
    this.columns = columns;
    return this;
  }

  public void unsetColumns() {
    this.columns = null;
  }

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

  public void setColumnsIsSet(boolean value) {
    if (!value) {
      this.columns = null;
    }
  }

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

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

  public void addToPartitions(THivePartition elem) {
    if (this.partitions == null) {
      this.partitions = new java.util.ArrayList<THivePartition>();
    }
    this.partitions.add(elem);
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.List<THivePartition> getPartitions() {
    return this.partitions;
  }

  public THiveTableSink setPartitions(@org.apache.thrift.annotation.Nullable java.util.List<THivePartition> partitions) {
    this.partitions = partitions;
    return this;
  }

  public void unsetPartitions() {
    this.partitions = null;
  }

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

  public void setPartitionsIsSet(boolean value) {
    if (!value) {
      this.partitions = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public THiveBucket getBucketInfo() {
    return this.bucket_info;
  }

  public THiveTableSink setBucketInfo(@org.apache.thrift.annotation.Nullable THiveBucket bucket_info) {
    this.bucket_info = bucket_info;
    return this;
  }

  public void unsetBucketInfo() {
    this.bucket_info = null;
  }

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

  public void setBucketInfoIsSet(boolean value) {
    if (!value) {
      this.bucket_info = null;
    }
  }

  /**
   * 
   * @see org.apache.doris.thrift.TFileFormatType
   */
  @org.apache.thrift.annotation.Nullable
  public org.apache.doris.thrift.TFileFormatType getFileFormat() {
    return this.file_format;
  }

  /**
   * 
   * @see org.apache.doris.thrift.TFileFormatType
   */
  public THiveTableSink setFileFormat(@org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TFileFormatType file_format) {
    this.file_format = file_format;
    return this;
  }

  public void unsetFileFormat() {
    this.file_format = null;
  }

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

  public void setFileFormatIsSet(boolean value) {
    if (!value) {
      this.file_format = null;
    }
  }

  /**
   * 
   * @see org.apache.doris.thrift.TFileCompressType
   */
  @org.apache.thrift.annotation.Nullable
  public org.apache.doris.thrift.TFileCompressType getCompressionType() {
    return this.compression_type;
  }

  /**
   * 
   * @see org.apache.doris.thrift.TFileCompressType
   */
  public THiveTableSink setCompressionType(@org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TFileCompressType compression_type) {
    this.compression_type = compression_type;
    return this;
  }

  public void unsetCompressionType() {
    this.compression_type = null;
  }

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

  public void setCompressionTypeIsSet(boolean value) {
    if (!value) {
      this.compression_type = null;
    }
  }

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

  public THiveTableSink setLocation(@org.apache.thrift.annotation.Nullable THiveLocationParams location) {
    this.location = location;
    return this;
  }

  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;
    }
  }

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

  public void putToHadoopConfig(java.lang.String key, java.lang.String val) {
    if (this.hadoop_config == null) {
      this.hadoop_config = new java.util.HashMap<java.lang.String,java.lang.String>();
    }
    this.hadoop_config.put(key, val);
  }

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

  public THiveTableSink setHadoopConfig(@org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,java.lang.String> hadoop_config) {
    this.hadoop_config = hadoop_config;
    return this;
  }

  public void unsetHadoopConfig() {
    this.hadoop_config = null;
  }

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

  public void setHadoopConfigIsSet(boolean value) {
    if (!value) {
      this.hadoop_config = null;
    }
  }

  public boolean isOverwrite() {
    return this.overwrite;
  }

  public THiveTableSink setOverwrite(boolean overwrite) {
    this.overwrite = overwrite;
    setOverwriteIsSet(true);
    return this;
  }

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

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

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

  @org.apache.thrift.annotation.Nullable
  public THiveSerDeProperties getSerdeProperties() {
    return this.serde_properties;
  }

  public THiveTableSink setSerdeProperties(@org.apache.thrift.annotation.Nullable THiveSerDeProperties serde_properties) {
    this.serde_properties = serde_properties;
    return this;
  }

  public void unsetSerdeProperties() {
    this.serde_properties = null;
  }

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

  public void setSerdePropertiesIsSet(boolean value) {
    if (!value) {
      this.serde_properties = null;
    }
  }

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

  @org.apache.thrift.annotation.Nullable
  public java.util.Iterator<org.apache.doris.thrift.TNetworkAddress> getBrokerAddressesIterator() {
    return (this.broker_addresses == null) ? null : this.broker_addresses.iterator();
  }

  public void addToBrokerAddresses(org.apache.doris.thrift.TNetworkAddress elem) {
    if (this.broker_addresses == null) {
      this.broker_addresses = new java.util.ArrayList<org.apache.doris.thrift.TNetworkAddress>();
    }
    this.broker_addresses.add(elem);
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.List<org.apache.doris.thrift.TNetworkAddress> getBrokerAddresses() {
    return this.broker_addresses;
  }

  public THiveTableSink setBrokerAddresses(@org.apache.thrift.annotation.Nullable java.util.List<org.apache.doris.thrift.TNetworkAddress> broker_addresses) {
    this.broker_addresses = broker_addresses;
    return this;
  }

  public void unsetBrokerAddresses() {
    this.broker_addresses = null;
  }

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

  public void setBrokerAddressesIsSet(boolean value) {
    if (!value) {
      this.broker_addresses = null;
    }
  }

  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
    switch (field) {
    case DB_NAME:
      if (value == null) {
        unsetDbName();
      } else {
        setDbName((java.lang.String)value);
      }
      break;

    case TABLE_NAME:
      if (value == null) {
        unsetTableName();
      } else {
        setTableName((java.lang.String)value);
      }
      break;

    case COLUMNS:
      if (value == null) {
        unsetColumns();
      } else {
        setColumns((java.util.List<THiveColumn>)value);
      }
      break;

    case PARTITIONS:
      if (value == null) {
        unsetPartitions();
      } else {
        setPartitions((java.util.List<THivePartition>)value);
      }
      break;

    case BUCKET_INFO:
      if (value == null) {
        unsetBucketInfo();
      } else {
        setBucketInfo((THiveBucket)value);
      }
      break;

    case FILE_FORMAT:
      if (value == null) {
        unsetFileFormat();
      } else {
        setFileFormat((org.apache.doris.thrift.TFileFormatType)value);
      }
      break;

    case COMPRESSION_TYPE:
      if (value == null) {
        unsetCompressionType();
      } else {
        setCompressionType((org.apache.doris.thrift.TFileCompressType)value);
      }
      break;

    case LOCATION:
      if (value == null) {
        unsetLocation();
      } else {
        setLocation((THiveLocationParams)value);
      }
      break;

    case HADOOP_CONFIG:
      if (value == null) {
        unsetHadoopConfig();
      } else {
        setHadoopConfig((java.util.Map<java.lang.String,java.lang.String>)value);
      }
      break;

    case OVERWRITE:
      if (value == null) {
        unsetOverwrite();
      } else {
        setOverwrite((java.lang.Boolean)value);
      }
      break;

    case SERDE_PROPERTIES:
      if (value == null) {
        unsetSerdeProperties();
      } else {
        setSerdeProperties((THiveSerDeProperties)value);
      }
      break;

    case BROKER_ADDRESSES:
      if (value == null) {
        unsetBrokerAddresses();
      } else {
        setBrokerAddresses((java.util.List<org.apache.doris.thrift.TNetworkAddress>)value);
      }
      break;

    }
  }

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

    case TABLE_NAME:
      return getTableName();

    case COLUMNS:
      return getColumns();

    case PARTITIONS:
      return getPartitions();

    case BUCKET_INFO:
      return getBucketInfo();

    case FILE_FORMAT:
      return getFileFormat();

    case COMPRESSION_TYPE:
      return getCompressionType();

    case LOCATION:
      return getLocation();

    case HADOOP_CONFIG:
      return getHadoopConfig();

    case OVERWRITE:
      return isOverwrite();

    case SERDE_PROPERTIES:
      return getSerdeProperties();

    case BROKER_ADDRESSES:
      return getBrokerAddresses();

    }
    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 DB_NAME:
      return isSetDbName();
    case TABLE_NAME:
      return isSetTableName();
    case COLUMNS:
      return isSetColumns();
    case PARTITIONS:
      return isSetPartitions();
    case BUCKET_INFO:
      return isSetBucketInfo();
    case FILE_FORMAT:
      return isSetFileFormat();
    case COMPRESSION_TYPE:
      return isSetCompressionType();
    case LOCATION:
      return isSetLocation();
    case HADOOP_CONFIG:
      return isSetHadoopConfig();
    case OVERWRITE:
      return isSetOverwrite();
    case SERDE_PROPERTIES:
      return isSetSerdeProperties();
    case BROKER_ADDRESSES:
      return isSetBrokerAddresses();
    }
    throw new java.lang.IllegalStateException();
  }

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

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

    boolean this_present_db_name = true && this.isSetDbName();
    boolean that_present_db_name = true && that.isSetDbName();
    if (this_present_db_name || that_present_db_name) {
      if (!(this_present_db_name && that_present_db_name))
        return false;
      if (!this.db_name.equals(that.db_name))
        return false;
    }

    boolean this_present_table_name = true && this.isSetTableName();
    boolean that_present_table_name = true && that.isSetTableName();
    if (this_present_table_name || that_present_table_name) {
      if (!(this_present_table_name && that_present_table_name))
        return false;
      if (!this.table_name.equals(that.table_name))
        return false;
    }

    boolean this_present_columns = true && this.isSetColumns();
    boolean that_present_columns = true && that.isSetColumns();
    if (this_present_columns || that_present_columns) {
      if (!(this_present_columns && that_present_columns))
        return false;
      if (!this.columns.equals(that.columns))
        return false;
    }

    boolean this_present_partitions = true && this.isSetPartitions();
    boolean that_present_partitions = true && that.isSetPartitions();
    if (this_present_partitions || that_present_partitions) {
      if (!(this_present_partitions && that_present_partitions))
        return false;
      if (!this.partitions.equals(that.partitions))
        return false;
    }

    boolean this_present_bucket_info = true && this.isSetBucketInfo();
    boolean that_present_bucket_info = true && that.isSetBucketInfo();
    if (this_present_bucket_info || that_present_bucket_info) {
      if (!(this_present_bucket_info && that_present_bucket_info))
        return false;
      if (!this.bucket_info.equals(that.bucket_info))
        return false;
    }

    boolean this_present_file_format = true && this.isSetFileFormat();
    boolean that_present_file_format = true && that.isSetFileFormat();
    if (this_present_file_format || that_present_file_format) {
      if (!(this_present_file_format && that_present_file_format))
        return false;
      if (!this.file_format.equals(that.file_format))
        return false;
    }

    boolean this_present_compression_type = true && this.isSetCompressionType();
    boolean that_present_compression_type = true && that.isSetCompressionType();
    if (this_present_compression_type || that_present_compression_type) {
      if (!(this_present_compression_type && that_present_compression_type))
        return false;
      if (!this.compression_type.equals(that.compression_type))
        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_hadoop_config = true && this.isSetHadoopConfig();
    boolean that_present_hadoop_config = true && that.isSetHadoopConfig();
    if (this_present_hadoop_config || that_present_hadoop_config) {
      if (!(this_present_hadoop_config && that_present_hadoop_config))
        return false;
      if (!this.hadoop_config.equals(that.hadoop_config))
        return false;
    }

    boolean this_present_overwrite = true && this.isSetOverwrite();
    boolean that_present_overwrite = true && that.isSetOverwrite();
    if (this_present_overwrite || that_present_overwrite) {
      if (!(this_present_overwrite && that_present_overwrite))
        return false;
      if (this.overwrite != that.overwrite)
        return false;
    }

    boolean this_present_serde_properties = true && this.isSetSerdeProperties();
    boolean that_present_serde_properties = true && that.isSetSerdeProperties();
    if (this_present_serde_properties || that_present_serde_properties) {
      if (!(this_present_serde_properties && that_present_serde_properties))
        return false;
      if (!this.serde_properties.equals(that.serde_properties))
        return false;
    }

    boolean this_present_broker_addresses = true && this.isSetBrokerAddresses();
    boolean that_present_broker_addresses = true && that.isSetBrokerAddresses();
    if (this_present_broker_addresses || that_present_broker_addresses) {
      if (!(this_present_broker_addresses && that_present_broker_addresses))
        return false;
      if (!this.broker_addresses.equals(that.broker_addresses))
        return false;
    }

    return true;
  }

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

    hashCode = hashCode * 8191 + ((isSetDbName()) ? 131071 : 524287);
    if (isSetDbName())
      hashCode = hashCode * 8191 + db_name.hashCode();

    hashCode = hashCode * 8191 + ((isSetTableName()) ? 131071 : 524287);
    if (isSetTableName())
      hashCode = hashCode * 8191 + table_name.hashCode();

    hashCode = hashCode * 8191 + ((isSetColumns()) ? 131071 : 524287);
    if (isSetColumns())
      hashCode = hashCode * 8191 + columns.hashCode();

    hashCode = hashCode * 8191 + ((isSetPartitions()) ? 131071 : 524287);
    if (isSetPartitions())
      hashCode = hashCode * 8191 + partitions.hashCode();

    hashCode = hashCode * 8191 + ((isSetBucketInfo()) ? 131071 : 524287);
    if (isSetBucketInfo())
      hashCode = hashCode * 8191 + bucket_info.hashCode();

    hashCode = hashCode * 8191 + ((isSetFileFormat()) ? 131071 : 524287);
    if (isSetFileFormat())
      hashCode = hashCode * 8191 + file_format.getValue();

    hashCode = hashCode * 8191 + ((isSetCompressionType()) ? 131071 : 524287);
    if (isSetCompressionType())
      hashCode = hashCode * 8191 + compression_type.getValue();

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

    hashCode = hashCode * 8191 + ((isSetHadoopConfig()) ? 131071 : 524287);
    if (isSetHadoopConfig())
      hashCode = hashCode * 8191 + hadoop_config.hashCode();

    hashCode = hashCode * 8191 + ((isSetOverwrite()) ? 131071 : 524287);
    if (isSetOverwrite())
      hashCode = hashCode * 8191 + ((overwrite) ? 131071 : 524287);

    hashCode = hashCode * 8191 + ((isSetSerdeProperties()) ? 131071 : 524287);
    if (isSetSerdeProperties())
      hashCode = hashCode * 8191 + serde_properties.hashCode();

    hashCode = hashCode * 8191 + ((isSetBrokerAddresses()) ? 131071 : 524287);
    if (isSetBrokerAddresses())
      hashCode = hashCode * 8191 + broker_addresses.hashCode();

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetDbName(), other.isSetDbName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDbName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.db_name, other.db_name);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetTableName(), other.isSetTableName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTableName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table_name, other.table_name);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetColumns(), other.isSetColumns());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetColumns()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columns, other.columns);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetPartitions(), other.isSetPartitions());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPartitions()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.partitions, other.partitions);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetBucketInfo(), other.isSetBucketInfo());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetBucketInfo()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bucket_info, other.bucket_info);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetFileFormat(), other.isSetFileFormat());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetFileFormat()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.file_format, other.file_format);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetCompressionType(), other.isSetCompressionType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCompressionType()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.compression_type, other.compression_type);
      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(isSetHadoopConfig(), other.isSetHadoopConfig());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetHadoopConfig()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hadoop_config, other.hadoop_config);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetOverwrite(), other.isSetOverwrite());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetOverwrite()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.overwrite, other.overwrite);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetSerdeProperties(), other.isSetSerdeProperties());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSerdeProperties()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serde_properties, other.serde_properties);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetBrokerAddresses(), other.isSetBrokerAddresses());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetBrokerAddresses()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.broker_addresses, other.broker_addresses);
      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("THiveTableSink(");
    boolean first = true;

    if (isSetDbName()) {
      sb.append("db_name:");
      if (this.db_name == null) {
        sb.append("null");
      } else {
        sb.append(this.db_name);
      }
      first = false;
    }
    if (isSetTableName()) {
      if (!first) sb.append(", ");
      sb.append("table_name:");
      if (this.table_name == null) {
        sb.append("null");
      } else {
        sb.append(this.table_name);
      }
      first = false;
    }
    if (isSetColumns()) {
      if (!first) sb.append(", ");
      sb.append("columns:");
      if (this.columns == null) {
        sb.append("null");
      } else {
        sb.append(this.columns);
      }
      first = false;
    }
    if (isSetPartitions()) {
      if (!first) sb.append(", ");
      sb.append("partitions:");
      if (this.partitions == null) {
        sb.append("null");
      } else {
        sb.append(this.partitions);
      }
      first = false;
    }
    if (isSetBucketInfo()) {
      if (!first) sb.append(", ");
      sb.append("bucket_info:");
      if (this.bucket_info == null) {
        sb.append("null");
      } else {
        sb.append(this.bucket_info);
      }
      first = false;
    }
    if (isSetFileFormat()) {
      if (!first) sb.append(", ");
      sb.append("file_format:");
      if (this.file_format == null) {
        sb.append("null");
      } else {
        sb.append(this.file_format);
      }
      first = false;
    }
    if (isSetCompressionType()) {
      if (!first) sb.append(", ");
      sb.append("compression_type:");
      if (this.compression_type == null) {
        sb.append("null");
      } else {
        sb.append(this.compression_type);
      }
      first = false;
    }
    if (isSetLocation()) {
      if (!first) sb.append(", ");
      sb.append("location:");
      if (this.location == null) {
        sb.append("null");
      } else {
        sb.append(this.location);
      }
      first = false;
    }
    if (isSetHadoopConfig()) {
      if (!first) sb.append(", ");
      sb.append("hadoop_config:");
      if (this.hadoop_config == null) {
        sb.append("null");
      } else {
        sb.append(this.hadoop_config);
      }
      first = false;
    }
    if (isSetOverwrite()) {
      if (!first) sb.append(", ");
      sb.append("overwrite:");
      sb.append(this.overwrite);
      first = false;
    }
    if (isSetSerdeProperties()) {
      if (!first) sb.append(", ");
      sb.append("serde_properties:");
      if (this.serde_properties == null) {
        sb.append("null");
      } else {
        sb.append(this.serde_properties);
      }
      first = false;
    }
    if (isSetBrokerAddresses()) {
      if (!first) sb.append(", ");
      sb.append("broker_addresses:");
      if (this.broker_addresses == null) {
        sb.append("null");
      } else {
        sb.append(this.broker_addresses);
      }
      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 (bucket_info != null) {
      bucket_info.validate();
    }
    if (location != null) {
      location.validate();
    }
    if (serde_properties != null) {
      serde_properties.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 THiveTableSinkStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public THiveTableSinkStandardScheme getScheme() {
      return new THiveTableSinkStandardScheme();
    }
  }

  private static class THiveTableSinkStandardScheme extends org.apache.thrift.scheme.StandardScheme<THiveTableSink> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, THiveTableSink 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: // DB_NAME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.db_name = iprot.readString();
              struct.setDbNameIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // TABLE_NAME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.table_name = iprot.readString();
              struct.setTableNameIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // COLUMNS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list158 = iprot.readListBegin();
                struct.columns = new java.util.ArrayList<THiveColumn>(_list158.size);
                @org.apache.thrift.annotation.Nullable THiveColumn _elem159;
                for (int _i160 = 0; _i160 < _list158.size; ++_i160)
                {
                  _elem159 = new THiveColumn();
                  _elem159.read(iprot);
                  struct.columns.add(_elem159);
                }
                iprot.readListEnd();
              }
              struct.setColumnsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // PARTITIONS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list161 = iprot.readListBegin();
                struct.partitions = new java.util.ArrayList<THivePartition>(_list161.size);
                @org.apache.thrift.annotation.Nullable THivePartition _elem162;
                for (int _i163 = 0; _i163 < _list161.size; ++_i163)
                {
                  _elem162 = new THivePartition();
                  _elem162.read(iprot);
                  struct.partitions.add(_elem162);
                }
                iprot.readListEnd();
              }
              struct.setPartitionsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // BUCKET_INFO
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.bucket_info = new THiveBucket();
              struct.bucket_info.read(iprot);
              struct.setBucketInfoIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // FILE_FORMAT
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.file_format = org.apache.doris.thrift.TFileFormatType.findByValue(iprot.readI32());
              struct.setFileFormatIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // COMPRESSION_TYPE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.compression_type = org.apache.doris.thrift.TFileCompressType.findByValue(iprot.readI32());
              struct.setCompressionTypeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 8: // LOCATION
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.location = new THiveLocationParams();
              struct.location.read(iprot);
              struct.setLocationIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 9: // HADOOP_CONFIG
            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map164 = iprot.readMapBegin();
                struct.hadoop_config = new java.util.HashMap<java.lang.String,java.lang.String>(2*_map164.size);
                @org.apache.thrift.annotation.Nullable java.lang.String _key165;
                @org.apache.thrift.annotation.Nullable java.lang.String _val166;
                for (int _i167 = 0; _i167 < _map164.size; ++_i167)
                {
                  _key165 = iprot.readString();
                  _val166 = iprot.readString();
                  struct.hadoop_config.put(_key165, _val166);
                }
                iprot.readMapEnd();
              }
              struct.setHadoopConfigIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 10: // OVERWRITE
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.overwrite = iprot.readBool();
              struct.setOverwriteIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 11: // SERDE_PROPERTIES
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.serde_properties = new THiveSerDeProperties();
              struct.serde_properties.read(iprot);
              struct.setSerdePropertiesIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 12: // BROKER_ADDRESSES
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list168 = iprot.readListBegin();
                struct.broker_addresses = new java.util.ArrayList<org.apache.doris.thrift.TNetworkAddress>(_list168.size);
                @org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TNetworkAddress _elem169;
                for (int _i170 = 0; _i170 < _list168.size; ++_i170)
                {
                  _elem169 = new org.apache.doris.thrift.TNetworkAddress();
                  _elem169.read(iprot);
                  struct.broker_addresses.add(_elem169);
                }
                iprot.readListEnd();
              }
              struct.setBrokerAddressesIsSet(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();

      // check for required fields of primitive type, which can't be checked in the validate method
      struct.validate();
    }

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

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.db_name != null) {
        if (struct.isSetDbName()) {
          oprot.writeFieldBegin(DB_NAME_FIELD_DESC);
          oprot.writeString(struct.db_name);
          oprot.writeFieldEnd();
        }
      }
      if (struct.table_name != null) {
        if (struct.isSetTableName()) {
          oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC);
          oprot.writeString(struct.table_name);
          oprot.writeFieldEnd();
        }
      }
      if (struct.columns != null) {
        if (struct.isSetColumns()) {
          oprot.writeFieldBegin(COLUMNS_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.columns.size()));
            for (THiveColumn _iter171 : struct.columns)
            {
              _iter171.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.partitions != null) {
        if (struct.isSetPartitions()) {
          oprot.writeFieldBegin(PARTITIONS_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.partitions.size()));
            for (THivePartition _iter172 : struct.partitions)
            {
              _iter172.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.bucket_info != null) {
        if (struct.isSetBucketInfo()) {
          oprot.writeFieldBegin(BUCKET_INFO_FIELD_DESC);
          struct.bucket_info.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.file_format != null) {
        if (struct.isSetFileFormat()) {
          oprot.writeFieldBegin(FILE_FORMAT_FIELD_DESC);
          oprot.writeI32(struct.file_format.getValue());
          oprot.writeFieldEnd();
        }
      }
      if (struct.compression_type != null) {
        if (struct.isSetCompressionType()) {
          oprot.writeFieldBegin(COMPRESSION_TYPE_FIELD_DESC);
          oprot.writeI32(struct.compression_type.getValue());
          oprot.writeFieldEnd();
        }
      }
      if (struct.location != null) {
        if (struct.isSetLocation()) {
          oprot.writeFieldBegin(LOCATION_FIELD_DESC);
          struct.location.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.hadoop_config != null) {
        if (struct.isSetHadoopConfig()) {
          oprot.writeFieldBegin(HADOOP_CONFIG_FIELD_DESC);
          {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.hadoop_config.size()));
            for (java.util.Map.Entry<java.lang.String, java.lang.String> _iter173 : struct.hadoop_config.entrySet())
            {
              oprot.writeString(_iter173.getKey());
              oprot.writeString(_iter173.getValue());
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetOverwrite()) {
        oprot.writeFieldBegin(OVERWRITE_FIELD_DESC);
        oprot.writeBool(struct.overwrite);
        oprot.writeFieldEnd();
      }
      if (struct.serde_properties != null) {
        if (struct.isSetSerdeProperties()) {
          oprot.writeFieldBegin(SERDE_PROPERTIES_FIELD_DESC);
          struct.serde_properties.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.broker_addresses != null) {
        if (struct.isSetBrokerAddresses()) {
          oprot.writeFieldBegin(BROKER_ADDRESSES_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.broker_addresses.size()));
            for (org.apache.doris.thrift.TNetworkAddress _iter174 : struct.broker_addresses)
            {
              _iter174.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

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

  private static class THiveTableSinkTupleScheme extends org.apache.thrift.scheme.TupleScheme<THiveTableSink> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, THiveTableSink 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.isSetDbName()) {
        optionals.set(0);
      }
      if (struct.isSetTableName()) {
        optionals.set(1);
      }
      if (struct.isSetColumns()) {
        optionals.set(2);
      }
      if (struct.isSetPartitions()) {
        optionals.set(3);
      }
      if (struct.isSetBucketInfo()) {
        optionals.set(4);
      }
      if (struct.isSetFileFormat()) {
        optionals.set(5);
      }
      if (struct.isSetCompressionType()) {
        optionals.set(6);
      }
      if (struct.isSetLocation()) {
        optionals.set(7);
      }
      if (struct.isSetHadoopConfig()) {
        optionals.set(8);
      }
      if (struct.isSetOverwrite()) {
        optionals.set(9);
      }
      if (struct.isSetSerdeProperties()) {
        optionals.set(10);
      }
      if (struct.isSetBrokerAddresses()) {
        optionals.set(11);
      }
      oprot.writeBitSet(optionals, 12);
      if (struct.isSetDbName()) {
        oprot.writeString(struct.db_name);
      }
      if (struct.isSetTableName()) {
        oprot.writeString(struct.table_name);
      }
      if (struct.isSetColumns()) {
        {
          oprot.writeI32(struct.columns.size());
          for (THiveColumn _iter175 : struct.columns)
          {
            _iter175.write(oprot);
          }
        }
      }
      if (struct.isSetPartitions()) {
        {
          oprot.writeI32(struct.partitions.size());
          for (THivePartition _iter176 : struct.partitions)
          {
            _iter176.write(oprot);
          }
        }
      }
      if (struct.isSetBucketInfo()) {
        struct.bucket_info.write(oprot);
      }
      if (struct.isSetFileFormat()) {
        oprot.writeI32(struct.file_format.getValue());
      }
      if (struct.isSetCompressionType()) {
        oprot.writeI32(struct.compression_type.getValue());
      }
      if (struct.isSetLocation()) {
        struct.location.write(oprot);
      }
      if (struct.isSetHadoopConfig()) {
        {
          oprot.writeI32(struct.hadoop_config.size());
          for (java.util.Map.Entry<java.lang.String, java.lang.String> _iter177 : struct.hadoop_config.entrySet())
          {
            oprot.writeString(_iter177.getKey());
            oprot.writeString(_iter177.getValue());
          }
        }
      }
      if (struct.isSetOverwrite()) {
        oprot.writeBool(struct.overwrite);
      }
      if (struct.isSetSerdeProperties()) {
        struct.serde_properties.write(oprot);
      }
      if (struct.isSetBrokerAddresses()) {
        {
          oprot.writeI32(struct.broker_addresses.size());
          for (org.apache.doris.thrift.TNetworkAddress _iter178 : struct.broker_addresses)
          {
            _iter178.write(oprot);
          }
        }
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, THiveTableSink 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)) {
        struct.db_name = iprot.readString();
        struct.setDbNameIsSet(true);
      }
      if (incoming.get(1)) {
        struct.table_name = iprot.readString();
        struct.setTableNameIsSet(true);
      }
      if (incoming.get(2)) {
        {
          org.apache.thrift.protocol.TList _list179 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT);
          struct.columns = new java.util.ArrayList<THiveColumn>(_list179.size);
          @org.apache.thrift.annotation.Nullable THiveColumn _elem180;
          for (int _i181 = 0; _i181 < _list179.size; ++_i181)
          {
            _elem180 = new THiveColumn();
            _elem180.read(iprot);
            struct.columns.add(_elem180);
          }
        }
        struct.setColumnsIsSet(true);
      }
      if (incoming.get(3)) {
        {
          org.apache.thrift.protocol.TList _list182 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT);
          struct.partitions = new java.util.ArrayList<THivePartition>(_list182.size);
          @org.apache.thrift.annotation.Nullable THivePartition _elem183;
          for (int _i184 = 0; _i184 < _list182.size; ++_i184)
          {
            _elem183 = new THivePartition();
            _elem183.read(iprot);
            struct.partitions.add(_elem183);
          }
        }
        struct.setPartitionsIsSet(true);
      }
      if (incoming.get(4)) {
        struct.bucket_info = new THiveBucket();
        struct.bucket_info.read(iprot);
        struct.setBucketInfoIsSet(true);
      }
      if (incoming.get(5)) {
        struct.file_format = org.apache.doris.thrift.TFileFormatType.findByValue(iprot.readI32());
        struct.setFileFormatIsSet(true);
      }
      if (incoming.get(6)) {
        struct.compression_type = org.apache.doris.thrift.TFileCompressType.findByValue(iprot.readI32());
        struct.setCompressionTypeIsSet(true);
      }
      if (incoming.get(7)) {
        struct.location = new THiveLocationParams();
        struct.location.read(iprot);
        struct.setLocationIsSet(true);
      }
      if (incoming.get(8)) {
        {
          org.apache.thrift.protocol.TMap _map185 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING); 
          struct.hadoop_config = new java.util.HashMap<java.lang.String,java.lang.String>(2*_map185.size);
          @org.apache.thrift.annotation.Nullable java.lang.String _key186;
          @org.apache.thrift.annotation.Nullable java.lang.String _val187;
          for (int _i188 = 0; _i188 < _map185.size; ++_i188)
          {
            _key186 = iprot.readString();
            _val187 = iprot.readString();
            struct.hadoop_config.put(_key186, _val187);
          }
        }
        struct.setHadoopConfigIsSet(true);
      }
      if (incoming.get(9)) {
        struct.overwrite = iprot.readBool();
        struct.setOverwriteIsSet(true);
      }
      if (incoming.get(10)) {
        struct.serde_properties = new THiveSerDeProperties();
        struct.serde_properties.read(iprot);
        struct.setSerdePropertiesIsSet(true);
      }
      if (incoming.get(11)) {
        {
          org.apache.thrift.protocol.TList _list189 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT);
          struct.broker_addresses = new java.util.ArrayList<org.apache.doris.thrift.TNetworkAddress>(_list189.size);
          @org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TNetworkAddress _elem190;
          for (int _i191 = 0; _i191 < _list189.size; ++_i191)
          {
            _elem190 = new org.apache.doris.thrift.TNetworkAddress();
            _elem190.read(iprot);
            struct.broker_addresses.add(_elem190);
          }
        }
        struct.setBrokerAddressesIsSet(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();
  }
}