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

  private static final org.apache.thrift.protocol.TField TRANSFORM_FIELD_DESC = new org.apache.thrift.protocol.TField("transform", org.apache.thrift.protocol.TType.STRING, (short)1);
  private static final org.apache.thrift.protocol.TField PARAM_FIELD_DESC = new org.apache.thrift.protocol.TField("param", org.apache.thrift.protocol.TType.I32, (short)2);
  private static final org.apache.thrift.protocol.TField SOURCE_EXPR_FIELD_DESC = new org.apache.thrift.protocol.TField("source_expr", org.apache.thrift.protocol.TType.STRUCT, (short)3);
  private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)4);
  private static final org.apache.thrift.protocol.TField SOURCE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("source_id", org.apache.thrift.protocol.TType.I32, (short)5);

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

  public @org.apache.thrift.annotation.Nullable java.lang.String transform; // required
  public int param; // optional
  public @org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TExpr source_expr; // required
  public @org.apache.thrift.annotation.Nullable java.lang.String name; // optional
  public int source_id; // 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 {
    TRANSFORM((short)1, "transform"),
    PARAM((short)2, "param"),
    SOURCE_EXPR((short)3, "source_expr"),
    NAME((short)4, "name"),
    SOURCE_ID((short)5, "source_id");

    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: // TRANSFORM
          return TRANSFORM;
        case 2: // PARAM
          return PARAM;
        case 3: // SOURCE_EXPR
          return SOURCE_EXPR;
        case 4: // NAME
          return NAME;
        case 5: // SOURCE_ID
          return SOURCE_ID;
        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 __PARAM_ISSET_ID = 0;
  private static final int __SOURCE_ID_ISSET_ID = 1;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.PARAM,_Fields.NAME,_Fields.SOURCE_ID};
  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.TRANSFORM, new org.apache.thrift.meta_data.FieldMetaData("transform", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.PARAM, new org.apache.thrift.meta_data.FieldMetaData("param", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.SOURCE_EXPR, new org.apache.thrift.meta_data.FieldMetaData("source_expr", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.doris.thrift.TExpr.class)));
    tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.SOURCE_ID, new org.apache.thrift.meta_data.FieldMetaData("source_id", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TIcebergPartitionField.class, metaDataMap);
  }

  public TIcebergPartitionField() {
  }

  public TIcebergPartitionField(
    java.lang.String transform,
    org.apache.doris.thrift.TExpr source_expr)
  {
    this();
    this.transform = transform;
    this.source_expr = source_expr;
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public TIcebergPartitionField(TIcebergPartitionField other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetTransform()) {
      this.transform = other.transform;
    }
    this.param = other.param;
    if (other.isSetSourceExpr()) {
      this.source_expr = new org.apache.doris.thrift.TExpr(other.source_expr);
    }
    if (other.isSetName()) {
      this.name = other.name;
    }
    this.source_id = other.source_id;
  }

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

  @Override
  public void clear() {
    this.transform = null;
    setParamIsSet(false);
    this.param = 0;
    this.source_expr = null;
    this.name = null;
    setSourceIdIsSet(false);
    this.source_id = 0;
  }

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

  public TIcebergPartitionField setTransform(@org.apache.thrift.annotation.Nullable java.lang.String transform) {
    this.transform = transform;
    return this;
  }

  public void unsetTransform() {
    this.transform = null;
  }

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

  public void setTransformIsSet(boolean value) {
    if (!value) {
      this.transform = null;
    }
  }

  public int getParam() {
    return this.param;
  }

  public TIcebergPartitionField setParam(int param) {
    this.param = param;
    setParamIsSet(true);
    return this;
  }

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

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

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

  @org.apache.thrift.annotation.Nullable
  public org.apache.doris.thrift.TExpr getSourceExpr() {
    return this.source_expr;
  }

  public TIcebergPartitionField setSourceExpr(@org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TExpr source_expr) {
    this.source_expr = source_expr;
    return this;
  }

  public void unsetSourceExpr() {
    this.source_expr = null;
  }

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

  public void setSourceExprIsSet(boolean value) {
    if (!value) {
      this.source_expr = null;
    }
  }

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

  public TIcebergPartitionField setName(@org.apache.thrift.annotation.Nullable java.lang.String name) {
    this.name = name;
    return this;
  }

  public void unsetName() {
    this.name = null;
  }

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

  public void setNameIsSet(boolean value) {
    if (!value) {
      this.name = null;
    }
  }

  public int getSourceId() {
    return this.source_id;
  }

  public TIcebergPartitionField setSourceId(int source_id) {
    this.source_id = source_id;
    setSourceIdIsSet(true);
    return this;
  }

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

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

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

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

    case PARAM:
      if (value == null) {
        unsetParam();
      } else {
        setParam((java.lang.Integer)value);
      }
      break;

    case SOURCE_EXPR:
      if (value == null) {
        unsetSourceExpr();
      } else {
        setSourceExpr((org.apache.doris.thrift.TExpr)value);
      }
      break;

    case NAME:
      if (value == null) {
        unsetName();
      } else {
        setName((java.lang.String)value);
      }
      break;

    case SOURCE_ID:
      if (value == null) {
        unsetSourceId();
      } else {
        setSourceId((java.lang.Integer)value);
      }
      break;

    }
  }

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

    case PARAM:
      return getParam();

    case SOURCE_EXPR:
      return getSourceExpr();

    case NAME:
      return getName();

    case SOURCE_ID:
      return getSourceId();

    }
    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 TRANSFORM:
      return isSetTransform();
    case PARAM:
      return isSetParam();
    case SOURCE_EXPR:
      return isSetSourceExpr();
    case NAME:
      return isSetName();
    case SOURCE_ID:
      return isSetSourceId();
    }
    throw new java.lang.IllegalStateException();
  }

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

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

    boolean this_present_transform = true && this.isSetTransform();
    boolean that_present_transform = true && that.isSetTransform();
    if (this_present_transform || that_present_transform) {
      if (!(this_present_transform && that_present_transform))
        return false;
      if (!this.transform.equals(that.transform))
        return false;
    }

    boolean this_present_param = true && this.isSetParam();
    boolean that_present_param = true && that.isSetParam();
    if (this_present_param || that_present_param) {
      if (!(this_present_param && that_present_param))
        return false;
      if (this.param != that.param)
        return false;
    }

    boolean this_present_source_expr = true && this.isSetSourceExpr();
    boolean that_present_source_expr = true && that.isSetSourceExpr();
    if (this_present_source_expr || that_present_source_expr) {
      if (!(this_present_source_expr && that_present_source_expr))
        return false;
      if (!this.source_expr.equals(that.source_expr))
        return false;
    }

    boolean this_present_name = true && this.isSetName();
    boolean that_present_name = true && that.isSetName();
    if (this_present_name || that_present_name) {
      if (!(this_present_name && that_present_name))
        return false;
      if (!this.name.equals(that.name))
        return false;
    }

    boolean this_present_source_id = true && this.isSetSourceId();
    boolean that_present_source_id = true && that.isSetSourceId();
    if (this_present_source_id || that_present_source_id) {
      if (!(this_present_source_id && that_present_source_id))
        return false;
      if (this.source_id != that.source_id)
        return false;
    }

    return true;
  }

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

    hashCode = hashCode * 8191 + ((isSetTransform()) ? 131071 : 524287);
    if (isSetTransform())
      hashCode = hashCode * 8191 + transform.hashCode();

    hashCode = hashCode * 8191 + ((isSetParam()) ? 131071 : 524287);
    if (isSetParam())
      hashCode = hashCode * 8191 + param;

    hashCode = hashCode * 8191 + ((isSetSourceExpr()) ? 131071 : 524287);
    if (isSetSourceExpr())
      hashCode = hashCode * 8191 + source_expr.hashCode();

    hashCode = hashCode * 8191 + ((isSetName()) ? 131071 : 524287);
    if (isSetName())
      hashCode = hashCode * 8191 + name.hashCode();

    hashCode = hashCode * 8191 + ((isSetSourceId()) ? 131071 : 524287);
    if (isSetSourceId())
      hashCode = hashCode * 8191 + source_id;

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetTransform(), other.isSetTransform());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTransform()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transform, other.transform);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetParam(), other.isSetParam());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetParam()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.param, other.param);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetSourceExpr(), other.isSetSourceExpr());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSourceExpr()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.source_expr, other.source_expr);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetName(), other.isSetName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetSourceId(), other.isSetSourceId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSourceId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.source_id, other.source_id);
      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("TIcebergPartitionField(");
    boolean first = true;

    sb.append("transform:");
    if (this.transform == null) {
      sb.append("null");
    } else {
      sb.append(this.transform);
    }
    first = false;
    if (isSetParam()) {
      if (!first) sb.append(", ");
      sb.append("param:");
      sb.append(this.param);
      first = false;
    }
    if (!first) sb.append(", ");
    sb.append("source_expr:");
    if (this.source_expr == null) {
      sb.append("null");
    } else {
      sb.append(this.source_expr);
    }
    first = false;
    if (isSetName()) {
      if (!first) sb.append(", ");
      sb.append("name:");
      if (this.name == null) {
        sb.append("null");
      } else {
        sb.append(this.name);
      }
      first = false;
    }
    if (isSetSourceId()) {
      if (!first) sb.append(", ");
      sb.append("source_id:");
      sb.append(this.source_id);
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

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

  private static class TIcebergPartitionFieldStandardScheme extends org.apache.thrift.scheme.StandardScheme<TIcebergPartitionField> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, TIcebergPartitionField 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: // TRANSFORM
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.transform = iprot.readString();
              struct.setTransformIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // PARAM
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.param = iprot.readI32();
              struct.setParamIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // SOURCE_EXPR
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.source_expr = new org.apache.doris.thrift.TExpr();
              struct.source_expr.read(iprot);
              struct.setSourceExprIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // NAME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.name = iprot.readString();
              struct.setNameIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // SOURCE_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.source_id = iprot.readI32();
              struct.setSourceIdIsSet(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, TIcebergPartitionField struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.transform != null) {
        oprot.writeFieldBegin(TRANSFORM_FIELD_DESC);
        oprot.writeString(struct.transform);
        oprot.writeFieldEnd();
      }
      if (struct.isSetParam()) {
        oprot.writeFieldBegin(PARAM_FIELD_DESC);
        oprot.writeI32(struct.param);
        oprot.writeFieldEnd();
      }
      if (struct.source_expr != null) {
        oprot.writeFieldBegin(SOURCE_EXPR_FIELD_DESC);
        struct.source_expr.write(oprot);
        oprot.writeFieldEnd();
      }
      if (struct.name != null) {
        if (struct.isSetName()) {
          oprot.writeFieldBegin(NAME_FIELD_DESC);
          oprot.writeString(struct.name);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetSourceId()) {
        oprot.writeFieldBegin(SOURCE_ID_FIELD_DESC);
        oprot.writeI32(struct.source_id);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

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

  private static class TIcebergPartitionFieldTupleScheme extends org.apache.thrift.scheme.TupleScheme<TIcebergPartitionField> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TIcebergPartitionField struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      oprot.writeString(struct.transform);
      struct.source_expr.write(oprot);
      java.util.BitSet optionals = new java.util.BitSet();
      if (struct.isSetParam()) {
        optionals.set(0);
      }
      if (struct.isSetName()) {
        optionals.set(1);
      }
      if (struct.isSetSourceId()) {
        optionals.set(2);
      }
      oprot.writeBitSet(optionals, 3);
      if (struct.isSetParam()) {
        oprot.writeI32(struct.param);
      }
      if (struct.isSetName()) {
        oprot.writeString(struct.name);
      }
      if (struct.isSetSourceId()) {
        oprot.writeI32(struct.source_id);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TIcebergPartitionField struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      struct.transform = iprot.readString();
      struct.setTransformIsSet(true);
      struct.source_expr = new org.apache.doris.thrift.TExpr();
      struct.source_expr.read(iprot);
      struct.setSourceExprIsSet(true);
      java.util.BitSet incoming = iprot.readBitSet(3);
      if (incoming.get(0)) {
        struct.param = iprot.readI32();
        struct.setParamIsSet(true);
      }
      if (incoming.get(1)) {
        struct.name = iprot.readString();
        struct.setNameIsSet(true);
      }
      if (incoming.get(2)) {
        struct.source_id = iprot.readI32();
        struct.setSourceIdIsSet(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();
  }
}