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

  private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I64, (short)1);
  private static final org.apache.thrift.protocol.TField COLUMNS_FIELD_DESC = new org.apache.thrift.protocol.TField("columns", org.apache.thrift.protocol.TType.LIST, (short)2);
  private static final org.apache.thrift.protocol.TField SCHEMA_HASH_FIELD_DESC = new org.apache.thrift.protocol.TField("schema_hash", org.apache.thrift.protocol.TType.I32, (short)3);
  private static final org.apache.thrift.protocol.TField COLUMNS_DESC_FIELD_DESC = new org.apache.thrift.protocol.TField("columns_desc", org.apache.thrift.protocol.TType.LIST, (short)4);
  private static final org.apache.thrift.protocol.TField INDEXES_DESC_FIELD_DESC = new org.apache.thrift.protocol.TField("indexes_desc", org.apache.thrift.protocol.TType.LIST, (short)5);
  private static final org.apache.thrift.protocol.TField WHERE_CLAUSE_FIELD_DESC = new org.apache.thrift.protocol.TField("where_clause", org.apache.thrift.protocol.TType.STRUCT, (short)6);

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

  public long id; // required
  public @org.apache.thrift.annotation.Nullable java.util.List<java.lang.String> columns; // required
  public int schema_hash; // required
  public @org.apache.thrift.annotation.Nullable java.util.List<TColumn> columns_desc; // optional
  public @org.apache.thrift.annotation.Nullable java.util.List<TOlapTableIndex> indexes_desc; // optional
  public @org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TExpr where_clause; // 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 {
    ID((short)1, "id"),
    COLUMNS((short)2, "columns"),
    SCHEMA_HASH((short)3, "schema_hash"),
    COLUMNS_DESC((short)4, "columns_desc"),
    INDEXES_DESC((short)5, "indexes_desc"),
    WHERE_CLAUSE((short)6, "where_clause");

    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: // ID
          return ID;
        case 2: // COLUMNS
          return COLUMNS;
        case 3: // SCHEMA_HASH
          return SCHEMA_HASH;
        case 4: // COLUMNS_DESC
          return COLUMNS_DESC;
        case 5: // INDEXES_DESC
          return INDEXES_DESC;
        case 6: // WHERE_CLAUSE
          return WHERE_CLAUSE;
        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 __ID_ISSET_ID = 0;
  private static final int __SCHEMA_HASH_ISSET_ID = 1;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.COLUMNS_DESC,_Fields.INDEXES_DESC,_Fields.WHERE_CLAUSE};
  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.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("columns", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
    tmpMap.put(_Fields.SCHEMA_HASH, new org.apache.thrift.meta_data.FieldMetaData("schema_hash", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.COLUMNS_DESC, new org.apache.thrift.meta_data.FieldMetaData("columns_desc", 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, TColumn.class))));
    tmpMap.put(_Fields.INDEXES_DESC, new org.apache.thrift.meta_data.FieldMetaData("indexes_desc", 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, TOlapTableIndex.class))));
    tmpMap.put(_Fields.WHERE_CLAUSE, new org.apache.thrift.meta_data.FieldMetaData("where_clause", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.doris.thrift.TExpr.class)));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TOlapTableIndexSchema.class, metaDataMap);
  }

  public TOlapTableIndexSchema() {
  }

  public TOlapTableIndexSchema(
    long id,
    java.util.List<java.lang.String> columns,
    int schema_hash)
  {
    this();
    this.id = id;
    setIdIsSet(true);
    this.columns = columns;
    this.schema_hash = schema_hash;
    setSchemaHashIsSet(true);
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public TOlapTableIndexSchema(TOlapTableIndexSchema other) {
    __isset_bitfield = other.__isset_bitfield;
    this.id = other.id;
    if (other.isSetColumns()) {
      java.util.List<java.lang.String> __this__columns = new java.util.ArrayList<java.lang.String>(other.columns);
      this.columns = __this__columns;
    }
    this.schema_hash = other.schema_hash;
    if (other.isSetColumnsDesc()) {
      java.util.List<TColumn> __this__columns_desc = new java.util.ArrayList<TColumn>(other.columns_desc.size());
      for (TColumn other_element : other.columns_desc) {
        __this__columns_desc.add(new TColumn(other_element));
      }
      this.columns_desc = __this__columns_desc;
    }
    if (other.isSetIndexesDesc()) {
      java.util.List<TOlapTableIndex> __this__indexes_desc = new java.util.ArrayList<TOlapTableIndex>(other.indexes_desc.size());
      for (TOlapTableIndex other_element : other.indexes_desc) {
        __this__indexes_desc.add(new TOlapTableIndex(other_element));
      }
      this.indexes_desc = __this__indexes_desc;
    }
    if (other.isSetWhereClause()) {
      this.where_clause = new org.apache.doris.thrift.TExpr(other.where_clause);
    }
  }

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

  @Override
  public void clear() {
    setIdIsSet(false);
    this.id = 0;
    this.columns = null;
    setSchemaHashIsSet(false);
    this.schema_hash = 0;
    this.columns_desc = null;
    this.indexes_desc = null;
    this.where_clause = null;
  }

  public long getId() {
    return this.id;
  }

  public TOlapTableIndexSchema setId(long id) {
    this.id = id;
    setIdIsSet(true);
    return this;
  }

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

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

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

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

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

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

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

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

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

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

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

  public int getSchemaHash() {
    return this.schema_hash;
  }

  public TOlapTableIndexSchema setSchemaHash(int schema_hash) {
    this.schema_hash = schema_hash;
    setSchemaHashIsSet(true);
    return this;
  }

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

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

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

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

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

  public void addToColumnsDesc(TColumn elem) {
    if (this.columns_desc == null) {
      this.columns_desc = new java.util.ArrayList<TColumn>();
    }
    this.columns_desc.add(elem);
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.List<TColumn> getColumnsDesc() {
    return this.columns_desc;
  }

  public TOlapTableIndexSchema setColumnsDesc(@org.apache.thrift.annotation.Nullable java.util.List<TColumn> columns_desc) {
    this.columns_desc = columns_desc;
    return this;
  }

  public void unsetColumnsDesc() {
    this.columns_desc = null;
  }

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

  public void setColumnsDescIsSet(boolean value) {
    if (!value) {
      this.columns_desc = null;
    }
  }

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

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

  public void addToIndexesDesc(TOlapTableIndex elem) {
    if (this.indexes_desc == null) {
      this.indexes_desc = new java.util.ArrayList<TOlapTableIndex>();
    }
    this.indexes_desc.add(elem);
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.List<TOlapTableIndex> getIndexesDesc() {
    return this.indexes_desc;
  }

  public TOlapTableIndexSchema setIndexesDesc(@org.apache.thrift.annotation.Nullable java.util.List<TOlapTableIndex> indexes_desc) {
    this.indexes_desc = indexes_desc;
    return this;
  }

  public void unsetIndexesDesc() {
    this.indexes_desc = null;
  }

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

  public void setIndexesDescIsSet(boolean value) {
    if (!value) {
      this.indexes_desc = null;
    }
  }

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

  public TOlapTableIndexSchema setWhereClause(@org.apache.thrift.annotation.Nullable org.apache.doris.thrift.TExpr where_clause) {
    this.where_clause = where_clause;
    return this;
  }

  public void unsetWhereClause() {
    this.where_clause = null;
  }

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

  public void setWhereClauseIsSet(boolean value) {
    if (!value) {
      this.where_clause = null;
    }
  }

  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
    switch (field) {
    case ID:
      if (value == null) {
        unsetId();
      } else {
        setId((java.lang.Long)value);
      }
      break;

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

    case SCHEMA_HASH:
      if (value == null) {
        unsetSchemaHash();
      } else {
        setSchemaHash((java.lang.Integer)value);
      }
      break;

    case COLUMNS_DESC:
      if (value == null) {
        unsetColumnsDesc();
      } else {
        setColumnsDesc((java.util.List<TColumn>)value);
      }
      break;

    case INDEXES_DESC:
      if (value == null) {
        unsetIndexesDesc();
      } else {
        setIndexesDesc((java.util.List<TOlapTableIndex>)value);
      }
      break;

    case WHERE_CLAUSE:
      if (value == null) {
        unsetWhereClause();
      } else {
        setWhereClause((org.apache.doris.thrift.TExpr)value);
      }
      break;

    }
  }

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

    case COLUMNS:
      return getColumns();

    case SCHEMA_HASH:
      return getSchemaHash();

    case COLUMNS_DESC:
      return getColumnsDesc();

    case INDEXES_DESC:
      return getIndexesDesc();

    case WHERE_CLAUSE:
      return getWhereClause();

    }
    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 ID:
      return isSetId();
    case COLUMNS:
      return isSetColumns();
    case SCHEMA_HASH:
      return isSetSchemaHash();
    case COLUMNS_DESC:
      return isSetColumnsDesc();
    case INDEXES_DESC:
      return isSetIndexesDesc();
    case WHERE_CLAUSE:
      return isSetWhereClause();
    }
    throw new java.lang.IllegalStateException();
  }

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

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

    boolean this_present_id = true;
    boolean that_present_id = true;
    if (this_present_id || that_present_id) {
      if (!(this_present_id && that_present_id))
        return false;
      if (this.id != that.id)
        return false;
    }

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

    boolean this_present_schema_hash = true;
    boolean that_present_schema_hash = true;
    if (this_present_schema_hash || that_present_schema_hash) {
      if (!(this_present_schema_hash && that_present_schema_hash))
        return false;
      if (this.schema_hash != that.schema_hash)
        return false;
    }

    boolean this_present_columns_desc = true && this.isSetColumnsDesc();
    boolean that_present_columns_desc = true && that.isSetColumnsDesc();
    if (this_present_columns_desc || that_present_columns_desc) {
      if (!(this_present_columns_desc && that_present_columns_desc))
        return false;
      if (!this.columns_desc.equals(that.columns_desc))
        return false;
    }

    boolean this_present_indexes_desc = true && this.isSetIndexesDesc();
    boolean that_present_indexes_desc = true && that.isSetIndexesDesc();
    if (this_present_indexes_desc || that_present_indexes_desc) {
      if (!(this_present_indexes_desc && that_present_indexes_desc))
        return false;
      if (!this.indexes_desc.equals(that.indexes_desc))
        return false;
    }

    boolean this_present_where_clause = true && this.isSetWhereClause();
    boolean that_present_where_clause = true && that.isSetWhereClause();
    if (this_present_where_clause || that_present_where_clause) {
      if (!(this_present_where_clause && that_present_where_clause))
        return false;
      if (!this.where_clause.equals(that.where_clause))
        return false;
    }

    return true;
  }

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

    hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(id);

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

    hashCode = hashCode * 8191 + schema_hash;

    hashCode = hashCode * 8191 + ((isSetColumnsDesc()) ? 131071 : 524287);
    if (isSetColumnsDesc())
      hashCode = hashCode * 8191 + columns_desc.hashCode();

    hashCode = hashCode * 8191 + ((isSetIndexesDesc()) ? 131071 : 524287);
    if (isSetIndexesDesc())
      hashCode = hashCode * 8191 + indexes_desc.hashCode();

    hashCode = hashCode * 8191 + ((isSetWhereClause()) ? 131071 : 524287);
    if (isSetWhereClause())
      hashCode = hashCode * 8191 + where_clause.hashCode();

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetId(), other.isSetId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetColumns(), other.isSetColumns());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetColumns()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columns, other.columns);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetSchemaHash(), other.isSetSchemaHash());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSchemaHash()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schema_hash, other.schema_hash);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetColumnsDesc(), other.isSetColumnsDesc());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetColumnsDesc()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columns_desc, other.columns_desc);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetIndexesDesc(), other.isSetIndexesDesc());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetIndexesDesc()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.indexes_desc, other.indexes_desc);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetWhereClause(), other.isSetWhereClause());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetWhereClause()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.where_clause, other.where_clause);
      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("TOlapTableIndexSchema(");
    boolean first = true;

    sb.append("id:");
    sb.append(this.id);
    first = false;
    if (!first) sb.append(", ");
    sb.append("columns:");
    if (this.columns == null) {
      sb.append("null");
    } else {
      sb.append(this.columns);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("schema_hash:");
    sb.append(this.schema_hash);
    first = false;
    if (isSetColumnsDesc()) {
      if (!first) sb.append(", ");
      sb.append("columns_desc:");
      if (this.columns_desc == null) {
        sb.append("null");
      } else {
        sb.append(this.columns_desc);
      }
      first = false;
    }
    if (isSetIndexesDesc()) {
      if (!first) sb.append(", ");
      sb.append("indexes_desc:");
      if (this.indexes_desc == null) {
        sb.append("null");
      } else {
        sb.append(this.indexes_desc);
      }
      first = false;
    }
    if (isSetWhereClause()) {
      if (!first) sb.append(", ");
      sb.append("where_clause:");
      if (this.where_clause == null) {
        sb.append("null");
      } else {
        sb.append(this.where_clause);
      }
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    // alas, we cannot check 'id' because it's a primitive and you chose the non-beans generator.
    if (columns == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'columns' was not present! Struct: " + toString());
    }
    // alas, we cannot check 'schema_hash' because it's a primitive and you chose the non-beans generator.
    // check for sub-struct validity
    if (where_clause != null) {
      where_clause.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 TOlapTableIndexSchemaStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public TOlapTableIndexSchemaStandardScheme getScheme() {
      return new TOlapTableIndexSchemaStandardScheme();
    }
  }

  private static class TOlapTableIndexSchemaStandardScheme extends org.apache.thrift.scheme.StandardScheme<TOlapTableIndexSchema> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, TOlapTableIndexSchema 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: // ID
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.id = iprot.readI64();
              struct.setIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // COLUMNS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list172 = iprot.readListBegin();
                struct.columns = new java.util.ArrayList<java.lang.String>(_list172.size);
                @org.apache.thrift.annotation.Nullable java.lang.String _elem173;
                for (int _i174 = 0; _i174 < _list172.size; ++_i174)
                {
                  _elem173 = iprot.readString();
                  struct.columns.add(_elem173);
                }
                iprot.readListEnd();
              }
              struct.setColumnsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // SCHEMA_HASH
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.schema_hash = iprot.readI32();
              struct.setSchemaHashIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // COLUMNS_DESC
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list175 = iprot.readListBegin();
                struct.columns_desc = new java.util.ArrayList<TColumn>(_list175.size);
                @org.apache.thrift.annotation.Nullable TColumn _elem176;
                for (int _i177 = 0; _i177 < _list175.size; ++_i177)
                {
                  _elem176 = new TColumn();
                  _elem176.read(iprot);
                  struct.columns_desc.add(_elem176);
                }
                iprot.readListEnd();
              }
              struct.setColumnsDescIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // INDEXES_DESC
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list178 = iprot.readListBegin();
                struct.indexes_desc = new java.util.ArrayList<TOlapTableIndex>(_list178.size);
                @org.apache.thrift.annotation.Nullable TOlapTableIndex _elem179;
                for (int _i180 = 0; _i180 < _list178.size; ++_i180)
                {
                  _elem179 = new TOlapTableIndex();
                  _elem179.read(iprot);
                  struct.indexes_desc.add(_elem179);
                }
                iprot.readListEnd();
              }
              struct.setIndexesDescIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // WHERE_CLAUSE
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.where_clause = new org.apache.doris.thrift.TExpr();
              struct.where_clause.read(iprot);
              struct.setWhereClauseIsSet(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
      if (!struct.isSetId()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'id' was not found in serialized data! Struct: " + toString());
      }
      if (!struct.isSetSchemaHash()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'schema_hash' was not found in serialized data! Struct: " + toString());
      }
      struct.validate();
    }

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

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ID_FIELD_DESC);
      oprot.writeI64(struct.id);
      oprot.writeFieldEnd();
      if (struct.columns != null) {
        oprot.writeFieldBegin(COLUMNS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.columns.size()));
          for (java.lang.String _iter181 : struct.columns)
          {
            oprot.writeString(_iter181);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(SCHEMA_HASH_FIELD_DESC);
      oprot.writeI32(struct.schema_hash);
      oprot.writeFieldEnd();
      if (struct.columns_desc != null) {
        if (struct.isSetColumnsDesc()) {
          oprot.writeFieldBegin(COLUMNS_DESC_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.columns_desc.size()));
            for (TColumn _iter182 : struct.columns_desc)
            {
              _iter182.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.indexes_desc != null) {
        if (struct.isSetIndexesDesc()) {
          oprot.writeFieldBegin(INDEXES_DESC_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.indexes_desc.size()));
            for (TOlapTableIndex _iter183 : struct.indexes_desc)
            {
              _iter183.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.where_clause != null) {
        if (struct.isSetWhereClause()) {
          oprot.writeFieldBegin(WHERE_CLAUSE_FIELD_DESC);
          struct.where_clause.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

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

  private static class TOlapTableIndexSchemaTupleScheme extends org.apache.thrift.scheme.TupleScheme<TOlapTableIndexSchema> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TOlapTableIndexSchema struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      oprot.writeI64(struct.id);
      {
        oprot.writeI32(struct.columns.size());
        for (java.lang.String _iter184 : struct.columns)
        {
          oprot.writeString(_iter184);
        }
      }
      oprot.writeI32(struct.schema_hash);
      java.util.BitSet optionals = new java.util.BitSet();
      if (struct.isSetColumnsDesc()) {
        optionals.set(0);
      }
      if (struct.isSetIndexesDesc()) {
        optionals.set(1);
      }
      if (struct.isSetWhereClause()) {
        optionals.set(2);
      }
      oprot.writeBitSet(optionals, 3);
      if (struct.isSetColumnsDesc()) {
        {
          oprot.writeI32(struct.columns_desc.size());
          for (TColumn _iter185 : struct.columns_desc)
          {
            _iter185.write(oprot);
          }
        }
      }
      if (struct.isSetIndexesDesc()) {
        {
          oprot.writeI32(struct.indexes_desc.size());
          for (TOlapTableIndex _iter186 : struct.indexes_desc)
          {
            _iter186.write(oprot);
          }
        }
      }
      if (struct.isSetWhereClause()) {
        struct.where_clause.write(oprot);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TOlapTableIndexSchema struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      struct.id = iprot.readI64();
      struct.setIdIsSet(true);
      {
        org.apache.thrift.protocol.TList _list187 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING);
        struct.columns = new java.util.ArrayList<java.lang.String>(_list187.size);
        @org.apache.thrift.annotation.Nullable java.lang.String _elem188;
        for (int _i189 = 0; _i189 < _list187.size; ++_i189)
        {
          _elem188 = iprot.readString();
          struct.columns.add(_elem188);
        }
      }
      struct.setColumnsIsSet(true);
      struct.schema_hash = iprot.readI32();
      struct.setSchemaHashIsSet(true);
      java.util.BitSet incoming = iprot.readBitSet(3);
      if (incoming.get(0)) {
        {
          org.apache.thrift.protocol.TList _list190 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT);
          struct.columns_desc = new java.util.ArrayList<TColumn>(_list190.size);
          @org.apache.thrift.annotation.Nullable TColumn _elem191;
          for (int _i192 = 0; _i192 < _list190.size; ++_i192)
          {
            _elem191 = new TColumn();
            _elem191.read(iprot);
            struct.columns_desc.add(_elem191);
          }
        }
        struct.setColumnsDescIsSet(true);
      }
      if (incoming.get(1)) {
        {
          org.apache.thrift.protocol.TList _list193 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT);
          struct.indexes_desc = new java.util.ArrayList<TOlapTableIndex>(_list193.size);
          @org.apache.thrift.annotation.Nullable TOlapTableIndex _elem194;
          for (int _i195 = 0; _i195 < _list193.size; ++_i195)
          {
            _elem194 = new TOlapTableIndex();
            _elem194.read(iprot);
            struct.indexes_desc.add(_elem194);
          }
        }
        struct.setIndexesDescIsSet(true);
      }
      if (incoming.get(2)) {
        struct.where_clause = new org.apache.doris.thrift.TExpr();
        struct.where_clause.read(iprot);
        struct.setWhereClauseIsSet(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();
  }
}