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

  private static final org.apache.thrift.protocol.TField SCHEMA_REPETITION_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("schema_repetition_type", org.apache.thrift.protocol.TType.I32, (short)1);
  private static final org.apache.thrift.protocol.TField SCHEMA_DATA_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("schema_data_type", org.apache.thrift.protocol.TType.I32, (short)2);
  private static final org.apache.thrift.protocol.TField SCHEMA_COLUMN_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("schema_column_name", org.apache.thrift.protocol.TType.STRING, (short)3);
  private static final org.apache.thrift.protocol.TField SCHEMA_DATA_LOGICAL_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("schema_data_logical_type", org.apache.thrift.protocol.TType.I32, (short)4);

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

  /**
   * 
   * @see TParquetRepetitionType
   */
  public @org.apache.thrift.annotation.Nullable TParquetRepetitionType schema_repetition_type; // optional
  /**
   * 
   * @see TParquetDataType
   */
  public @org.apache.thrift.annotation.Nullable TParquetDataType schema_data_type; // optional
  public @org.apache.thrift.annotation.Nullable java.lang.String schema_column_name; // optional
  /**
   * 
   * @see TParquetDataLogicalType
   */
  public @org.apache.thrift.annotation.Nullable TParquetDataLogicalType schema_data_logical_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 {
    /**
     * 
     * @see TParquetRepetitionType
     */
    SCHEMA_REPETITION_TYPE((short)1, "schema_repetition_type"),
    /**
     * 
     * @see TParquetDataType
     */
    SCHEMA_DATA_TYPE((short)2, "schema_data_type"),
    SCHEMA_COLUMN_NAME((short)3, "schema_column_name"),
    /**
     * 
     * @see TParquetDataLogicalType
     */
    SCHEMA_DATA_LOGICAL_TYPE((short)4, "schema_data_logical_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: // SCHEMA_REPETITION_TYPE
          return SCHEMA_REPETITION_TYPE;
        case 2: // SCHEMA_DATA_TYPE
          return SCHEMA_DATA_TYPE;
        case 3: // SCHEMA_COLUMN_NAME
          return SCHEMA_COLUMN_NAME;
        case 4: // SCHEMA_DATA_LOGICAL_TYPE
          return SCHEMA_DATA_LOGICAL_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 _Fields optionals[] = {_Fields.SCHEMA_REPETITION_TYPE,_Fields.SCHEMA_DATA_TYPE,_Fields.SCHEMA_COLUMN_NAME,_Fields.SCHEMA_DATA_LOGICAL_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.SCHEMA_REPETITION_TYPE, new org.apache.thrift.meta_data.FieldMetaData("schema_repetition_type", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TParquetRepetitionType.class)));
    tmpMap.put(_Fields.SCHEMA_DATA_TYPE, new org.apache.thrift.meta_data.FieldMetaData("schema_data_type", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TParquetDataType.class)));
    tmpMap.put(_Fields.SCHEMA_COLUMN_NAME, new org.apache.thrift.meta_data.FieldMetaData("schema_column_name", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.SCHEMA_DATA_LOGICAL_TYPE, new org.apache.thrift.meta_data.FieldMetaData("schema_data_logical_type", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TParquetDataLogicalType.class)));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TParquetSchema.class, metaDataMap);
  }

  public TParquetSchema() {
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public TParquetSchema(TParquetSchema other) {
    if (other.isSetSchemaRepetitionType()) {
      this.schema_repetition_type = other.schema_repetition_type;
    }
    if (other.isSetSchemaDataType()) {
      this.schema_data_type = other.schema_data_type;
    }
    if (other.isSetSchemaColumnName()) {
      this.schema_column_name = other.schema_column_name;
    }
    if (other.isSetSchemaDataLogicalType()) {
      this.schema_data_logical_type = other.schema_data_logical_type;
    }
  }

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

  @Override
  public void clear() {
    this.schema_repetition_type = null;
    this.schema_data_type = null;
    this.schema_column_name = null;
    this.schema_data_logical_type = null;
  }

  /**
   * 
   * @see TParquetRepetitionType
   */
  @org.apache.thrift.annotation.Nullable
  public TParquetRepetitionType getSchemaRepetitionType() {
    return this.schema_repetition_type;
  }

  /**
   * 
   * @see TParquetRepetitionType
   */
  public TParquetSchema setSchemaRepetitionType(@org.apache.thrift.annotation.Nullable TParquetRepetitionType schema_repetition_type) {
    this.schema_repetition_type = schema_repetition_type;
    return this;
  }

  public void unsetSchemaRepetitionType() {
    this.schema_repetition_type = null;
  }

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

  public void setSchemaRepetitionTypeIsSet(boolean value) {
    if (!value) {
      this.schema_repetition_type = null;
    }
  }

  /**
   * 
   * @see TParquetDataType
   */
  @org.apache.thrift.annotation.Nullable
  public TParquetDataType getSchemaDataType() {
    return this.schema_data_type;
  }

  /**
   * 
   * @see TParquetDataType
   */
  public TParquetSchema setSchemaDataType(@org.apache.thrift.annotation.Nullable TParquetDataType schema_data_type) {
    this.schema_data_type = schema_data_type;
    return this;
  }

  public void unsetSchemaDataType() {
    this.schema_data_type = null;
  }

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

  public void setSchemaDataTypeIsSet(boolean value) {
    if (!value) {
      this.schema_data_type = null;
    }
  }

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

  public TParquetSchema setSchemaColumnName(@org.apache.thrift.annotation.Nullable java.lang.String schema_column_name) {
    this.schema_column_name = schema_column_name;
    return this;
  }

  public void unsetSchemaColumnName() {
    this.schema_column_name = null;
  }

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

  public void setSchemaColumnNameIsSet(boolean value) {
    if (!value) {
      this.schema_column_name = null;
    }
  }

  /**
   * 
   * @see TParquetDataLogicalType
   */
  @org.apache.thrift.annotation.Nullable
  public TParquetDataLogicalType getSchemaDataLogicalType() {
    return this.schema_data_logical_type;
  }

  /**
   * 
   * @see TParquetDataLogicalType
   */
  public TParquetSchema setSchemaDataLogicalType(@org.apache.thrift.annotation.Nullable TParquetDataLogicalType schema_data_logical_type) {
    this.schema_data_logical_type = schema_data_logical_type;
    return this;
  }

  public void unsetSchemaDataLogicalType() {
    this.schema_data_logical_type = null;
  }

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

  public void setSchemaDataLogicalTypeIsSet(boolean value) {
    if (!value) {
      this.schema_data_logical_type = null;
    }
  }

  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
    switch (field) {
    case SCHEMA_REPETITION_TYPE:
      if (value == null) {
        unsetSchemaRepetitionType();
      } else {
        setSchemaRepetitionType((TParquetRepetitionType)value);
      }
      break;

    case SCHEMA_DATA_TYPE:
      if (value == null) {
        unsetSchemaDataType();
      } else {
        setSchemaDataType((TParquetDataType)value);
      }
      break;

    case SCHEMA_COLUMN_NAME:
      if (value == null) {
        unsetSchemaColumnName();
      } else {
        setSchemaColumnName((java.lang.String)value);
      }
      break;

    case SCHEMA_DATA_LOGICAL_TYPE:
      if (value == null) {
        unsetSchemaDataLogicalType();
      } else {
        setSchemaDataLogicalType((TParquetDataLogicalType)value);
      }
      break;

    }
  }

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

    case SCHEMA_DATA_TYPE:
      return getSchemaDataType();

    case SCHEMA_COLUMN_NAME:
      return getSchemaColumnName();

    case SCHEMA_DATA_LOGICAL_TYPE:
      return getSchemaDataLogicalType();

    }
    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 SCHEMA_REPETITION_TYPE:
      return isSetSchemaRepetitionType();
    case SCHEMA_DATA_TYPE:
      return isSetSchemaDataType();
    case SCHEMA_COLUMN_NAME:
      return isSetSchemaColumnName();
    case SCHEMA_DATA_LOGICAL_TYPE:
      return isSetSchemaDataLogicalType();
    }
    throw new java.lang.IllegalStateException();
  }

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

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

    boolean this_present_schema_repetition_type = true && this.isSetSchemaRepetitionType();
    boolean that_present_schema_repetition_type = true && that.isSetSchemaRepetitionType();
    if (this_present_schema_repetition_type || that_present_schema_repetition_type) {
      if (!(this_present_schema_repetition_type && that_present_schema_repetition_type))
        return false;
      if (!this.schema_repetition_type.equals(that.schema_repetition_type))
        return false;
    }

    boolean this_present_schema_data_type = true && this.isSetSchemaDataType();
    boolean that_present_schema_data_type = true && that.isSetSchemaDataType();
    if (this_present_schema_data_type || that_present_schema_data_type) {
      if (!(this_present_schema_data_type && that_present_schema_data_type))
        return false;
      if (!this.schema_data_type.equals(that.schema_data_type))
        return false;
    }

    boolean this_present_schema_column_name = true && this.isSetSchemaColumnName();
    boolean that_present_schema_column_name = true && that.isSetSchemaColumnName();
    if (this_present_schema_column_name || that_present_schema_column_name) {
      if (!(this_present_schema_column_name && that_present_schema_column_name))
        return false;
      if (!this.schema_column_name.equals(that.schema_column_name))
        return false;
    }

    boolean this_present_schema_data_logical_type = true && this.isSetSchemaDataLogicalType();
    boolean that_present_schema_data_logical_type = true && that.isSetSchemaDataLogicalType();
    if (this_present_schema_data_logical_type || that_present_schema_data_logical_type) {
      if (!(this_present_schema_data_logical_type && that_present_schema_data_logical_type))
        return false;
      if (!this.schema_data_logical_type.equals(that.schema_data_logical_type))
        return false;
    }

    return true;
  }

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

    hashCode = hashCode * 8191 + ((isSetSchemaRepetitionType()) ? 131071 : 524287);
    if (isSetSchemaRepetitionType())
      hashCode = hashCode * 8191 + schema_repetition_type.getValue();

    hashCode = hashCode * 8191 + ((isSetSchemaDataType()) ? 131071 : 524287);
    if (isSetSchemaDataType())
      hashCode = hashCode * 8191 + schema_data_type.getValue();

    hashCode = hashCode * 8191 + ((isSetSchemaColumnName()) ? 131071 : 524287);
    if (isSetSchemaColumnName())
      hashCode = hashCode * 8191 + schema_column_name.hashCode();

    hashCode = hashCode * 8191 + ((isSetSchemaDataLogicalType()) ? 131071 : 524287);
    if (isSetSchemaDataLogicalType())
      hashCode = hashCode * 8191 + schema_data_logical_type.getValue();

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetSchemaRepetitionType(), other.isSetSchemaRepetitionType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSchemaRepetitionType()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schema_repetition_type, other.schema_repetition_type);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetSchemaDataType(), other.isSetSchemaDataType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSchemaDataType()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schema_data_type, other.schema_data_type);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetSchemaColumnName(), other.isSetSchemaColumnName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSchemaColumnName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schema_column_name, other.schema_column_name);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetSchemaDataLogicalType(), other.isSetSchemaDataLogicalType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSchemaDataLogicalType()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schema_data_logical_type, other.schema_data_logical_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("TParquetSchema(");
    boolean first = true;

    if (isSetSchemaRepetitionType()) {
      sb.append("schema_repetition_type:");
      if (this.schema_repetition_type == null) {
        sb.append("null");
      } else {
        sb.append(this.schema_repetition_type);
      }
      first = false;
    }
    if (isSetSchemaDataType()) {
      if (!first) sb.append(", ");
      sb.append("schema_data_type:");
      if (this.schema_data_type == null) {
        sb.append("null");
      } else {
        sb.append(this.schema_data_type);
      }
      first = false;
    }
    if (isSetSchemaColumnName()) {
      if (!first) sb.append(", ");
      sb.append("schema_column_name:");
      if (this.schema_column_name == null) {
        sb.append("null");
      } else {
        sb.append(this.schema_column_name);
      }
      first = false;
    }
    if (isSetSchemaDataLogicalType()) {
      if (!first) sb.append(", ");
      sb.append("schema_data_logical_type:");
      if (this.schema_data_logical_type == null) {
        sb.append("null");
      } else {
        sb.append(this.schema_data_logical_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
  }

  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 TParquetSchemaStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public TParquetSchemaStandardScheme getScheme() {
      return new TParquetSchemaStandardScheme();
    }
  }

  private static class TParquetSchemaStandardScheme extends org.apache.thrift.scheme.StandardScheme<TParquetSchema> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, TParquetSchema 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: // SCHEMA_REPETITION_TYPE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.schema_repetition_type = org.apache.doris.thrift.TParquetRepetitionType.findByValue(iprot.readI32());
              struct.setSchemaRepetitionTypeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // SCHEMA_DATA_TYPE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.schema_data_type = org.apache.doris.thrift.TParquetDataType.findByValue(iprot.readI32());
              struct.setSchemaDataTypeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // SCHEMA_COLUMN_NAME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.schema_column_name = iprot.readString();
              struct.setSchemaColumnNameIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // SCHEMA_DATA_LOGICAL_TYPE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.schema_data_logical_type = org.apache.doris.thrift.TParquetDataLogicalType.findByValue(iprot.readI32());
              struct.setSchemaDataLogicalTypeIsSet(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, TParquetSchema struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.schema_repetition_type != null) {
        if (struct.isSetSchemaRepetitionType()) {
          oprot.writeFieldBegin(SCHEMA_REPETITION_TYPE_FIELD_DESC);
          oprot.writeI32(struct.schema_repetition_type.getValue());
          oprot.writeFieldEnd();
        }
      }
      if (struct.schema_data_type != null) {
        if (struct.isSetSchemaDataType()) {
          oprot.writeFieldBegin(SCHEMA_DATA_TYPE_FIELD_DESC);
          oprot.writeI32(struct.schema_data_type.getValue());
          oprot.writeFieldEnd();
        }
      }
      if (struct.schema_column_name != null) {
        if (struct.isSetSchemaColumnName()) {
          oprot.writeFieldBegin(SCHEMA_COLUMN_NAME_FIELD_DESC);
          oprot.writeString(struct.schema_column_name);
          oprot.writeFieldEnd();
        }
      }
      if (struct.schema_data_logical_type != null) {
        if (struct.isSetSchemaDataLogicalType()) {
          oprot.writeFieldBegin(SCHEMA_DATA_LOGICAL_TYPE_FIELD_DESC);
          oprot.writeI32(struct.schema_data_logical_type.getValue());
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

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

  private static class TParquetSchemaTupleScheme extends org.apache.thrift.scheme.TupleScheme<TParquetSchema> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TParquetSchema 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.isSetSchemaRepetitionType()) {
        optionals.set(0);
      }
      if (struct.isSetSchemaDataType()) {
        optionals.set(1);
      }
      if (struct.isSetSchemaColumnName()) {
        optionals.set(2);
      }
      if (struct.isSetSchemaDataLogicalType()) {
        optionals.set(3);
      }
      oprot.writeBitSet(optionals, 4);
      if (struct.isSetSchemaRepetitionType()) {
        oprot.writeI32(struct.schema_repetition_type.getValue());
      }
      if (struct.isSetSchemaDataType()) {
        oprot.writeI32(struct.schema_data_type.getValue());
      }
      if (struct.isSetSchemaColumnName()) {
        oprot.writeString(struct.schema_column_name);
      }
      if (struct.isSetSchemaDataLogicalType()) {
        oprot.writeI32(struct.schema_data_logical_type.getValue());
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TParquetSchema struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      java.util.BitSet incoming = iprot.readBitSet(4);
      if (incoming.get(0)) {
        struct.schema_repetition_type = org.apache.doris.thrift.TParquetRepetitionType.findByValue(iprot.readI32());
        struct.setSchemaRepetitionTypeIsSet(true);
      }
      if (incoming.get(1)) {
        struct.schema_data_type = org.apache.doris.thrift.TParquetDataType.findByValue(iprot.readI32());
        struct.setSchemaDataTypeIsSet(true);
      }
      if (incoming.get(2)) {
        struct.schema_column_name = iprot.readString();
        struct.setSchemaColumnNameIsSet(true);
      }
      if (incoming.get(3)) {
        struct.schema_data_logical_type = org.apache.doris.thrift.TParquetDataLogicalType.findByValue(iprot.readI32());
        struct.setSchemaDataLogicalTypeIsSet(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();
  }
}