TPaimonTableDescriptor.java

/**
 * Autogenerated by Thrift Compiler (0.24.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"})
public class TPaimonTableDescriptor implements org.apache.thrift.TBase<TPaimonTableDescriptor, TPaimonTableDescriptor._Fields>, java.io.Serializable, Cloneable, Comparable<TPaimonTableDescriptor> {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TPaimonTableDescriptor");

  private static final org.apache.thrift.protocol.TField ROOT_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("root_path", org.apache.thrift.protocol.TType.STRING, (short)1);
  private static final org.apache.thrift.protocol.TField SCHEMA_JSON_FIELD_DESC = new org.apache.thrift.protocol.TField("schema_json", org.apache.thrift.protocol.TType.STRING, (short)2);
  private static final org.apache.thrift.protocol.TField HADOOP_CONFIG_FIELD_DESC = new org.apache.thrift.protocol.TField("hadoop_config", org.apache.thrift.protocol.TType.MAP, (short)3);
  private static final org.apache.thrift.protocol.TField CATALOG_OPTIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("catalog_options", org.apache.thrift.protocol.TType.MAP, (short)4);
  private static final org.apache.thrift.protocol.TField CATALOG_ENVIRONMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("catalog_environment", org.apache.thrift.protocol.TType.STRUCT, (short)5);
  private static final org.apache.thrift.protocol.TField STORAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("storage", org.apache.thrift.protocol.TType.STRUCT, (short)6);

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

  public @org.apache.thrift.annotation.Nullable java.lang.String root_path; // required
  public @org.apache.thrift.annotation.Nullable java.lang.String schema_json; // required
  public @org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,java.lang.String> hadoop_config; // required
  public @org.apache.thrift.annotation.Nullable java.util.Map<java.lang.String,java.lang.String> catalog_options; // required
  public @org.apache.thrift.annotation.Nullable TPaimonCatalogEnvironment catalog_environment; // optional
  public @org.apache.thrift.annotation.Nullable TPaimonStorageDescriptor storage; // 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 {
    ROOT_PATH((short)1, "root_path"),
    SCHEMA_JSON((short)2, "schema_json"),
    HADOOP_CONFIG((short)3, "hadoop_config"),
    CATALOG_OPTIONS((short)4, "catalog_options"),
    CATALOG_ENVIRONMENT((short)5, "catalog_environment"),
    STORAGE((short)6, "storage");

    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: // ROOT_PATH
          return ROOT_PATH;
        case 2: // SCHEMA_JSON
          return SCHEMA_JSON;
        case 3: // HADOOP_CONFIG
          return HADOOP_CONFIG;
        case 4: // CATALOG_OPTIONS
          return CATALOG_OPTIONS;
        case 5: // CATALOG_ENVIRONMENT
          return CATALOG_ENVIRONMENT;
        case 6: // STORAGE
          return STORAGE;
        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;
    }

    @Override
    public short getThriftFieldId() {
      return _thriftId;
    }

    @Override
    public java.lang.String getFieldName() {
      return _fieldName;
    }
  }

  // isset id assignments
  private static final _Fields[] optionals = {_Fields.CATALOG_ENVIRONMENT,_Fields.STORAGE};
  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.ROOT_PATH, new org.apache.thrift.meta_data.FieldMetaData("root_path", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.SCHEMA_JSON, new org.apache.thrift.meta_data.FieldMetaData("schema_json", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.HADOOP_CONFIG, new org.apache.thrift.meta_data.FieldMetaData("hadoop_config", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
    tmpMap.put(_Fields.CATALOG_OPTIONS, new org.apache.thrift.meta_data.FieldMetaData("catalog_options", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
    tmpMap.put(_Fields.CATALOG_ENVIRONMENT, new org.apache.thrift.meta_data.FieldMetaData("catalog_environment", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TPaimonCatalogEnvironment.class)));
    tmpMap.put(_Fields.STORAGE, new org.apache.thrift.meta_data.FieldMetaData("storage", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TPaimonStorageDescriptor.class)));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TPaimonTableDescriptor.class, metaDataMap);
  }

  public TPaimonTableDescriptor() {
  }

  public TPaimonTableDescriptor(
    java.lang.String root_path,
    java.lang.String schema_json,
    java.util.Map<java.lang.String,java.lang.String> hadoop_config,
    java.util.Map<java.lang.String,java.lang.String> catalog_options)
  {
    this();
    this.root_path = root_path;
    this.schema_json = schema_json;
    this.hadoop_config = hadoop_config;
    this.catalog_options = catalog_options;
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public TPaimonTableDescriptor(TPaimonTableDescriptor other) {
    if (other.isSetRootPath()) {
      this.root_path = other.root_path;
    }
    if (other.isSetSchemaJson()) {
      this.schema_json = other.schema_json;
    }
    if (other.isSetHadoopConfig()) {
      java.util.Map<java.lang.String,java.lang.String> __this__hadoop_config = new java.util.HashMap<java.lang.String,java.lang.String>(other.hadoop_config);
      this.hadoop_config = __this__hadoop_config;
    }
    if (other.isSetCatalogOptions()) {
      java.util.Map<java.lang.String,java.lang.String> __this__catalog_options = new java.util.HashMap<java.lang.String,java.lang.String>(other.catalog_options);
      this.catalog_options = __this__catalog_options;
    }
    if (other.isSetCatalogEnvironment()) {
      this.catalog_environment = new TPaimonCatalogEnvironment(other.catalog_environment);
    }
    if (other.isSetStorage()) {
      this.storage = new TPaimonStorageDescriptor(other.storage);
    }
  }

  @Override
  public TPaimonTableDescriptor deepCopy() {
    return new TPaimonTableDescriptor(this);
  }

  @Override
  public void clear() {
    this.root_path = null;
    this.schema_json = null;
    this.hadoop_config = null;
    this.catalog_options = null;
    this.catalog_environment = null;
    this.storage = null;
  }

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

  public TPaimonTableDescriptor setRootPath(@org.apache.thrift.annotation.Nullable java.lang.String root_path) {
    this.root_path = root_path;
    return this;
  }

  public void unsetRootPath() {
    this.root_path = null;
  }

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

  public void setRootPathIsSet(boolean value) {
    if (!value) {
      this.root_path = null;
    }
  }

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

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

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

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

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

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

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

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

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

  public void unsetHadoopConfig() {
    this.hadoop_config = null;
  }

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

  public void setHadoopConfigIsSet(boolean value) {
    if (!value) {
      this.hadoop_config = null;
    }
  }

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

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

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

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

  public void unsetCatalogOptions() {
    this.catalog_options = null;
  }

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

  public void setCatalogOptionsIsSet(boolean value) {
    if (!value) {
      this.catalog_options = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public TPaimonCatalogEnvironment getCatalogEnvironment() {
    return this.catalog_environment;
  }

  public TPaimonTableDescriptor setCatalogEnvironment(@org.apache.thrift.annotation.Nullable TPaimonCatalogEnvironment catalog_environment) {
    this.catalog_environment = catalog_environment;
    return this;
  }

  public void unsetCatalogEnvironment() {
    this.catalog_environment = null;
  }

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

  public void setCatalogEnvironmentIsSet(boolean value) {
    if (!value) {
      this.catalog_environment = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public TPaimonStorageDescriptor getStorage() {
    return this.storage;
  }

  public TPaimonTableDescriptor setStorage(@org.apache.thrift.annotation.Nullable TPaimonStorageDescriptor storage) {
    this.storage = storage;
    return this;
  }

  public void unsetStorage() {
    this.storage = null;
  }

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

  public void setStorageIsSet(boolean value) {
    if (!value) {
      this.storage = null;
    }
  }

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

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

    case HADOOP_CONFIG:
      if (value == null) {
        unsetHadoopConfig();
      } else {
        setHadoopConfig((java.util.Map<java.lang.String,java.lang.String>)value);
      }
      break;

    case CATALOG_OPTIONS:
      if (value == null) {
        unsetCatalogOptions();
      } else {
        setCatalogOptions((java.util.Map<java.lang.String,java.lang.String>)value);
      }
      break;

    case CATALOG_ENVIRONMENT:
      if (value == null) {
        unsetCatalogEnvironment();
      } else {
        setCatalogEnvironment((TPaimonCatalogEnvironment)value);
      }
      break;

    case STORAGE:
      if (value == null) {
        unsetStorage();
      } else {
        setStorage((TPaimonStorageDescriptor)value);
      }
      break;

    }
  }

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

    case SCHEMA_JSON:
      return getSchemaJson();

    case HADOOP_CONFIG:
      return getHadoopConfig();

    case CATALOG_OPTIONS:
      return getCatalogOptions();

    case CATALOG_ENVIRONMENT:
      return getCatalogEnvironment();

    case STORAGE:
      return getStorage();

    }
    throw new java.lang.IllegalStateException();
  }

  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
  @Override
  public boolean isSet(_Fields field) {
    if (field == null) {
      throw new java.lang.IllegalArgumentException();
    }

    switch (field) {
    case ROOT_PATH:
      return isSetRootPath();
    case SCHEMA_JSON:
      return isSetSchemaJson();
    case HADOOP_CONFIG:
      return isSetHadoopConfig();
    case CATALOG_OPTIONS:
      return isSetCatalogOptions();
    case CATALOG_ENVIRONMENT:
      return isSetCatalogEnvironment();
    case STORAGE:
      return isSetStorage();
    }
    throw new java.lang.IllegalStateException();
  }

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

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

    boolean this_present_root_path = true && this.isSetRootPath();
    boolean that_present_root_path = true && that.isSetRootPath();
    if (this_present_root_path || that_present_root_path) {
      if (!(this_present_root_path && that_present_root_path))
        return false;
      if (!this.root_path.equals(that.root_path))
        return false;
    }

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

    boolean this_present_hadoop_config = true && this.isSetHadoopConfig();
    boolean that_present_hadoop_config = true && that.isSetHadoopConfig();
    if (this_present_hadoop_config || that_present_hadoop_config) {
      if (!(this_present_hadoop_config && that_present_hadoop_config))
        return false;
      if (!this.hadoop_config.equals(that.hadoop_config))
        return false;
    }

    boolean this_present_catalog_options = true && this.isSetCatalogOptions();
    boolean that_present_catalog_options = true && that.isSetCatalogOptions();
    if (this_present_catalog_options || that_present_catalog_options) {
      if (!(this_present_catalog_options && that_present_catalog_options))
        return false;
      if (!this.catalog_options.equals(that.catalog_options))
        return false;
    }

    boolean this_present_catalog_environment = true && this.isSetCatalogEnvironment();
    boolean that_present_catalog_environment = true && that.isSetCatalogEnvironment();
    if (this_present_catalog_environment || that_present_catalog_environment) {
      if (!(this_present_catalog_environment && that_present_catalog_environment))
        return false;
      if (!this.catalog_environment.equals(that.catalog_environment))
        return false;
    }

    boolean this_present_storage = true && this.isSetStorage();
    boolean that_present_storage = true && that.isSetStorage();
    if (this_present_storage || that_present_storage) {
      if (!(this_present_storage && that_present_storage))
        return false;
      if (!this.storage.equals(that.storage))
        return false;
    }

    return true;
  }

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

    hashCode = hashCode * 8191 + ((isSetRootPath()) ? 131071 : 524287);
    if (isSetRootPath())
      hashCode = hashCode * 8191 + root_path.hashCode();

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

    hashCode = hashCode * 8191 + ((isSetHadoopConfig()) ? 131071 : 524287);
    if (isSetHadoopConfig())
      hashCode = hashCode * 8191 + hadoop_config.hashCode();

    hashCode = hashCode * 8191 + ((isSetCatalogOptions()) ? 131071 : 524287);
    if (isSetCatalogOptions())
      hashCode = hashCode * 8191 + catalog_options.hashCode();

    hashCode = hashCode * 8191 + ((isSetCatalogEnvironment()) ? 131071 : 524287);
    if (isSetCatalogEnvironment())
      hashCode = hashCode * 8191 + catalog_environment.hashCode();

    hashCode = hashCode * 8191 + ((isSetStorage()) ? 131071 : 524287);
    if (isSetStorage())
      hashCode = hashCode * 8191 + storage.hashCode();

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetRootPath(), other.isSetRootPath());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetRootPath()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.root_path, other.root_path);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetSchemaJson(), other.isSetSchemaJson());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSchemaJson()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schema_json, other.schema_json);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetHadoopConfig(), other.isSetHadoopConfig());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetHadoopConfig()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hadoop_config, other.hadoop_config);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetCatalogOptions(), other.isSetCatalogOptions());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCatalogOptions()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.catalog_options, other.catalog_options);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetCatalogEnvironment(), other.isSetCatalogEnvironment());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCatalogEnvironment()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.catalog_environment, other.catalog_environment);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetStorage(), other.isSetStorage());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStorage()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.storage, other.storage);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

  @org.apache.thrift.annotation.Nullable
  @Override
  public _Fields fieldForId(int fieldId) {
    return _Fields.findByThriftId(fieldId);
  }

  @Override
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    scheme(iprot).read(iprot, this);
  }

  @Override
  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("TPaimonTableDescriptor(");
    boolean first = true;

    sb.append("root_path:");
    if (this.root_path == null) {
      sb.append("null");
    } else {
      sb.append(this.root_path);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("schema_json:");
    if (this.schema_json == null) {
      sb.append("null");
    } else {
      sb.append(this.schema_json);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("hadoop_config:");
    if (this.hadoop_config == null) {
      sb.append("null");
    } else {
      sb.append(this.hadoop_config);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("catalog_options:");
    if (this.catalog_options == null) {
      sb.append("null");
    } else {
      sb.append(this.catalog_options);
    }
    first = false;
    if (isSetCatalogEnvironment()) {
      if (!first) sb.append(", ");
      sb.append("catalog_environment:");
      if (this.catalog_environment == null) {
        sb.append("null");
      } else {
        sb.append(this.catalog_environment);
      }
      first = false;
    }
    if (isSetStorage()) {
      if (!first) sb.append(", ");
      sb.append("storage:");
      if (this.storage == null) {
        sb.append("null");
      } else {
        sb.append(this.storage);
      }
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    if (root_path == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'root_path' was not present! Struct: " + toString());
    }
    if (schema_json == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'schema_json' was not present! Struct: " + toString());
    }
    if (hadoop_config == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'hadoop_config' was not present! Struct: " + toString());
    }
    if (catalog_options == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'catalog_options' was not present! Struct: " + toString());
    }
    // check for sub-struct validity
    if (catalog_environment != null) {
      catalog_environment.validate();
    }
    if (storage != null) {
      storage.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 TPaimonTableDescriptorStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    @Override
    public TPaimonTableDescriptorStandardScheme getScheme() {
      return new TPaimonTableDescriptorStandardScheme();
    }
  }

  private static class TPaimonTableDescriptorStandardScheme extends org.apache.thrift.scheme.StandardScheme<TPaimonTableDescriptor> {

    @Override
    public void read(org.apache.thrift.protocol.TProtocol iprot, TPaimonTableDescriptor struct) throws org.apache.thrift.TException {
      iprot.incrementRecursionDepth();
      try {
        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: // ROOT_PATH
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.root_path = iprot.readString();
                struct.setRootPathIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // SCHEMA_JSON
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.schema_json = iprot.readString();
                struct.setSchemaJsonIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // HADOOP_CONFIG
              if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
                {
                  org.apache.thrift.protocol.TMap _map532 = iprot.readMapBegin();
                  struct.hadoop_config = new java.util.HashMap<java.lang.String,java.lang.String>(2*_map532.size);
                  @org.apache.thrift.annotation.Nullable java.lang.String _key533;
                  @org.apache.thrift.annotation.Nullable java.lang.String _val534;
                  for (int _i535 = 0; _i535 < _map532.size; ++_i535)
                  {
                    _key533 = iprot.readString();
                    _val534 = iprot.readString();
                    struct.hadoop_config.put(_key533, _val534);
                  }
                  iprot.readMapEnd();
                }
                struct.setHadoopConfigIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // CATALOG_OPTIONS
              if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
                {
                  org.apache.thrift.protocol.TMap _map536 = iprot.readMapBegin();
                  struct.catalog_options = new java.util.HashMap<java.lang.String,java.lang.String>(2*_map536.size);
                  @org.apache.thrift.annotation.Nullable java.lang.String _key537;
                  @org.apache.thrift.annotation.Nullable java.lang.String _val538;
                  for (int _i539 = 0; _i539 < _map536.size; ++_i539)
                  {
                    _key537 = iprot.readString();
                    _val538 = iprot.readString();
                    struct.catalog_options.put(_key537, _val538);
                  }
                  iprot.readMapEnd();
                }
                struct.setCatalogOptionsIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 5: // CATALOG_ENVIRONMENT
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.catalog_environment = new TPaimonCatalogEnvironment();
                struct.catalog_environment.read(iprot);
                struct.setCatalogEnvironmentIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 6: // STORAGE
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.storage = new TPaimonStorageDescriptor();
                struct.storage.read(iprot);
                struct.setStorageIsSet(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();
      } finally {
        iprot.decrementRecursionDepth();
      }
    }

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

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.root_path != null) {
        oprot.writeFieldBegin(ROOT_PATH_FIELD_DESC);
        oprot.writeString(struct.root_path);
        oprot.writeFieldEnd();
      }
      if (struct.schema_json != null) {
        oprot.writeFieldBegin(SCHEMA_JSON_FIELD_DESC);
        oprot.writeString(struct.schema_json);
        oprot.writeFieldEnd();
      }
      if (struct.hadoop_config != null) {
        oprot.writeFieldBegin(HADOOP_CONFIG_FIELD_DESC);
        {
          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.hadoop_config.size()));
          for (java.util.Map.Entry<java.lang.String, java.lang.String> _iter540 : struct.hadoop_config.entrySet())
          {
            oprot.writeString(_iter540.getKey());
            oprot.writeString(_iter540.getValue());
          }
          oprot.writeMapEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.catalog_options != null) {
        oprot.writeFieldBegin(CATALOG_OPTIONS_FIELD_DESC);
        {
          oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.catalog_options.size()));
          for (java.util.Map.Entry<java.lang.String, java.lang.String> _iter541 : struct.catalog_options.entrySet())
          {
            oprot.writeString(_iter541.getKey());
            oprot.writeString(_iter541.getValue());
          }
          oprot.writeMapEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.catalog_environment != null) {
        if (struct.isSetCatalogEnvironment()) {
          oprot.writeFieldBegin(CATALOG_ENVIRONMENT_FIELD_DESC);
          struct.catalog_environment.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.storage != null) {
        if (struct.isSetStorage()) {
          oprot.writeFieldBegin(STORAGE_FIELD_DESC);
          struct.storage.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class TPaimonTableDescriptorTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    @Override
    public TPaimonTableDescriptorTupleScheme getScheme() {
      return new TPaimonTableDescriptorTupleScheme();
    }
  }

  private static class TPaimonTableDescriptorTupleScheme extends org.apache.thrift.scheme.TupleScheme<TPaimonTableDescriptor> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TPaimonTableDescriptor struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      oprot.writeString(struct.root_path);
      oprot.writeString(struct.schema_json);
      {
        oprot.writeI32(struct.hadoop_config.size());
        for (java.util.Map.Entry<java.lang.String, java.lang.String> _iter542 : struct.hadoop_config.entrySet())
        {
          oprot.writeString(_iter542.getKey());
          oprot.writeString(_iter542.getValue());
        }
      }
      {
        oprot.writeI32(struct.catalog_options.size());
        for (java.util.Map.Entry<java.lang.String, java.lang.String> _iter543 : struct.catalog_options.entrySet())
        {
          oprot.writeString(_iter543.getKey());
          oprot.writeString(_iter543.getValue());
        }
      }
      java.util.BitSet optionals = new java.util.BitSet();
      if (struct.isSetCatalogEnvironment()) {
        optionals.set(0);
      }
      if (struct.isSetStorage()) {
        optionals.set(1);
      }
      oprot.writeBitSet(optionals, 2);
      if (struct.isSetCatalogEnvironment()) {
        struct.catalog_environment.write(oprot);
      }
      if (struct.isSetStorage()) {
        struct.storage.write(oprot);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TPaimonTableDescriptor struct) throws org.apache.thrift.TException {
      prot.incrementRecursionDepth();
      try {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        struct.root_path = iprot.readString();
        struct.setRootPathIsSet(true);
        struct.schema_json = iprot.readString();
        struct.setSchemaJsonIsSet(true);
        {
          org.apache.thrift.protocol.TMap _map544 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING); 
          struct.hadoop_config = new java.util.HashMap<java.lang.String,java.lang.String>(2*_map544.size);
          @org.apache.thrift.annotation.Nullable java.lang.String _key545;
          @org.apache.thrift.annotation.Nullable java.lang.String _val546;
          for (int _i547 = 0; _i547 < _map544.size; ++_i547)
          {
            _key545 = iprot.readString();
            _val546 = iprot.readString();
            struct.hadoop_config.put(_key545, _val546);
          }
        }
        struct.setHadoopConfigIsSet(true);
        {
          org.apache.thrift.protocol.TMap _map548 = iprot.readMapBegin(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING); 
          struct.catalog_options = new java.util.HashMap<java.lang.String,java.lang.String>(2*_map548.size);
          @org.apache.thrift.annotation.Nullable java.lang.String _key549;
          @org.apache.thrift.annotation.Nullable java.lang.String _val550;
          for (int _i551 = 0; _i551 < _map548.size; ++_i551)
          {
            _key549 = iprot.readString();
            _val550 = iprot.readString();
            struct.catalog_options.put(_key549, _val550);
          }
        }
        struct.setCatalogOptionsIsSet(true);
        java.util.BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.catalog_environment = new TPaimonCatalogEnvironment();
          struct.catalog_environment.read(iprot);
          struct.setCatalogEnvironmentIsSet(true);
        }
        if (incoming.get(1)) {
          struct.storage = new TPaimonStorageDescriptor();
          struct.storage.read(iprot);
          struct.setStorageIsSet(true);
        }
      } finally {
        prot.decrementRecursionDepth();
      }
    }
  }

  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();
  }
}