TIcebergTableSink.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 TIcebergTableSink implements org.apache.thrift.TBase<TIcebergTableSink, TIcebergTableSink._Fields>, java.io.Serializable, Cloneable, Comparable<TIcebergTableSink> {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TIcebergTableSink");

  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 TB_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tb_name", org.apache.thrift.protocol.TType.STRING, (short)2);
  private static final org.apache.thrift.protocol.TField SCHEMA_JSON_FIELD_DESC = new org.apache.thrift.protocol.TField("schema_json", org.apache.thrift.protocol.TType.STRING, (short)3);
  private static final org.apache.thrift.protocol.TField PARTITION_SPECS_JSON_FIELD_DESC = new org.apache.thrift.protocol.TField("partition_specs_json", org.apache.thrift.protocol.TType.MAP, (short)4);
  private static final org.apache.thrift.protocol.TField PARTITION_SPEC_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("partition_spec_id", org.apache.thrift.protocol.TType.I32, (short)5);
  private static final org.apache.thrift.protocol.TField SORT_FIELDS_FIELD_DESC = new org.apache.thrift.protocol.TField("sort_fields", org.apache.thrift.protocol.TType.LIST, (short)6);
  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)7);
  private static final org.apache.thrift.protocol.TField OUTPUT_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("output_path", org.apache.thrift.protocol.TType.STRING, (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 FILE_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("file_type", org.apache.thrift.protocol.TType.I32, (short)11);
  private static final org.apache.thrift.protocol.TField ORIGINAL_OUTPUT_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("original_output_path", org.apache.thrift.protocol.TType.STRING, (short)12);
  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)13);
  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)14);
  private static final org.apache.thrift.protocol.TField STATIC_PARTITION_VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("static_partition_values", org.apache.thrift.protocol.TType.MAP, (short)15);
  private static final org.apache.thrift.protocol.TField SORT_INFO_FIELD_DESC = new org.apache.thrift.protocol.TField("sort_info", org.apache.thrift.protocol.TType.STRUCT, (short)16);
  private static final org.apache.thrift.protocol.TField WRITE_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("write_type", org.apache.thrift.protocol.TType.I32, (short)17);

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

  public @org.apache.thrift.annotation.Nullable java.lang.String db_name; // optional
  public @org.apache.thrift.annotation.Nullable java.lang.String tb_name; // optional
  public @org.apache.thrift.annotation.Nullable java.lang.String schema_json; // optional
  public @org.apache.thrift.annotation.Nullable java.util.Map<java.lang.Integer,java.lang.String> partition_specs_json; // optional
  public int partition_spec_id; // optional
  public @org.apache.thrift.annotation.Nullable java.util.List<TSortField> sort_fields; // optional
  /**
   * 
   * @see org.apache.doris.thrift.TFileFormatType
   */
  public @org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TFileFormatType file_format; // optional
  public @org.apache.thrift.annotation.Nullable java.lang.String output_path; // optional
  public @org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,java.lang.String> hadoop_config; // optional
  public boolean overwrite; // optional
  /**
   * 
   * @see org.apache.doris.thrift.TFileType
   */
  public @org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TFileType file_type; // optional
  public @org.apache.thrift.annotation.Nullable java.lang.String original_output_path; // 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 java.util.List<org.apache.doris.thrift.TNetworkAddress> broker_addresses; // optional
  public @org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,java.lang.String> static_partition_values; // optional
  public @org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TSortInfo sort_info; // optional
  /**
   * 
   * @see TIcebergWriteType
   */
  public @org.apache.thrift.annotation.Nullable TIcebergWriteType write_type; // 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"),
    TB_NAME((short)2, "tb_name"),
    SCHEMA_JSON((short)3, "schema_json"),
    PARTITION_SPECS_JSON((short)4, "partition_specs_json"),
    PARTITION_SPEC_ID((short)5, "partition_spec_id"),
    SORT_FIELDS((short)6, "sort_fields"),
    /**
     * 
     * @see org.apache.doris.thrift.TFileFormatType
     */
    FILE_FORMAT((short)7, "file_format"),
    OUTPUT_PATH((short)8, "output_path"),
    HADOOP_CONFIG((short)9, "hadoop_config"),
    OVERWRITE((short)10, "overwrite"),
    /**
     * 
     * @see org.apache.doris.thrift.TFileType
     */
    FILE_TYPE((short)11, "file_type"),
    ORIGINAL_OUTPUT_PATH((short)12, "original_output_path"),
    /**
     * 
     * @see org.apache.doris.thrift.TFileCompressType
     */
    COMPRESSION_TYPE((short)13, "compression_type"),
    BROKER_ADDRESSES((short)14, "broker_addresses"),
    STATIC_PARTITION_VALUES((short)15, "static_partition_values"),
    SORT_INFO((short)16, "sort_info"),
    /**
     * 
     * @see TIcebergWriteType
     */
    WRITE_TYPE((short)17, "write_type");

    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: // TB_NAME
          return TB_NAME;
        case 3: // SCHEMA_JSON
          return SCHEMA_JSON;
        case 4: // PARTITION_SPECS_JSON
          return PARTITION_SPECS_JSON;
        case 5: // PARTITION_SPEC_ID
          return PARTITION_SPEC_ID;
        case 6: // SORT_FIELDS
          return SORT_FIELDS;
        case 7: // FILE_FORMAT
          return FILE_FORMAT;
        case 8: // OUTPUT_PATH
          return OUTPUT_PATH;
        case 9: // HADOOP_CONFIG
          return HADOOP_CONFIG;
        case 10: // OVERWRITE
          return OVERWRITE;
        case 11: // FILE_TYPE
          return FILE_TYPE;
        case 12: // ORIGINAL_OUTPUT_PATH
          return ORIGINAL_OUTPUT_PATH;
        case 13: // COMPRESSION_TYPE
          return COMPRESSION_TYPE;
        case 14: // BROKER_ADDRESSES
          return BROKER_ADDRESSES;
        case 15: // STATIC_PARTITION_VALUES
          return STATIC_PARTITION_VALUES;
        case 16: // SORT_INFO
          return SORT_INFO;
        case 17: // WRITE_TYPE
          return WRITE_TYPE;
        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 __PARTITION_SPEC_ID_ISSET_ID = 0;
  private static final int __OVERWRITE_ISSET_ID = 1;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.DB_NAME,_Fields.TB_NAME,_Fields.SCHEMA_JSON,_Fields.PARTITION_SPECS_JSON,_Fields.PARTITION_SPEC_ID,_Fields.SORT_FIELDS,_Fields.FILE_FORMAT,_Fields.OUTPUT_PATH,_Fields.HADOOP_CONFIG,_Fields.OVERWRITE,_Fields.FILE_TYPE,_Fields.ORIGINAL_OUTPUT_PATH,_Fields.COMPRESSION_TYPE,_Fields.BROKER_ADDRESSES,_Fields.STATIC_PARTITION_VALUES,_Fields.SORT_INFO,_Fields.WRITE_TYPE};
  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.TB_NAME, new org.apache.thrift.meta_data.FieldMetaData("tb_name", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.SCHEMA_JSON, new org.apache.thrift.meta_data.FieldMetaData("schema_json", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.PARTITION_SPECS_JSON, new org.apache.thrift.meta_data.FieldMetaData("partition_specs_json", 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.I32), 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
    tmpMap.put(_Fields.PARTITION_SPEC_ID, new org.apache.thrift.meta_data.FieldMetaData("partition_spec_id", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.SORT_FIELDS, new org.apache.thrift.meta_data.FieldMetaData("sort_fields", 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, TSortField.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.OUTPUT_PATH, new org.apache.thrift.meta_data.FieldMetaData("output_path", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    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.FILE_TYPE, new org.apache.thrift.meta_data.FieldMetaData("file_type", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, org.apache.doris.thrift.TFileType.class)));
    tmpMap.put(_Fields.ORIGINAL_OUTPUT_PATH, new org.apache.thrift.meta_data.FieldMetaData("original_output_path", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    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.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))));
    tmpMap.put(_Fields.STATIC_PARTITION_VALUES, new org.apache.thrift.meta_data.FieldMetaData("static_partition_values", 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.SORT_INFO, new org.apache.thrift.meta_data.FieldMetaData("sort_info", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.doris.thrift.TSortInfo.class)));
    tmpMap.put(_Fields.WRITE_TYPE, new org.apache.thrift.meta_data.FieldMetaData("write_type", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TIcebergWriteType.class)));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TIcebergTableSink.class, metaDataMap);
  }

  public TIcebergTableSink() {
    this.write_type = org.apache.doris.thrift.TIcebergWriteType.INSERT;

  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public TIcebergTableSink(TIcebergTableSink other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetDbName()) {
      this.db_name = other.db_name;
    }
    if (other.isSetTbName()) {
      this.tb_name = other.tb_name;
    }
    if (other.isSetSchemaJson()) {
      this.schema_json = other.schema_json;
    }
    if (other.isSetPartitionSpecsJson()) {
      java.util.Map<java.lang.Integer,java.lang.String> __this__partition_specs_json = new java.util.HashMap<java.lang.Integer,java.lang.String>(other.partition_specs_json);
      this.partition_specs_json = __this__partition_specs_json;
    }
    this.partition_spec_id = other.partition_spec_id;
    if (other.isSetSortFields()) {
      java.util.List<TSortField> __this__sort_fields = new java.util.ArrayList<TSortField>(other.sort_fields.size());
      for (TSortField other_element : other.sort_fields) {
        __this__sort_fields.add(new TSortField(other_element));
      }
      this.sort_fields = __this__sort_fields;
    }
    if (other.isSetFileFormat()) {
      this.file_format = other.file_format;
    }
    if (other.isSetOutputPath()) {
      this.output_path = other.output_path;
    }
    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.isSetFileType()) {
      this.file_type = other.file_type;
    }
    if (other.isSetOriginalOutputPath()) {
      this.original_output_path = other.original_output_path;
    }
    if (other.isSetCompressionType()) {
      this.compression_type = other.compression_type;
    }
    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;
    }
    if (other.isSetStaticPartitionValues()) {
      java.util.Map<java.lang.String,java.lang.String> __this__static_partition_values = new java.util.HashMap<java.lang.String,java.lang.String>(other.static_partition_values);
      this.static_partition_values = __this__static_partition_values;
    }
    if (other.isSetSortInfo()) {
      this.sort_info = new org.apache.doris.thrift.TSortInfo(other.sort_info);
    }
    if (other.isSetWriteType()) {
      this.write_type = other.write_type;
    }
  }

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

  @Override
  public void clear() {
    this.db_name = null;
    this.tb_name = null;
    this.schema_json = null;
    this.partition_specs_json = null;
    setPartitionSpecIdIsSet(false);
    this.partition_spec_id = 0;
    this.sort_fields = null;
    this.file_format = null;
    this.output_path = null;
    this.hadoop_config = null;
    setOverwriteIsSet(false);
    this.overwrite = false;
    this.file_type = null;
    this.original_output_path = null;
    this.compression_type = null;
    this.broker_addresses = null;
    this.static_partition_values = null;
    this.sort_info = null;
    this.write_type = org.apache.doris.thrift.TIcebergWriteType.INSERT;

  }

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

  public TIcebergTableSink 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 getTbName() {
    return this.tb_name;
  }

  public TIcebergTableSink setTbName(@org.apache.thrift.annotation.Nullable java.lang.String tb_name) {
    this.tb_name = tb_name;
    return this;
  }

  public void unsetTbName() {
    this.tb_name = null;
  }

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

  public void setTbNameIsSet(boolean value) {
    if (!value) {
      this.tb_name = null;
    }
  }

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

  public TIcebergTableSink setSchemaJson(@org.apache.thrift.annotation.Nullable java.lang.String schema_json) {
    this.schema_json = schema_json;
    return this;
  }

  public void unsetSchemaJson() {
    this.schema_json = null;
  }

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

  public void setSchemaJsonIsSet(boolean value) {
    if (!value) {
      this.schema_json = null;
    }
  }

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

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

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

  public TIcebergTableSink setPartitionSpecsJson(@org.apache.thrift.annotation.Nullable java.util.Map<java.lang.Integer,java.lang.String> partition_specs_json) {
    this.partition_specs_json = partition_specs_json;
    return this;
  }

  public void unsetPartitionSpecsJson() {
    this.partition_specs_json = null;
  }

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

  public void setPartitionSpecsJsonIsSet(boolean value) {
    if (!value) {
      this.partition_specs_json = null;
    }
  }

  public int getPartitionSpecId() {
    return this.partition_spec_id;
  }

  public TIcebergTableSink setPartitionSpecId(int partition_spec_id) {
    this.partition_spec_id = partition_spec_id;
    setPartitionSpecIdIsSet(true);
    return this;
  }

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

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

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

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

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

  public void addToSortFields(TSortField elem) {
    if (this.sort_fields == null) {
      this.sort_fields = new java.util.ArrayList<TSortField>();
    }
    this.sort_fields.add(elem);
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.List<TSortField> getSortFields() {
    return this.sort_fields;
  }

  public TIcebergTableSink setSortFields(@org.apache.thrift.annotation.Nullable java.util.List<TSortField> sort_fields) {
    this.sort_fields = sort_fields;
    return this;
  }

  public void unsetSortFields() {
    this.sort_fields = null;
  }

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

  public void setSortFieldsIsSet(boolean value) {
    if (!value) {
      this.sort_fields = 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 TIcebergTableSink 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;
    }
  }

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

  public TIcebergTableSink setOutputPath(@org.apache.thrift.annotation.Nullable java.lang.String output_path) {
    this.output_path = output_path;
    return this;
  }

  public void unsetOutputPath() {
    this.output_path = null;
  }

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

  public void setOutputPathIsSet(boolean value) {
    if (!value) {
      this.output_path = 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 TIcebergTableSink 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 TIcebergTableSink 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);
  }

  /**
   * 
   * @see org.apache.doris.thrift.TFileType
   */
  @org.apache.thrift.annotation.Nullable
  public org.apache.doris.thrift.TFileType getFileType() {
    return this.file_type;
  }

  /**
   * 
   * @see org.apache.doris.thrift.TFileType
   */
  public TIcebergTableSink setFileType(@org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TFileType file_type) {
    this.file_type = file_type;
    return this;
  }

  public void unsetFileType() {
    this.file_type = null;
  }

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

  public void setFileTypeIsSet(boolean value) {
    if (!value) {
      this.file_type = null;
    }
  }

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

  public TIcebergTableSink setOriginalOutputPath(@org.apache.thrift.annotation.Nullable java.lang.String original_output_path) {
    this.original_output_path = original_output_path;
    return this;
  }

  public void unsetOriginalOutputPath() {
    this.original_output_path = null;
  }

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

  public void setOriginalOutputPathIsSet(boolean value) {
    if (!value) {
      this.original_output_path = 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 TIcebergTableSink 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;
    }
  }

  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 TIcebergTableSink 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 int getStaticPartitionValuesSize() {
    return (this.static_partition_values == null) ? 0 : this.static_partition_values.size();
  }

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

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

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

  public void unsetStaticPartitionValues() {
    this.static_partition_values = null;
  }

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

  public void setStaticPartitionValuesIsSet(boolean value) {
    if (!value) {
      this.static_partition_values = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public org.apache.doris.thrift.TSortInfo getSortInfo() {
    return this.sort_info;
  }

  public TIcebergTableSink setSortInfo(@org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TSortInfo sort_info) {
    this.sort_info = sort_info;
    return this;
  }

  public void unsetSortInfo() {
    this.sort_info = null;
  }

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

  public void setSortInfoIsSet(boolean value) {
    if (!value) {
      this.sort_info = null;
    }
  }

  /**
   * 
   * @see TIcebergWriteType
   */
  @org.apache.thrift.annotation.Nullable
  public TIcebergWriteType getWriteType() {
    return this.write_type;
  }

  /**
   * 
   * @see TIcebergWriteType
   */
  public TIcebergTableSink setWriteType(@org.apache.thrift.annotation.Nullable TIcebergWriteType write_type) {
    this.write_type = write_type;
    return this;
  }

  public void unsetWriteType() {
    this.write_type = null;
  }

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

  public void setWriteTypeIsSet(boolean value) {
    if (!value) {
      this.write_type = 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 TB_NAME:
      if (value == null) {
        unsetTbName();
      } else {
        setTbName((java.lang.String)value);
      }
      break;

    case SCHEMA_JSON:
      if (value == null) {
        unsetSchemaJson();
      } else {
        setSchemaJson((java.lang.String)value);
      }
      break;

    case PARTITION_SPECS_JSON:
      if (value == null) {
        unsetPartitionSpecsJson();
      } else {
        setPartitionSpecsJson((java.util.Map<java.lang.Integer,java.lang.String>)value);
      }
      break;

    case PARTITION_SPEC_ID:
      if (value == null) {
        unsetPartitionSpecId();
      } else {
        setPartitionSpecId((java.lang.Integer)value);
      }
      break;

    case SORT_FIELDS:
      if (value == null) {
        unsetSortFields();
      } else {
        setSortFields((java.util.List<TSortField>)value);
      }
      break;

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

    case OUTPUT_PATH:
      if (value == null) {
        unsetOutputPath();
      } else {
        setOutputPath((java.lang.String)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 FILE_TYPE:
      if (value == null) {
        unsetFileType();
      } else {
        setFileType((org.apache.doris.thrift.TFileType)value);
      }
      break;

    case ORIGINAL_OUTPUT_PATH:
      if (value == null) {
        unsetOriginalOutputPath();
      } else {
        setOriginalOutputPath((java.lang.String)value);
      }
      break;

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

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

    case STATIC_PARTITION_VALUES:
      if (value == null) {
        unsetStaticPartitionValues();
      } else {
        setStaticPartitionValues((java.util.Map<java.lang.String,java.lang.String>)value);
      }
      break;

    case SORT_INFO:
      if (value == null) {
        unsetSortInfo();
      } else {
        setSortInfo((org.apache.doris.thrift.TSortInfo)value);
      }
      break;

    case WRITE_TYPE:
      if (value == null) {
        unsetWriteType();
      } else {
        setWriteType((TIcebergWriteType)value);
      }
      break;

    }
  }

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

    case TB_NAME:
      return getTbName();

    case SCHEMA_JSON:
      return getSchemaJson();

    case PARTITION_SPECS_JSON:
      return getPartitionSpecsJson();

    case PARTITION_SPEC_ID:
      return getPartitionSpecId();

    case SORT_FIELDS:
      return getSortFields();

    case FILE_FORMAT:
      return getFileFormat();

    case OUTPUT_PATH:
      return getOutputPath();

    case HADOOP_CONFIG:
      return getHadoopConfig();

    case OVERWRITE:
      return isOverwrite();

    case FILE_TYPE:
      return getFileType();

    case ORIGINAL_OUTPUT_PATH:
      return getOriginalOutputPath();

    case COMPRESSION_TYPE:
      return getCompressionType();

    case BROKER_ADDRESSES:
      return getBrokerAddresses();

    case STATIC_PARTITION_VALUES:
      return getStaticPartitionValues();

    case SORT_INFO:
      return getSortInfo();

    case WRITE_TYPE:
      return getWriteType();

    }
    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 TB_NAME:
      return isSetTbName();
    case SCHEMA_JSON:
      return isSetSchemaJson();
    case PARTITION_SPECS_JSON:
      return isSetPartitionSpecsJson();
    case PARTITION_SPEC_ID:
      return isSetPartitionSpecId();
    case SORT_FIELDS:
      return isSetSortFields();
    case FILE_FORMAT:
      return isSetFileFormat();
    case OUTPUT_PATH:
      return isSetOutputPath();
    case HADOOP_CONFIG:
      return isSetHadoopConfig();
    case OVERWRITE:
      return isSetOverwrite();
    case FILE_TYPE:
      return isSetFileType();
    case ORIGINAL_OUTPUT_PATH:
      return isSetOriginalOutputPath();
    case COMPRESSION_TYPE:
      return isSetCompressionType();
    case BROKER_ADDRESSES:
      return isSetBrokerAddresses();
    case STATIC_PARTITION_VALUES:
      return isSetStaticPartitionValues();
    case SORT_INFO:
      return isSetSortInfo();
    case WRITE_TYPE:
      return isSetWriteType();
    }
    throw new java.lang.IllegalStateException();
  }

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

  public boolean equals(TIcebergTableSink 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_tb_name = true && this.isSetTbName();
    boolean that_present_tb_name = true && that.isSetTbName();
    if (this_present_tb_name || that_present_tb_name) {
      if (!(this_present_tb_name && that_present_tb_name))
        return false;
      if (!this.tb_name.equals(that.tb_name))
        return false;
    }

    boolean this_present_schema_json = true && this.isSetSchemaJson();
    boolean that_present_schema_json = true && that.isSetSchemaJson();
    if (this_present_schema_json || that_present_schema_json) {
      if (!(this_present_schema_json && that_present_schema_json))
        return false;
      if (!this.schema_json.equals(that.schema_json))
        return false;
    }

    boolean this_present_partition_specs_json = true && this.isSetPartitionSpecsJson();
    boolean that_present_partition_specs_json = true && that.isSetPartitionSpecsJson();
    if (this_present_partition_specs_json || that_present_partition_specs_json) {
      if (!(this_present_partition_specs_json && that_present_partition_specs_json))
        return false;
      if (!this.partition_specs_json.equals(that.partition_specs_json))
        return false;
    }

    boolean this_present_partition_spec_id = true && this.isSetPartitionSpecId();
    boolean that_present_partition_spec_id = true && that.isSetPartitionSpecId();
    if (this_present_partition_spec_id || that_present_partition_spec_id) {
      if (!(this_present_partition_spec_id && that_present_partition_spec_id))
        return false;
      if (this.partition_spec_id != that.partition_spec_id)
        return false;
    }

    boolean this_present_sort_fields = true && this.isSetSortFields();
    boolean that_present_sort_fields = true && that.isSetSortFields();
    if (this_present_sort_fields || that_present_sort_fields) {
      if (!(this_present_sort_fields && that_present_sort_fields))
        return false;
      if (!this.sort_fields.equals(that.sort_fields))
        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_output_path = true && this.isSetOutputPath();
    boolean that_present_output_path = true && that.isSetOutputPath();
    if (this_present_output_path || that_present_output_path) {
      if (!(this_present_output_path && that_present_output_path))
        return false;
      if (!this.output_path.equals(that.output_path))
        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_file_type = true && this.isSetFileType();
    boolean that_present_file_type = true && that.isSetFileType();
    if (this_present_file_type || that_present_file_type) {
      if (!(this_present_file_type && that_present_file_type))
        return false;
      if (!this.file_type.equals(that.file_type))
        return false;
    }

    boolean this_present_original_output_path = true && this.isSetOriginalOutputPath();
    boolean that_present_original_output_path = true && that.isSetOriginalOutputPath();
    if (this_present_original_output_path || that_present_original_output_path) {
      if (!(this_present_original_output_path && that_present_original_output_path))
        return false;
      if (!this.original_output_path.equals(that.original_output_path))
        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_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;
    }

    boolean this_present_static_partition_values = true && this.isSetStaticPartitionValues();
    boolean that_present_static_partition_values = true && that.isSetStaticPartitionValues();
    if (this_present_static_partition_values || that_present_static_partition_values) {
      if (!(this_present_static_partition_values && that_present_static_partition_values))
        return false;
      if (!this.static_partition_values.equals(that.static_partition_values))
        return false;
    }

    boolean this_present_sort_info = true && this.isSetSortInfo();
    boolean that_present_sort_info = true && that.isSetSortInfo();
    if (this_present_sort_info || that_present_sort_info) {
      if (!(this_present_sort_info && that_present_sort_info))
        return false;
      if (!this.sort_info.equals(that.sort_info))
        return false;
    }

    boolean this_present_write_type = true && this.isSetWriteType();
    boolean that_present_write_type = true && that.isSetWriteType();
    if (this_present_write_type || that_present_write_type) {
      if (!(this_present_write_type && that_present_write_type))
        return false;
      if (!this.write_type.equals(that.write_type))
        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 + ((isSetTbName()) ? 131071 : 524287);
    if (isSetTbName())
      hashCode = hashCode * 8191 + tb_name.hashCode();

    hashCode = hashCode * 8191 + ((isSetSchemaJson()) ? 131071 : 524287);
    if (isSetSchemaJson())
      hashCode = hashCode * 8191 + schema_json.hashCode();

    hashCode = hashCode * 8191 + ((isSetPartitionSpecsJson()) ? 131071 : 524287);
    if (isSetPartitionSpecsJson())
      hashCode = hashCode * 8191 + partition_specs_json.hashCode();

    hashCode = hashCode * 8191 + ((isSetPartitionSpecId()) ? 131071 : 524287);
    if (isSetPartitionSpecId())
      hashCode = hashCode * 8191 + partition_spec_id;

    hashCode = hashCode * 8191 + ((isSetSortFields()) ? 131071 : 524287);
    if (isSetSortFields())
      hashCode = hashCode * 8191 + sort_fields.hashCode();

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

    hashCode = hashCode * 8191 + ((isSetOutputPath()) ? 131071 : 524287);
    if (isSetOutputPath())
      hashCode = hashCode * 8191 + output_path.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 + ((isSetFileType()) ? 131071 : 524287);
    if (isSetFileType())
      hashCode = hashCode * 8191 + file_type.getValue();

    hashCode = hashCode * 8191 + ((isSetOriginalOutputPath()) ? 131071 : 524287);
    if (isSetOriginalOutputPath())
      hashCode = hashCode * 8191 + original_output_path.hashCode();

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

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

    hashCode = hashCode * 8191 + ((isSetStaticPartitionValues()) ? 131071 : 524287);
    if (isSetStaticPartitionValues())
      hashCode = hashCode * 8191 + static_partition_values.hashCode();

    hashCode = hashCode * 8191 + ((isSetSortInfo()) ? 131071 : 524287);
    if (isSetSortInfo())
      hashCode = hashCode * 8191 + sort_info.hashCode();

    hashCode = hashCode * 8191 + ((isSetWriteType()) ? 131071 : 524287);
    if (isSetWriteType())
      hashCode = hashCode * 8191 + write_type.getValue();

    return hashCode;
  }

  @Override
  public int compareTo(TIcebergTableSink 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(isSetTbName(), other.isSetTbName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTbName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tb_name, other.tb_name);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetSchemaJson(), other.isSetSchemaJson());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSchemaJson()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schema_json, other.schema_json);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetPartitionSpecsJson(), other.isSetPartitionSpecsJson());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPartitionSpecsJson()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.partition_specs_json, other.partition_specs_json);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetPartitionSpecId(), other.isSetPartitionSpecId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPartitionSpecId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.partition_spec_id, other.partition_spec_id);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetSortFields(), other.isSetSortFields());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSortFields()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sort_fields, other.sort_fields);
      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(isSetOutputPath(), other.isSetOutputPath());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetOutputPath()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.output_path, other.output_path);
      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(isSetFileType(), other.isSetFileType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetFileType()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.file_type, other.file_type);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetOriginalOutputPath(), other.isSetOriginalOutputPath());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetOriginalOutputPath()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.original_output_path, other.original_output_path);
      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(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;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetStaticPartitionValues(), other.isSetStaticPartitionValues());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStaticPartitionValues()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.static_partition_values, other.static_partition_values);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetSortInfo(), other.isSetSortInfo());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSortInfo()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sort_info, other.sort_info);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetWriteType(), other.isSetWriteType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetWriteType()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.write_type, other.write_type);
      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("TIcebergTableSink(");
    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 (isSetTbName()) {
      if (!first) sb.append(", ");
      sb.append("tb_name:");
      if (this.tb_name == null) {
        sb.append("null");
      } else {
        sb.append(this.tb_name);
      }
      first = false;
    }
    if (isSetSchemaJson()) {
      if (!first) sb.append(", ");
      sb.append("schema_json:");
      if (this.schema_json == null) {
        sb.append("null");
      } else {
        sb.append(this.schema_json);
      }
      first = false;
    }
    if (isSetPartitionSpecsJson()) {
      if (!first) sb.append(", ");
      sb.append("partition_specs_json:");
      if (this.partition_specs_json == null) {
        sb.append("null");
      } else {
        sb.append(this.partition_specs_json);
      }
      first = false;
    }
    if (isSetPartitionSpecId()) {
      if (!first) sb.append(", ");
      sb.append("partition_spec_id:");
      sb.append(this.partition_spec_id);
      first = false;
    }
    if (isSetSortFields()) {
      if (!first) sb.append(", ");
      sb.append("sort_fields:");
      if (this.sort_fields == null) {
        sb.append("null");
      } else {
        sb.append(this.sort_fields);
      }
      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 (isSetOutputPath()) {
      if (!first) sb.append(", ");
      sb.append("output_path:");
      if (this.output_path == null) {
        sb.append("null");
      } else {
        sb.append(this.output_path);
      }
      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 (isSetFileType()) {
      if (!first) sb.append(", ");
      sb.append("file_type:");
      if (this.file_type == null) {
        sb.append("null");
      } else {
        sb.append(this.file_type);
      }
      first = false;
    }
    if (isSetOriginalOutputPath()) {
      if (!first) sb.append(", ");
      sb.append("original_output_path:");
      if (this.original_output_path == null) {
        sb.append("null");
      } else {
        sb.append(this.original_output_path);
      }
      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 (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;
    }
    if (isSetStaticPartitionValues()) {
      if (!first) sb.append(", ");
      sb.append("static_partition_values:");
      if (this.static_partition_values == null) {
        sb.append("null");
      } else {
        sb.append(this.static_partition_values);
      }
      first = false;
    }
    if (isSetSortInfo()) {
      if (!first) sb.append(", ");
      sb.append("sort_info:");
      if (this.sort_info == null) {
        sb.append("null");
      } else {
        sb.append(this.sort_info);
      }
      first = false;
    }
    if (isSetWriteType()) {
      if (!first) sb.append(", ");
      sb.append("write_type:");
      if (this.write_type == null) {
        sb.append("null");
      } else {
        sb.append(this.write_type);
      }
      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 (sort_info != null) {
      sort_info.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 TIcebergTableSinkStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public TIcebergTableSinkStandardScheme getScheme() {
      return new TIcebergTableSinkStandardScheme();
    }
  }

  private static class TIcebergTableSinkStandardScheme extends org.apache.thrift.scheme.StandardScheme<TIcebergTableSink> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, TIcebergTableSink 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: // TB_NAME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.tb_name = iprot.readString();
              struct.setTbNameIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // SCHEMA_JSON
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.schema_json = iprot.readString();
              struct.setSchemaJsonIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // PARTITION_SPECS_JSON
            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map302 = iprot.readMapBegin();
                struct.partition_specs_json = new java.util.HashMap<java.lang.Integer,java.lang.String>(2*_map302.size);
                int _key303;
                @org.apache.thrift.annotation.Nullable java.lang.String _val304;
                for (int _i305 = 0; _i305 < _map302.size; ++_i305)
                {
                  _key303 = iprot.readI32();
                  _val304 = iprot.readString();
                  struct.partition_specs_json.put(_key303, _val304);
                }
                iprot.readMapEnd();
              }
              struct.setPartitionSpecsJsonIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // PARTITION_SPEC_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.partition_spec_id = iprot.readI32();
              struct.setPartitionSpecIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // SORT_FIELDS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list306 = iprot.readListBegin();
                struct.sort_fields = new java.util.ArrayList<TSortField>(_list306.size);
                @org.apache.thrift.annotation.Nullable TSortField _elem307;
                for (int _i308 = 0; _i308 < _list306.size; ++_i308)
                {
                  _elem307 = new TSortField();
                  _elem307.read(iprot);
                  struct.sort_fields.add(_elem307);
                }
                iprot.readListEnd();
              }
              struct.setSortFieldsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // 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 8: // OUTPUT_PATH
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.output_path = iprot.readString();
              struct.setOutputPathIsSet(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 _map309 = iprot.readMapBegin();
                struct.hadoop_config = new java.util.HashMap<java.lang.String,java.lang.String>(2*_map309.size);
                @org.apache.thrift.annotation.Nullable java.lang.String _key310;
                @org.apache.thrift.annotation.Nullable java.lang.String _val311;
                for (int _i312 = 0; _i312 < _map309.size; ++_i312)
                {
                  _key310 = iprot.readString();
                  _val311 = iprot.readString();
                  struct.hadoop_config.put(_key310, _val311);
                }
                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: // FILE_TYPE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.file_type = org.apache.doris.thrift.TFileType.findByValue(iprot.readI32());
              struct.setFileTypeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 12: // ORIGINAL_OUTPUT_PATH
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.original_output_path = iprot.readString();
              struct.setOriginalOutputPathIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 13: // 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 14: // BROKER_ADDRESSES
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list313 = iprot.readListBegin();
                struct.broker_addresses = new java.util.ArrayList<org.apache.doris.thrift.TNetworkAddress>(_list313.size);
                @org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TNetworkAddress _elem314;
                for (int _i315 = 0; _i315 < _list313.size; ++_i315)
                {
                  _elem314 = new org.apache.doris.thrift.TNetworkAddress();
                  _elem314.read(iprot);
                  struct.broker_addresses.add(_elem314);
                }
                iprot.readListEnd();
              }
              struct.setBrokerAddressesIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 15: // STATIC_PARTITION_VALUES
            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map316 = iprot.readMapBegin();
                struct.static_partition_values = new java.util.HashMap<java.lang.String,java.lang.String>(2*_map316.size);
                @org.apache.thrift.annotation.Nullable java.lang.String _key317;
                @org.apache.thrift.annotation.Nullable java.lang.String _val318;
                for (int _i319 = 0; _i319 < _map316.size; ++_i319)
                {
                  _key317 = iprot.readString();
                  _val318 = iprot.readString();
                  struct.static_partition_values.put(_key317, _val318);
                }
                iprot.readMapEnd();
              }
              struct.setStaticPartitionValuesIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 16: // SORT_INFO
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.sort_info = new org.apache.doris.thrift.TSortInfo();
              struct.sort_info.read(iprot);
              struct.setSortInfoIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 17: // WRITE_TYPE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.write_type = org.apache.doris.thrift.TIcebergWriteType.findByValue(iprot.readI32());
              struct.setWriteTypeIsSet(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, TIcebergTableSink 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.tb_name != null) {
        if (struct.isSetTbName()) {
          oprot.writeFieldBegin(TB_NAME_FIELD_DESC);
          oprot.writeString(struct.tb_name);
          oprot.writeFieldEnd();
        }
      }
      if (struct.schema_json != null) {
        if (struct.isSetSchemaJson()) {
          oprot.writeFieldBegin(SCHEMA_JSON_FIELD_DESC);
          oprot.writeString(struct.schema_json);
          oprot.writeFieldEnd();
        }
      }
      if (struct.partition_specs_json != null) {
        if (struct.isSetPartitionSpecsJson()) {
          oprot.writeFieldBegin(PARTITION_SPECS_JSON_FIELD_DESC);
          {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.STRING, struct.partition_specs_json.size()));
            for (java.util.Map.Entry<java.lang.Integer, java.lang.String> _iter320 : struct.partition_specs_json.entrySet())
            {
              oprot.writeI32(_iter320.getKey());
              oprot.writeString(_iter320.getValue());
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetPartitionSpecId()) {
        oprot.writeFieldBegin(PARTITION_SPEC_ID_FIELD_DESC);
        oprot.writeI32(struct.partition_spec_id);
        oprot.writeFieldEnd();
      }
      if (struct.sort_fields != null) {
        if (struct.isSetSortFields()) {
          oprot.writeFieldBegin(SORT_FIELDS_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.sort_fields.size()));
            for (TSortField _iter321 : struct.sort_fields)
            {
              _iter321.write(oprot);
            }
            oprot.writeListEnd();
          }
          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.output_path != null) {
        if (struct.isSetOutputPath()) {
          oprot.writeFieldBegin(OUTPUT_PATH_FIELD_DESC);
          oprot.writeString(struct.output_path);
          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> _iter322 : struct.hadoop_config.entrySet())
            {
              oprot.writeString(_iter322.getKey());
              oprot.writeString(_iter322.getValue());
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetOverwrite()) {
        oprot.writeFieldBegin(OVERWRITE_FIELD_DESC);
        oprot.writeBool(struct.overwrite);
        oprot.writeFieldEnd();
      }
      if (struct.file_type != null) {
        if (struct.isSetFileType()) {
          oprot.writeFieldBegin(FILE_TYPE_FIELD_DESC);
          oprot.writeI32(struct.file_type.getValue());
          oprot.writeFieldEnd();
        }
      }
      if (struct.original_output_path != null) {
        if (struct.isSetOriginalOutputPath()) {
          oprot.writeFieldBegin(ORIGINAL_OUTPUT_PATH_FIELD_DESC);
          oprot.writeString(struct.original_output_path);
          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.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 _iter323 : struct.broker_addresses)
            {
              _iter323.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.static_partition_values != null) {
        if (struct.isSetStaticPartitionValues()) {
          oprot.writeFieldBegin(STATIC_PARTITION_VALUES_FIELD_DESC);
          {
            oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.static_partition_values.size()));
            for (java.util.Map.Entry<java.lang.String, java.lang.String> _iter324 : struct.static_partition_values.entrySet())
            {
              oprot.writeString(_iter324.getKey());
              oprot.writeString(_iter324.getValue());
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.sort_info != null) {
        if (struct.isSetSortInfo()) {
          oprot.writeFieldBegin(SORT_INFO_FIELD_DESC);
          struct.sort_info.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.write_type != null) {
        if (struct.isSetWriteType()) {
          oprot.writeFieldBegin(WRITE_TYPE_FIELD_DESC);
          oprot.writeI32(struct.write_type.getValue());
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

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

  private static class TIcebergTableSinkTupleScheme extends org.apache.thrift.scheme.TupleScheme<TIcebergTableSink> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TIcebergTableSink 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.isSetTbName()) {
        optionals.set(1);
      }
      if (struct.isSetSchemaJson()) {
        optionals.set(2);
      }
      if (struct.isSetPartitionSpecsJson()) {
        optionals.set(3);
      }
      if (struct.isSetPartitionSpecId()) {
        optionals.set(4);
      }
      if (struct.isSetSortFields()) {
        optionals.set(5);
      }
      if (struct.isSetFileFormat()) {
        optionals.set(6);
      }
      if (struct.isSetOutputPath()) {
        optionals.set(7);
      }
      if (struct.isSetHadoopConfig()) {
        optionals.set(8);
      }
      if (struct.isSetOverwrite()) {
        optionals.set(9);
      }
      if (struct.isSetFileType()) {
        optionals.set(10);
      }
      if (struct.isSetOriginalOutputPath()) {
        optionals.set(11);
      }
      if (struct.isSetCompressionType()) {
        optionals.set(12);
      }
      if (struct.isSetBrokerAddresses()) {
        optionals.set(13);
      }
      if (struct.isSetStaticPartitionValues()) {
        optionals.set(14);
      }
      if (struct.isSetSortInfo()) {
        optionals.set(15);
      }
      if (struct.isSetWriteType()) {
        optionals.set(16);
      }
      oprot.writeBitSet(optionals, 17);
      if (struct.isSetDbName()) {
        oprot.writeString(struct.db_name);
      }
      if (struct.isSetTbName()) {
        oprot.writeString(struct.tb_name);
      }
      if (struct.isSetSchemaJson()) {
        oprot.writeString(struct.schema_json);
      }
      if (struct.isSetPartitionSpecsJson()) {
        {
          oprot.writeI32(struct.partition_specs_json.size());
          for (java.util.Map.Entry<java.lang.Integer, java.lang.String> _iter325 : struct.partition_specs_json.entrySet())
          {
            oprot.writeI32(_iter325.getKey());
            oprot.writeString(_iter325.getValue());
          }
        }
      }
      if (struct.isSetPartitionSpecId()) {
        oprot.writeI32(struct.partition_spec_id);
      }
      if (struct.isSetSortFields()) {
        {
          oprot.writeI32(struct.sort_fields.size());
          for (TSortField _iter326 : struct.sort_fields)
          {
            _iter326.write(oprot);
          }
        }
      }
      if (struct.isSetFileFormat()) {
        oprot.writeI32(struct.file_format.getValue());
      }
      if (struct.isSetOutputPath()) {
        oprot.writeString(struct.output_path);
      }
      if (struct.isSetHadoopConfig()) {
        {
          oprot.writeI32(struct.hadoop_config.size());
          for (java.util.Map.Entry<java.lang.String, java.lang.String> _iter327 : struct.hadoop_config.entrySet())
          {
            oprot.writeString(_iter327.getKey());
            oprot.writeString(_iter327.getValue());
          }
        }
      }
      if (struct.isSetOverwrite()) {
        oprot.writeBool(struct.overwrite);
      }
      if (struct.isSetFileType()) {
        oprot.writeI32(struct.file_type.getValue());
      }
      if (struct.isSetOriginalOutputPath()) {
        oprot.writeString(struct.original_output_path);
      }
      if (struct.isSetCompressionType()) {
        oprot.writeI32(struct.compression_type.getValue());
      }
      if (struct.isSetBrokerAddresses()) {
        {
          oprot.writeI32(struct.broker_addresses.size());
          for (org.apache.doris.thrift.TNetworkAddress _iter328 : struct.broker_addresses)
          {
            _iter328.write(oprot);
          }
        }
      }
      if (struct.isSetStaticPartitionValues()) {
        {
          oprot.writeI32(struct.static_partition_values.size());
          for (java.util.Map.Entry<java.lang.String, java.lang.String> _iter329 : struct.static_partition_values.entrySet())
          {
            oprot.writeString(_iter329.getKey());
            oprot.writeString(_iter329.getValue());
          }
        }
      }
      if (struct.isSetSortInfo()) {
        struct.sort_info.write(oprot);
      }
      if (struct.isSetWriteType()) {
        oprot.writeI32(struct.write_type.getValue());
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TIcebergTableSink struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet incoming = iprot.readBitSet(17);
      if (incoming.get(0)) {
        struct.db_name = iprot.readString();
        struct.setDbNameIsSet(true);
      }
      if (incoming.get(1)) {
        struct.tb_name = iprot.readString();
        struct.setTbNameIsSet(true);
      }
      if (incoming.get(2)) {
        struct.schema_json = iprot.readString();
        struct.setSchemaJsonIsSet(true);
      }
      if (incoming.get(3)) {
        {
          org.apache.thrift.protocol.TMap _map330 = iprot.readMapBegin(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.STRING); 
          struct.partition_specs_json = new java.util.HashMap<java.lang.Integer,java.lang.String>(2*_map330.size);
          int _key331;
          @org.apache.thrift.annotation.Nullable java.lang.String _val332;
          for (int _i333 = 0; _i333 < _map330.size; ++_i333)
          {
            _key331 = iprot.readI32();
            _val332 = iprot.readString();
            struct.partition_specs_json.put(_key331, _val332);
          }
        }
        struct.setPartitionSpecsJsonIsSet(true);
      }
      if (incoming.get(4)) {
        struct.partition_spec_id = iprot.readI32();
        struct.setPartitionSpecIdIsSet(true);
      }
      if (incoming.get(5)) {
        {
          org.apache.thrift.protocol.TList _list334 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT);
          struct.sort_fields = new java.util.ArrayList<TSortField>(_list334.size);
          @org.apache.thrift.annotation.Nullable TSortField _elem335;
          for (int _i336 = 0; _i336 < _list334.size; ++_i336)
          {
            _elem335 = new TSortField();
            _elem335.read(iprot);
            struct.sort_fields.add(_elem335);
          }
        }
        struct.setSortFieldsIsSet(true);
      }
      if (incoming.get(6)) {
        struct.file_format = org.apache.doris.thrift.TFileFormatType.findByValue(iprot.readI32());
        struct.setFileFormatIsSet(true);
      }
      if (incoming.get(7)) {
        struct.output_path = iprot.readString();
        struct.setOutputPathIsSet(true);
      }
      if (incoming.get(8)) {
        {
          org.apache.thrift.protocol.TMap _map337 = 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*_map337.size);
          @org.apache.thrift.annotation.Nullable java.lang.String _key338;
          @org.apache.thrift.annotation.Nullable java.lang.String _val339;
          for (int _i340 = 0; _i340 < _map337.size; ++_i340)
          {
            _key338 = iprot.readString();
            _val339 = iprot.readString();
            struct.hadoop_config.put(_key338, _val339);
          }
        }
        struct.setHadoopConfigIsSet(true);
      }
      if (incoming.get(9)) {
        struct.overwrite = iprot.readBool();
        struct.setOverwriteIsSet(true);
      }
      if (incoming.get(10)) {
        struct.file_type = org.apache.doris.thrift.TFileType.findByValue(iprot.readI32());
        struct.setFileTypeIsSet(true);
      }
      if (incoming.get(11)) {
        struct.original_output_path = iprot.readString();
        struct.setOriginalOutputPathIsSet(true);
      }
      if (incoming.get(12)) {
        struct.compression_type = org.apache.doris.thrift.TFileCompressType.findByValue(iprot.readI32());
        struct.setCompressionTypeIsSet(true);
      }
      if (incoming.get(13)) {
        {
          org.apache.thrift.protocol.TList _list341 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT);
          struct.broker_addresses = new java.util.ArrayList<org.apache.doris.thrift.TNetworkAddress>(_list341.size);
          @org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TNetworkAddress _elem342;
          for (int _i343 = 0; _i343 < _list341.size; ++_i343)
          {
            _elem342 = new org.apache.doris.thrift.TNetworkAddress();
            _elem342.read(iprot);
            struct.broker_addresses.add(_elem342);
          }
        }
        struct.setBrokerAddressesIsSet(true);
      }
      if (incoming.get(14)) {
        {
          org.apache.thrift.protocol.TMap _map344 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING); 
          struct.static_partition_values = new java.util.HashMap<java.lang.String,java.lang.String>(2*_map344.size);
          @org.apache.thrift.annotation.Nullable java.lang.String _key345;
          @org.apache.thrift.annotation.Nullable java.lang.String _val346;
          for (int _i347 = 0; _i347 < _map344.size; ++_i347)
          {
            _key345 = iprot.readString();
            _val346 = iprot.readString();
            struct.static_partition_values.put(_key345, _val346);
          }
        }
        struct.setStaticPartitionValuesIsSet(true);
      }
      if (incoming.get(15)) {
        struct.sort_info = new org.apache.doris.thrift.TSortInfo();
        struct.sort_info.read(iprot);
        struct.setSortInfoIsSet(true);
      }
      if (incoming.get(16)) {
        struct.write_type = org.apache.doris.thrift.TIcebergWriteType.findByValue(iprot.readI32());
        struct.setWriteTypeIsSet(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();
  }
}