All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.starrocks.thrift.TFunction Maven / Gradle / Ivy

The newest version!
/**
 * Autogenerated by Thrift Compiler (0.13.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package com.starrocks.thrift;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.13.0)", date = "2022-03-09")
public class TFunction implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TFunction");

  private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRUCT, (short)1);
  private static final org.apache.thrift.protocol.TField BINARY_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("binary_type", org.apache.thrift.protocol.TType.I32, (short)2);
  private static final org.apache.thrift.protocol.TField ARG_TYPES_FIELD_DESC = new org.apache.thrift.protocol.TField("arg_types", org.apache.thrift.protocol.TType.LIST, (short)3);
  private static final org.apache.thrift.protocol.TField RET_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("ret_type", org.apache.thrift.protocol.TType.STRUCT, (short)4);
  private static final org.apache.thrift.protocol.TField HAS_VAR_ARGS_FIELD_DESC = new org.apache.thrift.protocol.TField("has_var_args", org.apache.thrift.protocol.TType.BOOL, (short)5);
  private static final org.apache.thrift.protocol.TField COMMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("comment", org.apache.thrift.protocol.TType.STRING, (short)6);
  private static final org.apache.thrift.protocol.TField SIGNATURE_FIELD_DESC = new org.apache.thrift.protocol.TField("signature", org.apache.thrift.protocol.TType.STRING, (short)7);
  private static final org.apache.thrift.protocol.TField HDFS_LOCATION_FIELD_DESC = new org.apache.thrift.protocol.TField("hdfs_location", org.apache.thrift.protocol.TType.STRING, (short)8);
  private static final org.apache.thrift.protocol.TField SCALAR_FN_FIELD_DESC = new org.apache.thrift.protocol.TField("scalar_fn", org.apache.thrift.protocol.TType.STRUCT, (short)9);
  private static final org.apache.thrift.protocol.TField AGGREGATE_FN_FIELD_DESC = new org.apache.thrift.protocol.TField("aggregate_fn", org.apache.thrift.protocol.TType.STRUCT, (short)10);
  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)11);
  private static final org.apache.thrift.protocol.TField CHECKSUM_FIELD_DESC = new org.apache.thrift.protocol.TField("checksum", org.apache.thrift.protocol.TType.STRING, (short)12);
  private static final org.apache.thrift.protocol.TField FID_FIELD_DESC = new org.apache.thrift.protocol.TField("fid", org.apache.thrift.protocol.TType.I64, (short)30);
  private static final org.apache.thrift.protocol.TField TABLE_FN_FIELD_DESC = new org.apache.thrift.protocol.TField("table_fn", org.apache.thrift.protocol.TType.STRUCT, (short)31);

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

  public @org.apache.thrift.annotation.Nullable TFunctionName name; // required
  /**
   * 
   * @see TFunctionBinaryType
   */
  public @org.apache.thrift.annotation.Nullable TFunctionBinaryType binary_type; // required
  public @org.apache.thrift.annotation.Nullable java.util.List arg_types; // required
  public @org.apache.thrift.annotation.Nullable TTypeDesc ret_type; // required
  public boolean has_var_args; // required
  public @org.apache.thrift.annotation.Nullable java.lang.String comment; // optional
  public @org.apache.thrift.annotation.Nullable java.lang.String signature; // optional
  public @org.apache.thrift.annotation.Nullable java.lang.String hdfs_location; // optional
  public @org.apache.thrift.annotation.Nullable TScalarFunction scalar_fn; // optional
  public @org.apache.thrift.annotation.Nullable TAggregateFunction aggregate_fn; // optional
  public long id; // optional
  public @org.apache.thrift.annotation.Nullable java.lang.String checksum; // optional
  public long fid; // optional
  public @org.apache.thrift.annotation.Nullable TTableFunction table_fn; // 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 {
    NAME((short)1, "name"),
    /**
     * 
     * @see TFunctionBinaryType
     */
    BINARY_TYPE((short)2, "binary_type"),
    ARG_TYPES((short)3, "arg_types"),
    RET_TYPE((short)4, "ret_type"),
    HAS_VAR_ARGS((short)5, "has_var_args"),
    COMMENT((short)6, "comment"),
    SIGNATURE((short)7, "signature"),
    HDFS_LOCATION((short)8, "hdfs_location"),
    SCALAR_FN((short)9, "scalar_fn"),
    AGGREGATE_FN((short)10, "aggregate_fn"),
    ID((short)11, "id"),
    CHECKSUM((short)12, "checksum"),
    FID((short)30, "fid"),
    TABLE_FN((short)31, "table_fn");

    private static final java.util.Map byName = new java.util.HashMap();

    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: // NAME
          return NAME;
        case 2: // BINARY_TYPE
          return BINARY_TYPE;
        case 3: // ARG_TYPES
          return ARG_TYPES;
        case 4: // RET_TYPE
          return RET_TYPE;
        case 5: // HAS_VAR_ARGS
          return HAS_VAR_ARGS;
        case 6: // COMMENT
          return COMMENT;
        case 7: // SIGNATURE
          return SIGNATURE;
        case 8: // HDFS_LOCATION
          return HDFS_LOCATION;
        case 9: // SCALAR_FN
          return SCALAR_FN;
        case 10: // AGGREGATE_FN
          return AGGREGATE_FN;
        case 11: // ID
          return ID;
        case 12: // CHECKSUM
          return CHECKSUM;
        case 30: // FID
          return FID;
        case 31: // TABLE_FN
          return TABLE_FN;
        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 __HAS_VAR_ARGS_ISSET_ID = 0;
  private static final int __ID_ISSET_ID = 1;
  private static final int __FID_ISSET_ID = 2;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.COMMENT,_Fields.SIGNATURE,_Fields.HDFS_LOCATION,_Fields.SCALAR_FN,_Fields.AGGREGATE_FN,_Fields.ID,_Fields.CHECKSUM,_Fields.FID,_Fields.TABLE_FN};
  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.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TFunctionName.class)));
    tmpMap.put(_Fields.BINARY_TYPE, new org.apache.thrift.meta_data.FieldMetaData("binary_type", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TFunctionBinaryType.class)));
    tmpMap.put(_Fields.ARG_TYPES, new org.apache.thrift.meta_data.FieldMetaData("arg_types", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        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, TTypeDesc.class))));
    tmpMap.put(_Fields.RET_TYPE, new org.apache.thrift.meta_data.FieldMetaData("ret_type", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTypeDesc.class)));
    tmpMap.put(_Fields.HAS_VAR_ARGS, new org.apache.thrift.meta_data.FieldMetaData("has_var_args", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.COMMENT, new org.apache.thrift.meta_data.FieldMetaData("comment", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.SIGNATURE, new org.apache.thrift.meta_data.FieldMetaData("signature", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.HDFS_LOCATION, new org.apache.thrift.meta_data.FieldMetaData("hdfs_location", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.SCALAR_FN, new org.apache.thrift.meta_data.FieldMetaData("scalar_fn", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TScalarFunction.class)));
    tmpMap.put(_Fields.AGGREGATE_FN, new org.apache.thrift.meta_data.FieldMetaData("aggregate_fn", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TAggregateFunction.class)));
    tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.CHECKSUM, new org.apache.thrift.meta_data.FieldMetaData("checksum", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.FID, new org.apache.thrift.meta_data.FieldMetaData("fid", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.TABLE_FN, new org.apache.thrift.meta_data.FieldMetaData("table_fn", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTableFunction.class)));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TFunction.class, metaDataMap);
  }

  public TFunction() {
  }

  public TFunction(
    TFunctionName name,
    TFunctionBinaryType binary_type,
    java.util.List arg_types,
    TTypeDesc ret_type,
    boolean has_var_args)
  {
    this();
    this.name = name;
    this.binary_type = binary_type;
    this.arg_types = arg_types;
    this.ret_type = ret_type;
    this.has_var_args = has_var_args;
    setHas_var_argsIsSet(true);
  }

  /**
   * Performs a deep copy on other.
   */
  public TFunction(TFunction other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetName()) {
      this.name = new TFunctionName(other.name);
    }
    if (other.isSetBinary_type()) {
      this.binary_type = other.binary_type;
    }
    if (other.isSetArg_types()) {
      java.util.List __this__arg_types = new java.util.ArrayList(other.arg_types.size());
      for (TTypeDesc other_element : other.arg_types) {
        __this__arg_types.add(new TTypeDesc(other_element));
      }
      this.arg_types = __this__arg_types;
    }
    if (other.isSetRet_type()) {
      this.ret_type = new TTypeDesc(other.ret_type);
    }
    this.has_var_args = other.has_var_args;
    if (other.isSetComment()) {
      this.comment = other.comment;
    }
    if (other.isSetSignature()) {
      this.signature = other.signature;
    }
    if (other.isSetHdfs_location()) {
      this.hdfs_location = other.hdfs_location;
    }
    if (other.isSetScalar_fn()) {
      this.scalar_fn = new TScalarFunction(other.scalar_fn);
    }
    if (other.isSetAggregate_fn()) {
      this.aggregate_fn = new TAggregateFunction(other.aggregate_fn);
    }
    this.id = other.id;
    if (other.isSetChecksum()) {
      this.checksum = other.checksum;
    }
    this.fid = other.fid;
    if (other.isSetTable_fn()) {
      this.table_fn = new TTableFunction(other.table_fn);
    }
  }

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

  @Override
  public void clear() {
    this.name = null;
    this.binary_type = null;
    this.arg_types = null;
    this.ret_type = null;
    setHas_var_argsIsSet(false);
    this.has_var_args = false;
    this.comment = null;
    this.signature = null;
    this.hdfs_location = null;
    this.scalar_fn = null;
    this.aggregate_fn = null;
    setIdIsSet(false);
    this.id = 0;
    this.checksum = null;
    setFidIsSet(false);
    this.fid = 0;
    this.table_fn = null;
  }

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

  public TFunction setName(@org.apache.thrift.annotation.Nullable TFunctionName name) {
    this.name = name;
    return this;
  }

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

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

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

  /**
   * 
   * @see TFunctionBinaryType
   */
  @org.apache.thrift.annotation.Nullable
  public TFunctionBinaryType getBinary_type() {
    return this.binary_type;
  }

  /**
   * 
   * @see TFunctionBinaryType
   */
  public TFunction setBinary_type(@org.apache.thrift.annotation.Nullable TFunctionBinaryType binary_type) {
    this.binary_type = binary_type;
    return this;
  }

  public void unsetBinary_type() {
    this.binary_type = null;
  }

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

  public void setBinary_typeIsSet(boolean value) {
    if (!value) {
      this.binary_type = null;
    }
  }

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

  @org.apache.thrift.annotation.Nullable
  public java.util.Iterator getArg_typesIterator() {
    return (this.arg_types == null) ? null : this.arg_types.iterator();
  }

  public void addToArg_types(TTypeDesc elem) {
    if (this.arg_types == null) {
      this.arg_types = new java.util.ArrayList();
    }
    this.arg_types.add(elem);
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.List getArg_types() {
    return this.arg_types;
  }

  public TFunction setArg_types(@org.apache.thrift.annotation.Nullable java.util.List arg_types) {
    this.arg_types = arg_types;
    return this;
  }

  public void unsetArg_types() {
    this.arg_types = null;
  }

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

  public void setArg_typesIsSet(boolean value) {
    if (!value) {
      this.arg_types = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public TTypeDesc getRet_type() {
    return this.ret_type;
  }

  public TFunction setRet_type(@org.apache.thrift.annotation.Nullable TTypeDesc ret_type) {
    this.ret_type = ret_type;
    return this;
  }

  public void unsetRet_type() {
    this.ret_type = null;
  }

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

  public void setRet_typeIsSet(boolean value) {
    if (!value) {
      this.ret_type = null;
    }
  }

  public boolean isHas_var_args() {
    return this.has_var_args;
  }

  public TFunction setHas_var_args(boolean has_var_args) {
    this.has_var_args = has_var_args;
    setHas_var_argsIsSet(true);
    return this;
  }

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

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

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

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

  public TFunction setComment(@org.apache.thrift.annotation.Nullable java.lang.String comment) {
    this.comment = comment;
    return this;
  }

  public void unsetComment() {
    this.comment = null;
  }

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

  public void setCommentIsSet(boolean value) {
    if (!value) {
      this.comment = null;
    }
  }

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

  public TFunction setSignature(@org.apache.thrift.annotation.Nullable java.lang.String signature) {
    this.signature = signature;
    return this;
  }

  public void unsetSignature() {
    this.signature = null;
  }

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

  public void setSignatureIsSet(boolean value) {
    if (!value) {
      this.signature = null;
    }
  }

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

  public TFunction setHdfs_location(@org.apache.thrift.annotation.Nullable java.lang.String hdfs_location) {
    this.hdfs_location = hdfs_location;
    return this;
  }

  public void unsetHdfs_location() {
    this.hdfs_location = null;
  }

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

  public void setHdfs_locationIsSet(boolean value) {
    if (!value) {
      this.hdfs_location = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public TScalarFunction getScalar_fn() {
    return this.scalar_fn;
  }

  public TFunction setScalar_fn(@org.apache.thrift.annotation.Nullable TScalarFunction scalar_fn) {
    this.scalar_fn = scalar_fn;
    return this;
  }

  public void unsetScalar_fn() {
    this.scalar_fn = null;
  }

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

  public void setScalar_fnIsSet(boolean value) {
    if (!value) {
      this.scalar_fn = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public TAggregateFunction getAggregate_fn() {
    return this.aggregate_fn;
  }

  public TFunction setAggregate_fn(@org.apache.thrift.annotation.Nullable TAggregateFunction aggregate_fn) {
    this.aggregate_fn = aggregate_fn;
    return this;
  }

  public void unsetAggregate_fn() {
    this.aggregate_fn = null;
  }

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

  public void setAggregate_fnIsSet(boolean value) {
    if (!value) {
      this.aggregate_fn = null;
    }
  }

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

  public TFunction 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);
  }

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

  public TFunction setChecksum(@org.apache.thrift.annotation.Nullable java.lang.String checksum) {
    this.checksum = checksum;
    return this;
  }

  public void unsetChecksum() {
    this.checksum = null;
  }

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

  public void setChecksumIsSet(boolean value) {
    if (!value) {
      this.checksum = null;
    }
  }

  public long getFid() {
    return this.fid;
  }

  public TFunction setFid(long fid) {
    this.fid = fid;
    setFidIsSet(true);
    return this;
  }

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

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

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

  @org.apache.thrift.annotation.Nullable
  public TTableFunction getTable_fn() {
    return this.table_fn;
  }

  public TFunction setTable_fn(@org.apache.thrift.annotation.Nullable TTableFunction table_fn) {
    this.table_fn = table_fn;
    return this;
  }

  public void unsetTable_fn() {
    this.table_fn = null;
  }

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

  public void setTable_fnIsSet(boolean value) {
    if (!value) {
      this.table_fn = null;
    }
  }

  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
    switch (field) {
    case NAME:
      if (value == null) {
        unsetName();
      } else {
        setName((TFunctionName)value);
      }
      break;

    case BINARY_TYPE:
      if (value == null) {
        unsetBinary_type();
      } else {
        setBinary_type((TFunctionBinaryType)value);
      }
      break;

    case ARG_TYPES:
      if (value == null) {
        unsetArg_types();
      } else {
        setArg_types((java.util.List)value);
      }
      break;

    case RET_TYPE:
      if (value == null) {
        unsetRet_type();
      } else {
        setRet_type((TTypeDesc)value);
      }
      break;

    case HAS_VAR_ARGS:
      if (value == null) {
        unsetHas_var_args();
      } else {
        setHas_var_args((java.lang.Boolean)value);
      }
      break;

    case COMMENT:
      if (value == null) {
        unsetComment();
      } else {
        setComment((java.lang.String)value);
      }
      break;

    case SIGNATURE:
      if (value == null) {
        unsetSignature();
      } else {
        setSignature((java.lang.String)value);
      }
      break;

    case HDFS_LOCATION:
      if (value == null) {
        unsetHdfs_location();
      } else {
        setHdfs_location((java.lang.String)value);
      }
      break;

    case SCALAR_FN:
      if (value == null) {
        unsetScalar_fn();
      } else {
        setScalar_fn((TScalarFunction)value);
      }
      break;

    case AGGREGATE_FN:
      if (value == null) {
        unsetAggregate_fn();
      } else {
        setAggregate_fn((TAggregateFunction)value);
      }
      break;

    case ID:
      if (value == null) {
        unsetId();
      } else {
        setId((java.lang.Long)value);
      }
      break;

    case CHECKSUM:
      if (value == null) {
        unsetChecksum();
      } else {
        setChecksum((java.lang.String)value);
      }
      break;

    case FID:
      if (value == null) {
        unsetFid();
      } else {
        setFid((java.lang.Long)value);
      }
      break;

    case TABLE_FN:
      if (value == null) {
        unsetTable_fn();
      } else {
        setTable_fn((TTableFunction)value);
      }
      break;

    }
  }

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

    case BINARY_TYPE:
      return getBinary_type();

    case ARG_TYPES:
      return getArg_types();

    case RET_TYPE:
      return getRet_type();

    case HAS_VAR_ARGS:
      return isHas_var_args();

    case COMMENT:
      return getComment();

    case SIGNATURE:
      return getSignature();

    case HDFS_LOCATION:
      return getHdfs_location();

    case SCALAR_FN:
      return getScalar_fn();

    case AGGREGATE_FN:
      return getAggregate_fn();

    case ID:
      return getId();

    case CHECKSUM:
      return getChecksum();

    case FID:
      return getFid();

    case TABLE_FN:
      return getTable_fn();

    }
    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 NAME:
      return isSetName();
    case BINARY_TYPE:
      return isSetBinary_type();
    case ARG_TYPES:
      return isSetArg_types();
    case RET_TYPE:
      return isSetRet_type();
    case HAS_VAR_ARGS:
      return isSetHas_var_args();
    case COMMENT:
      return isSetComment();
    case SIGNATURE:
      return isSetSignature();
    case HDFS_LOCATION:
      return isSetHdfs_location();
    case SCALAR_FN:
      return isSetScalar_fn();
    case AGGREGATE_FN:
      return isSetAggregate_fn();
    case ID:
      return isSetId();
    case CHECKSUM:
      return isSetChecksum();
    case FID:
      return isSetFid();
    case TABLE_FN:
      return isSetTable_fn();
    }
    throw new java.lang.IllegalStateException();
  }

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

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

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

    boolean this_present_binary_type = true && this.isSetBinary_type();
    boolean that_present_binary_type = true && that.isSetBinary_type();
    if (this_present_binary_type || that_present_binary_type) {
      if (!(this_present_binary_type && that_present_binary_type))
        return false;
      if (!this.binary_type.equals(that.binary_type))
        return false;
    }

    boolean this_present_arg_types = true && this.isSetArg_types();
    boolean that_present_arg_types = true && that.isSetArg_types();
    if (this_present_arg_types || that_present_arg_types) {
      if (!(this_present_arg_types && that_present_arg_types))
        return false;
      if (!this.arg_types.equals(that.arg_types))
        return false;
    }

    boolean this_present_ret_type = true && this.isSetRet_type();
    boolean that_present_ret_type = true && that.isSetRet_type();
    if (this_present_ret_type || that_present_ret_type) {
      if (!(this_present_ret_type && that_present_ret_type))
        return false;
      if (!this.ret_type.equals(that.ret_type))
        return false;
    }

    boolean this_present_has_var_args = true;
    boolean that_present_has_var_args = true;
    if (this_present_has_var_args || that_present_has_var_args) {
      if (!(this_present_has_var_args && that_present_has_var_args))
        return false;
      if (this.has_var_args != that.has_var_args)
        return false;
    }

    boolean this_present_comment = true && this.isSetComment();
    boolean that_present_comment = true && that.isSetComment();
    if (this_present_comment || that_present_comment) {
      if (!(this_present_comment && that_present_comment))
        return false;
      if (!this.comment.equals(that.comment))
        return false;
    }

    boolean this_present_signature = true && this.isSetSignature();
    boolean that_present_signature = true && that.isSetSignature();
    if (this_present_signature || that_present_signature) {
      if (!(this_present_signature && that_present_signature))
        return false;
      if (!this.signature.equals(that.signature))
        return false;
    }

    boolean this_present_hdfs_location = true && this.isSetHdfs_location();
    boolean that_present_hdfs_location = true && that.isSetHdfs_location();
    if (this_present_hdfs_location || that_present_hdfs_location) {
      if (!(this_present_hdfs_location && that_present_hdfs_location))
        return false;
      if (!this.hdfs_location.equals(that.hdfs_location))
        return false;
    }

    boolean this_present_scalar_fn = true && this.isSetScalar_fn();
    boolean that_present_scalar_fn = true && that.isSetScalar_fn();
    if (this_present_scalar_fn || that_present_scalar_fn) {
      if (!(this_present_scalar_fn && that_present_scalar_fn))
        return false;
      if (!this.scalar_fn.equals(that.scalar_fn))
        return false;
    }

    boolean this_present_aggregate_fn = true && this.isSetAggregate_fn();
    boolean that_present_aggregate_fn = true && that.isSetAggregate_fn();
    if (this_present_aggregate_fn || that_present_aggregate_fn) {
      if (!(this_present_aggregate_fn && that_present_aggregate_fn))
        return false;
      if (!this.aggregate_fn.equals(that.aggregate_fn))
        return false;
    }

    boolean this_present_id = true && this.isSetId();
    boolean that_present_id = true && that.isSetId();
    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_checksum = true && this.isSetChecksum();
    boolean that_present_checksum = true && that.isSetChecksum();
    if (this_present_checksum || that_present_checksum) {
      if (!(this_present_checksum && that_present_checksum))
        return false;
      if (!this.checksum.equals(that.checksum))
        return false;
    }

    boolean this_present_fid = true && this.isSetFid();
    boolean that_present_fid = true && that.isSetFid();
    if (this_present_fid || that_present_fid) {
      if (!(this_present_fid && that_present_fid))
        return false;
      if (this.fid != that.fid)
        return false;
    }

    boolean this_present_table_fn = true && this.isSetTable_fn();
    boolean that_present_table_fn = true && that.isSetTable_fn();
    if (this_present_table_fn || that_present_table_fn) {
      if (!(this_present_table_fn && that_present_table_fn))
        return false;
      if (!this.table_fn.equals(that.table_fn))
        return false;
    }

    return true;
  }

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

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

    hashCode = hashCode * 8191 + ((isSetBinary_type()) ? 131071 : 524287);
    if (isSetBinary_type())
      hashCode = hashCode * 8191 + binary_type.getValue();

    hashCode = hashCode * 8191 + ((isSetArg_types()) ? 131071 : 524287);
    if (isSetArg_types())
      hashCode = hashCode * 8191 + arg_types.hashCode();

    hashCode = hashCode * 8191 + ((isSetRet_type()) ? 131071 : 524287);
    if (isSetRet_type())
      hashCode = hashCode * 8191 + ret_type.hashCode();

    hashCode = hashCode * 8191 + ((has_var_args) ? 131071 : 524287);

    hashCode = hashCode * 8191 + ((isSetComment()) ? 131071 : 524287);
    if (isSetComment())
      hashCode = hashCode * 8191 + comment.hashCode();

    hashCode = hashCode * 8191 + ((isSetSignature()) ? 131071 : 524287);
    if (isSetSignature())
      hashCode = hashCode * 8191 + signature.hashCode();

    hashCode = hashCode * 8191 + ((isSetHdfs_location()) ? 131071 : 524287);
    if (isSetHdfs_location())
      hashCode = hashCode * 8191 + hdfs_location.hashCode();

    hashCode = hashCode * 8191 + ((isSetScalar_fn()) ? 131071 : 524287);
    if (isSetScalar_fn())
      hashCode = hashCode * 8191 + scalar_fn.hashCode();

    hashCode = hashCode * 8191 + ((isSetAggregate_fn()) ? 131071 : 524287);
    if (isSetAggregate_fn())
      hashCode = hashCode * 8191 + aggregate_fn.hashCode();

    hashCode = hashCode * 8191 + ((isSetId()) ? 131071 : 524287);
    if (isSetId())
      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(id);

    hashCode = hashCode * 8191 + ((isSetChecksum()) ? 131071 : 524287);
    if (isSetChecksum())
      hashCode = hashCode * 8191 + checksum.hashCode();

    hashCode = hashCode * 8191 + ((isSetFid()) ? 131071 : 524287);
    if (isSetFid())
      hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(fid);

    hashCode = hashCode * 8191 + ((isSetTable_fn()) ? 131071 : 524287);
    if (isSetTable_fn())
      hashCode = hashCode * 8191 + table_fn.hashCode();

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.valueOf(isSetName()).compareTo(other.isSetName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetBinary_type()).compareTo(other.isSetBinary_type());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetBinary_type()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.binary_type, other.binary_type);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetArg_types()).compareTo(other.isSetArg_types());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetArg_types()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.arg_types, other.arg_types);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetRet_type()).compareTo(other.isSetRet_type());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetRet_type()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ret_type, other.ret_type);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetHas_var_args()).compareTo(other.isSetHas_var_args());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetHas_var_args()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.has_var_args, other.has_var_args);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetComment()).compareTo(other.isSetComment());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetComment()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.comment, other.comment);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetSignature()).compareTo(other.isSetSignature());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSignature()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.signature, other.signature);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetHdfs_location()).compareTo(other.isSetHdfs_location());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetHdfs_location()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hdfs_location, other.hdfs_location);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetScalar_fn()).compareTo(other.isSetScalar_fn());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetScalar_fn()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.scalar_fn, other.scalar_fn);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetAggregate_fn()).compareTo(other.isSetAggregate_fn());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAggregate_fn()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.aggregate_fn, other.aggregate_fn);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetId()).compareTo(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.valueOf(isSetChecksum()).compareTo(other.isSetChecksum());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetChecksum()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.checksum, other.checksum);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetFid()).compareTo(other.isSetFid());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetFid()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fid, other.fid);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.valueOf(isSetTable_fn()).compareTo(other.isSetTable_fn());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTable_fn()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table_fn, other.table_fn);
      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("TFunction(");
    boolean first = true;

    sb.append("name:");
    if (this.name == null) {
      sb.append("null");
    } else {
      sb.append(this.name);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("binary_type:");
    if (this.binary_type == null) {
      sb.append("null");
    } else {
      sb.append(this.binary_type);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("arg_types:");
    if (this.arg_types == null) {
      sb.append("null");
    } else {
      sb.append(this.arg_types);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("ret_type:");
    if (this.ret_type == null) {
      sb.append("null");
    } else {
      sb.append(this.ret_type);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("has_var_args:");
    sb.append(this.has_var_args);
    first = false;
    if (isSetComment()) {
      if (!first) sb.append(", ");
      sb.append("comment:");
      if (this.comment == null) {
        sb.append("null");
      } else {
        sb.append(this.comment);
      }
      first = false;
    }
    if (isSetSignature()) {
      if (!first) sb.append(", ");
      sb.append("signature:");
      if (this.signature == null) {
        sb.append("null");
      } else {
        sb.append(this.signature);
      }
      first = false;
    }
    if (isSetHdfs_location()) {
      if (!first) sb.append(", ");
      sb.append("hdfs_location:");
      if (this.hdfs_location == null) {
        sb.append("null");
      } else {
        sb.append(this.hdfs_location);
      }
      first = false;
    }
    if (isSetScalar_fn()) {
      if (!first) sb.append(", ");
      sb.append("scalar_fn:");
      if (this.scalar_fn == null) {
        sb.append("null");
      } else {
        sb.append(this.scalar_fn);
      }
      first = false;
    }
    if (isSetAggregate_fn()) {
      if (!first) sb.append(", ");
      sb.append("aggregate_fn:");
      if (this.aggregate_fn == null) {
        sb.append("null");
      } else {
        sb.append(this.aggregate_fn);
      }
      first = false;
    }
    if (isSetId()) {
      if (!first) sb.append(", ");
      sb.append("id:");
      sb.append(this.id);
      first = false;
    }
    if (isSetChecksum()) {
      if (!first) sb.append(", ");
      sb.append("checksum:");
      if (this.checksum == null) {
        sb.append("null");
      } else {
        sb.append(this.checksum);
      }
      first = false;
    }
    if (isSetFid()) {
      if (!first) sb.append(", ");
      sb.append("fid:");
      sb.append(this.fid);
      first = false;
    }
    if (isSetTable_fn()) {
      if (!first) sb.append(", ");
      sb.append("table_fn:");
      if (this.table_fn == null) {
        sb.append("null");
      } else {
        sb.append(this.table_fn);
      }
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

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

  private static class TFunctionStandardScheme extends org.apache.thrift.scheme.StandardScheme {

    public void read(org.apache.thrift.protocol.TProtocol iprot, TFunction 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: // NAME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.name = new TFunctionName();
              struct.name.read(iprot);
              struct.setNameIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // BINARY_TYPE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.binary_type = com.starrocks.thrift.TFunctionBinaryType.findByValue(iprot.readI32());
              struct.setBinary_typeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // ARG_TYPES
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list24 = iprot.readListBegin();
                struct.arg_types = new java.util.ArrayList(_list24.size);
                @org.apache.thrift.annotation.Nullable TTypeDesc _elem25;
                for (int _i26 = 0; _i26 < _list24.size; ++_i26)
                {
                  _elem25 = new TTypeDesc();
                  _elem25.read(iprot);
                  struct.arg_types.add(_elem25);
                }
                iprot.readListEnd();
              }
              struct.setArg_typesIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // RET_TYPE
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.ret_type = new TTypeDesc();
              struct.ret_type.read(iprot);
              struct.setRet_typeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // HAS_VAR_ARGS
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.has_var_args = iprot.readBool();
              struct.setHas_var_argsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // COMMENT
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.comment = iprot.readString();
              struct.setCommentIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // SIGNATURE
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.signature = iprot.readString();
              struct.setSignatureIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 8: // HDFS_LOCATION
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.hdfs_location = iprot.readString();
              struct.setHdfs_locationIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 9: // SCALAR_FN
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.scalar_fn = new TScalarFunction();
              struct.scalar_fn.read(iprot);
              struct.setScalar_fnIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 10: // AGGREGATE_FN
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.aggregate_fn = new TAggregateFunction();
              struct.aggregate_fn.read(iprot);
              struct.setAggregate_fnIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 11: // 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 12: // CHECKSUM
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.checksum = iprot.readString();
              struct.setChecksumIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 30: // FID
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.fid = iprot.readI64();
              struct.setFidIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 31: // TABLE_FN
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.table_fn = new TTableFunction();
              struct.table_fn.read(iprot);
              struct.setTable_fnIsSet(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.isSetHas_var_args()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'has_var_args' was not found in serialized data! Struct: " + toString());
      }
      struct.validate();
    }

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

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.name != null) {
        oprot.writeFieldBegin(NAME_FIELD_DESC);
        struct.name.write(oprot);
        oprot.writeFieldEnd();
      }
      if (struct.binary_type != null) {
        oprot.writeFieldBegin(BINARY_TYPE_FIELD_DESC);
        oprot.writeI32(struct.binary_type.getValue());
        oprot.writeFieldEnd();
      }
      if (struct.arg_types != null) {
        oprot.writeFieldBegin(ARG_TYPES_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.arg_types.size()));
          for (TTypeDesc _iter27 : struct.arg_types)
          {
            _iter27.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.ret_type != null) {
        oprot.writeFieldBegin(RET_TYPE_FIELD_DESC);
        struct.ret_type.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(HAS_VAR_ARGS_FIELD_DESC);
      oprot.writeBool(struct.has_var_args);
      oprot.writeFieldEnd();
      if (struct.comment != null) {
        if (struct.isSetComment()) {
          oprot.writeFieldBegin(COMMENT_FIELD_DESC);
          oprot.writeString(struct.comment);
          oprot.writeFieldEnd();
        }
      }
      if (struct.signature != null) {
        if (struct.isSetSignature()) {
          oprot.writeFieldBegin(SIGNATURE_FIELD_DESC);
          oprot.writeString(struct.signature);
          oprot.writeFieldEnd();
        }
      }
      if (struct.hdfs_location != null) {
        if (struct.isSetHdfs_location()) {
          oprot.writeFieldBegin(HDFS_LOCATION_FIELD_DESC);
          oprot.writeString(struct.hdfs_location);
          oprot.writeFieldEnd();
        }
      }
      if (struct.scalar_fn != null) {
        if (struct.isSetScalar_fn()) {
          oprot.writeFieldBegin(SCALAR_FN_FIELD_DESC);
          struct.scalar_fn.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.aggregate_fn != null) {
        if (struct.isSetAggregate_fn()) {
          oprot.writeFieldBegin(AGGREGATE_FN_FIELD_DESC);
          struct.aggregate_fn.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetId()) {
        oprot.writeFieldBegin(ID_FIELD_DESC);
        oprot.writeI64(struct.id);
        oprot.writeFieldEnd();
      }
      if (struct.checksum != null) {
        if (struct.isSetChecksum()) {
          oprot.writeFieldBegin(CHECKSUM_FIELD_DESC);
          oprot.writeString(struct.checksum);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetFid()) {
        oprot.writeFieldBegin(FID_FIELD_DESC);
        oprot.writeI64(struct.fid);
        oprot.writeFieldEnd();
      }
      if (struct.table_fn != null) {
        if (struct.isSetTable_fn()) {
          oprot.writeFieldBegin(TABLE_FN_FIELD_DESC);
          struct.table_fn.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

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

  private static class TFunctionTupleScheme extends org.apache.thrift.scheme.TupleScheme {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TFunction struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      struct.name.write(oprot);
      oprot.writeI32(struct.binary_type.getValue());
      {
        oprot.writeI32(struct.arg_types.size());
        for (TTypeDesc _iter28 : struct.arg_types)
        {
          _iter28.write(oprot);
        }
      }
      struct.ret_type.write(oprot);
      oprot.writeBool(struct.has_var_args);
      java.util.BitSet optionals = new java.util.BitSet();
      if (struct.isSetComment()) {
        optionals.set(0);
      }
      if (struct.isSetSignature()) {
        optionals.set(1);
      }
      if (struct.isSetHdfs_location()) {
        optionals.set(2);
      }
      if (struct.isSetScalar_fn()) {
        optionals.set(3);
      }
      if (struct.isSetAggregate_fn()) {
        optionals.set(4);
      }
      if (struct.isSetId()) {
        optionals.set(5);
      }
      if (struct.isSetChecksum()) {
        optionals.set(6);
      }
      if (struct.isSetFid()) {
        optionals.set(7);
      }
      if (struct.isSetTable_fn()) {
        optionals.set(8);
      }
      oprot.writeBitSet(optionals, 9);
      if (struct.isSetComment()) {
        oprot.writeString(struct.comment);
      }
      if (struct.isSetSignature()) {
        oprot.writeString(struct.signature);
      }
      if (struct.isSetHdfs_location()) {
        oprot.writeString(struct.hdfs_location);
      }
      if (struct.isSetScalar_fn()) {
        struct.scalar_fn.write(oprot);
      }
      if (struct.isSetAggregate_fn()) {
        struct.aggregate_fn.write(oprot);
      }
      if (struct.isSetId()) {
        oprot.writeI64(struct.id);
      }
      if (struct.isSetChecksum()) {
        oprot.writeString(struct.checksum);
      }
      if (struct.isSetFid()) {
        oprot.writeI64(struct.fid);
      }
      if (struct.isSetTable_fn()) {
        struct.table_fn.write(oprot);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TFunction struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      struct.name = new TFunctionName();
      struct.name.read(iprot);
      struct.setNameIsSet(true);
      struct.binary_type = com.starrocks.thrift.TFunctionBinaryType.findByValue(iprot.readI32());
      struct.setBinary_typeIsSet(true);
      {
        org.apache.thrift.protocol.TList _list29 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
        struct.arg_types = new java.util.ArrayList(_list29.size);
        @org.apache.thrift.annotation.Nullable TTypeDesc _elem30;
        for (int _i31 = 0; _i31 < _list29.size; ++_i31)
        {
          _elem30 = new TTypeDesc();
          _elem30.read(iprot);
          struct.arg_types.add(_elem30);
        }
      }
      struct.setArg_typesIsSet(true);
      struct.ret_type = new TTypeDesc();
      struct.ret_type.read(iprot);
      struct.setRet_typeIsSet(true);
      struct.has_var_args = iprot.readBool();
      struct.setHas_var_argsIsSet(true);
      java.util.BitSet incoming = iprot.readBitSet(9);
      if (incoming.get(0)) {
        struct.comment = iprot.readString();
        struct.setCommentIsSet(true);
      }
      if (incoming.get(1)) {
        struct.signature = iprot.readString();
        struct.setSignatureIsSet(true);
      }
      if (incoming.get(2)) {
        struct.hdfs_location = iprot.readString();
        struct.setHdfs_locationIsSet(true);
      }
      if (incoming.get(3)) {
        struct.scalar_fn = new TScalarFunction();
        struct.scalar_fn.read(iprot);
        struct.setScalar_fnIsSet(true);
      }
      if (incoming.get(4)) {
        struct.aggregate_fn = new TAggregateFunction();
        struct.aggregate_fn.read(iprot);
        struct.setAggregate_fnIsSet(true);
      }
      if (incoming.get(5)) {
        struct.id = iprot.readI64();
        struct.setIdIsSet(true);
      }
      if (incoming.get(6)) {
        struct.checksum = iprot.readString();
        struct.setChecksumIsSet(true);
      }
      if (incoming.get(7)) {
        struct.fid = iprot.readI64();
        struct.setFidIsSet(true);
      }
      if (incoming.get(8)) {
        struct.table_fn = new TTableFunction();
        struct.table_fn.read(iprot);
        struct.setTable_fnIsSet(true);
      }
    }
  }

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





© 2015 - 2024 Weber Informatics LLC | Privacy Policy