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

org.apache.parquet.format.ColumnMetaData Maven / Gradle / Ivy

/**
 * Autogenerated by Thrift Compiler (0.16.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package org.apache.parquet.format;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
/**
 * Description for column metadata
 */
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.16.0)", date = "2023-05-12")
public class ColumnMetaData 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("ColumnMetaData");

  private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)1);
  private static final org.apache.thrift.protocol.TField ENCODINGS_FIELD_DESC = new org.apache.thrift.protocol.TField("encodings", org.apache.thrift.protocol.TType.LIST, (short)2);
  private static final org.apache.thrift.protocol.TField PATH_IN_SCHEMA_FIELD_DESC = new org.apache.thrift.protocol.TField("path_in_schema", org.apache.thrift.protocol.TType.LIST, (short)3);
  private static final org.apache.thrift.protocol.TField CODEC_FIELD_DESC = new org.apache.thrift.protocol.TField("codec", org.apache.thrift.protocol.TType.I32, (short)4);
  private static final org.apache.thrift.protocol.TField NUM_VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("num_values", org.apache.thrift.protocol.TType.I64, (short)5);
  private static final org.apache.thrift.protocol.TField TOTAL_UNCOMPRESSED_SIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("total_uncompressed_size", org.apache.thrift.protocol.TType.I64, (short)6);
  private static final org.apache.thrift.protocol.TField TOTAL_COMPRESSED_SIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("total_compressed_size", org.apache.thrift.protocol.TType.I64, (short)7);
  private static final org.apache.thrift.protocol.TField KEY_VALUE_METADATA_FIELD_DESC = new org.apache.thrift.protocol.TField("key_value_metadata", org.apache.thrift.protocol.TType.LIST, (short)8);
  private static final org.apache.thrift.protocol.TField DATA_PAGE_OFFSET_FIELD_DESC = new org.apache.thrift.protocol.TField("data_page_offset", org.apache.thrift.protocol.TType.I64, (short)9);
  private static final org.apache.thrift.protocol.TField INDEX_PAGE_OFFSET_FIELD_DESC = new org.apache.thrift.protocol.TField("index_page_offset", org.apache.thrift.protocol.TType.I64, (short)10);
  private static final org.apache.thrift.protocol.TField DICTIONARY_PAGE_OFFSET_FIELD_DESC = new org.apache.thrift.protocol.TField("dictionary_page_offset", org.apache.thrift.protocol.TType.I64, (short)11);
  private static final org.apache.thrift.protocol.TField STATISTICS_FIELD_DESC = new org.apache.thrift.protocol.TField("statistics", org.apache.thrift.protocol.TType.STRUCT, (short)12);
  private static final org.apache.thrift.protocol.TField ENCODING_STATS_FIELD_DESC = new org.apache.thrift.protocol.TField("encoding_stats", org.apache.thrift.protocol.TType.LIST, (short)13);
  private static final org.apache.thrift.protocol.TField BLOOM_FILTER_OFFSET_FIELD_DESC = new org.apache.thrift.protocol.TField("bloom_filter_offset", org.apache.thrift.protocol.TType.I64, (short)14);

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

  /**
   * Type of this column *
   * 
   * @see Type
   */
  public @org.apache.thrift.annotation.Nullable Type type; // required
  /**
   * Set of all encodings used for this column. The purpose is to validate
   * whether we can decode those pages. *
   */
  public @org.apache.thrift.annotation.Nullable java.util.List encodings; // required
  /**
   * Path in schema *
   */
  public @org.apache.thrift.annotation.Nullable java.util.List path_in_schema; // required
  /**
   * Compression codec *
   * 
   * @see CompressionCodec
   */
  public @org.apache.thrift.annotation.Nullable CompressionCodec codec; // required
  /**
   * Number of values in this column *
   */
  public long num_values; // required
  /**
   * total byte size of all uncompressed pages in this column chunk (including the headers) *
   */
  public long total_uncompressed_size; // required
  /**
   * total byte size of all compressed, and potentially encrypted, pages
   * in this column chunk (including the headers) *
   */
  public long total_compressed_size; // required
  /**
   * Optional key/value metadata *
   */
  public @org.apache.thrift.annotation.Nullable java.util.List key_value_metadata; // optional
  /**
   * Byte offset from beginning of file to first data page *
   */
  public long data_page_offset; // required
  /**
   * Byte offset from beginning of file to root index page *
   */
  public long index_page_offset; // optional
  /**
   * Byte offset from the beginning of file to first (only) dictionary page *
   */
  public long dictionary_page_offset; // optional
  /**
   * optional statistics for this column chunk
   */
  public @org.apache.thrift.annotation.Nullable Statistics statistics; // optional
  /**
   * Set of all encodings used for pages in this column chunk.
   * This information can be used to determine if all data pages are
   * dictionary encoded for example *
   */
  public @org.apache.thrift.annotation.Nullable java.util.List encoding_stats; // optional
  /**
   * Byte offset from beginning of file to Bloom filter data. *
   */
  public long bloom_filter_offset; // 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 {
    /**
     * Type of this column *
     * 
     * @see Type
     */
    TYPE((short)1, "type"),
    /**
     * Set of all encodings used for this column. The purpose is to validate
     * whether we can decode those pages. *
     */
    ENCODINGS((short)2, "encodings"),
    /**
     * Path in schema *
     */
    PATH_IN_SCHEMA((short)3, "path_in_schema"),
    /**
     * Compression codec *
     * 
     * @see CompressionCodec
     */
    CODEC((short)4, "codec"),
    /**
     * Number of values in this column *
     */
    NUM_VALUES((short)5, "num_values"),
    /**
     * total byte size of all uncompressed pages in this column chunk (including the headers) *
     */
    TOTAL_UNCOMPRESSED_SIZE((short)6, "total_uncompressed_size"),
    /**
     * total byte size of all compressed, and potentially encrypted, pages
     * in this column chunk (including the headers) *
     */
    TOTAL_COMPRESSED_SIZE((short)7, "total_compressed_size"),
    /**
     * Optional key/value metadata *
     */
    KEY_VALUE_METADATA((short)8, "key_value_metadata"),
    /**
     * Byte offset from beginning of file to first data page *
     */
    DATA_PAGE_OFFSET((short)9, "data_page_offset"),
    /**
     * Byte offset from beginning of file to root index page *
     */
    INDEX_PAGE_OFFSET((short)10, "index_page_offset"),
    /**
     * Byte offset from the beginning of file to first (only) dictionary page *
     */
    DICTIONARY_PAGE_OFFSET((short)11, "dictionary_page_offset"),
    /**
     * optional statistics for this column chunk
     */
    STATISTICS((short)12, "statistics"),
    /**
     * Set of all encodings used for pages in this column chunk.
     * This information can be used to determine if all data pages are
     * dictionary encoded for example *
     */
    ENCODING_STATS((short)13, "encoding_stats"),
    /**
     * Byte offset from beginning of file to Bloom filter data. *
     */
    BLOOM_FILTER_OFFSET((short)14, "bloom_filter_offset");

    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: // TYPE
          return TYPE;
        case 2: // ENCODINGS
          return ENCODINGS;
        case 3: // PATH_IN_SCHEMA
          return PATH_IN_SCHEMA;
        case 4: // CODEC
          return CODEC;
        case 5: // NUM_VALUES
          return NUM_VALUES;
        case 6: // TOTAL_UNCOMPRESSED_SIZE
          return TOTAL_UNCOMPRESSED_SIZE;
        case 7: // TOTAL_COMPRESSED_SIZE
          return TOTAL_COMPRESSED_SIZE;
        case 8: // KEY_VALUE_METADATA
          return KEY_VALUE_METADATA;
        case 9: // DATA_PAGE_OFFSET
          return DATA_PAGE_OFFSET;
        case 10: // INDEX_PAGE_OFFSET
          return INDEX_PAGE_OFFSET;
        case 11: // DICTIONARY_PAGE_OFFSET
          return DICTIONARY_PAGE_OFFSET;
        case 12: // STATISTICS
          return STATISTICS;
        case 13: // ENCODING_STATS
          return ENCODING_STATS;
        case 14: // BLOOM_FILTER_OFFSET
          return BLOOM_FILTER_OFFSET;
        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 __NUM_VALUES_ISSET_ID = 0;
  private static final int __TOTAL_UNCOMPRESSED_SIZE_ISSET_ID = 1;
  private static final int __TOTAL_COMPRESSED_SIZE_ISSET_ID = 2;
  private static final int __DATA_PAGE_OFFSET_ISSET_ID = 3;
  private static final int __INDEX_PAGE_OFFSET_ISSET_ID = 4;
  private static final int __DICTIONARY_PAGE_OFFSET_ISSET_ID = 5;
  private static final int __BLOOM_FILTER_OFFSET_ISSET_ID = 6;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.KEY_VALUE_METADATA,_Fields.INDEX_PAGE_OFFSET,_Fields.DICTIONARY_PAGE_OFFSET,_Fields.STATISTICS,_Fields.ENCODING_STATS,_Fields.BLOOM_FILTER_OFFSET};
  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.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, Type.class)));
    tmpMap.put(_Fields.ENCODINGS, new org.apache.thrift.meta_data.FieldMetaData("encodings", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
            new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, Encoding.class))));
    tmpMap.put(_Fields.PATH_IN_SCHEMA, new org.apache.thrift.meta_data.FieldMetaData("path_in_schema", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
    tmpMap.put(_Fields.CODEC, new org.apache.thrift.meta_data.FieldMetaData("codec", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, CompressionCodec.class)));
    tmpMap.put(_Fields.NUM_VALUES, new org.apache.thrift.meta_data.FieldMetaData("num_values", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.TOTAL_UNCOMPRESSED_SIZE, new org.apache.thrift.meta_data.FieldMetaData("total_uncompressed_size", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.TOTAL_COMPRESSED_SIZE, new org.apache.thrift.meta_data.FieldMetaData("total_compressed_size", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.KEY_VALUE_METADATA, new org.apache.thrift.meta_data.FieldMetaData("key_value_metadata", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
            new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, KeyValue.class))));
    tmpMap.put(_Fields.DATA_PAGE_OFFSET, new org.apache.thrift.meta_data.FieldMetaData("data_page_offset", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.INDEX_PAGE_OFFSET, new org.apache.thrift.meta_data.FieldMetaData("index_page_offset", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.DICTIONARY_PAGE_OFFSET, new org.apache.thrift.meta_data.FieldMetaData("dictionary_page_offset", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.STATISTICS, new org.apache.thrift.meta_data.FieldMetaData("statistics", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Statistics.class)));
    tmpMap.put(_Fields.ENCODING_STATS, new org.apache.thrift.meta_data.FieldMetaData("encoding_stats", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
            new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, PageEncodingStats.class))));
    tmpMap.put(_Fields.BLOOM_FILTER_OFFSET, new org.apache.thrift.meta_data.FieldMetaData("bloom_filter_offset", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ColumnMetaData.class, metaDataMap);
  }

  public ColumnMetaData() {
  }

  public ColumnMetaData(
    Type type,
    java.util.List encodings,
    java.util.List path_in_schema,
    CompressionCodec codec,
    long num_values,
    long total_uncompressed_size,
    long total_compressed_size,
    long data_page_offset)
  {
    this();
    this.type = type;
    this.encodings = encodings;
    this.path_in_schema = path_in_schema;
    this.codec = codec;
    this.num_values = num_values;
    setNum_valuesIsSet(true);
    this.total_uncompressed_size = total_uncompressed_size;
    setTotal_uncompressed_sizeIsSet(true);
    this.total_compressed_size = total_compressed_size;
    setTotal_compressed_sizeIsSet(true);
    this.data_page_offset = data_page_offset;
    setData_page_offsetIsSet(true);
  }

  /**
   * Performs a deep copy on other.
   */
  public ColumnMetaData(ColumnMetaData other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetType()) {
      this.type = other.type;
    }
    if (other.isSetEncodings()) {
      java.util.List __this__encodings = new java.util.ArrayList(other.encodings.size());
      for (Encoding other_element : other.encodings) {
        __this__encodings.add(other_element);
      }
      this.encodings = __this__encodings;
    }
    if (other.isSetPath_in_schema()) {
      java.util.List __this__path_in_schema = new java.util.ArrayList(other.path_in_schema);
      this.path_in_schema = __this__path_in_schema;
    }
    if (other.isSetCodec()) {
      this.codec = other.codec;
    }
    this.num_values = other.num_values;
    this.total_uncompressed_size = other.total_uncompressed_size;
    this.total_compressed_size = other.total_compressed_size;
    if (other.isSetKey_value_metadata()) {
      java.util.List __this__key_value_metadata = new java.util.ArrayList(other.key_value_metadata.size());
      for (KeyValue other_element : other.key_value_metadata) {
        __this__key_value_metadata.add(new KeyValue(other_element));
      }
      this.key_value_metadata = __this__key_value_metadata;
    }
    this.data_page_offset = other.data_page_offset;
    this.index_page_offset = other.index_page_offset;
    this.dictionary_page_offset = other.dictionary_page_offset;
    if (other.isSetStatistics()) {
      this.statistics = new Statistics(other.statistics);
    }
    if (other.isSetEncoding_stats()) {
      java.util.List __this__encoding_stats = new java.util.ArrayList(other.encoding_stats.size());
      for (PageEncodingStats other_element : other.encoding_stats) {
        __this__encoding_stats.add(new PageEncodingStats(other_element));
      }
      this.encoding_stats = __this__encoding_stats;
    }
    this.bloom_filter_offset = other.bloom_filter_offset;
  }

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

  @Override
  public void clear() {
    this.type = null;
    this.encodings = null;
    this.path_in_schema = null;
    this.codec = null;
    setNum_valuesIsSet(false);
    this.num_values = 0;
    setTotal_uncompressed_sizeIsSet(false);
    this.total_uncompressed_size = 0;
    setTotal_compressed_sizeIsSet(false);
    this.total_compressed_size = 0;
    this.key_value_metadata = null;
    setData_page_offsetIsSet(false);
    this.data_page_offset = 0;
    setIndex_page_offsetIsSet(false);
    this.index_page_offset = 0;
    setDictionary_page_offsetIsSet(false);
    this.dictionary_page_offset = 0;
    this.statistics = null;
    this.encoding_stats = null;
    setBloom_filter_offsetIsSet(false);
    this.bloom_filter_offset = 0;
  }

  /**
   * Type of this column *
   * 
   * @see Type
   */
  @org.apache.thrift.annotation.Nullable
  public Type getType() {
    return this.type;
  }

  /**
   * Type of this column *
   * 
   * @see Type
   */
  public ColumnMetaData setType(@org.apache.thrift.annotation.Nullable Type type) {
    this.type = type;
    return this;
  }

  public void unsetType() {
    this.type = null;
  }

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

  public void setTypeIsSet(boolean value) {
    if (!value) {
      this.type = null;
    }
  }

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

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

  public void addToEncodings(Encoding elem) {
    if (this.encodings == null) {
      this.encodings = new java.util.ArrayList();
    }
    this.encodings.add(elem);
  }

  /**
   * Set of all encodings used for this column. The purpose is to validate
   * whether we can decode those pages. *
   */
  @org.apache.thrift.annotation.Nullable
  public java.util.List getEncodings() {
    return this.encodings;
  }

  /**
   * Set of all encodings used for this column. The purpose is to validate
   * whether we can decode those pages. *
   */
  public ColumnMetaData setEncodings(@org.apache.thrift.annotation.Nullable java.util.List encodings) {
    this.encodings = encodings;
    return this;
  }

  public void unsetEncodings() {
    this.encodings = null;
  }

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

  public void setEncodingsIsSet(boolean value) {
    if (!value) {
      this.encodings = null;
    }
  }

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

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

  public void addToPath_in_schema(java.lang.String elem) {
    if (this.path_in_schema == null) {
      this.path_in_schema = new java.util.ArrayList();
    }
    this.path_in_schema.add(elem);
  }

  /**
   * Path in schema *
   */
  @org.apache.thrift.annotation.Nullable
  public java.util.List getPath_in_schema() {
    return this.path_in_schema;
  }

  /**
   * Path in schema *
   */
  public ColumnMetaData setPath_in_schema(@org.apache.thrift.annotation.Nullable java.util.List path_in_schema) {
    this.path_in_schema = path_in_schema;
    return this;
  }

  public void unsetPath_in_schema() {
    this.path_in_schema = null;
  }

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

  public void setPath_in_schemaIsSet(boolean value) {
    if (!value) {
      this.path_in_schema = null;
    }
  }

  /**
   * Compression codec *
   * 
   * @see CompressionCodec
   */
  @org.apache.thrift.annotation.Nullable
  public CompressionCodec getCodec() {
    return this.codec;
  }

  /**
   * Compression codec *
   * 
   * @see CompressionCodec
   */
  public ColumnMetaData setCodec(@org.apache.thrift.annotation.Nullable CompressionCodec codec) {
    this.codec = codec;
    return this;
  }

  public void unsetCodec() {
    this.codec = null;
  }

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

  public void setCodecIsSet(boolean value) {
    if (!value) {
      this.codec = null;
    }
  }

  /**
   * Number of values in this column *
   */
  public long getNum_values() {
    return this.num_values;
  }

  /**
   * Number of values in this column *
   */
  public ColumnMetaData setNum_values(long num_values) {
    this.num_values = num_values;
    setNum_valuesIsSet(true);
    return this;
  }

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

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

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

  /**
   * total byte size of all uncompressed pages in this column chunk (including the headers) *
   */
  public long getTotal_uncompressed_size() {
    return this.total_uncompressed_size;
  }

  /**
   * total byte size of all uncompressed pages in this column chunk (including the headers) *
   */
  public ColumnMetaData setTotal_uncompressed_size(long total_uncompressed_size) {
    this.total_uncompressed_size = total_uncompressed_size;
    setTotal_uncompressed_sizeIsSet(true);
    return this;
  }

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

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

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

  /**
   * total byte size of all compressed, and potentially encrypted, pages
   * in this column chunk (including the headers) *
   */
  public long getTotal_compressed_size() {
    return this.total_compressed_size;
  }

  /**
   * total byte size of all compressed, and potentially encrypted, pages
   * in this column chunk (including the headers) *
   */
  public ColumnMetaData setTotal_compressed_size(long total_compressed_size) {
    this.total_compressed_size = total_compressed_size;
    setTotal_compressed_sizeIsSet(true);
    return this;
  }

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

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

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

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

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

  public void addToKey_value_metadata(KeyValue elem) {
    if (this.key_value_metadata == null) {
      this.key_value_metadata = new java.util.ArrayList();
    }
    this.key_value_metadata.add(elem);
  }

  /**
   * Optional key/value metadata *
   */
  @org.apache.thrift.annotation.Nullable
  public java.util.List getKey_value_metadata() {
    return this.key_value_metadata;
  }

  /**
   * Optional key/value metadata *
   */
  public ColumnMetaData setKey_value_metadata(@org.apache.thrift.annotation.Nullable java.util.List key_value_metadata) {
    this.key_value_metadata = key_value_metadata;
    return this;
  }

  public void unsetKey_value_metadata() {
    this.key_value_metadata = null;
  }

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

  public void setKey_value_metadataIsSet(boolean value) {
    if (!value) {
      this.key_value_metadata = null;
    }
  }

  /**
   * Byte offset from beginning of file to first data page *
   */
  public long getData_page_offset() {
    return this.data_page_offset;
  }

  /**
   * Byte offset from beginning of file to first data page *
   */
  public ColumnMetaData setData_page_offset(long data_page_offset) {
    this.data_page_offset = data_page_offset;
    setData_page_offsetIsSet(true);
    return this;
  }

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

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

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

  /**
   * Byte offset from beginning of file to root index page *
   */
  public long getIndex_page_offset() {
    return this.index_page_offset;
  }

  /**
   * Byte offset from beginning of file to root index page *
   */
  public ColumnMetaData setIndex_page_offset(long index_page_offset) {
    this.index_page_offset = index_page_offset;
    setIndex_page_offsetIsSet(true);
    return this;
  }

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

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

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

  /**
   * Byte offset from the beginning of file to first (only) dictionary page *
   */
  public long getDictionary_page_offset() {
    return this.dictionary_page_offset;
  }

  /**
   * Byte offset from the beginning of file to first (only) dictionary page *
   */
  public ColumnMetaData setDictionary_page_offset(long dictionary_page_offset) {
    this.dictionary_page_offset = dictionary_page_offset;
    setDictionary_page_offsetIsSet(true);
    return this;
  }

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

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

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

  /**
   * optional statistics for this column chunk
   */
  @org.apache.thrift.annotation.Nullable
  public Statistics getStatistics() {
    return this.statistics;
  }

  /**
   * optional statistics for this column chunk
   */
  public ColumnMetaData setStatistics(@org.apache.thrift.annotation.Nullable Statistics statistics) {
    this.statistics = statistics;
    return this;
  }

  public void unsetStatistics() {
    this.statistics = null;
  }

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

  public void setStatisticsIsSet(boolean value) {
    if (!value) {
      this.statistics = null;
    }
  }

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

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

  public void addToEncoding_stats(PageEncodingStats elem) {
    if (this.encoding_stats == null) {
      this.encoding_stats = new java.util.ArrayList();
    }
    this.encoding_stats.add(elem);
  }

  /**
   * Set of all encodings used for pages in this column chunk.
   * This information can be used to determine if all data pages are
   * dictionary encoded for example *
   */
  @org.apache.thrift.annotation.Nullable
  public java.util.List getEncoding_stats() {
    return this.encoding_stats;
  }

  /**
   * Set of all encodings used for pages in this column chunk.
   * This information can be used to determine if all data pages are
   * dictionary encoded for example *
   */
  public ColumnMetaData setEncoding_stats(@org.apache.thrift.annotation.Nullable java.util.List encoding_stats) {
    this.encoding_stats = encoding_stats;
    return this;
  }

  public void unsetEncoding_stats() {
    this.encoding_stats = null;
  }

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

  public void setEncoding_statsIsSet(boolean value) {
    if (!value) {
      this.encoding_stats = null;
    }
  }

  /**
   * Byte offset from beginning of file to Bloom filter data. *
   */
  public long getBloom_filter_offset() {
    return this.bloom_filter_offset;
  }

  /**
   * Byte offset from beginning of file to Bloom filter data. *
   */
  public ColumnMetaData setBloom_filter_offset(long bloom_filter_offset) {
    this.bloom_filter_offset = bloom_filter_offset;
    setBloom_filter_offsetIsSet(true);
    return this;
  }

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

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

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

  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
    switch (field) {
    case TYPE:
      if (value == null) {
        unsetType();
      } else {
        setType((Type)value);
      }
      break;

    case ENCODINGS:
      if (value == null) {
        unsetEncodings();
      } else {
        setEncodings((java.util.List)value);
      }
      break;

    case PATH_IN_SCHEMA:
      if (value == null) {
        unsetPath_in_schema();
      } else {
        setPath_in_schema((java.util.List)value);
      }
      break;

    case CODEC:
      if (value == null) {
        unsetCodec();
      } else {
        setCodec((CompressionCodec)value);
      }
      break;

    case NUM_VALUES:
      if (value == null) {
        unsetNum_values();
      } else {
        setNum_values((java.lang.Long)value);
      }
      break;

    case TOTAL_UNCOMPRESSED_SIZE:
      if (value == null) {
        unsetTotal_uncompressed_size();
      } else {
        setTotal_uncompressed_size((java.lang.Long)value);
      }
      break;

    case TOTAL_COMPRESSED_SIZE:
      if (value == null) {
        unsetTotal_compressed_size();
      } else {
        setTotal_compressed_size((java.lang.Long)value);
      }
      break;

    case KEY_VALUE_METADATA:
      if (value == null) {
        unsetKey_value_metadata();
      } else {
        setKey_value_metadata((java.util.List)value);
      }
      break;

    case DATA_PAGE_OFFSET:
      if (value == null) {
        unsetData_page_offset();
      } else {
        setData_page_offset((java.lang.Long)value);
      }
      break;

    case INDEX_PAGE_OFFSET:
      if (value == null) {
        unsetIndex_page_offset();
      } else {
        setIndex_page_offset((java.lang.Long)value);
      }
      break;

    case DICTIONARY_PAGE_OFFSET:
      if (value == null) {
        unsetDictionary_page_offset();
      } else {
        setDictionary_page_offset((java.lang.Long)value);
      }
      break;

    case STATISTICS:
      if (value == null) {
        unsetStatistics();
      } else {
        setStatistics((Statistics)value);
      }
      break;

    case ENCODING_STATS:
      if (value == null) {
        unsetEncoding_stats();
      } else {
        setEncoding_stats((java.util.List)value);
      }
      break;

    case BLOOM_FILTER_OFFSET:
      if (value == null) {
        unsetBloom_filter_offset();
      } else {
        setBloom_filter_offset((java.lang.Long)value);
      }
      break;

    }
  }

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

    case ENCODINGS:
      return getEncodings();

    case PATH_IN_SCHEMA:
      return getPath_in_schema();

    case CODEC:
      return getCodec();

    case NUM_VALUES:
      return getNum_values();

    case TOTAL_UNCOMPRESSED_SIZE:
      return getTotal_uncompressed_size();

    case TOTAL_COMPRESSED_SIZE:
      return getTotal_compressed_size();

    case KEY_VALUE_METADATA:
      return getKey_value_metadata();

    case DATA_PAGE_OFFSET:
      return getData_page_offset();

    case INDEX_PAGE_OFFSET:
      return getIndex_page_offset();

    case DICTIONARY_PAGE_OFFSET:
      return getDictionary_page_offset();

    case STATISTICS:
      return getStatistics();

    case ENCODING_STATS:
      return getEncoding_stats();

    case BLOOM_FILTER_OFFSET:
      return getBloom_filter_offset();

    }
    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 TYPE:
      return isSetType();
    case ENCODINGS:
      return isSetEncodings();
    case PATH_IN_SCHEMA:
      return isSetPath_in_schema();
    case CODEC:
      return isSetCodec();
    case NUM_VALUES:
      return isSetNum_values();
    case TOTAL_UNCOMPRESSED_SIZE:
      return isSetTotal_uncompressed_size();
    case TOTAL_COMPRESSED_SIZE:
      return isSetTotal_compressed_size();
    case KEY_VALUE_METADATA:
      return isSetKey_value_metadata();
    case DATA_PAGE_OFFSET:
      return isSetData_page_offset();
    case INDEX_PAGE_OFFSET:
      return isSetIndex_page_offset();
    case DICTIONARY_PAGE_OFFSET:
      return isSetDictionary_page_offset();
    case STATISTICS:
      return isSetStatistics();
    case ENCODING_STATS:
      return isSetEncoding_stats();
    case BLOOM_FILTER_OFFSET:
      return isSetBloom_filter_offset();
    }
    throw new java.lang.IllegalStateException();
  }

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

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

    boolean this_present_type = true && this.isSetType();
    boolean that_present_type = true && that.isSetType();
    if (this_present_type || that_present_type) {
      if (!(this_present_type && that_present_type))
        return false;
      if (!this.type.equals(that.type))
        return false;
    }

    boolean this_present_encodings = true && this.isSetEncodings();
    boolean that_present_encodings = true && that.isSetEncodings();
    if (this_present_encodings || that_present_encodings) {
      if (!(this_present_encodings && that_present_encodings))
        return false;
      if (!this.encodings.equals(that.encodings))
        return false;
    }

    boolean this_present_path_in_schema = true && this.isSetPath_in_schema();
    boolean that_present_path_in_schema = true && that.isSetPath_in_schema();
    if (this_present_path_in_schema || that_present_path_in_schema) {
      if (!(this_present_path_in_schema && that_present_path_in_schema))
        return false;
      if (!this.path_in_schema.equals(that.path_in_schema))
        return false;
    }

    boolean this_present_codec = true && this.isSetCodec();
    boolean that_present_codec = true && that.isSetCodec();
    if (this_present_codec || that_present_codec) {
      if (!(this_present_codec && that_present_codec))
        return false;
      if (!this.codec.equals(that.codec))
        return false;
    }

    boolean this_present_num_values = true;
    boolean that_present_num_values = true;
    if (this_present_num_values || that_present_num_values) {
      if (!(this_present_num_values && that_present_num_values))
        return false;
      if (this.num_values != that.num_values)
        return false;
    }

    boolean this_present_total_uncompressed_size = true;
    boolean that_present_total_uncompressed_size = true;
    if (this_present_total_uncompressed_size || that_present_total_uncompressed_size) {
      if (!(this_present_total_uncompressed_size && that_present_total_uncompressed_size))
        return false;
      if (this.total_uncompressed_size != that.total_uncompressed_size)
        return false;
    }

    boolean this_present_total_compressed_size = true;
    boolean that_present_total_compressed_size = true;
    if (this_present_total_compressed_size || that_present_total_compressed_size) {
      if (!(this_present_total_compressed_size && that_present_total_compressed_size))
        return false;
      if (this.total_compressed_size != that.total_compressed_size)
        return false;
    }

    boolean this_present_key_value_metadata = true && this.isSetKey_value_metadata();
    boolean that_present_key_value_metadata = true && that.isSetKey_value_metadata();
    if (this_present_key_value_metadata || that_present_key_value_metadata) {
      if (!(this_present_key_value_metadata && that_present_key_value_metadata))
        return false;
      if (!this.key_value_metadata.equals(that.key_value_metadata))
        return false;
    }

    boolean this_present_data_page_offset = true;
    boolean that_present_data_page_offset = true;
    if (this_present_data_page_offset || that_present_data_page_offset) {
      if (!(this_present_data_page_offset && that_present_data_page_offset))
        return false;
      if (this.data_page_offset != that.data_page_offset)
        return false;
    }

    boolean this_present_index_page_offset = true && this.isSetIndex_page_offset();
    boolean that_present_index_page_offset = true && that.isSetIndex_page_offset();
    if (this_present_index_page_offset || that_present_index_page_offset) {
      if (!(this_present_index_page_offset && that_present_index_page_offset))
        return false;
      if (this.index_page_offset != that.index_page_offset)
        return false;
    }

    boolean this_present_dictionary_page_offset = true && this.isSetDictionary_page_offset();
    boolean that_present_dictionary_page_offset = true && that.isSetDictionary_page_offset();
    if (this_present_dictionary_page_offset || that_present_dictionary_page_offset) {
      if (!(this_present_dictionary_page_offset && that_present_dictionary_page_offset))
        return false;
      if (this.dictionary_page_offset != that.dictionary_page_offset)
        return false;
    }

    boolean this_present_statistics = true && this.isSetStatistics();
    boolean that_present_statistics = true && that.isSetStatistics();
    if (this_present_statistics || that_present_statistics) {
      if (!(this_present_statistics && that_present_statistics))
        return false;
      if (!this.statistics.equals(that.statistics))
        return false;
    }

    boolean this_present_encoding_stats = true && this.isSetEncoding_stats();
    boolean that_present_encoding_stats = true && that.isSetEncoding_stats();
    if (this_present_encoding_stats || that_present_encoding_stats) {
      if (!(this_present_encoding_stats && that_present_encoding_stats))
        return false;
      if (!this.encoding_stats.equals(that.encoding_stats))
        return false;
    }

    boolean this_present_bloom_filter_offset = true && this.isSetBloom_filter_offset();
    boolean that_present_bloom_filter_offset = true && that.isSetBloom_filter_offset();
    if (this_present_bloom_filter_offset || that_present_bloom_filter_offset) {
      if (!(this_present_bloom_filter_offset && that_present_bloom_filter_offset))
        return false;
      if (this.bloom_filter_offset != that.bloom_filter_offset)
        return false;
    }

    return true;
  }

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

    hashCode = hashCode * 8191 + ((isSetType()) ? 131071 : 524287);
    if (isSetType())
      hashCode = hashCode * 8191 + type.getValue();

    hashCode = hashCode * 8191 + ((isSetEncodings()) ? 131071 : 524287);
    if (isSetEncodings())
      hashCode = hashCode * 8191 + encodings.hashCode();

    hashCode = hashCode * 8191 + ((isSetPath_in_schema()) ? 131071 : 524287);
    if (isSetPath_in_schema())
      hashCode = hashCode * 8191 + path_in_schema.hashCode();

    hashCode = hashCode * 8191 + ((isSetCodec()) ? 131071 : 524287);
    if (isSetCodec())
      hashCode = hashCode * 8191 + codec.getValue();

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

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

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

    hashCode = hashCode * 8191 + ((isSetKey_value_metadata()) ? 131071 : 524287);
    if (isSetKey_value_metadata())
      hashCode = hashCode * 8191 + key_value_metadata.hashCode();

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

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

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

    hashCode = hashCode * 8191 + ((isSetStatistics()) ? 131071 : 524287);
    if (isSetStatistics())
      hashCode = hashCode * 8191 + statistics.hashCode();

    hashCode = hashCode * 8191 + ((isSetEncoding_stats()) ? 131071 : 524287);
    if (isSetEncoding_stats())
      hashCode = hashCode * 8191 + encoding_stats.hashCode();

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

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetType(), other.isSetType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetType()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, other.type);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetEncodings(), other.isSetEncodings());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetEncodings()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.encodings, other.encodings);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetPath_in_schema(), other.isSetPath_in_schema());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPath_in_schema()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path_in_schema, other.path_in_schema);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetCodec(), other.isSetCodec());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCodec()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.codec, other.codec);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetNum_values(), other.isSetNum_values());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetNum_values()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num_values, other.num_values);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetTotal_uncompressed_size(), other.isSetTotal_uncompressed_size());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTotal_uncompressed_size()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.total_uncompressed_size, other.total_uncompressed_size);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetTotal_compressed_size(), other.isSetTotal_compressed_size());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTotal_compressed_size()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.total_compressed_size, other.total_compressed_size);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetKey_value_metadata(), other.isSetKey_value_metadata());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetKey_value_metadata()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.key_value_metadata, other.key_value_metadata);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetData_page_offset(), other.isSetData_page_offset());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetData_page_offset()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.data_page_offset, other.data_page_offset);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetIndex_page_offset(), other.isSetIndex_page_offset());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetIndex_page_offset()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.index_page_offset, other.index_page_offset);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetDictionary_page_offset(), other.isSetDictionary_page_offset());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDictionary_page_offset()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dictionary_page_offset, other.dictionary_page_offset);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetStatistics(), other.isSetStatistics());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStatistics()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.statistics, other.statistics);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetEncoding_stats(), other.isSetEncoding_stats());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetEncoding_stats()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.encoding_stats, other.encoding_stats);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetBloom_filter_offset(), other.isSetBloom_filter_offset());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetBloom_filter_offset()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bloom_filter_offset, other.bloom_filter_offset);
      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("ColumnMetaData(");
    boolean first = true;

    sb.append("type:");
    if (this.type == null) {
      sb.append("null");
    } else {
      sb.append(this.type);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("encodings:");
    if (this.encodings == null) {
      sb.append("null");
    } else {
      sb.append(this.encodings);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("path_in_schema:");
    if (this.path_in_schema == null) {
      sb.append("null");
    } else {
      sb.append(this.path_in_schema);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("codec:");
    if (this.codec == null) {
      sb.append("null");
    } else {
      sb.append(this.codec);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("num_values:");
    sb.append(this.num_values);
    first = false;
    if (!first) sb.append(", ");
    sb.append("total_uncompressed_size:");
    sb.append(this.total_uncompressed_size);
    first = false;
    if (!first) sb.append(", ");
    sb.append("total_compressed_size:");
    sb.append(this.total_compressed_size);
    first = false;
    if (isSetKey_value_metadata()) {
      if (!first) sb.append(", ");
      sb.append("key_value_metadata:");
      if (this.key_value_metadata == null) {
        sb.append("null");
      } else {
        sb.append(this.key_value_metadata);
      }
      first = false;
    }
    if (!first) sb.append(", ");
    sb.append("data_page_offset:");
    sb.append(this.data_page_offset);
    first = false;
    if (isSetIndex_page_offset()) {
      if (!first) sb.append(", ");
      sb.append("index_page_offset:");
      sb.append(this.index_page_offset);
      first = false;
    }
    if (isSetDictionary_page_offset()) {
      if (!first) sb.append(", ");
      sb.append("dictionary_page_offset:");
      sb.append(this.dictionary_page_offset);
      first = false;
    }
    if (isSetStatistics()) {
      if (!first) sb.append(", ");
      sb.append("statistics:");
      if (this.statistics == null) {
        sb.append("null");
      } else {
        sb.append(this.statistics);
      }
      first = false;
    }
    if (isSetEncoding_stats()) {
      if (!first) sb.append(", ");
      sb.append("encoding_stats:");
      if (this.encoding_stats == null) {
        sb.append("null");
      } else {
        sb.append(this.encoding_stats);
      }
      first = false;
    }
    if (isSetBloom_filter_offset()) {
      if (!first) sb.append(", ");
      sb.append("bloom_filter_offset:");
      sb.append(this.bloom_filter_offset);
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

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

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

    public void read(org.apache.thrift.protocol.TProtocol iprot, ColumnMetaData 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: // TYPE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.type = org.apache.parquet.format.Type.findByValue(iprot.readI32());
              struct.setTypeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // ENCODINGS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
                struct.encodings = new java.util.ArrayList(_list0.size);
                @org.apache.thrift.annotation.Nullable Encoding _elem1;
                for (int _i2 = 0; _i2 < _list0.size; ++_i2)
                {
                  _elem1 = org.apache.parquet.format.Encoding.findByValue(iprot.readI32());
                  if (_elem1 != null)
                  {
                    struct.encodings.add(_elem1);
                  }
                }
                iprot.readListEnd();
              }
              struct.setEncodingsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // PATH_IN_SCHEMA
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list3 = iprot.readListBegin();
                struct.path_in_schema = new java.util.ArrayList(_list3.size);
                @org.apache.thrift.annotation.Nullable java.lang.String _elem4;
                for (int _i5 = 0; _i5 < _list3.size; ++_i5)
                {
                  _elem4 = iprot.readString();
                  struct.path_in_schema.add(_elem4);
                }
                iprot.readListEnd();
              }
              struct.setPath_in_schemaIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // CODEC
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.codec = org.apache.parquet.format.CompressionCodec.findByValue(iprot.readI32());
              struct.setCodecIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // NUM_VALUES
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.num_values = iprot.readI64();
              struct.setNum_valuesIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // TOTAL_UNCOMPRESSED_SIZE
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.total_uncompressed_size = iprot.readI64();
              struct.setTotal_uncompressed_sizeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // TOTAL_COMPRESSED_SIZE
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.total_compressed_size = iprot.readI64();
              struct.setTotal_compressed_sizeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 8: // KEY_VALUE_METADATA
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list6 = iprot.readListBegin();
                struct.key_value_metadata = new java.util.ArrayList(_list6.size);
                @org.apache.thrift.annotation.Nullable KeyValue _elem7;
                for (int _i8 = 0; _i8 < _list6.size; ++_i8)
                {
                  _elem7 = new KeyValue();
                  _elem7.read(iprot);
                  struct.key_value_metadata.add(_elem7);
                }
                iprot.readListEnd();
              }
              struct.setKey_value_metadataIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 9: // DATA_PAGE_OFFSET
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.data_page_offset = iprot.readI64();
              struct.setData_page_offsetIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 10: // INDEX_PAGE_OFFSET
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.index_page_offset = iprot.readI64();
              struct.setIndex_page_offsetIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 11: // DICTIONARY_PAGE_OFFSET
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.dictionary_page_offset = iprot.readI64();
              struct.setDictionary_page_offsetIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 12: // STATISTICS
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.statistics = new Statistics();
              struct.statistics.read(iprot);
              struct.setStatisticsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 13: // ENCODING_STATS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list9 = iprot.readListBegin();
                struct.encoding_stats = new java.util.ArrayList(_list9.size);
                @org.apache.thrift.annotation.Nullable PageEncodingStats _elem10;
                for (int _i11 = 0; _i11 < _list9.size; ++_i11)
                {
                  _elem10 = new PageEncodingStats();
                  _elem10.read(iprot);
                  struct.encoding_stats.add(_elem10);
                }
                iprot.readListEnd();
              }
              struct.setEncoding_statsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 14: // BLOOM_FILTER_OFFSET
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.bloom_filter_offset = iprot.readI64();
              struct.setBloom_filter_offsetIsSet(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.isSetNum_values()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'num_values' was not found in serialized data! Struct: " + toString());
      }
      if (!struct.isSetTotal_uncompressed_size()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'total_uncompressed_size' was not found in serialized data! Struct: " + toString());
      }
      if (!struct.isSetTotal_compressed_size()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'total_compressed_size' was not found in serialized data! Struct: " + toString());
      }
      if (!struct.isSetData_page_offset()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'data_page_offset' was not found in serialized data! Struct: " + toString());
      }
      struct.validate();
    }

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

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.type != null) {
        oprot.writeFieldBegin(TYPE_FIELD_DESC);
        oprot.writeI32(struct.type.getValue());
        oprot.writeFieldEnd();
      }
      if (struct.encodings != null) {
        oprot.writeFieldBegin(ENCODINGS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, struct.encodings.size()));
          for (Encoding _iter12 : struct.encodings)
          {
            oprot.writeI32(_iter12.getValue());
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.path_in_schema != null) {
        oprot.writeFieldBegin(PATH_IN_SCHEMA_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.path_in_schema.size()));
          for (java.lang.String _iter13 : struct.path_in_schema)
          {
            oprot.writeString(_iter13);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.codec != null) {
        oprot.writeFieldBegin(CODEC_FIELD_DESC);
        oprot.writeI32(struct.codec.getValue());
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(NUM_VALUES_FIELD_DESC);
      oprot.writeI64(struct.num_values);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(TOTAL_UNCOMPRESSED_SIZE_FIELD_DESC);
      oprot.writeI64(struct.total_uncompressed_size);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(TOTAL_COMPRESSED_SIZE_FIELD_DESC);
      oprot.writeI64(struct.total_compressed_size);
      oprot.writeFieldEnd();
      if (struct.key_value_metadata != null) {
        if (struct.isSetKey_value_metadata()) {
          oprot.writeFieldBegin(KEY_VALUE_METADATA_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.key_value_metadata.size()));
            for (KeyValue _iter14 : struct.key_value_metadata)
            {
              _iter14.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldBegin(DATA_PAGE_OFFSET_FIELD_DESC);
      oprot.writeI64(struct.data_page_offset);
      oprot.writeFieldEnd();
      if (struct.isSetIndex_page_offset()) {
        oprot.writeFieldBegin(INDEX_PAGE_OFFSET_FIELD_DESC);
        oprot.writeI64(struct.index_page_offset);
        oprot.writeFieldEnd();
      }
      if (struct.isSetDictionary_page_offset()) {
        oprot.writeFieldBegin(DICTIONARY_PAGE_OFFSET_FIELD_DESC);
        oprot.writeI64(struct.dictionary_page_offset);
        oprot.writeFieldEnd();
      }
      if (struct.statistics != null) {
        if (struct.isSetStatistics()) {
          oprot.writeFieldBegin(STATISTICS_FIELD_DESC);
          struct.statistics.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.encoding_stats != null) {
        if (struct.isSetEncoding_stats()) {
          oprot.writeFieldBegin(ENCODING_STATS_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.encoding_stats.size()));
            for (PageEncodingStats _iter15 : struct.encoding_stats)
            {
              _iter15.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetBloom_filter_offset()) {
        oprot.writeFieldBegin(BLOOM_FILTER_OFFSET_FIELD_DESC);
        oprot.writeI64(struct.bloom_filter_offset);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

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

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

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, ColumnMetaData struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      oprot.writeI32(struct.type.getValue());
      {
        oprot.writeI32(struct.encodings.size());
        for (Encoding _iter16 : struct.encodings)
        {
          oprot.writeI32(_iter16.getValue());
        }
      }
      {
        oprot.writeI32(struct.path_in_schema.size());
        for (java.lang.String _iter17 : struct.path_in_schema)
        {
          oprot.writeString(_iter17);
        }
      }
      oprot.writeI32(struct.codec.getValue());
      oprot.writeI64(struct.num_values);
      oprot.writeI64(struct.total_uncompressed_size);
      oprot.writeI64(struct.total_compressed_size);
      oprot.writeI64(struct.data_page_offset);
      java.util.BitSet optionals = new java.util.BitSet();
      if (struct.isSetKey_value_metadata()) {
        optionals.set(0);
      }
      if (struct.isSetIndex_page_offset()) {
        optionals.set(1);
      }
      if (struct.isSetDictionary_page_offset()) {
        optionals.set(2);
      }
      if (struct.isSetStatistics()) {
        optionals.set(3);
      }
      if (struct.isSetEncoding_stats()) {
        optionals.set(4);
      }
      if (struct.isSetBloom_filter_offset()) {
        optionals.set(5);
      }
      oprot.writeBitSet(optionals, 6);
      if (struct.isSetKey_value_metadata()) {
        {
          oprot.writeI32(struct.key_value_metadata.size());
          for (KeyValue _iter18 : struct.key_value_metadata)
          {
            _iter18.write(oprot);
          }
        }
      }
      if (struct.isSetIndex_page_offset()) {
        oprot.writeI64(struct.index_page_offset);
      }
      if (struct.isSetDictionary_page_offset()) {
        oprot.writeI64(struct.dictionary_page_offset);
      }
      if (struct.isSetStatistics()) {
        struct.statistics.write(oprot);
      }
      if (struct.isSetEncoding_stats()) {
        {
          oprot.writeI32(struct.encoding_stats.size());
          for (PageEncodingStats _iter19 : struct.encoding_stats)
          {
            _iter19.write(oprot);
          }
        }
      }
      if (struct.isSetBloom_filter_offset()) {
        oprot.writeI64(struct.bloom_filter_offset);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, ColumnMetaData struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      struct.type = org.apache.parquet.format.Type.findByValue(iprot.readI32());
      struct.setTypeIsSet(true);
      {
        org.apache.thrift.protocol.TList _list20 = iprot.readListBegin(org.apache.thrift.protocol.TType.I32);
        struct.encodings = new java.util.ArrayList(_list20.size);
        @org.apache.thrift.annotation.Nullable Encoding _elem21;
        for (int _i22 = 0; _i22 < _list20.size; ++_i22)
        {
          _elem21 = org.apache.parquet.format.Encoding.findByValue(iprot.readI32());
          if (_elem21 != null)
          {
            struct.encodings.add(_elem21);
          }
        }
      }
      struct.setEncodingsIsSet(true);
      {
        org.apache.thrift.protocol.TList _list23 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRING);
        struct.path_in_schema = new java.util.ArrayList(_list23.size);
        @org.apache.thrift.annotation.Nullable java.lang.String _elem24;
        for (int _i25 = 0; _i25 < _list23.size; ++_i25)
        {
          _elem24 = iprot.readString();
          struct.path_in_schema.add(_elem24);
        }
      }
      struct.setPath_in_schemaIsSet(true);
      struct.codec = org.apache.parquet.format.CompressionCodec.findByValue(iprot.readI32());
      struct.setCodecIsSet(true);
      struct.num_values = iprot.readI64();
      struct.setNum_valuesIsSet(true);
      struct.total_uncompressed_size = iprot.readI64();
      struct.setTotal_uncompressed_sizeIsSet(true);
      struct.total_compressed_size = iprot.readI64();
      struct.setTotal_compressed_sizeIsSet(true);
      struct.data_page_offset = iprot.readI64();
      struct.setData_page_offsetIsSet(true);
      java.util.BitSet incoming = iprot.readBitSet(6);
      if (incoming.get(0)) {
        {
          org.apache.thrift.protocol.TList _list26 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT);
          struct.key_value_metadata = new java.util.ArrayList(_list26.size);
          @org.apache.thrift.annotation.Nullable KeyValue _elem27;
          for (int _i28 = 0; _i28 < _list26.size; ++_i28)
          {
            _elem27 = new KeyValue();
            _elem27.read(iprot);
            struct.key_value_metadata.add(_elem27);
          }
        }
        struct.setKey_value_metadataIsSet(true);
      }
      if (incoming.get(1)) {
        struct.index_page_offset = iprot.readI64();
        struct.setIndex_page_offsetIsSet(true);
      }
      if (incoming.get(2)) {
        struct.dictionary_page_offset = iprot.readI64();
        struct.setDictionary_page_offsetIsSet(true);
      }
      if (incoming.get(3)) {
        struct.statistics = new Statistics();
        struct.statistics.read(iprot);
        struct.setStatisticsIsSet(true);
      }
      if (incoming.get(4)) {
        {
          org.apache.thrift.protocol.TList _list29 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT);
          struct.encoding_stats = new java.util.ArrayList(_list29.size);
          @org.apache.thrift.annotation.Nullable PageEncodingStats _elem30;
          for (int _i31 = 0; _i31 < _list29.size; ++_i31)
          {
            _elem30 = new PageEncodingStats();
            _elem30.read(iprot);
            struct.encoding_stats.add(_elem30);
          }
        }
        struct.setEncoding_statsIsSet(true);
      }
      if (incoming.get(5)) {
        struct.bloom_filter_offset = iprot.readI64();
        struct.setBloom_filter_offsetIsSet(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