org.apache.parquet.format.Statistics Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of parquet-format Show documentation
Show all versions of parquet-format Show documentation
Parquet is a columnar storage format that supports nested data. This provides all generated metadata code.
/**
* Autogenerated by Thrift Compiler (0.9.3)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.apache.parquet.format;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
import org.apache.thrift.async.AsyncMethodCallback;
import org.apache.thrift.server.AbstractNonblockingServer.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import javax.annotation.Generated;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
/**
* Statistics per row group and per page
* All fields are optional.
*/
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2017-10-17")
public class Statistics 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("Statistics");
private static final org.apache.thrift.protocol.TField MAX_FIELD_DESC = new org.apache.thrift.protocol.TField("max", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField MIN_FIELD_DESC = new org.apache.thrift.protocol.TField("min", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final org.apache.thrift.protocol.TField NULL_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("null_count", org.apache.thrift.protocol.TType.I64, (short)3);
private static final org.apache.thrift.protocol.TField DISTINCT_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("distinct_count", org.apache.thrift.protocol.TType.I64, (short)4);
private static final org.apache.thrift.protocol.TField MAX_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("max_value", org.apache.thrift.protocol.TType.STRING, (short)5);
private static final org.apache.thrift.protocol.TField MIN_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("min_value", org.apache.thrift.protocol.TType.STRING, (short)6);
private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new StatisticsStandardSchemeFactory());
schemes.put(TupleScheme.class, new StatisticsTupleSchemeFactory());
}
/**
* DEPRECATED: min and max value of the column. Use min_value and max_value.
*
* Values are encoded using PLAIN encoding, except that variable-length byte
* arrays do not include a length prefix.
*
* These fields encode min and max values determined by signed comparison
* only. New files should use the correct order for a column's logical type
* and store the values in the min_value and max_value fields.
*
* To support older readers, these may be set when the column order is
* signed.
*/
public ByteBuffer max; // optional
public ByteBuffer min; // optional
/**
* count of null value in the column
*/
public long null_count; // optional
/**
* count of distinct values occurring
*/
public long distinct_count; // optional
/**
* Min and max values for the column, determined by its ColumnOrder.
*
* Values are encoded using PLAIN encoding, except that variable-length byte
* arrays do not include a length prefix.
*/
public ByteBuffer max_value; // optional
public ByteBuffer min_value; // 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 {
/**
* DEPRECATED: min and max value of the column. Use min_value and max_value.
*
* Values are encoded using PLAIN encoding, except that variable-length byte
* arrays do not include a length prefix.
*
* These fields encode min and max values determined by signed comparison
* only. New files should use the correct order for a column's logical type
* and store the values in the min_value and max_value fields.
*
* To support older readers, these may be set when the column order is
* signed.
*/
MAX((short)1, "max"),
MIN((short)2, "min"),
/**
* count of null value in the column
*/
NULL_COUNT((short)3, "null_count"),
/**
* count of distinct values occurring
*/
DISTINCT_COUNT((short)4, "distinct_count"),
/**
* Min and max values for the column, determined by its ColumnOrder.
*
* Values are encoded using PLAIN encoding, except that variable-length byte
* arrays do not include a length prefix.
*/
MAX_VALUE((short)5, "max_value"),
MIN_VALUE((short)6, "min_value");
private static final Map byName = new HashMap();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // MAX
return MAX;
case 2: // MIN
return MIN;
case 3: // NULL_COUNT
return NULL_COUNT;
case 4: // DISTINCT_COUNT
return DISTINCT_COUNT;
case 5: // MAX_VALUE
return MAX_VALUE;
case 6: // MIN_VALUE
return MIN_VALUE;
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 IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __NULL_COUNT_ISSET_ID = 0;
private static final int __DISTINCT_COUNT_ISSET_ID = 1;
private byte __isset_bitfield = 0;
private static final _Fields optionals[] = {_Fields.MAX,_Fields.MIN,_Fields.NULL_COUNT,_Fields.DISTINCT_COUNT,_Fields.MAX_VALUE,_Fields.MIN_VALUE};
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.MAX, new org.apache.thrift.meta_data.FieldMetaData("max", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
tmpMap.put(_Fields.MIN, new org.apache.thrift.meta_data.FieldMetaData("min", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
tmpMap.put(_Fields.NULL_COUNT, new org.apache.thrift.meta_data.FieldMetaData("null_count", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.DISTINCT_COUNT, new org.apache.thrift.meta_data.FieldMetaData("distinct_count", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.MAX_VALUE, new org.apache.thrift.meta_data.FieldMetaData("max_value", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
tmpMap.put(_Fields.MIN_VALUE, new org.apache.thrift.meta_data.FieldMetaData("min_value", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Statistics.class, metaDataMap);
}
public Statistics() {
}
/**
* Performs a deep copy on other.
*/
public Statistics(Statistics other) {
__isset_bitfield = other.__isset_bitfield;
if (other.isSetMax()) {
this.max = org.apache.thrift.TBaseHelper.copyBinary(other.max);
}
if (other.isSetMin()) {
this.min = org.apache.thrift.TBaseHelper.copyBinary(other.min);
}
this.null_count = other.null_count;
this.distinct_count = other.distinct_count;
if (other.isSetMax_value()) {
this.max_value = org.apache.thrift.TBaseHelper.copyBinary(other.max_value);
}
if (other.isSetMin_value()) {
this.min_value = org.apache.thrift.TBaseHelper.copyBinary(other.min_value);
}
}
public Statistics deepCopy() {
return new Statistics(this);
}
@Override
public void clear() {
this.max = null;
this.min = null;
setNull_countIsSet(false);
this.null_count = 0;
setDistinct_countIsSet(false);
this.distinct_count = 0;
this.max_value = null;
this.min_value = null;
}
/**
* DEPRECATED: min and max value of the column. Use min_value and max_value.
*
* Values are encoded using PLAIN encoding, except that variable-length byte
* arrays do not include a length prefix.
*
* These fields encode min and max values determined by signed comparison
* only. New files should use the correct order for a column's logical type
* and store the values in the min_value and max_value fields.
*
* To support older readers, these may be set when the column order is
* signed.
*/
public byte[] getMax() {
setMax(org.apache.thrift.TBaseHelper.rightSize(max));
return max == null ? null : max.array();
}
public ByteBuffer bufferForMax() {
return org.apache.thrift.TBaseHelper.copyBinary(max);
}
/**
* DEPRECATED: min and max value of the column. Use min_value and max_value.
*
* Values are encoded using PLAIN encoding, except that variable-length byte
* arrays do not include a length prefix.
*
* These fields encode min and max values determined by signed comparison
* only. New files should use the correct order for a column's logical type
* and store the values in the min_value and max_value fields.
*
* To support older readers, these may be set when the column order is
* signed.
*/
public Statistics setMax(byte[] max) {
this.max = max == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(max, max.length));
return this;
}
public Statistics setMax(ByteBuffer max) {
this.max = org.apache.thrift.TBaseHelper.copyBinary(max);
return this;
}
public void unsetMax() {
this.max = null;
}
/** Returns true if field max is set (has been assigned a value) and false otherwise */
public boolean isSetMax() {
return this.max != null;
}
public void setMaxIsSet(boolean value) {
if (!value) {
this.max = null;
}
}
public byte[] getMin() {
setMin(org.apache.thrift.TBaseHelper.rightSize(min));
return min == null ? null : min.array();
}
public ByteBuffer bufferForMin() {
return org.apache.thrift.TBaseHelper.copyBinary(min);
}
public Statistics setMin(byte[] min) {
this.min = min == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(min, min.length));
return this;
}
public Statistics setMin(ByteBuffer min) {
this.min = org.apache.thrift.TBaseHelper.copyBinary(min);
return this;
}
public void unsetMin() {
this.min = null;
}
/** Returns true if field min is set (has been assigned a value) and false otherwise */
public boolean isSetMin() {
return this.min != null;
}
public void setMinIsSet(boolean value) {
if (!value) {
this.min = null;
}
}
/**
* count of null value in the column
*/
public long getNull_count() {
return this.null_count;
}
/**
* count of null value in the column
*/
public Statistics setNull_count(long null_count) {
this.null_count = null_count;
setNull_countIsSet(true);
return this;
}
public void unsetNull_count() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NULL_COUNT_ISSET_ID);
}
/** Returns true if field null_count is set (has been assigned a value) and false otherwise */
public boolean isSetNull_count() {
return EncodingUtils.testBit(__isset_bitfield, __NULL_COUNT_ISSET_ID);
}
public void setNull_countIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NULL_COUNT_ISSET_ID, value);
}
/**
* count of distinct values occurring
*/
public long getDistinct_count() {
return this.distinct_count;
}
/**
* count of distinct values occurring
*/
public Statistics setDistinct_count(long distinct_count) {
this.distinct_count = distinct_count;
setDistinct_countIsSet(true);
return this;
}
public void unsetDistinct_count() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DISTINCT_COUNT_ISSET_ID);
}
/** Returns true if field distinct_count is set (has been assigned a value) and false otherwise */
public boolean isSetDistinct_count() {
return EncodingUtils.testBit(__isset_bitfield, __DISTINCT_COUNT_ISSET_ID);
}
public void setDistinct_countIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DISTINCT_COUNT_ISSET_ID, value);
}
/**
* Min and max values for the column, determined by its ColumnOrder.
*
* Values are encoded using PLAIN encoding, except that variable-length byte
* arrays do not include a length prefix.
*/
public byte[] getMax_value() {
setMax_value(org.apache.thrift.TBaseHelper.rightSize(max_value));
return max_value == null ? null : max_value.array();
}
public ByteBuffer bufferForMax_value() {
return org.apache.thrift.TBaseHelper.copyBinary(max_value);
}
/**
* Min and max values for the column, determined by its ColumnOrder.
*
* Values are encoded using PLAIN encoding, except that variable-length byte
* arrays do not include a length prefix.
*/
public Statistics setMax_value(byte[] max_value) {
this.max_value = max_value == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(max_value, max_value.length));
return this;
}
public Statistics setMax_value(ByteBuffer max_value) {
this.max_value = org.apache.thrift.TBaseHelper.copyBinary(max_value);
return this;
}
public void unsetMax_value() {
this.max_value = null;
}
/** Returns true if field max_value is set (has been assigned a value) and false otherwise */
public boolean isSetMax_value() {
return this.max_value != null;
}
public void setMax_valueIsSet(boolean value) {
if (!value) {
this.max_value = null;
}
}
public byte[] getMin_value() {
setMin_value(org.apache.thrift.TBaseHelper.rightSize(min_value));
return min_value == null ? null : min_value.array();
}
public ByteBuffer bufferForMin_value() {
return org.apache.thrift.TBaseHelper.copyBinary(min_value);
}
public Statistics setMin_value(byte[] min_value) {
this.min_value = min_value == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(min_value, min_value.length));
return this;
}
public Statistics setMin_value(ByteBuffer min_value) {
this.min_value = org.apache.thrift.TBaseHelper.copyBinary(min_value);
return this;
}
public void unsetMin_value() {
this.min_value = null;
}
/** Returns true if field min_value is set (has been assigned a value) and false otherwise */
public boolean isSetMin_value() {
return this.min_value != null;
}
public void setMin_valueIsSet(boolean value) {
if (!value) {
this.min_value = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case MAX:
if (value == null) {
unsetMax();
} else {
setMax((ByteBuffer)value);
}
break;
case MIN:
if (value == null) {
unsetMin();
} else {
setMin((ByteBuffer)value);
}
break;
case NULL_COUNT:
if (value == null) {
unsetNull_count();
} else {
setNull_count((Long)value);
}
break;
case DISTINCT_COUNT:
if (value == null) {
unsetDistinct_count();
} else {
setDistinct_count((Long)value);
}
break;
case MAX_VALUE:
if (value == null) {
unsetMax_value();
} else {
setMax_value((ByteBuffer)value);
}
break;
case MIN_VALUE:
if (value == null) {
unsetMin_value();
} else {
setMin_value((ByteBuffer)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case MAX:
return getMax();
case MIN:
return getMin();
case NULL_COUNT:
return getNull_count();
case DISTINCT_COUNT:
return getDistinct_count();
case MAX_VALUE:
return getMax_value();
case MIN_VALUE:
return getMin_value();
}
throw new 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 IllegalArgumentException();
}
switch (field) {
case MAX:
return isSetMax();
case MIN:
return isSetMin();
case NULL_COUNT:
return isSetNull_count();
case DISTINCT_COUNT:
return isSetDistinct_count();
case MAX_VALUE:
return isSetMax_value();
case MIN_VALUE:
return isSetMin_value();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof Statistics)
return this.equals((Statistics)that);
return false;
}
public boolean equals(Statistics that) {
if (that == null)
return false;
boolean this_present_max = true && this.isSetMax();
boolean that_present_max = true && that.isSetMax();
if (this_present_max || that_present_max) {
if (!(this_present_max && that_present_max))
return false;
if (!this.max.equals(that.max))
return false;
}
boolean this_present_min = true && this.isSetMin();
boolean that_present_min = true && that.isSetMin();
if (this_present_min || that_present_min) {
if (!(this_present_min && that_present_min))
return false;
if (!this.min.equals(that.min))
return false;
}
boolean this_present_null_count = true && this.isSetNull_count();
boolean that_present_null_count = true && that.isSetNull_count();
if (this_present_null_count || that_present_null_count) {
if (!(this_present_null_count && that_present_null_count))
return false;
if (this.null_count != that.null_count)
return false;
}
boolean this_present_distinct_count = true && this.isSetDistinct_count();
boolean that_present_distinct_count = true && that.isSetDistinct_count();
if (this_present_distinct_count || that_present_distinct_count) {
if (!(this_present_distinct_count && that_present_distinct_count))
return false;
if (this.distinct_count != that.distinct_count)
return false;
}
boolean this_present_max_value = true && this.isSetMax_value();
boolean that_present_max_value = true && that.isSetMax_value();
if (this_present_max_value || that_present_max_value) {
if (!(this_present_max_value && that_present_max_value))
return false;
if (!this.max_value.equals(that.max_value))
return false;
}
boolean this_present_min_value = true && this.isSetMin_value();
boolean that_present_min_value = true && that.isSetMin_value();
if (this_present_min_value || that_present_min_value) {
if (!(this_present_min_value && that_present_min_value))
return false;
if (!this.min_value.equals(that.min_value))
return false;
}
return true;
}
@Override
public int hashCode() {
List