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

  private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)1);
  private static final org.apache.thrift.protocol.TField PARTITION_EXPRS_FIELD_DESC = new org.apache.thrift.protocol.TField("partition_exprs", org.apache.thrift.protocol.TType.LIST, (short)2);
  private static final org.apache.thrift.protocol.TField PARTITION_INFOS_FIELD_DESC = new org.apache.thrift.protocol.TField("partition_infos", org.apache.thrift.protocol.TType.LIST, (short)3);
  private static final org.apache.thrift.protocol.TField MERGE_PARTITION_INFO_FIELD_DESC = new org.apache.thrift.protocol.TField("merge_partition_info", org.apache.thrift.protocol.TType.STRUCT, (short)4);

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

  /**
   * 
   * @see TPartitionType
   */
  public @org.apache.thrift.annotation.Nullable TPartitionType type; // required
  public @org.apache.thrift.annotation.Nullable java.util.List<org.apache.doris.thrift.TExpr> partition_exprs; // optional
  public @org.apache.thrift.annotation.Nullable java.util.List<TRangePartition> partition_infos; // optional
  public @org.apache.thrift.annotation.Nullable TMergePartitionInfo merge_partition_info; // 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 {
    /**
     * 
     * @see TPartitionType
     */
    TYPE((short)1, "type"),
    PARTITION_EXPRS((short)2, "partition_exprs"),
    PARTITION_INFOS((short)3, "partition_infos"),
    MERGE_PARTITION_INFO((short)4, "merge_partition_info");

    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: // TYPE
          return TYPE;
        case 2: // PARTITION_EXPRS
          return PARTITION_EXPRS;
        case 3: // PARTITION_INFOS
          return PARTITION_INFOS;
        case 4: // MERGE_PARTITION_INFO
          return MERGE_PARTITION_INFO;
        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 _Fields optionals[] = {_Fields.PARTITION_EXPRS,_Fields.PARTITION_INFOS,_Fields.MERGE_PARTITION_INFO};
  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.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TPartitionType.class)));
    tmpMap.put(_Fields.PARTITION_EXPRS, new org.apache.thrift.meta_data.FieldMetaData("partition_exprs", 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.TExpr.class))));
    tmpMap.put(_Fields.PARTITION_INFOS, new org.apache.thrift.meta_data.FieldMetaData("partition_infos", 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, TRangePartition.class))));
    tmpMap.put(_Fields.MERGE_PARTITION_INFO, new org.apache.thrift.meta_data.FieldMetaData("merge_partition_info", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TMergePartitionInfo.class)));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TDataPartition.class, metaDataMap);
  }

  public TDataPartition() {
  }

  public TDataPartition(
    TPartitionType type)
  {
    this();
    this.type = type;
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public TDataPartition(TDataPartition other) {
    if (other.isSetType()) {
      this.type = other.type;
    }
    if (other.isSetPartitionExprs()) {
      java.util.List<org.apache.doris.thrift.TExpr> __this__partition_exprs = new java.util.ArrayList<org.apache.doris.thrift.TExpr>(other.partition_exprs.size());
      for (org.apache.doris.thrift.TExpr other_element : other.partition_exprs) {
        __this__partition_exprs.add(new org.apache.doris.thrift.TExpr(other_element));
      }
      this.partition_exprs = __this__partition_exprs;
    }
    if (other.isSetPartitionInfos()) {
      java.util.List<TRangePartition> __this__partition_infos = new java.util.ArrayList<TRangePartition>(other.partition_infos.size());
      for (TRangePartition other_element : other.partition_infos) {
        __this__partition_infos.add(new TRangePartition(other_element));
      }
      this.partition_infos = __this__partition_infos;
    }
    if (other.isSetMergePartitionInfo()) {
      this.merge_partition_info = new TMergePartitionInfo(other.merge_partition_info);
    }
  }

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

  @Override
  public void clear() {
    this.type = null;
    this.partition_exprs = null;
    this.partition_infos = null;
    this.merge_partition_info = null;
  }

  /**
   * 
   * @see TPartitionType
   */
  @org.apache.thrift.annotation.Nullable
  public TPartitionType getType() {
    return this.type;
  }

  /**
   * 
   * @see TPartitionType
   */
  public TDataPartition setType(@org.apache.thrift.annotation.Nullable TPartitionType type) {
    this.type = type;
    return this;
  }

  public void unsetType() {
    this.type = null;
  }

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

  public void setTypeIsSet(boolean value) {
    if (!value) {
      this.type = null;
    }
  }

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

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

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

  @org.apache.thrift.annotation.Nullable
  public java.util.List<org.apache.doris.thrift.TExpr> getPartitionExprs() {
    return this.partition_exprs;
  }

  public TDataPartition setPartitionExprs(@org.apache.thrift.annotation.Nullable java.util.List<org.apache.doris.thrift.TExpr> partition_exprs) {
    this.partition_exprs = partition_exprs;
    return this;
  }

  public void unsetPartitionExprs() {
    this.partition_exprs = null;
  }

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

  public void setPartitionExprsIsSet(boolean value) {
    if (!value) {
      this.partition_exprs = null;
    }
  }

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

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

  public void addToPartitionInfos(TRangePartition elem) {
    if (this.partition_infos == null) {
      this.partition_infos = new java.util.ArrayList<TRangePartition>();
    }
    this.partition_infos.add(elem);
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.List<TRangePartition> getPartitionInfos() {
    return this.partition_infos;
  }

  public TDataPartition setPartitionInfos(@org.apache.thrift.annotation.Nullable java.util.List<TRangePartition> partition_infos) {
    this.partition_infos = partition_infos;
    return this;
  }

  public void unsetPartitionInfos() {
    this.partition_infos = null;
  }

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

  public void setPartitionInfosIsSet(boolean value) {
    if (!value) {
      this.partition_infos = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public TMergePartitionInfo getMergePartitionInfo() {
    return this.merge_partition_info;
  }

  public TDataPartition setMergePartitionInfo(@org.apache.thrift.annotation.Nullable TMergePartitionInfo merge_partition_info) {
    this.merge_partition_info = merge_partition_info;
    return this;
  }

  public void unsetMergePartitionInfo() {
    this.merge_partition_info = null;
  }

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

  public void setMergePartitionInfoIsSet(boolean value) {
    if (!value) {
      this.merge_partition_info = null;
    }
  }

  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
    switch (field) {
    case TYPE:
      if (value == null) {
        unsetType();
      } else {
        setType((TPartitionType)value);
      }
      break;

    case PARTITION_EXPRS:
      if (value == null) {
        unsetPartitionExprs();
      } else {
        setPartitionExprs((java.util.List<org.apache.doris.thrift.TExpr>)value);
      }
      break;

    case PARTITION_INFOS:
      if (value == null) {
        unsetPartitionInfos();
      } else {
        setPartitionInfos((java.util.List<TRangePartition>)value);
      }
      break;

    case MERGE_PARTITION_INFO:
      if (value == null) {
        unsetMergePartitionInfo();
      } else {
        setMergePartitionInfo((TMergePartitionInfo)value);
      }
      break;

    }
  }

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

    case PARTITION_EXPRS:
      return getPartitionExprs();

    case PARTITION_INFOS:
      return getPartitionInfos();

    case MERGE_PARTITION_INFO:
      return getMergePartitionInfo();

    }
    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 TYPE:
      return isSetType();
    case PARTITION_EXPRS:
      return isSetPartitionExprs();
    case PARTITION_INFOS:
      return isSetPartitionInfos();
    case MERGE_PARTITION_INFO:
      return isSetMergePartitionInfo();
    }
    throw new java.lang.IllegalStateException();
  }

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

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

    boolean this_present_type = true && this.isSetType();
    boolean that_present_type = true && that.isSetType();
    if (this_present_type || that_present_type) {
      if (!(this_present_type && that_present_type))
        return false;
      if (!this.type.equals(that.type))
        return false;
    }

    boolean this_present_partition_exprs = true && this.isSetPartitionExprs();
    boolean that_present_partition_exprs = true && that.isSetPartitionExprs();
    if (this_present_partition_exprs || that_present_partition_exprs) {
      if (!(this_present_partition_exprs && that_present_partition_exprs))
        return false;
      if (!this.partition_exprs.equals(that.partition_exprs))
        return false;
    }

    boolean this_present_partition_infos = true && this.isSetPartitionInfos();
    boolean that_present_partition_infos = true && that.isSetPartitionInfos();
    if (this_present_partition_infos || that_present_partition_infos) {
      if (!(this_present_partition_infos && that_present_partition_infos))
        return false;
      if (!this.partition_infos.equals(that.partition_infos))
        return false;
    }

    boolean this_present_merge_partition_info = true && this.isSetMergePartitionInfo();
    boolean that_present_merge_partition_info = true && that.isSetMergePartitionInfo();
    if (this_present_merge_partition_info || that_present_merge_partition_info) {
      if (!(this_present_merge_partition_info && that_present_merge_partition_info))
        return false;
      if (!this.merge_partition_info.equals(that.merge_partition_info))
        return false;
    }

    return true;
  }

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

    hashCode = hashCode * 8191 + ((isSetType()) ? 131071 : 524287);
    if (isSetType())
      hashCode = hashCode * 8191 + type.getValue();

    hashCode = hashCode * 8191 + ((isSetPartitionExprs()) ? 131071 : 524287);
    if (isSetPartitionExprs())
      hashCode = hashCode * 8191 + partition_exprs.hashCode();

    hashCode = hashCode * 8191 + ((isSetPartitionInfos()) ? 131071 : 524287);
    if (isSetPartitionInfos())
      hashCode = hashCode * 8191 + partition_infos.hashCode();

    hashCode = hashCode * 8191 + ((isSetMergePartitionInfo()) ? 131071 : 524287);
    if (isSetMergePartitionInfo())
      hashCode = hashCode * 8191 + merge_partition_info.hashCode();

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetType(), other.isSetType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetType()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, other.type);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetPartitionExprs(), other.isSetPartitionExprs());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPartitionExprs()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.partition_exprs, other.partition_exprs);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetPartitionInfos(), other.isSetPartitionInfos());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPartitionInfos()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.partition_infos, other.partition_infos);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetMergePartitionInfo(), other.isSetMergePartitionInfo());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMergePartitionInfo()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.merge_partition_info, other.merge_partition_info);
      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("TDataPartition(");
    boolean first = true;

    sb.append("type:");
    if (this.type == null) {
      sb.append("null");
    } else {
      sb.append(this.type);
    }
    first = false;
    if (isSetPartitionExprs()) {
      if (!first) sb.append(", ");
      sb.append("partition_exprs:");
      if (this.partition_exprs == null) {
        sb.append("null");
      } else {
        sb.append(this.partition_exprs);
      }
      first = false;
    }
    if (isSetPartitionInfos()) {
      if (!first) sb.append(", ");
      sb.append("partition_infos:");
      if (this.partition_infos == null) {
        sb.append("null");
      } else {
        sb.append(this.partition_infos);
      }
      first = false;
    }
    if (isSetMergePartitionInfo()) {
      if (!first) sb.append(", ");
      sb.append("merge_partition_info:");
      if (this.merge_partition_info == null) {
        sb.append("null");
      } else {
        sb.append(this.merge_partition_info);
      }
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    if (type == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'type' was not present! Struct: " + toString());
    }
    // check for sub-struct validity
    if (merge_partition_info != null) {
      merge_partition_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 {
      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 TDataPartitionStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public TDataPartitionStandardScheme getScheme() {
      return new TDataPartitionStandardScheme();
    }
  }

  private static class TDataPartitionStandardScheme extends org.apache.thrift.scheme.StandardScheme<TDataPartition> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, TDataPartition 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: // TYPE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.type = org.apache.doris.thrift.TPartitionType.findByValue(iprot.readI32());
              struct.setTypeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // PARTITION_EXPRS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list32 = iprot.readListBegin();
                struct.partition_exprs = new java.util.ArrayList<org.apache.doris.thrift.TExpr>(_list32.size);
                @org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TExpr _elem33;
                for (int _i34 = 0; _i34 < _list32.size; ++_i34)
                {
                  _elem33 = new org.apache.doris.thrift.TExpr();
                  _elem33.read(iprot);
                  struct.partition_exprs.add(_elem33);
                }
                iprot.readListEnd();
              }
              struct.setPartitionExprsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // PARTITION_INFOS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list35 = iprot.readListBegin();
                struct.partition_infos = new java.util.ArrayList<TRangePartition>(_list35.size);
                @org.apache.thrift.annotation.Nullable TRangePartition _elem36;
                for (int _i37 = 0; _i37 < _list35.size; ++_i37)
                {
                  _elem36 = new TRangePartition();
                  _elem36.read(iprot);
                  struct.partition_infos.add(_elem36);
                }
                iprot.readListEnd();
              }
              struct.setPartitionInfosIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // MERGE_PARTITION_INFO
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.merge_partition_info = new TMergePartitionInfo();
              struct.merge_partition_info.read(iprot);
              struct.setMergePartitionInfoIsSet(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, TDataPartition struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.type != null) {
        oprot.writeFieldBegin(TYPE_FIELD_DESC);
        oprot.writeI32(struct.type.getValue());
        oprot.writeFieldEnd();
      }
      if (struct.partition_exprs != null) {
        if (struct.isSetPartitionExprs()) {
          oprot.writeFieldBegin(PARTITION_EXPRS_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.partition_exprs.size()));
            for (org.apache.doris.thrift.TExpr _iter38 : struct.partition_exprs)
            {
              _iter38.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.partition_infos != null) {
        if (struct.isSetPartitionInfos()) {
          oprot.writeFieldBegin(PARTITION_INFOS_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.partition_infos.size()));
            for (TRangePartition _iter39 : struct.partition_infos)
            {
              _iter39.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.merge_partition_info != null) {
        if (struct.isSetMergePartitionInfo()) {
          oprot.writeFieldBegin(MERGE_PARTITION_INFO_FIELD_DESC);
          struct.merge_partition_info.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

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

  private static class TDataPartitionTupleScheme extends org.apache.thrift.scheme.TupleScheme<TDataPartition> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TDataPartition struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      oprot.writeI32(struct.type.getValue());
      java.util.BitSet optionals = new java.util.BitSet();
      if (struct.isSetPartitionExprs()) {
        optionals.set(0);
      }
      if (struct.isSetPartitionInfos()) {
        optionals.set(1);
      }
      if (struct.isSetMergePartitionInfo()) {
        optionals.set(2);
      }
      oprot.writeBitSet(optionals, 3);
      if (struct.isSetPartitionExprs()) {
        {
          oprot.writeI32(struct.partition_exprs.size());
          for (org.apache.doris.thrift.TExpr _iter40 : struct.partition_exprs)
          {
            _iter40.write(oprot);
          }
        }
      }
      if (struct.isSetPartitionInfos()) {
        {
          oprot.writeI32(struct.partition_infos.size());
          for (TRangePartition _iter41 : struct.partition_infos)
          {
            _iter41.write(oprot);
          }
        }
      }
      if (struct.isSetMergePartitionInfo()) {
        struct.merge_partition_info.write(oprot);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TDataPartition struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      struct.type = org.apache.doris.thrift.TPartitionType.findByValue(iprot.readI32());
      struct.setTypeIsSet(true);
      java.util.BitSet incoming = iprot.readBitSet(3);
      if (incoming.get(0)) {
        {
          org.apache.thrift.protocol.TList _list42 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT);
          struct.partition_exprs = new java.util.ArrayList<org.apache.doris.thrift.TExpr>(_list42.size);
          @org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TExpr _elem43;
          for (int _i44 = 0; _i44 < _list42.size; ++_i44)
          {
            _elem43 = new org.apache.doris.thrift.TExpr();
            _elem43.read(iprot);
            struct.partition_exprs.add(_elem43);
          }
        }
        struct.setPartitionExprsIsSet(true);
      }
      if (incoming.get(1)) {
        {
          org.apache.thrift.protocol.TList _list45 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT);
          struct.partition_infos = new java.util.ArrayList<TRangePartition>(_list45.size);
          @org.apache.thrift.annotation.Nullable TRangePartition _elem46;
          for (int _i47 = 0; _i47 < _list45.size; ++_i47)
          {
            _elem46 = new TRangePartition();
            _elem46.read(iprot);
            struct.partition_infos.add(_elem46);
          }
        }
        struct.setPartitionInfosIsSet(true);
      }
      if (incoming.get(2)) {
        struct.merge_partition_info = new TMergePartitionInfo();
        struct.merge_partition_info.read(iprot);
        struct.setMergePartitionInfoIsSet(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();
  }
}