FileMetaData.java
/**
* Autogenerated by Thrift Compiler (0.16.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.apache.parquet.format;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
/**
* Description for file metadata
*/
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.16.0)", date = "2026-05-14")
public class FileMetaData implements org.apache.thrift.TBase<FileMetaData, FileMetaData._Fields>, java.io.Serializable, Cloneable, Comparable<FileMetaData> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("FileMetaData");
private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.I32, (short)1);
private static final org.apache.thrift.protocol.TField SCHEMA_FIELD_DESC = new org.apache.thrift.protocol.TField("schema", org.apache.thrift.protocol.TType.LIST, (short)2);
private static final org.apache.thrift.protocol.TField NUM_ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("num_rows", org.apache.thrift.protocol.TType.I64, (short)3);
private static final org.apache.thrift.protocol.TField ROW_GROUPS_FIELD_DESC = new org.apache.thrift.protocol.TField("row_groups", org.apache.thrift.protocol.TType.LIST, (short)4);
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)5);
private static final org.apache.thrift.protocol.TField CREATED_BY_FIELD_DESC = new org.apache.thrift.protocol.TField("created_by", org.apache.thrift.protocol.TType.STRING, (short)6);
private static final org.apache.thrift.protocol.TField COLUMN_ORDERS_FIELD_DESC = new org.apache.thrift.protocol.TField("column_orders", org.apache.thrift.protocol.TType.LIST, (short)7);
private static final org.apache.thrift.protocol.TField ENCRYPTION_ALGORITHM_FIELD_DESC = new org.apache.thrift.protocol.TField("encryption_algorithm", org.apache.thrift.protocol.TType.STRUCT, (short)8);
private static final org.apache.thrift.protocol.TField FOOTER_SIGNING_KEY_METADATA_FIELD_DESC = new org.apache.thrift.protocol.TField("footer_signing_key_metadata", org.apache.thrift.protocol.TType.STRING, (short)9);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new FileMetaDataStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new FileMetaDataTupleSchemeFactory();
/**
* Version of this file *
*/
public int version; // required
/**
* Parquet schema for this file. This schema contains metadata for all the columns.
* The schema is represented as a tree with a single root. The nodes of the tree
* are flattened to a list by doing a depthfirst traversal.
* The column metadata contains the path in the schema for that column which can be
* used to map columns to nodes in the schema.
* The first element is the root *
*/
public @org.apache.thrift.annotation.Nullable java.util.List<SchemaElement> schema; // required
/**
* Number of rows in this file *
*/
public long num_rows; // required
/**
* Row groups in this file *
*/
public @org.apache.thrift.annotation.Nullable java.util.List<RowGroup> row_groups; // required
/**
* Optional key/value metadata *
*/
public @org.apache.thrift.annotation.Nullable java.util.List<KeyValue> key_value_metadata; // optional
/**
* String for application that wrote this file. This should be in the format
* <Application> version <App Version> (build <App Build Hash>).
* e.g. impala version 1.0 (build 6cf94d29b2b7115df4de2c06e2ab4326d721eb55)
*
*/
public @org.apache.thrift.annotation.Nullable java.lang.String created_by; // optional
/**
* Sort order used for the min_value and max_value fields in the Statistics
* objects and the min_values and max_values fields in the ColumnIndex
* objects of each column in this file. Sort orders are listed in the order
* matching the columns in the schema. The indexes are not necessary the same
* though, because only leaf nodes of the schema are represented in the list
* of sort orders.
*
* Without column_orders, the meaning of the min_value and max_value fields
* in the Statistics object and the ColumnIndex object is undefined. To ensure
* welldefined behaviour, if these fields are written to a Parquet file,
* column_orders must be written as well.
*
* The obsolete min and max fields in the Statistics object are always sorted
* by signed comparison regardless of column_orders.
*/
public @org.apache.thrift.annotation.Nullable java.util.List<ColumnOrder> column_orders; // optional
/**
* Encryption algorithm. This field is set only in encrypted files
* with plaintext footer. Files with encrypted footer store algorithm id
* in FileCryptoMetaData structure.
*/
public @org.apache.thrift.annotation.Nullable EncryptionAlgorithm encryption_algorithm; // optional
/**
* Retrieval metadata of key used for signing the footer.
* Used only in encrypted files with plaintext footer.
*/
public @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer footer_signing_key_metadata; // 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 {
/**
* Version of this file *
*/
VERSION((short)1, "version"),
/**
* Parquet schema for this file. This schema contains metadata for all the columns.
* The schema is represented as a tree with a single root. The nodes of the tree
* are flattened to a list by doing a depthfirst traversal.
* The column metadata contains the path in the schema for that column which can be
* used to map columns to nodes in the schema.
* The first element is the root *
*/
SCHEMA((short)2, "schema"),
/**
* Number of rows in this file *
*/
NUM_ROWS((short)3, "num_rows"),
/**
* Row groups in this file *
*/
ROW_GROUPS((short)4, "row_groups"),
/**
* Optional key/value metadata *
*/
KEY_VALUE_METADATA((short)5, "key_value_metadata"),
/**
* String for application that wrote this file. This should be in the format
* <Application> version <App Version> (build <App Build Hash>).
* e.g. impala version 1.0 (build 6cf94d29b2b7115df4de2c06e2ab4326d721eb55)
*
*/
CREATED_BY((short)6, "created_by"),
/**
* Sort order used for the min_value and max_value fields in the Statistics
* objects and the min_values and max_values fields in the ColumnIndex
* objects of each column in this file. Sort orders are listed in the order
* matching the columns in the schema. The indexes are not necessary the same
* though, because only leaf nodes of the schema are represented in the list
* of sort orders.
*
* Without column_orders, the meaning of the min_value and max_value fields
* in the Statistics object and the ColumnIndex object is undefined. To ensure
* welldefined behaviour, if these fields are written to a Parquet file,
* column_orders must be written as well.
*
* The obsolete min and max fields in the Statistics object are always sorted
* by signed comparison regardless of column_orders.
*/
COLUMN_ORDERS((short)7, "column_orders"),
/**
* Encryption algorithm. This field is set only in encrypted files
* with plaintext footer. Files with encrypted footer store algorithm id
* in FileCryptoMetaData structure.
*/
ENCRYPTION_ALGORITHM((short)8, "encryption_algorithm"),
/**
* Retrieval metadata of key used for signing the footer.
* Used only in encrypted files with plaintext footer.
*/
FOOTER_SIGNING_KEY_METADATA((short)9, "footer_signing_key_metadata");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // VERSION
return VERSION;
case 2: // SCHEMA
return SCHEMA;
case 3: // NUM_ROWS
return NUM_ROWS;
case 4: // ROW_GROUPS
return ROW_GROUPS;
case 5: // KEY_VALUE_METADATA
return KEY_VALUE_METADATA;
case 6: // CREATED_BY
return CREATED_BY;
case 7: // COLUMN_ORDERS
return COLUMN_ORDERS;
case 8: // ENCRYPTION_ALGORITHM
return ENCRYPTION_ALGORITHM;
case 9: // FOOTER_SIGNING_KEY_METADATA
return FOOTER_SIGNING_KEY_METADATA;
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 __VERSION_ISSET_ID = 0;
private static final int __NUM_ROWS_ISSET_ID = 1;
private byte __isset_bitfield = 0;
private static final _Fields optionals[] = {_Fields.KEY_VALUE_METADATA,_Fields.CREATED_BY,_Fields.COLUMN_ORDERS,_Fields.ENCRYPTION_ALGORITHM,_Fields.FOOTER_SIGNING_KEY_METADATA};
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.VERSION, new org.apache.thrift.meta_data.FieldMetaData("version", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.SCHEMA, new org.apache.thrift.meta_data.FieldMetaData("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.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, SchemaElement.class))));
tmpMap.put(_Fields.NUM_ROWS, new org.apache.thrift.meta_data.FieldMetaData("num_rows", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.ROW_GROUPS, new org.apache.thrift.meta_data.FieldMetaData("row_groups", 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, RowGroup.class))));
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.CREATED_BY, new org.apache.thrift.meta_data.FieldMetaData("created_by", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.COLUMN_ORDERS, new org.apache.thrift.meta_data.FieldMetaData("column_orders", 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, ColumnOrder.class))));
tmpMap.put(_Fields.ENCRYPTION_ALGORITHM, new org.apache.thrift.meta_data.FieldMetaData("encryption_algorithm", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, EncryptionAlgorithm.class)));
tmpMap.put(_Fields.FOOTER_SIGNING_KEY_METADATA, new org.apache.thrift.meta_data.FieldMetaData("footer_signing_key_metadata", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(FileMetaData.class, metaDataMap);
}
public FileMetaData() {
}
public FileMetaData(
int version,
java.util.List<SchemaElement> schema,
long num_rows,
java.util.List<RowGroup> row_groups)
{
this();
this.version = version;
setVersionIsSet(true);
this.schema = schema;
this.num_rows = num_rows;
setNumRowsIsSet(true);
this.row_groups = row_groups;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public FileMetaData(FileMetaData other) {
__isset_bitfield = other.__isset_bitfield;
this.version = other.version;
if (other.isSetSchema()) {
java.util.List<SchemaElement> __this__schema = new java.util.ArrayList<SchemaElement>(other.schema.size());
for (SchemaElement other_element : other.schema) {
__this__schema.add(new SchemaElement(other_element));
}
this.schema = __this__schema;
}
this.num_rows = other.num_rows;
if (other.isSetRowGroups()) {
java.util.List<RowGroup> __this__row_groups = new java.util.ArrayList<RowGroup>(other.row_groups.size());
for (RowGroup other_element : other.row_groups) {
__this__row_groups.add(new RowGroup(other_element));
}
this.row_groups = __this__row_groups;
}
if (other.isSetKeyValueMetadata()) {
java.util.List<KeyValue> __this__key_value_metadata = new java.util.ArrayList<KeyValue>(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;
}
if (other.isSetCreatedBy()) {
this.created_by = other.created_by;
}
if (other.isSetColumnOrders()) {
java.util.List<ColumnOrder> __this__column_orders = new java.util.ArrayList<ColumnOrder>(other.column_orders.size());
for (ColumnOrder other_element : other.column_orders) {
__this__column_orders.add(new ColumnOrder(other_element));
}
this.column_orders = __this__column_orders;
}
if (other.isSetEncryptionAlgorithm()) {
this.encryption_algorithm = new EncryptionAlgorithm(other.encryption_algorithm);
}
if (other.isSetFooterSigningKeyMetadata()) {
this.footer_signing_key_metadata = org.apache.thrift.TBaseHelper.copyBinary(other.footer_signing_key_metadata);
}
}
public FileMetaData deepCopy() {
return new FileMetaData(this);
}
@Override
public void clear() {
setVersionIsSet(false);
this.version = 0;
this.schema = null;
setNumRowsIsSet(false);
this.num_rows = 0;
this.row_groups = null;
this.key_value_metadata = null;
this.created_by = null;
this.column_orders = null;
this.encryption_algorithm = null;
this.footer_signing_key_metadata = null;
}
/**
* Version of this file *
*/
public int getVersion() {
return this.version;
}
/**
* Version of this file *
*/
public FileMetaData setVersion(int version) {
this.version = version;
setVersionIsSet(true);
return this;
}
public void unsetVersion() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __VERSION_ISSET_ID);
}
/** Returns true if field version is set (has been assigned a value) and false otherwise */
public boolean isSetVersion() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __VERSION_ISSET_ID);
}
public void setVersionIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __VERSION_ISSET_ID, value);
}
public int getSchemaSize() {
return (this.schema == null) ? 0 : this.schema.size();
}
@org.apache.thrift.annotation.Nullable
public java.util.Iterator<SchemaElement> getSchemaIterator() {
return (this.schema == null) ? null : this.schema.iterator();
}
public void addToSchema(SchemaElement elem) {
if (this.schema == null) {
this.schema = new java.util.ArrayList<SchemaElement>();
}
this.schema.add(elem);
}
/**
* Parquet schema for this file. This schema contains metadata for all the columns.
* The schema is represented as a tree with a single root. The nodes of the tree
* are flattened to a list by doing a depthfirst traversal.
* The column metadata contains the path in the schema for that column which can be
* used to map columns to nodes in the schema.
* The first element is the root *
*/
@org.apache.thrift.annotation.Nullable
public java.util.List<SchemaElement> getSchema() {
return this.schema;
}
/**
* Parquet schema for this file. This schema contains metadata for all the columns.
* The schema is represented as a tree with a single root. The nodes of the tree
* are flattened to a list by doing a depthfirst traversal.
* The column metadata contains the path in the schema for that column which can be
* used to map columns to nodes in the schema.
* The first element is the root *
*/
public FileMetaData setSchema(@org.apache.thrift.annotation.Nullable java.util.List<SchemaElement> schema) {
this.schema = schema;
return this;
}
public void unsetSchema() {
this.schema = null;
}
/** Returns true if field schema is set (has been assigned a value) and false otherwise */
public boolean isSetSchema() {
return this.schema != null;
}
public void setSchemaIsSet(boolean value) {
if (!value) {
this.schema = null;
}
}
/**
* Number of rows in this file *
*/
public long getNumRows() {
return this.num_rows;
}
/**
* Number of rows in this file *
*/
public FileMetaData setNumRows(long num_rows) {
this.num_rows = num_rows;
setNumRowsIsSet(true);
return this;
}
public void unsetNumRows() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __NUM_ROWS_ISSET_ID);
}
/** Returns true if field num_rows is set (has been assigned a value) and false otherwise */
public boolean isSetNumRows() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __NUM_ROWS_ISSET_ID);
}
public void setNumRowsIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __NUM_ROWS_ISSET_ID, value);
}
public int getRowGroupsSize() {
return (this.row_groups == null) ? 0 : this.row_groups.size();
}
@org.apache.thrift.annotation.Nullable
public java.util.Iterator<RowGroup> getRowGroupsIterator() {
return (this.row_groups == null) ? null : this.row_groups.iterator();
}
public void addToRowGroups(RowGroup elem) {
if (this.row_groups == null) {
this.row_groups = new java.util.ArrayList<RowGroup>();
}
this.row_groups.add(elem);
}
/**
* Row groups in this file *
*/
@org.apache.thrift.annotation.Nullable
public java.util.List<RowGroup> getRowGroups() {
return this.row_groups;
}
/**
* Row groups in this file *
*/
public FileMetaData setRowGroups(@org.apache.thrift.annotation.Nullable java.util.List<RowGroup> row_groups) {
this.row_groups = row_groups;
return this;
}
public void unsetRowGroups() {
this.row_groups = null;
}
/** Returns true if field row_groups is set (has been assigned a value) and false otherwise */
public boolean isSetRowGroups() {
return this.row_groups != null;
}
public void setRowGroupsIsSet(boolean value) {
if (!value) {
this.row_groups = null;
}
}
public int getKeyValueMetadataSize() {
return (this.key_value_metadata == null) ? 0 : this.key_value_metadata.size();
}
@org.apache.thrift.annotation.Nullable
public java.util.Iterator<KeyValue> getKeyValueMetadataIterator() {
return (this.key_value_metadata == null) ? null : this.key_value_metadata.iterator();
}
public void addToKeyValueMetadata(KeyValue elem) {
if (this.key_value_metadata == null) {
this.key_value_metadata = new java.util.ArrayList<KeyValue>();
}
this.key_value_metadata.add(elem);
}
/**
* Optional key/value metadata *
*/
@org.apache.thrift.annotation.Nullable
public java.util.List<KeyValue> getKeyValueMetadata() {
return this.key_value_metadata;
}
/**
* Optional key/value metadata *
*/
public FileMetaData setKeyValueMetadata(@org.apache.thrift.annotation.Nullable java.util.List<KeyValue> key_value_metadata) {
this.key_value_metadata = key_value_metadata;
return this;
}
public void unsetKeyValueMetadata() {
this.key_value_metadata = null;
}
/** Returns true if field key_value_metadata is set (has been assigned a value) and false otherwise */
public boolean isSetKeyValueMetadata() {
return this.key_value_metadata != null;
}
public void setKeyValueMetadataIsSet(boolean value) {
if (!value) {
this.key_value_metadata = null;
}
}
/**
* String for application that wrote this file. This should be in the format
* <Application> version <App Version> (build <App Build Hash>).
* e.g. impala version 1.0 (build 6cf94d29b2b7115df4de2c06e2ab4326d721eb55)
*
*/
@org.apache.thrift.annotation.Nullable
public java.lang.String getCreatedBy() {
return this.created_by;
}
/**
* String for application that wrote this file. This should be in the format
* <Application> version <App Version> (build <App Build Hash>).
* e.g. impala version 1.0 (build 6cf94d29b2b7115df4de2c06e2ab4326d721eb55)
*
*/
public FileMetaData setCreatedBy(@org.apache.thrift.annotation.Nullable java.lang.String created_by) {
this.created_by = created_by;
return this;
}
public void unsetCreatedBy() {
this.created_by = null;
}
/** Returns true if field created_by is set (has been assigned a value) and false otherwise */
public boolean isSetCreatedBy() {
return this.created_by != null;
}
public void setCreatedByIsSet(boolean value) {
if (!value) {
this.created_by = null;
}
}
public int getColumnOrdersSize() {
return (this.column_orders == null) ? 0 : this.column_orders.size();
}
@org.apache.thrift.annotation.Nullable
public java.util.Iterator<ColumnOrder> getColumnOrdersIterator() {
return (this.column_orders == null) ? null : this.column_orders.iterator();
}
public void addToColumnOrders(ColumnOrder elem) {
if (this.column_orders == null) {
this.column_orders = new java.util.ArrayList<ColumnOrder>();
}
this.column_orders.add(elem);
}
/**
* Sort order used for the min_value and max_value fields in the Statistics
* objects and the min_values and max_values fields in the ColumnIndex
* objects of each column in this file. Sort orders are listed in the order
* matching the columns in the schema. The indexes are not necessary the same
* though, because only leaf nodes of the schema are represented in the list
* of sort orders.
*
* Without column_orders, the meaning of the min_value and max_value fields
* in the Statistics object and the ColumnIndex object is undefined. To ensure
* welldefined behaviour, if these fields are written to a Parquet file,
* column_orders must be written as well.
*
* The obsolete min and max fields in the Statistics object are always sorted
* by signed comparison regardless of column_orders.
*/
@org.apache.thrift.annotation.Nullable
public java.util.List<ColumnOrder> getColumnOrders() {
return this.column_orders;
}
/**
* Sort order used for the min_value and max_value fields in the Statistics
* objects and the min_values and max_values fields in the ColumnIndex
* objects of each column in this file. Sort orders are listed in the order
* matching the columns in the schema. The indexes are not necessary the same
* though, because only leaf nodes of the schema are represented in the list
* of sort orders.
*
* Without column_orders, the meaning of the min_value and max_value fields
* in the Statistics object and the ColumnIndex object is undefined. To ensure
* welldefined behaviour, if these fields are written to a Parquet file,
* column_orders must be written as well.
*
* The obsolete min and max fields in the Statistics object are always sorted
* by signed comparison regardless of column_orders.
*/
public FileMetaData setColumnOrders(@org.apache.thrift.annotation.Nullable java.util.List<ColumnOrder> column_orders) {
this.column_orders = column_orders;
return this;
}
public void unsetColumnOrders() {
this.column_orders = null;
}
/** Returns true if field column_orders is set (has been assigned a value) and false otherwise */
public boolean isSetColumnOrders() {
return this.column_orders != null;
}
public void setColumnOrdersIsSet(boolean value) {
if (!value) {
this.column_orders = null;
}
}
/**
* Encryption algorithm. This field is set only in encrypted files
* with plaintext footer. Files with encrypted footer store algorithm id
* in FileCryptoMetaData structure.
*/
@org.apache.thrift.annotation.Nullable
public EncryptionAlgorithm getEncryptionAlgorithm() {
return this.encryption_algorithm;
}
/**
* Encryption algorithm. This field is set only in encrypted files
* with plaintext footer. Files with encrypted footer store algorithm id
* in FileCryptoMetaData structure.
*/
public FileMetaData setEncryptionAlgorithm(@org.apache.thrift.annotation.Nullable EncryptionAlgorithm encryption_algorithm) {
this.encryption_algorithm = encryption_algorithm;
return this;
}
public void unsetEncryptionAlgorithm() {
this.encryption_algorithm = null;
}
/** Returns true if field encryption_algorithm is set (has been assigned a value) and false otherwise */
public boolean isSetEncryptionAlgorithm() {
return this.encryption_algorithm != null;
}
public void setEncryptionAlgorithmIsSet(boolean value) {
if (!value) {
this.encryption_algorithm = null;
}
}
/**
* Retrieval metadata of key used for signing the footer.
* Used only in encrypted files with plaintext footer.
*/
public byte[] getFooterSigningKeyMetadata() {
setFooterSigningKeyMetadata(org.apache.thrift.TBaseHelper.rightSize(footer_signing_key_metadata));
return footer_signing_key_metadata == null ? null : footer_signing_key_metadata.array();
}
public java.nio.ByteBuffer bufferForFooterSigningKeyMetadata() {
return org.apache.thrift.TBaseHelper.copyBinary(footer_signing_key_metadata);
}
/**
* Retrieval metadata of key used for signing the footer.
* Used only in encrypted files with plaintext footer.
*/
public FileMetaData setFooterSigningKeyMetadata(byte[] footer_signing_key_metadata) {
this.footer_signing_key_metadata = footer_signing_key_metadata == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(footer_signing_key_metadata.clone());
return this;
}
public FileMetaData setFooterSigningKeyMetadata(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer footer_signing_key_metadata) {
this.footer_signing_key_metadata = org.apache.thrift.TBaseHelper.copyBinary(footer_signing_key_metadata);
return this;
}
public void unsetFooterSigningKeyMetadata() {
this.footer_signing_key_metadata = null;
}
/** Returns true if field footer_signing_key_metadata is set (has been assigned a value) and false otherwise */
public boolean isSetFooterSigningKeyMetadata() {
return this.footer_signing_key_metadata != null;
}
public void setFooterSigningKeyMetadataIsSet(boolean value) {
if (!value) {
this.footer_signing_key_metadata = null;
}
}
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case VERSION:
if (value == null) {
unsetVersion();
} else {
setVersion((java.lang.Integer)value);
}
break;
case SCHEMA:
if (value == null) {
unsetSchema();
} else {
setSchema((java.util.List<SchemaElement>)value);
}
break;
case NUM_ROWS:
if (value == null) {
unsetNumRows();
} else {
setNumRows((java.lang.Long)value);
}
break;
case ROW_GROUPS:
if (value == null) {
unsetRowGroups();
} else {
setRowGroups((java.util.List<RowGroup>)value);
}
break;
case KEY_VALUE_METADATA:
if (value == null) {
unsetKeyValueMetadata();
} else {
setKeyValueMetadata((java.util.List<KeyValue>)value);
}
break;
case CREATED_BY:
if (value == null) {
unsetCreatedBy();
} else {
setCreatedBy((java.lang.String)value);
}
break;
case COLUMN_ORDERS:
if (value == null) {
unsetColumnOrders();
} else {
setColumnOrders((java.util.List<ColumnOrder>)value);
}
break;
case ENCRYPTION_ALGORITHM:
if (value == null) {
unsetEncryptionAlgorithm();
} else {
setEncryptionAlgorithm((EncryptionAlgorithm)value);
}
break;
case FOOTER_SIGNING_KEY_METADATA:
if (value == null) {
unsetFooterSigningKeyMetadata();
} else {
if (value instanceof byte[]) {
setFooterSigningKeyMetadata((byte[])value);
} else {
setFooterSigningKeyMetadata((java.nio.ByteBuffer)value);
}
}
break;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case VERSION:
return getVersion();
case SCHEMA:
return getSchema();
case NUM_ROWS:
return getNumRows();
case ROW_GROUPS:
return getRowGroups();
case KEY_VALUE_METADATA:
return getKeyValueMetadata();
case CREATED_BY:
return getCreatedBy();
case COLUMN_ORDERS:
return getColumnOrders();
case ENCRYPTION_ALGORITHM:
return getEncryptionAlgorithm();
case FOOTER_SIGNING_KEY_METADATA:
return getFooterSigningKeyMetadata();
}
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 VERSION:
return isSetVersion();
case SCHEMA:
return isSetSchema();
case NUM_ROWS:
return isSetNumRows();
case ROW_GROUPS:
return isSetRowGroups();
case KEY_VALUE_METADATA:
return isSetKeyValueMetadata();
case CREATED_BY:
return isSetCreatedBy();
case COLUMN_ORDERS:
return isSetColumnOrders();
case ENCRYPTION_ALGORITHM:
return isSetEncryptionAlgorithm();
case FOOTER_SIGNING_KEY_METADATA:
return isSetFooterSigningKeyMetadata();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that instanceof FileMetaData)
return this.equals((FileMetaData)that);
return false;
}
public boolean equals(FileMetaData that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_version = true;
boolean that_present_version = true;
if (this_present_version || that_present_version) {
if (!(this_present_version && that_present_version))
return false;
if (this.version != that.version)
return false;
}
boolean this_present_schema = true && this.isSetSchema();
boolean that_present_schema = true && that.isSetSchema();
if (this_present_schema || that_present_schema) {
if (!(this_present_schema && that_present_schema))
return false;
if (!this.schema.equals(that.schema))
return false;
}
boolean this_present_num_rows = true;
boolean that_present_num_rows = true;
if (this_present_num_rows || that_present_num_rows) {
if (!(this_present_num_rows && that_present_num_rows))
return false;
if (this.num_rows != that.num_rows)
return false;
}
boolean this_present_row_groups = true && this.isSetRowGroups();
boolean that_present_row_groups = true && that.isSetRowGroups();
if (this_present_row_groups || that_present_row_groups) {
if (!(this_present_row_groups && that_present_row_groups))
return false;
if (!this.row_groups.equals(that.row_groups))
return false;
}
boolean this_present_key_value_metadata = true && this.isSetKeyValueMetadata();
boolean that_present_key_value_metadata = true && that.isSetKeyValueMetadata();
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_created_by = true && this.isSetCreatedBy();
boolean that_present_created_by = true && that.isSetCreatedBy();
if (this_present_created_by || that_present_created_by) {
if (!(this_present_created_by && that_present_created_by))
return false;
if (!this.created_by.equals(that.created_by))
return false;
}
boolean this_present_column_orders = true && this.isSetColumnOrders();
boolean that_present_column_orders = true && that.isSetColumnOrders();
if (this_present_column_orders || that_present_column_orders) {
if (!(this_present_column_orders && that_present_column_orders))
return false;
if (!this.column_orders.equals(that.column_orders))
return false;
}
boolean this_present_encryption_algorithm = true && this.isSetEncryptionAlgorithm();
boolean that_present_encryption_algorithm = true && that.isSetEncryptionAlgorithm();
if (this_present_encryption_algorithm || that_present_encryption_algorithm) {
if (!(this_present_encryption_algorithm && that_present_encryption_algorithm))
return false;
if (!this.encryption_algorithm.equals(that.encryption_algorithm))
return false;
}
boolean this_present_footer_signing_key_metadata = true && this.isSetFooterSigningKeyMetadata();
boolean that_present_footer_signing_key_metadata = true && that.isSetFooterSigningKeyMetadata();
if (this_present_footer_signing_key_metadata || that_present_footer_signing_key_metadata) {
if (!(this_present_footer_signing_key_metadata && that_present_footer_signing_key_metadata))
return false;
if (!this.footer_signing_key_metadata.equals(that.footer_signing_key_metadata))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + version;
hashCode = hashCode * 8191 + ((isSetSchema()) ? 131071 : 524287);
if (isSetSchema())
hashCode = hashCode * 8191 + schema.hashCode();
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(num_rows);
hashCode = hashCode * 8191 + ((isSetRowGroups()) ? 131071 : 524287);
if (isSetRowGroups())
hashCode = hashCode * 8191 + row_groups.hashCode();
hashCode = hashCode * 8191 + ((isSetKeyValueMetadata()) ? 131071 : 524287);
if (isSetKeyValueMetadata())
hashCode = hashCode * 8191 + key_value_metadata.hashCode();
hashCode = hashCode * 8191 + ((isSetCreatedBy()) ? 131071 : 524287);
if (isSetCreatedBy())
hashCode = hashCode * 8191 + created_by.hashCode();
hashCode = hashCode * 8191 + ((isSetColumnOrders()) ? 131071 : 524287);
if (isSetColumnOrders())
hashCode = hashCode * 8191 + column_orders.hashCode();
hashCode = hashCode * 8191 + ((isSetEncryptionAlgorithm()) ? 131071 : 524287);
if (isSetEncryptionAlgorithm())
hashCode = hashCode * 8191 + encryption_algorithm.hashCode();
hashCode = hashCode * 8191 + ((isSetFooterSigningKeyMetadata()) ? 131071 : 524287);
if (isSetFooterSigningKeyMetadata())
hashCode = hashCode * 8191 + footer_signing_key_metadata.hashCode();
return hashCode;
}
@Override
public int compareTo(FileMetaData other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.compare(isSetVersion(), other.isSetVersion());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetVersion()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.version, other.version);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetSchema(), other.isSetSchema());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSchema()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schema, other.schema);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetNumRows(), other.isSetNumRows());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetNumRows()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num_rows, other.num_rows);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetRowGroups(), other.isSetRowGroups());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetRowGroups()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.row_groups, other.row_groups);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetKeyValueMetadata(), other.isSetKeyValueMetadata());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetKeyValueMetadata()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.key_value_metadata, other.key_value_metadata);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetCreatedBy(), other.isSetCreatedBy());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetCreatedBy()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.created_by, other.created_by);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetColumnOrders(), other.isSetColumnOrders());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetColumnOrders()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.column_orders, other.column_orders);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetEncryptionAlgorithm(), other.isSetEncryptionAlgorithm());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetEncryptionAlgorithm()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.encryption_algorithm, other.encryption_algorithm);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetFooterSigningKeyMetadata(), other.isSetFooterSigningKeyMetadata());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetFooterSigningKeyMetadata()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.footer_signing_key_metadata, other.footer_signing_key_metadata);
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("FileMetaData(");
boolean first = true;
sb.append("version:");
sb.append(this.version);
first = false;
if (!first) sb.append(", ");
sb.append("schema:");
if (this.schema == null) {
sb.append("null");
} else {
sb.append(this.schema);
}
first = false;
if (!first) sb.append(", ");
sb.append("num_rows:");
sb.append(this.num_rows);
first = false;
if (!first) sb.append(", ");
sb.append("row_groups:");
if (this.row_groups == null) {
sb.append("null");
} else {
sb.append(this.row_groups);
}
first = false;
if (isSetKeyValueMetadata()) {
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 (isSetCreatedBy()) {
if (!first) sb.append(", ");
sb.append("created_by:");
if (this.created_by == null) {
sb.append("null");
} else {
sb.append(this.created_by);
}
first = false;
}
if (isSetColumnOrders()) {
if (!first) sb.append(", ");
sb.append("column_orders:");
if (this.column_orders == null) {
sb.append("null");
} else {
sb.append(this.column_orders);
}
first = false;
}
if (isSetEncryptionAlgorithm()) {
if (!first) sb.append(", ");
sb.append("encryption_algorithm:");
if (this.encryption_algorithm == null) {
sb.append("null");
} else {
sb.append(this.encryption_algorithm);
}
first = false;
}
if (isSetFooterSigningKeyMetadata()) {
if (!first) sb.append(", ");
sb.append("footer_signing_key_metadata:");
if (this.footer_signing_key_metadata == null) {
sb.append("null");
} else {
org.apache.thrift.TBaseHelper.toString(this.footer_signing_key_metadata, sb);
}
first = false;
}
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// alas, we cannot check 'version' because it's a primitive and you chose the non-beans generator.
if (schema == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'schema' was not present! Struct: " + toString());
}
// alas, we cannot check 'num_rows' because it's a primitive and you chose the non-beans generator.
if (row_groups == null) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'row_groups' was not present! Struct: " + toString());
}
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
// 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 FileMetaDataStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public FileMetaDataStandardScheme getScheme() {
return new FileMetaDataStandardScheme();
}
}
private static class FileMetaDataStandardScheme extends org.apache.thrift.scheme.StandardScheme<FileMetaData> {
public void read(org.apache.thrift.protocol.TProtocol iprot, FileMetaData 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: // VERSION
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.version = iprot.readI32();
struct.setVersionIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // SCHEMA
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
org.apache.thrift.protocol.TList _list144 = iprot.readListBegin();
struct.schema = new java.util.ArrayList<SchemaElement>(_list144.size);
@org.apache.thrift.annotation.Nullable SchemaElement _elem145;
for (int _i146 = 0; _i146 < _list144.size; ++_i146)
{
_elem145 = new SchemaElement();
_elem145.read(iprot);
struct.schema.add(_elem145);
}
iprot.readListEnd();
}
struct.setSchemaIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 3: // NUM_ROWS
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.num_rows = iprot.readI64();
struct.setNumRowsIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 4: // ROW_GROUPS
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
org.apache.thrift.protocol.TList _list147 = iprot.readListBegin();
struct.row_groups = new java.util.ArrayList<RowGroup>(_list147.size);
@org.apache.thrift.annotation.Nullable RowGroup _elem148;
for (int _i149 = 0; _i149 < _list147.size; ++_i149)
{
_elem148 = new RowGroup();
_elem148.read(iprot);
struct.row_groups.add(_elem148);
}
iprot.readListEnd();
}
struct.setRowGroupsIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 5: // KEY_VALUE_METADATA
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
org.apache.thrift.protocol.TList _list150 = iprot.readListBegin();
struct.key_value_metadata = new java.util.ArrayList<KeyValue>(_list150.size);
@org.apache.thrift.annotation.Nullable KeyValue _elem151;
for (int _i152 = 0; _i152 < _list150.size; ++_i152)
{
_elem151 = new KeyValue();
_elem151.read(iprot);
struct.key_value_metadata.add(_elem151);
}
iprot.readListEnd();
}
struct.setKeyValueMetadataIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 6: // CREATED_BY
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.created_by = iprot.readString();
struct.setCreatedByIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 7: // COLUMN_ORDERS
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
org.apache.thrift.protocol.TList _list153 = iprot.readListBegin();
struct.column_orders = new java.util.ArrayList<ColumnOrder>(_list153.size);
@org.apache.thrift.annotation.Nullable ColumnOrder _elem154;
for (int _i155 = 0; _i155 < _list153.size; ++_i155)
{
_elem154 = new ColumnOrder();
_elem154.read(iprot);
struct.column_orders.add(_elem154);
}
iprot.readListEnd();
}
struct.setColumnOrdersIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 8: // ENCRYPTION_ALGORITHM
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.encryption_algorithm = new EncryptionAlgorithm();
struct.encryption_algorithm.read(iprot);
struct.setEncryptionAlgorithmIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 9: // FOOTER_SIGNING_KEY_METADATA
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.footer_signing_key_metadata = iprot.readBinary();
struct.setFooterSigningKeyMetadataIsSet(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.isSetVersion()) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'version' was not found in serialized data! Struct: " + toString());
}
if (!struct.isSetNumRows()) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'num_rows' was not found in serialized data! Struct: " + toString());
}
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, FileMetaData struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldBegin(VERSION_FIELD_DESC);
oprot.writeI32(struct.version);
oprot.writeFieldEnd();
if (struct.schema != null) {
oprot.writeFieldBegin(SCHEMA_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.schema.size()));
for (SchemaElement _iter156 : struct.schema)
{
_iter156.write(oprot);
}
oprot.writeListEnd();
}
oprot.writeFieldEnd();
}
oprot.writeFieldBegin(NUM_ROWS_FIELD_DESC);
oprot.writeI64(struct.num_rows);
oprot.writeFieldEnd();
if (struct.row_groups != null) {
oprot.writeFieldBegin(ROW_GROUPS_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.row_groups.size()));
for (RowGroup _iter157 : struct.row_groups)
{
_iter157.write(oprot);
}
oprot.writeListEnd();
}
oprot.writeFieldEnd();
}
if (struct.key_value_metadata != null) {
if (struct.isSetKeyValueMetadata()) {
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 _iter158 : struct.key_value_metadata)
{
_iter158.write(oprot);
}
oprot.writeListEnd();
}
oprot.writeFieldEnd();
}
}
if (struct.created_by != null) {
if (struct.isSetCreatedBy()) {
oprot.writeFieldBegin(CREATED_BY_FIELD_DESC);
oprot.writeString(struct.created_by);
oprot.writeFieldEnd();
}
}
if (struct.column_orders != null) {
if (struct.isSetColumnOrders()) {
oprot.writeFieldBegin(COLUMN_ORDERS_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.column_orders.size()));
for (ColumnOrder _iter159 : struct.column_orders)
{
_iter159.write(oprot);
}
oprot.writeListEnd();
}
oprot.writeFieldEnd();
}
}
if (struct.encryption_algorithm != null) {
if (struct.isSetEncryptionAlgorithm()) {
oprot.writeFieldBegin(ENCRYPTION_ALGORITHM_FIELD_DESC);
struct.encryption_algorithm.write(oprot);
oprot.writeFieldEnd();
}
}
if (struct.footer_signing_key_metadata != null) {
if (struct.isSetFooterSigningKeyMetadata()) {
oprot.writeFieldBegin(FOOTER_SIGNING_KEY_METADATA_FIELD_DESC);
oprot.writeBinary(struct.footer_signing_key_metadata);
oprot.writeFieldEnd();
}
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class FileMetaDataTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public FileMetaDataTupleScheme getScheme() {
return new FileMetaDataTupleScheme();
}
}
private static class FileMetaDataTupleScheme extends org.apache.thrift.scheme.TupleScheme<FileMetaData> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, FileMetaData struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeI32(struct.version);
{
oprot.writeI32(struct.schema.size());
for (SchemaElement _iter160 : struct.schema)
{
_iter160.write(oprot);
}
}
oprot.writeI64(struct.num_rows);
{
oprot.writeI32(struct.row_groups.size());
for (RowGroup _iter161 : struct.row_groups)
{
_iter161.write(oprot);
}
}
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetKeyValueMetadata()) {
optionals.set(0);
}
if (struct.isSetCreatedBy()) {
optionals.set(1);
}
if (struct.isSetColumnOrders()) {
optionals.set(2);
}
if (struct.isSetEncryptionAlgorithm()) {
optionals.set(3);
}
if (struct.isSetFooterSigningKeyMetadata()) {
optionals.set(4);
}
oprot.writeBitSet(optionals, 5);
if (struct.isSetKeyValueMetadata()) {
{
oprot.writeI32(struct.key_value_metadata.size());
for (KeyValue _iter162 : struct.key_value_metadata)
{
_iter162.write(oprot);
}
}
}
if (struct.isSetCreatedBy()) {
oprot.writeString(struct.created_by);
}
if (struct.isSetColumnOrders()) {
{
oprot.writeI32(struct.column_orders.size());
for (ColumnOrder _iter163 : struct.column_orders)
{
_iter163.write(oprot);
}
}
}
if (struct.isSetEncryptionAlgorithm()) {
struct.encryption_algorithm.write(oprot);
}
if (struct.isSetFooterSigningKeyMetadata()) {
oprot.writeBinary(struct.footer_signing_key_metadata);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, FileMetaData struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.version = iprot.readI32();
struct.setVersionIsSet(true);
{
org.apache.thrift.protocol.TList _list164 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT);
struct.schema = new java.util.ArrayList<SchemaElement>(_list164.size);
@org.apache.thrift.annotation.Nullable SchemaElement _elem165;
for (int _i166 = 0; _i166 < _list164.size; ++_i166)
{
_elem165 = new SchemaElement();
_elem165.read(iprot);
struct.schema.add(_elem165);
}
}
struct.setSchemaIsSet(true);
struct.num_rows = iprot.readI64();
struct.setNumRowsIsSet(true);
{
org.apache.thrift.protocol.TList _list167 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT);
struct.row_groups = new java.util.ArrayList<RowGroup>(_list167.size);
@org.apache.thrift.annotation.Nullable RowGroup _elem168;
for (int _i169 = 0; _i169 < _list167.size; ++_i169)
{
_elem168 = new RowGroup();
_elem168.read(iprot);
struct.row_groups.add(_elem168);
}
}
struct.setRowGroupsIsSet(true);
java.util.BitSet incoming = iprot.readBitSet(5);
if (incoming.get(0)) {
{
org.apache.thrift.protocol.TList _list170 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT);
struct.key_value_metadata = new java.util.ArrayList<KeyValue>(_list170.size);
@org.apache.thrift.annotation.Nullable KeyValue _elem171;
for (int _i172 = 0; _i172 < _list170.size; ++_i172)
{
_elem171 = new KeyValue();
_elem171.read(iprot);
struct.key_value_metadata.add(_elem171);
}
}
struct.setKeyValueMetadataIsSet(true);
}
if (incoming.get(1)) {
struct.created_by = iprot.readString();
struct.setCreatedByIsSet(true);
}
if (incoming.get(2)) {
{
org.apache.thrift.protocol.TList _list173 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT);
struct.column_orders = new java.util.ArrayList<ColumnOrder>(_list173.size);
@org.apache.thrift.annotation.Nullable ColumnOrder _elem174;
for (int _i175 = 0; _i175 < _list173.size; ++_i175)
{
_elem174 = new ColumnOrder();
_elem174.read(iprot);
struct.column_orders.add(_elem174);
}
}
struct.setColumnOrdersIsSet(true);
}
if (incoming.get(3)) {
struct.encryption_algorithm = new EncryptionAlgorithm();
struct.encryption_algorithm.read(iprot);
struct.setEncryptionAlgorithmIsSet(true);
}
if (incoming.get(4)) {
struct.footer_signing_key_metadata = iprot.readBinary();
struct.setFooterSigningKeyMetadataIsSet(true);
}
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}