From 2d45571fcb002cc9f03056c5a3f14493b83315a4 Mon Sep 17 00:00:00 2001 From: Cheng Lian Date: Thu, 9 Jul 2015 17:09:16 -0700 Subject: [SPARK-8959] [SQL] [HOTFIX] Removes parquet-thrift and libthrift dependencies These two dependencies were introduced in #7231 to help testing Parquet compatibility with `parquet-thrift`. However, they somehow crash the Scala compiler in Maven builds. This PR fixes this issue by: 1. Removing these two dependencies, and 2. Instead of generating the testing Parquet file programmatically, checking in an actual testing Parquet file generated by `parquet-thrift` as a test resource. This is just a quick fix to bring back Maven builds. Need to figure out the root case as binary Parquet files are harder to maintain. Author: Cheng Lian Closes #7330 from liancheng/spark-8959 and squashes the following commits: cf69512 [Cheng Lian] Brings back Maven builds --- sql/core/pom.xml | 10 - .../spark/sql/parquet/test/thrift/Nested.java | 541 ---- .../parquet/test/thrift/ParquetThriftCompat.java | 2808 -------------------- .../apache/spark/sql/parquet/test/thrift/Suit.java | 51 - .../resources/parquet-thrift-compat.snappy.parquet | Bin 0 -> 10550 bytes .../parquet/ParquetThriftCompatibilitySuite.scala | 78 +- 6 files changed, 8 insertions(+), 3480 deletions(-) delete mode 100644 sql/core/src/test/gen-java/org/apache/spark/sql/parquet/test/thrift/Nested.java delete mode 100644 sql/core/src/test/gen-java/org/apache/spark/sql/parquet/test/thrift/ParquetThriftCompat.java delete mode 100644 sql/core/src/test/gen-java/org/apache/spark/sql/parquet/test/thrift/Suit.java create mode 100755 sql/core/src/test/resources/parquet-thrift-compat.snappy.parquet (limited to 'sql') diff --git a/sql/core/pom.xml b/sql/core/pom.xml index f90099f22d..2c03fee9db 100644 --- a/sql/core/pom.xml +++ b/sql/core/pom.xml @@ -106,16 +106,6 @@ parquet-avro test - - org.apache.parquet - parquet-thrift - test - - - org.apache.thrift - libthrift - test - target/scala-${scala.binary.version}/classes diff --git a/sql/core/src/test/gen-java/org/apache/spark/sql/parquet/test/thrift/Nested.java b/sql/core/src/test/gen-java/org/apache/spark/sql/parquet/test/thrift/Nested.java deleted file mode 100644 index 281e60cc3a..0000000000 --- a/sql/core/src/test/gen-java/org/apache/spark/sql/parquet/test/thrift/Nested.java +++ /dev/null @@ -1,541 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.2) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.sql.parquet.test.thrift; - -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"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-7-7") -public class Nested 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("Nested"); - - private static final org.apache.thrift.protocol.TField NESTED_INTS_COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("nestedIntsColumn", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final org.apache.thrift.protocol.TField NESTED_STRING_COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("nestedStringColumn", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new NestedStandardSchemeFactory()); - schemes.put(TupleScheme.class, new NestedTupleSchemeFactory()); - } - - public List nestedIntsColumn; // required - public String nestedStringColumn; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - NESTED_INTS_COLUMN((short)1, "nestedIntsColumn"), - NESTED_STRING_COLUMN((short)2, "nestedStringColumn"); - - 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: // NESTED_INTS_COLUMN - return NESTED_INTS_COLUMN; - case 2: // NESTED_STRING_COLUMN - return NESTED_STRING_COLUMN; - 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 - 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.NESTED_INTS_COLUMN, new org.apache.thrift.meta_data.FieldMetaData("nestedIntsColumn", 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.I32)))); - tmpMap.put(_Fields.NESTED_STRING_COLUMN, new org.apache.thrift.meta_data.FieldMetaData("nestedStringColumn", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Nested.class, metaDataMap); - } - - public Nested() { - } - - public Nested( - List nestedIntsColumn, - String nestedStringColumn) - { - this(); - this.nestedIntsColumn = nestedIntsColumn; - this.nestedStringColumn = nestedStringColumn; - } - - /** - * Performs a deep copy on other. - */ - public Nested(Nested other) { - if (other.isSetNestedIntsColumn()) { - List __this__nestedIntsColumn = new ArrayList(other.nestedIntsColumn); - this.nestedIntsColumn = __this__nestedIntsColumn; - } - if (other.isSetNestedStringColumn()) { - this.nestedStringColumn = other.nestedStringColumn; - } - } - - public Nested deepCopy() { - return new Nested(this); - } - - @Override - public void clear() { - this.nestedIntsColumn = null; - this.nestedStringColumn = null; - } - - public int getNestedIntsColumnSize() { - return (this.nestedIntsColumn == null) ? 0 : this.nestedIntsColumn.size(); - } - - public java.util.Iterator getNestedIntsColumnIterator() { - return (this.nestedIntsColumn == null) ? null : this.nestedIntsColumn.iterator(); - } - - public void addToNestedIntsColumn(int elem) { - if (this.nestedIntsColumn == null) { - this.nestedIntsColumn = new ArrayList(); - } - this.nestedIntsColumn.add(elem); - } - - public List getNestedIntsColumn() { - return this.nestedIntsColumn; - } - - public Nested setNestedIntsColumn(List nestedIntsColumn) { - this.nestedIntsColumn = nestedIntsColumn; - return this; - } - - public void unsetNestedIntsColumn() { - this.nestedIntsColumn = null; - } - - /** Returns true if field nestedIntsColumn is set (has been assigned a value) and false otherwise */ - public boolean isSetNestedIntsColumn() { - return this.nestedIntsColumn != null; - } - - public void setNestedIntsColumnIsSet(boolean value) { - if (!value) { - this.nestedIntsColumn = null; - } - } - - public String getNestedStringColumn() { - return this.nestedStringColumn; - } - - public Nested setNestedStringColumn(String nestedStringColumn) { - this.nestedStringColumn = nestedStringColumn; - return this; - } - - public void unsetNestedStringColumn() { - this.nestedStringColumn = null; - } - - /** Returns true if field nestedStringColumn is set (has been assigned a value) and false otherwise */ - public boolean isSetNestedStringColumn() { - return this.nestedStringColumn != null; - } - - public void setNestedStringColumnIsSet(boolean value) { - if (!value) { - this.nestedStringColumn = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case NESTED_INTS_COLUMN: - if (value == null) { - unsetNestedIntsColumn(); - } else { - setNestedIntsColumn((List)value); - } - break; - - case NESTED_STRING_COLUMN: - if (value == null) { - unsetNestedStringColumn(); - } else { - setNestedStringColumn((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case NESTED_INTS_COLUMN: - return getNestedIntsColumn(); - - case NESTED_STRING_COLUMN: - return getNestedStringColumn(); - - } - 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 NESTED_INTS_COLUMN: - return isSetNestedIntsColumn(); - case NESTED_STRING_COLUMN: - return isSetNestedStringColumn(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof Nested) - return this.equals((Nested)that); - return false; - } - - public boolean equals(Nested that) { - if (that == null) - return false; - - boolean this_present_nestedIntsColumn = true && this.isSetNestedIntsColumn(); - boolean that_present_nestedIntsColumn = true && that.isSetNestedIntsColumn(); - if (this_present_nestedIntsColumn || that_present_nestedIntsColumn) { - if (!(this_present_nestedIntsColumn && that_present_nestedIntsColumn)) - return false; - if (!this.nestedIntsColumn.equals(that.nestedIntsColumn)) - return false; - } - - boolean this_present_nestedStringColumn = true && this.isSetNestedStringColumn(); - boolean that_present_nestedStringColumn = true && that.isSetNestedStringColumn(); - if (this_present_nestedStringColumn || that_present_nestedStringColumn) { - if (!(this_present_nestedStringColumn && that_present_nestedStringColumn)) - return false; - if (!this.nestedStringColumn.equals(that.nestedStringColumn)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_nestedIntsColumn = true && (isSetNestedIntsColumn()); - list.add(present_nestedIntsColumn); - if (present_nestedIntsColumn) - list.add(nestedIntsColumn); - - boolean present_nestedStringColumn = true && (isSetNestedStringColumn()); - list.add(present_nestedStringColumn); - if (present_nestedStringColumn) - list.add(nestedStringColumn); - - return list.hashCode(); - } - - @Override - public int compareTo(Nested other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetNestedIntsColumn()).compareTo(other.isSetNestedIntsColumn()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNestedIntsColumn()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nestedIntsColumn, other.nestedIntsColumn); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetNestedStringColumn()).compareTo(other.isSetNestedStringColumn()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNestedStringColumn()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nestedStringColumn, other.nestedStringColumn); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("Nested("); - boolean first = true; - - sb.append("nestedIntsColumn:"); - if (this.nestedIntsColumn == null) { - sb.append("null"); - } else { - sb.append(this.nestedIntsColumn); - } - first = false; - if (!first) sb.append(", "); - sb.append("nestedStringColumn:"); - if (this.nestedStringColumn == null) { - sb.append("null"); - } else { - sb.append(this.nestedStringColumn); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (nestedIntsColumn == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'nestedIntsColumn' was not present! Struct: " + toString()); - } - if (nestedStringColumn == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'nestedStringColumn' 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, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class NestedStandardSchemeFactory implements SchemeFactory { - public NestedStandardScheme getScheme() { - return new NestedStandardScheme(); - } - } - - private static class NestedStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, Nested 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: // NESTED_INTS_COLUMN - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list0 = iprot.readListBegin(); - struct.nestedIntsColumn = new ArrayList(_list0.size); - int _elem1; - for (int _i2 = 0; _i2 < _list0.size; ++_i2) - { - _elem1 = iprot.readI32(); - struct.nestedIntsColumn.add(_elem1); - } - iprot.readListEnd(); - } - struct.setNestedIntsColumnIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // NESTED_STRING_COLUMN - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.nestedStringColumn = iprot.readString(); - struct.setNestedStringColumnIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, Nested struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.nestedIntsColumn != null) { - oprot.writeFieldBegin(NESTED_INTS_COLUMN_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, struct.nestedIntsColumn.size())); - for (int _iter3 : struct.nestedIntsColumn) - { - oprot.writeI32(_iter3); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (struct.nestedStringColumn != null) { - oprot.writeFieldBegin(NESTED_STRING_COLUMN_FIELD_DESC); - oprot.writeString(struct.nestedStringColumn); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class NestedTupleSchemeFactory implements SchemeFactory { - public NestedTupleScheme getScheme() { - return new NestedTupleScheme(); - } - } - - private static class NestedTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, Nested struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - { - oprot.writeI32(struct.nestedIntsColumn.size()); - for (int _iter4 : struct.nestedIntsColumn) - { - oprot.writeI32(_iter4); - } - } - oprot.writeString(struct.nestedStringColumn); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, Nested struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - { - org.apache.thrift.protocol.TList _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, iprot.readI32()); - struct.nestedIntsColumn = new ArrayList(_list5.size); - int _elem6; - for (int _i7 = 0; _i7 < _list5.size; ++_i7) - { - _elem6 = iprot.readI32(); - struct.nestedIntsColumn.add(_elem6); - } - } - struct.setNestedIntsColumnIsSet(true); - struct.nestedStringColumn = iprot.readString(); - struct.setNestedStringColumnIsSet(true); - } - } - -} - diff --git a/sql/core/src/test/gen-java/org/apache/spark/sql/parquet/test/thrift/ParquetThriftCompat.java b/sql/core/src/test/gen-java/org/apache/spark/sql/parquet/test/thrift/ParquetThriftCompat.java deleted file mode 100644 index 326ae9dbaa..0000000000 --- a/sql/core/src/test/gen-java/org/apache/spark/sql/parquet/test/thrift/ParquetThriftCompat.java +++ /dev/null @@ -1,2808 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.2) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.sql.parquet.test.thrift; - -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"}) -/** - * This is a test struct for testing parquet-thrift compatibility. - */ -@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-7-7") -public class ParquetThriftCompat 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("ParquetThriftCompat"); - - private static final org.apache.thrift.protocol.TField BOOL_COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("boolColumn", org.apache.thrift.protocol.TType.BOOL, (short)1); - private static final org.apache.thrift.protocol.TField BYTE_COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("byteColumn", org.apache.thrift.protocol.TType.BYTE, (short)2); - private static final org.apache.thrift.protocol.TField SHORT_COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("shortColumn", org.apache.thrift.protocol.TType.I16, (short)3); - private static final org.apache.thrift.protocol.TField INT_COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("intColumn", org.apache.thrift.protocol.TType.I32, (short)4); - private static final org.apache.thrift.protocol.TField LONG_COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("longColumn", org.apache.thrift.protocol.TType.I64, (short)5); - private static final org.apache.thrift.protocol.TField DOUBLE_COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("doubleColumn", org.apache.thrift.protocol.TType.DOUBLE, (short)6); - private static final org.apache.thrift.protocol.TField BINARY_COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("binaryColumn", org.apache.thrift.protocol.TType.STRING, (short)7); - private static final org.apache.thrift.protocol.TField STRING_COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("stringColumn", org.apache.thrift.protocol.TType.STRING, (short)8); - private static final org.apache.thrift.protocol.TField ENUM_COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("enumColumn", org.apache.thrift.protocol.TType.I32, (short)9); - private static final org.apache.thrift.protocol.TField MAYBE_BOOL_COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("maybeBoolColumn", org.apache.thrift.protocol.TType.BOOL, (short)10); - private static final org.apache.thrift.protocol.TField MAYBE_BYTE_COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("maybeByteColumn", org.apache.thrift.protocol.TType.BYTE, (short)11); - private static final org.apache.thrift.protocol.TField MAYBE_SHORT_COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("maybeShortColumn", org.apache.thrift.protocol.TType.I16, (short)12); - private static final org.apache.thrift.protocol.TField MAYBE_INT_COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("maybeIntColumn", org.apache.thrift.protocol.TType.I32, (short)13); - private static final org.apache.thrift.protocol.TField MAYBE_LONG_COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("maybeLongColumn", org.apache.thrift.protocol.TType.I64, (short)14); - private static final org.apache.thrift.protocol.TField MAYBE_DOUBLE_COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("maybeDoubleColumn", org.apache.thrift.protocol.TType.DOUBLE, (short)15); - private static final org.apache.thrift.protocol.TField MAYBE_BINARY_COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("maybeBinaryColumn", org.apache.thrift.protocol.TType.STRING, (short)16); - private static final org.apache.thrift.protocol.TField MAYBE_STRING_COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("maybeStringColumn", org.apache.thrift.protocol.TType.STRING, (short)17); - private static final org.apache.thrift.protocol.TField MAYBE_ENUM_COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("maybeEnumColumn", org.apache.thrift.protocol.TType.I32, (short)18); - private static final org.apache.thrift.protocol.TField STRINGS_COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("stringsColumn", org.apache.thrift.protocol.TType.LIST, (short)19); - private static final org.apache.thrift.protocol.TField INT_SET_COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("intSetColumn", org.apache.thrift.protocol.TType.SET, (short)20); - private static final org.apache.thrift.protocol.TField INT_TO_STRING_COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("intToStringColumn", org.apache.thrift.protocol.TType.MAP, (short)21); - private static final org.apache.thrift.protocol.TField COMPLEX_COLUMN_FIELD_DESC = new org.apache.thrift.protocol.TField("complexColumn", org.apache.thrift.protocol.TType.MAP, (short)22); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new ParquetThriftCompatStandardSchemeFactory()); - schemes.put(TupleScheme.class, new ParquetThriftCompatTupleSchemeFactory()); - } - - public boolean boolColumn; // required - public byte byteColumn; // required - public short shortColumn; // required - public int intColumn; // required - public long longColumn; // required - public double doubleColumn; // required - public ByteBuffer binaryColumn; // required - public String stringColumn; // required - /** - * - * @see Suit - */ - public Suit enumColumn; // required - public boolean maybeBoolColumn; // optional - public byte maybeByteColumn; // optional - public short maybeShortColumn; // optional - public int maybeIntColumn; // optional - public long maybeLongColumn; // optional - public double maybeDoubleColumn; // optional - public ByteBuffer maybeBinaryColumn; // optional - public String maybeStringColumn; // optional - /** - * - * @see Suit - */ - public Suit maybeEnumColumn; // optional - public List stringsColumn; // required - public Set intSetColumn; // required - public Map intToStringColumn; // required - public Map> complexColumn; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - BOOL_COLUMN((short)1, "boolColumn"), - BYTE_COLUMN((short)2, "byteColumn"), - SHORT_COLUMN((short)3, "shortColumn"), - INT_COLUMN((short)4, "intColumn"), - LONG_COLUMN((short)5, "longColumn"), - DOUBLE_COLUMN((short)6, "doubleColumn"), - BINARY_COLUMN((short)7, "binaryColumn"), - STRING_COLUMN((short)8, "stringColumn"), - /** - * - * @see Suit - */ - ENUM_COLUMN((short)9, "enumColumn"), - MAYBE_BOOL_COLUMN((short)10, "maybeBoolColumn"), - MAYBE_BYTE_COLUMN((short)11, "maybeByteColumn"), - MAYBE_SHORT_COLUMN((short)12, "maybeShortColumn"), - MAYBE_INT_COLUMN((short)13, "maybeIntColumn"), - MAYBE_LONG_COLUMN((short)14, "maybeLongColumn"), - MAYBE_DOUBLE_COLUMN((short)15, "maybeDoubleColumn"), - MAYBE_BINARY_COLUMN((short)16, "maybeBinaryColumn"), - MAYBE_STRING_COLUMN((short)17, "maybeStringColumn"), - /** - * - * @see Suit - */ - MAYBE_ENUM_COLUMN((short)18, "maybeEnumColumn"), - STRINGS_COLUMN((short)19, "stringsColumn"), - INT_SET_COLUMN((short)20, "intSetColumn"), - INT_TO_STRING_COLUMN((short)21, "intToStringColumn"), - COMPLEX_COLUMN((short)22, "complexColumn"); - - 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: // BOOL_COLUMN - return BOOL_COLUMN; - case 2: // BYTE_COLUMN - return BYTE_COLUMN; - case 3: // SHORT_COLUMN - return SHORT_COLUMN; - case 4: // INT_COLUMN - return INT_COLUMN; - case 5: // LONG_COLUMN - return LONG_COLUMN; - case 6: // DOUBLE_COLUMN - return DOUBLE_COLUMN; - case 7: // BINARY_COLUMN - return BINARY_COLUMN; - case 8: // STRING_COLUMN - return STRING_COLUMN; - case 9: // ENUM_COLUMN - return ENUM_COLUMN; - case 10: // MAYBE_BOOL_COLUMN - return MAYBE_BOOL_COLUMN; - case 11: // MAYBE_BYTE_COLUMN - return MAYBE_BYTE_COLUMN; - case 12: // MAYBE_SHORT_COLUMN - return MAYBE_SHORT_COLUMN; - case 13: // MAYBE_INT_COLUMN - return MAYBE_INT_COLUMN; - case 14: // MAYBE_LONG_COLUMN - return MAYBE_LONG_COLUMN; - case 15: // MAYBE_DOUBLE_COLUMN - return MAYBE_DOUBLE_COLUMN; - case 16: // MAYBE_BINARY_COLUMN - return MAYBE_BINARY_COLUMN; - case 17: // MAYBE_STRING_COLUMN - return MAYBE_STRING_COLUMN; - case 18: // MAYBE_ENUM_COLUMN - return MAYBE_ENUM_COLUMN; - case 19: // STRINGS_COLUMN - return STRINGS_COLUMN; - case 20: // INT_SET_COLUMN - return INT_SET_COLUMN; - case 21: // INT_TO_STRING_COLUMN - return INT_TO_STRING_COLUMN; - case 22: // COMPLEX_COLUMN - return COMPLEX_COLUMN; - 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 __BOOLCOLUMN_ISSET_ID = 0; - private static final int __BYTECOLUMN_ISSET_ID = 1; - private static final int __SHORTCOLUMN_ISSET_ID = 2; - private static final int __INTCOLUMN_ISSET_ID = 3; - private static final int __LONGCOLUMN_ISSET_ID = 4; - private static final int __DOUBLECOLUMN_ISSET_ID = 5; - private static final int __MAYBEBOOLCOLUMN_ISSET_ID = 6; - private static final int __MAYBEBYTECOLUMN_ISSET_ID = 7; - private static final int __MAYBESHORTCOLUMN_ISSET_ID = 8; - private static final int __MAYBEINTCOLUMN_ISSET_ID = 9; - private static final int __MAYBELONGCOLUMN_ISSET_ID = 10; - private static final int __MAYBEDOUBLECOLUMN_ISSET_ID = 11; - private short __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.MAYBE_BOOL_COLUMN,_Fields.MAYBE_BYTE_COLUMN,_Fields.MAYBE_SHORT_COLUMN,_Fields.MAYBE_INT_COLUMN,_Fields.MAYBE_LONG_COLUMN,_Fields.MAYBE_DOUBLE_COLUMN,_Fields.MAYBE_BINARY_COLUMN,_Fields.MAYBE_STRING_COLUMN,_Fields.MAYBE_ENUM_COLUMN}; - 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.BOOL_COLUMN, new org.apache.thrift.meta_data.FieldMetaData("boolColumn", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put(_Fields.BYTE_COLUMN, new org.apache.thrift.meta_data.FieldMetaData("byteColumn", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BYTE))); - tmpMap.put(_Fields.SHORT_COLUMN, new org.apache.thrift.meta_data.FieldMetaData("shortColumn", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); - tmpMap.put(_Fields.INT_COLUMN, new org.apache.thrift.meta_data.FieldMetaData("intColumn", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.LONG_COLUMN, new org.apache.thrift.meta_data.FieldMetaData("longColumn", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.DOUBLE_COLUMN, new org.apache.thrift.meta_data.FieldMetaData("doubleColumn", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))); - tmpMap.put(_Fields.BINARY_COLUMN, new org.apache.thrift.meta_data.FieldMetaData("binaryColumn", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - tmpMap.put(_Fields.STRING_COLUMN, new org.apache.thrift.meta_data.FieldMetaData("stringColumn", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.ENUM_COLUMN, new org.apache.thrift.meta_data.FieldMetaData("enumColumn", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, Suit.class))); - tmpMap.put(_Fields.MAYBE_BOOL_COLUMN, new org.apache.thrift.meta_data.FieldMetaData("maybeBoolColumn", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put(_Fields.MAYBE_BYTE_COLUMN, new org.apache.thrift.meta_data.FieldMetaData("maybeByteColumn", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BYTE))); - tmpMap.put(_Fields.MAYBE_SHORT_COLUMN, new org.apache.thrift.meta_data.FieldMetaData("maybeShortColumn", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); - tmpMap.put(_Fields.MAYBE_INT_COLUMN, new org.apache.thrift.meta_data.FieldMetaData("maybeIntColumn", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.MAYBE_LONG_COLUMN, new org.apache.thrift.meta_data.FieldMetaData("maybeLongColumn", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.MAYBE_DOUBLE_COLUMN, new org.apache.thrift.meta_data.FieldMetaData("maybeDoubleColumn", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))); - tmpMap.put(_Fields.MAYBE_BINARY_COLUMN, new org.apache.thrift.meta_data.FieldMetaData("maybeBinaryColumn", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - tmpMap.put(_Fields.MAYBE_STRING_COLUMN, new org.apache.thrift.meta_data.FieldMetaData("maybeStringColumn", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.MAYBE_ENUM_COLUMN, new org.apache.thrift.meta_data.FieldMetaData("maybeEnumColumn", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, Suit.class))); - tmpMap.put(_Fields.STRINGS_COLUMN, new org.apache.thrift.meta_data.FieldMetaData("stringsColumn", 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.INT_SET_COLUMN, new org.apache.thrift.meta_data.FieldMetaData("intSetColumn", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)))); - tmpMap.put(_Fields.INT_TO_STRING_COLUMN, new org.apache.thrift.meta_data.FieldMetaData("intToStringColumn", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32), - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - tmpMap.put(_Fields.COMPLEX_COLUMN, new org.apache.thrift.meta_data.FieldMetaData("complexColumn", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32), - 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, Nested.class))))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ParquetThriftCompat.class, metaDataMap); - } - - public ParquetThriftCompat() { - } - - public ParquetThriftCompat( - boolean boolColumn, - byte byteColumn, - short shortColumn, - int intColumn, - long longColumn, - double doubleColumn, - ByteBuffer binaryColumn, - String stringColumn, - Suit enumColumn, - List stringsColumn, - Set intSetColumn, - Map intToStringColumn, - Map> complexColumn) - { - this(); - this.boolColumn = boolColumn; - setBoolColumnIsSet(true); - this.byteColumn = byteColumn; - setByteColumnIsSet(true); - this.shortColumn = shortColumn; - setShortColumnIsSet(true); - this.intColumn = intColumn; - setIntColumnIsSet(true); - this.longColumn = longColumn; - setLongColumnIsSet(true); - this.doubleColumn = doubleColumn; - setDoubleColumnIsSet(true); - this.binaryColumn = org.apache.thrift.TBaseHelper.copyBinary(binaryColumn); - this.stringColumn = stringColumn; - this.enumColumn = enumColumn; - this.stringsColumn = stringsColumn; - this.intSetColumn = intSetColumn; - this.intToStringColumn = intToStringColumn; - this.complexColumn = complexColumn; - } - - /** - * Performs a deep copy on other. - */ - public ParquetThriftCompat(ParquetThriftCompat other) { - __isset_bitfield = other.__isset_bitfield; - this.boolColumn = other.boolColumn; - this.byteColumn = other.byteColumn; - this.shortColumn = other.shortColumn; - this.intColumn = other.intColumn; - this.longColumn = other.longColumn; - this.doubleColumn = other.doubleColumn; - if (other.isSetBinaryColumn()) { - this.binaryColumn = org.apache.thrift.TBaseHelper.copyBinary(other.binaryColumn); - } - if (other.isSetStringColumn()) { - this.stringColumn = other.stringColumn; - } - if (other.isSetEnumColumn()) { - this.enumColumn = other.enumColumn; - } - this.maybeBoolColumn = other.maybeBoolColumn; - this.maybeByteColumn = other.maybeByteColumn; - this.maybeShortColumn = other.maybeShortColumn; - this.maybeIntColumn = other.maybeIntColumn; - this.maybeLongColumn = other.maybeLongColumn; - this.maybeDoubleColumn = other.maybeDoubleColumn; - if (other.isSetMaybeBinaryColumn()) { - this.maybeBinaryColumn = org.apache.thrift.TBaseHelper.copyBinary(other.maybeBinaryColumn); - } - if (other.isSetMaybeStringColumn()) { - this.maybeStringColumn = other.maybeStringColumn; - } - if (other.isSetMaybeEnumColumn()) { - this.maybeEnumColumn = other.maybeEnumColumn; - } - if (other.isSetStringsColumn()) { - List __this__stringsColumn = new ArrayList(other.stringsColumn); - this.stringsColumn = __this__stringsColumn; - } - if (other.isSetIntSetColumn()) { - Set __this__intSetColumn = new HashSet(other.intSetColumn); - this.intSetColumn = __this__intSetColumn; - } - if (other.isSetIntToStringColumn()) { - Map __this__intToStringColumn = new HashMap(other.intToStringColumn); - this.intToStringColumn = __this__intToStringColumn; - } - if (other.isSetComplexColumn()) { - Map> __this__complexColumn = new HashMap>(other.complexColumn.size()); - for (Map.Entry> other_element : other.complexColumn.entrySet()) { - - Integer other_element_key = other_element.getKey(); - List other_element_value = other_element.getValue(); - - Integer __this__complexColumn_copy_key = other_element_key; - - List __this__complexColumn_copy_value = new ArrayList(other_element_value.size()); - for (Nested other_element_value_element : other_element_value) { - __this__complexColumn_copy_value.add(new Nested(other_element_value_element)); - } - - __this__complexColumn.put(__this__complexColumn_copy_key, __this__complexColumn_copy_value); - } - this.complexColumn = __this__complexColumn; - } - } - - public ParquetThriftCompat deepCopy() { - return new ParquetThriftCompat(this); - } - - @Override - public void clear() { - setBoolColumnIsSet(false); - this.boolColumn = false; - setByteColumnIsSet(false); - this.byteColumn = 0; - setShortColumnIsSet(false); - this.shortColumn = 0; - setIntColumnIsSet(false); - this.intColumn = 0; - setLongColumnIsSet(false); - this.longColumn = 0; - setDoubleColumnIsSet(false); - this.doubleColumn = 0.0; - this.binaryColumn = null; - this.stringColumn = null; - this.enumColumn = null; - setMaybeBoolColumnIsSet(false); - this.maybeBoolColumn = false; - setMaybeByteColumnIsSet(false); - this.maybeByteColumn = 0; - setMaybeShortColumnIsSet(false); - this.maybeShortColumn = 0; - setMaybeIntColumnIsSet(false); - this.maybeIntColumn = 0; - setMaybeLongColumnIsSet(false); - this.maybeLongColumn = 0; - setMaybeDoubleColumnIsSet(false); - this.maybeDoubleColumn = 0.0; - this.maybeBinaryColumn = null; - this.maybeStringColumn = null; - this.maybeEnumColumn = null; - this.stringsColumn = null; - this.intSetColumn = null; - this.intToStringColumn = null; - this.complexColumn = null; - } - - public boolean isBoolColumn() { - return this.boolColumn; - } - - public ParquetThriftCompat setBoolColumn(boolean boolColumn) { - this.boolColumn = boolColumn; - setBoolColumnIsSet(true); - return this; - } - - public void unsetBoolColumn() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BOOLCOLUMN_ISSET_ID); - } - - /** Returns true if field boolColumn is set (has been assigned a value) and false otherwise */ - public boolean isSetBoolColumn() { - return EncodingUtils.testBit(__isset_bitfield, __BOOLCOLUMN_ISSET_ID); - } - - public void setBoolColumnIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BOOLCOLUMN_ISSET_ID, value); - } - - public byte getByteColumn() { - return this.byteColumn; - } - - public ParquetThriftCompat setByteColumn(byte byteColumn) { - this.byteColumn = byteColumn; - setByteColumnIsSet(true); - return this; - } - - public void unsetByteColumn() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BYTECOLUMN_ISSET_ID); - } - - /** Returns true if field byteColumn is set (has been assigned a value) and false otherwise */ - public boolean isSetByteColumn() { - return EncodingUtils.testBit(__isset_bitfield, __BYTECOLUMN_ISSET_ID); - } - - public void setByteColumnIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BYTECOLUMN_ISSET_ID, value); - } - - public short getShortColumn() { - return this.shortColumn; - } - - public ParquetThriftCompat setShortColumn(short shortColumn) { - this.shortColumn = shortColumn; - setShortColumnIsSet(true); - return this; - } - - public void unsetShortColumn() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SHORTCOLUMN_ISSET_ID); - } - - /** Returns true if field shortColumn is set (has been assigned a value) and false otherwise */ - public boolean isSetShortColumn() { - return EncodingUtils.testBit(__isset_bitfield, __SHORTCOLUMN_ISSET_ID); - } - - public void setShortColumnIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SHORTCOLUMN_ISSET_ID, value); - } - - public int getIntColumn() { - return this.intColumn; - } - - public ParquetThriftCompat setIntColumn(int intColumn) { - this.intColumn = intColumn; - setIntColumnIsSet(true); - return this; - } - - public void unsetIntColumn() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __INTCOLUMN_ISSET_ID); - } - - /** Returns true if field intColumn is set (has been assigned a value) and false otherwise */ - public boolean isSetIntColumn() { - return EncodingUtils.testBit(__isset_bitfield, __INTCOLUMN_ISSET_ID); - } - - public void setIntColumnIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __INTCOLUMN_ISSET_ID, value); - } - - public long getLongColumn() { - return this.longColumn; - } - - public ParquetThriftCompat setLongColumn(long longColumn) { - this.longColumn = longColumn; - setLongColumnIsSet(true); - return this; - } - - public void unsetLongColumn() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LONGCOLUMN_ISSET_ID); - } - - /** Returns true if field longColumn is set (has been assigned a value) and false otherwise */ - public boolean isSetLongColumn() { - return EncodingUtils.testBit(__isset_bitfield, __LONGCOLUMN_ISSET_ID); - } - - public void setLongColumnIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LONGCOLUMN_ISSET_ID, value); - } - - public double getDoubleColumn() { - return this.doubleColumn; - } - - public ParquetThriftCompat setDoubleColumn(double doubleColumn) { - this.doubleColumn = doubleColumn; - setDoubleColumnIsSet(true); - return this; - } - - public void unsetDoubleColumn() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DOUBLECOLUMN_ISSET_ID); - } - - /** Returns true if field doubleColumn is set (has been assigned a value) and false otherwise */ - public boolean isSetDoubleColumn() { - return EncodingUtils.testBit(__isset_bitfield, __DOUBLECOLUMN_ISSET_ID); - } - - public void setDoubleColumnIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DOUBLECOLUMN_ISSET_ID, value); - } - - public byte[] getBinaryColumn() { - setBinaryColumn(org.apache.thrift.TBaseHelper.rightSize(binaryColumn)); - return binaryColumn == null ? null : binaryColumn.array(); - } - - public ByteBuffer bufferForBinaryColumn() { - return org.apache.thrift.TBaseHelper.copyBinary(binaryColumn); - } - - public ParquetThriftCompat setBinaryColumn(byte[] binaryColumn) { - this.binaryColumn = binaryColumn == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(binaryColumn, binaryColumn.length)); - return this; - } - - public ParquetThriftCompat setBinaryColumn(ByteBuffer binaryColumn) { - this.binaryColumn = org.apache.thrift.TBaseHelper.copyBinary(binaryColumn); - return this; - } - - public void unsetBinaryColumn() { - this.binaryColumn = null; - } - - /** Returns true if field binaryColumn is set (has been assigned a value) and false otherwise */ - public boolean isSetBinaryColumn() { - return this.binaryColumn != null; - } - - public void setBinaryColumnIsSet(boolean value) { - if (!value) { - this.binaryColumn = null; - } - } - - public String getStringColumn() { - return this.stringColumn; - } - - public ParquetThriftCompat setStringColumn(String stringColumn) { - this.stringColumn = stringColumn; - return this; - } - - public void unsetStringColumn() { - this.stringColumn = null; - } - - /** Returns true if field stringColumn is set (has been assigned a value) and false otherwise */ - public boolean isSetStringColumn() { - return this.stringColumn != null; - } - - public void setStringColumnIsSet(boolean value) { - if (!value) { - this.stringColumn = null; - } - } - - /** - * - * @see Suit - */ - public Suit getEnumColumn() { - return this.enumColumn; - } - - /** - * - * @see Suit - */ - public ParquetThriftCompat setEnumColumn(Suit enumColumn) { - this.enumColumn = enumColumn; - return this; - } - - public void unsetEnumColumn() { - this.enumColumn = null; - } - - /** Returns true if field enumColumn is set (has been assigned a value) and false otherwise */ - public boolean isSetEnumColumn() { - return this.enumColumn != null; - } - - public void setEnumColumnIsSet(boolean value) { - if (!value) { - this.enumColumn = null; - } - } - - public boolean isMaybeBoolColumn() { - return this.maybeBoolColumn; - } - - public ParquetThriftCompat setMaybeBoolColumn(boolean maybeBoolColumn) { - this.maybeBoolColumn = maybeBoolColumn; - setMaybeBoolColumnIsSet(true); - return this; - } - - public void unsetMaybeBoolColumn() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MAYBEBOOLCOLUMN_ISSET_ID); - } - - /** Returns true if field maybeBoolColumn is set (has been assigned a value) and false otherwise */ - public boolean isSetMaybeBoolColumn() { - return EncodingUtils.testBit(__isset_bitfield, __MAYBEBOOLCOLUMN_ISSET_ID); - } - - public void setMaybeBoolColumnIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MAYBEBOOLCOLUMN_ISSET_ID, value); - } - - public byte getMaybeByteColumn() { - return this.maybeByteColumn; - } - - public ParquetThriftCompat setMaybeByteColumn(byte maybeByteColumn) { - this.maybeByteColumn = maybeByteColumn; - setMaybeByteColumnIsSet(true); - return this; - } - - public void unsetMaybeByteColumn() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MAYBEBYTECOLUMN_ISSET_ID); - } - - /** Returns true if field maybeByteColumn is set (has been assigned a value) and false otherwise */ - public boolean isSetMaybeByteColumn() { - return EncodingUtils.testBit(__isset_bitfield, __MAYBEBYTECOLUMN_ISSET_ID); - } - - public void setMaybeByteColumnIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MAYBEBYTECOLUMN_ISSET_ID, value); - } - - public short getMaybeShortColumn() { - return this.maybeShortColumn; - } - - public ParquetThriftCompat setMaybeShortColumn(short maybeShortColumn) { - this.maybeShortColumn = maybeShortColumn; - setMaybeShortColumnIsSet(true); - return this; - } - - public void unsetMaybeShortColumn() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MAYBESHORTCOLUMN_ISSET_ID); - } - - /** Returns true if field maybeShortColumn is set (has been assigned a value) and false otherwise */ - public boolean isSetMaybeShortColumn() { - return EncodingUtils.testBit(__isset_bitfield, __MAYBESHORTCOLUMN_ISSET_ID); - } - - public void setMaybeShortColumnIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MAYBESHORTCOLUMN_ISSET_ID, value); - } - - public int getMaybeIntColumn() { - return this.maybeIntColumn; - } - - public ParquetThriftCompat setMaybeIntColumn(int maybeIntColumn) { - this.maybeIntColumn = maybeIntColumn; - setMaybeIntColumnIsSet(true); - return this; - } - - public void unsetMaybeIntColumn() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MAYBEINTCOLUMN_ISSET_ID); - } - - /** Returns true if field maybeIntColumn is set (has been assigned a value) and false otherwise */ - public boolean isSetMaybeIntColumn() { - return EncodingUtils.testBit(__isset_bitfield, __MAYBEINTCOLUMN_ISSET_ID); - } - - public void setMaybeIntColumnIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MAYBEINTCOLUMN_ISSET_ID, value); - } - - public long getMaybeLongColumn() { - return this.maybeLongColumn; - } - - public ParquetThriftCompat setMaybeLongColumn(long maybeLongColumn) { - this.maybeLongColumn = maybeLongColumn; - setMaybeLongColumnIsSet(true); - return this; - } - - public void unsetMaybeLongColumn() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MAYBELONGCOLUMN_ISSET_ID); - } - - /** Returns true if field maybeLongColumn is set (has been assigned a value) and false otherwise */ - public boolean isSetMaybeLongColumn() { - return EncodingUtils.testBit(__isset_bitfield, __MAYBELONGCOLUMN_ISSET_ID); - } - - public void setMaybeLongColumnIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MAYBELONGCOLUMN_ISSET_ID, value); - } - - public double getMaybeDoubleColumn() { - return this.maybeDoubleColumn; - } - - public ParquetThriftCompat setMaybeDoubleColumn(double maybeDoubleColumn) { - this.maybeDoubleColumn = maybeDoubleColumn; - setMaybeDoubleColumnIsSet(true); - return this; - } - - public void unsetMaybeDoubleColumn() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MAYBEDOUBLECOLUMN_ISSET_ID); - } - - /** Returns true if field maybeDoubleColumn is set (has been assigned a value) and false otherwise */ - public boolean isSetMaybeDoubleColumn() { - return EncodingUtils.testBit(__isset_bitfield, __MAYBEDOUBLECOLUMN_ISSET_ID); - } - - public void setMaybeDoubleColumnIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MAYBEDOUBLECOLUMN_ISSET_ID, value); - } - - public byte[] getMaybeBinaryColumn() { - setMaybeBinaryColumn(org.apache.thrift.TBaseHelper.rightSize(maybeBinaryColumn)); - return maybeBinaryColumn == null ? null : maybeBinaryColumn.array(); - } - - public ByteBuffer bufferForMaybeBinaryColumn() { - return org.apache.thrift.TBaseHelper.copyBinary(maybeBinaryColumn); - } - - public ParquetThriftCompat setMaybeBinaryColumn(byte[] maybeBinaryColumn) { - this.maybeBinaryColumn = maybeBinaryColumn == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(maybeBinaryColumn, maybeBinaryColumn.length)); - return this; - } - - public ParquetThriftCompat setMaybeBinaryColumn(ByteBuffer maybeBinaryColumn) { - this.maybeBinaryColumn = org.apache.thrift.TBaseHelper.copyBinary(maybeBinaryColumn); - return this; - } - - public void unsetMaybeBinaryColumn() { - this.maybeBinaryColumn = null; - } - - /** Returns true if field maybeBinaryColumn is set (has been assigned a value) and false otherwise */ - public boolean isSetMaybeBinaryColumn() { - return this.maybeBinaryColumn != null; - } - - public void setMaybeBinaryColumnIsSet(boolean value) { - if (!value) { - this.maybeBinaryColumn = null; - } - } - - public String getMaybeStringColumn() { - return this.maybeStringColumn; - } - - public ParquetThriftCompat setMaybeStringColumn(String maybeStringColumn) { - this.maybeStringColumn = maybeStringColumn; - return this; - } - - public void unsetMaybeStringColumn() { - this.maybeStringColumn = null; - } - - /** Returns true if field maybeStringColumn is set (has been assigned a value) and false otherwise */ - public boolean isSetMaybeStringColumn() { - return this.maybeStringColumn != null; - } - - public void setMaybeStringColumnIsSet(boolean value) { - if (!value) { - this.maybeStringColumn = null; - } - } - - /** - * - * @see Suit - */ - public Suit getMaybeEnumColumn() { - return this.maybeEnumColumn; - } - - /** - * - * @see Suit - */ - public ParquetThriftCompat setMaybeEnumColumn(Suit maybeEnumColumn) { - this.maybeEnumColumn = maybeEnumColumn; - return this; - } - - public void unsetMaybeEnumColumn() { - this.maybeEnumColumn = null; - } - - /** Returns true if field maybeEnumColumn is set (has been assigned a value) and false otherwise */ - public boolean isSetMaybeEnumColumn() { - return this.maybeEnumColumn != null; - } - - public void setMaybeEnumColumnIsSet(boolean value) { - if (!value) { - this.maybeEnumColumn = null; - } - } - - public int getStringsColumnSize() { - return (this.stringsColumn == null) ? 0 : this.stringsColumn.size(); - } - - public java.util.Iterator getStringsColumnIterator() { - return (this.stringsColumn == null) ? null : this.stringsColumn.iterator(); - } - - public void addToStringsColumn(String elem) { - if (this.stringsColumn == null) { - this.stringsColumn = new ArrayList(); - } - this.stringsColumn.add(elem); - } - - public List getStringsColumn() { - return this.stringsColumn; - } - - public ParquetThriftCompat setStringsColumn(List stringsColumn) { - this.stringsColumn = stringsColumn; - return this; - } - - public void unsetStringsColumn() { - this.stringsColumn = null; - } - - /** Returns true if field stringsColumn is set (has been assigned a value) and false otherwise */ - public boolean isSetStringsColumn() { - return this.stringsColumn != null; - } - - public void setStringsColumnIsSet(boolean value) { - if (!value) { - this.stringsColumn = null; - } - } - - public int getIntSetColumnSize() { - return (this.intSetColumn == null) ? 0 : this.intSetColumn.size(); - } - - public java.util.Iterator getIntSetColumnIterator() { - return (this.intSetColumn == null) ? null : this.intSetColumn.iterator(); - } - - public void addToIntSetColumn(int elem) { - if (this.intSetColumn == null) { - this.intSetColumn = new HashSet(); - } - this.intSetColumn.add(elem); - } - - public Set getIntSetColumn() { - return this.intSetColumn; - } - - public ParquetThriftCompat setIntSetColumn(Set intSetColumn) { - this.intSetColumn = intSetColumn; - return this; - } - - public void unsetIntSetColumn() { - this.intSetColumn = null; - } - - /** Returns true if field intSetColumn is set (has been assigned a value) and false otherwise */ - public boolean isSetIntSetColumn() { - return this.intSetColumn != null; - } - - public void setIntSetColumnIsSet(boolean value) { - if (!value) { - this.intSetColumn = null; - } - } - - public int getIntToStringColumnSize() { - return (this.intToStringColumn == null) ? 0 : this.intToStringColumn.size(); - } - - public void putToIntToStringColumn(int key, String val) { - if (this.intToStringColumn == null) { - this.intToStringColumn = new HashMap(); - } - this.intToStringColumn.put(key, val); - } - - public Map getIntToStringColumn() { - return this.intToStringColumn; - } - - public ParquetThriftCompat setIntToStringColumn(Map intToStringColumn) { - this.intToStringColumn = intToStringColumn; - return this; - } - - public void unsetIntToStringColumn() { - this.intToStringColumn = null; - } - - /** Returns true if field intToStringColumn is set (has been assigned a value) and false otherwise */ - public boolean isSetIntToStringColumn() { - return this.intToStringColumn != null; - } - - public void setIntToStringColumnIsSet(boolean value) { - if (!value) { - this.intToStringColumn = null; - } - } - - public int getComplexColumnSize() { - return (this.complexColumn == null) ? 0 : this.complexColumn.size(); - } - - public void putToComplexColumn(int key, List val) { - if (this.complexColumn == null) { - this.complexColumn = new HashMap>(); - } - this.complexColumn.put(key, val); - } - - public Map> getComplexColumn() { - return this.complexColumn; - } - - public ParquetThriftCompat setComplexColumn(Map> complexColumn) { - this.complexColumn = complexColumn; - return this; - } - - public void unsetComplexColumn() { - this.complexColumn = null; - } - - /** Returns true if field complexColumn is set (has been assigned a value) and false otherwise */ - public boolean isSetComplexColumn() { - return this.complexColumn != null; - } - - public void setComplexColumnIsSet(boolean value) { - if (!value) { - this.complexColumn = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case BOOL_COLUMN: - if (value == null) { - unsetBoolColumn(); - } else { - setBoolColumn((Boolean)value); - } - break; - - case BYTE_COLUMN: - if (value == null) { - unsetByteColumn(); - } else { - setByteColumn((Byte)value); - } - break; - - case SHORT_COLUMN: - if (value == null) { - unsetShortColumn(); - } else { - setShortColumn((Short)value); - } - break; - - case INT_COLUMN: - if (value == null) { - unsetIntColumn(); - } else { - setIntColumn((Integer)value); - } - break; - - case LONG_COLUMN: - if (value == null) { - unsetLongColumn(); - } else { - setLongColumn((Long)value); - } - break; - - case DOUBLE_COLUMN: - if (value == null) { - unsetDoubleColumn(); - } else { - setDoubleColumn((Double)value); - } - break; - - case BINARY_COLUMN: - if (value == null) { - unsetBinaryColumn(); - } else { - setBinaryColumn((ByteBuffer)value); - } - break; - - case STRING_COLUMN: - if (value == null) { - unsetStringColumn(); - } else { - setStringColumn((String)value); - } - break; - - case ENUM_COLUMN: - if (value == null) { - unsetEnumColumn(); - } else { - setEnumColumn((Suit)value); - } - break; - - case MAYBE_BOOL_COLUMN: - if (value == null) { - unsetMaybeBoolColumn(); - } else { - setMaybeBoolColumn((Boolean)value); - } - break; - - case MAYBE_BYTE_COLUMN: - if (value == null) { - unsetMaybeByteColumn(); - } else { - setMaybeByteColumn((Byte)value); - } - break; - - case MAYBE_SHORT_COLUMN: - if (value == null) { - unsetMaybeShortColumn(); - } else { - setMaybeShortColumn((Short)value); - } - break; - - case MAYBE_INT_COLUMN: - if (value == null) { - unsetMaybeIntColumn(); - } else { - setMaybeIntColumn((Integer)value); - } - break; - - case MAYBE_LONG_COLUMN: - if (value == null) { - unsetMaybeLongColumn(); - } else { - setMaybeLongColumn((Long)value); - } - break; - - case MAYBE_DOUBLE_COLUMN: - if (value == null) { - unsetMaybeDoubleColumn(); - } else { - setMaybeDoubleColumn((Double)value); - } - break; - - case MAYBE_BINARY_COLUMN: - if (value == null) { - unsetMaybeBinaryColumn(); - } else { - setMaybeBinaryColumn((ByteBuffer)value); - } - break; - - case MAYBE_STRING_COLUMN: - if (value == null) { - unsetMaybeStringColumn(); - } else { - setMaybeStringColumn((String)value); - } - break; - - case MAYBE_ENUM_COLUMN: - if (value == null) { - unsetMaybeEnumColumn(); - } else { - setMaybeEnumColumn((Suit)value); - } - break; - - case STRINGS_COLUMN: - if (value == null) { - unsetStringsColumn(); - } else { - setStringsColumn((List)value); - } - break; - - case INT_SET_COLUMN: - if (value == null) { - unsetIntSetColumn(); - } else { - setIntSetColumn((Set)value); - } - break; - - case INT_TO_STRING_COLUMN: - if (value == null) { - unsetIntToStringColumn(); - } else { - setIntToStringColumn((Map)value); - } - break; - - case COMPLEX_COLUMN: - if (value == null) { - unsetComplexColumn(); - } else { - setComplexColumn((Map>)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case BOOL_COLUMN: - return Boolean.valueOf(isBoolColumn()); - - case BYTE_COLUMN: - return Byte.valueOf(getByteColumn()); - - case SHORT_COLUMN: - return Short.valueOf(getShortColumn()); - - case INT_COLUMN: - return Integer.valueOf(getIntColumn()); - - case LONG_COLUMN: - return Long.valueOf(getLongColumn()); - - case DOUBLE_COLUMN: - return Double.valueOf(getDoubleColumn()); - - case BINARY_COLUMN: - return getBinaryColumn(); - - case STRING_COLUMN: - return getStringColumn(); - - case ENUM_COLUMN: - return getEnumColumn(); - - case MAYBE_BOOL_COLUMN: - return Boolean.valueOf(isMaybeBoolColumn()); - - case MAYBE_BYTE_COLUMN: - return Byte.valueOf(getMaybeByteColumn()); - - case MAYBE_SHORT_COLUMN: - return Short.valueOf(getMaybeShortColumn()); - - case MAYBE_INT_COLUMN: - return Integer.valueOf(getMaybeIntColumn()); - - case MAYBE_LONG_COLUMN: - return Long.valueOf(getMaybeLongColumn()); - - case MAYBE_DOUBLE_COLUMN: - return Double.valueOf(getMaybeDoubleColumn()); - - case MAYBE_BINARY_COLUMN: - return getMaybeBinaryColumn(); - - case MAYBE_STRING_COLUMN: - return getMaybeStringColumn(); - - case MAYBE_ENUM_COLUMN: - return getMaybeEnumColumn(); - - case STRINGS_COLUMN: - return getStringsColumn(); - - case INT_SET_COLUMN: - return getIntSetColumn(); - - case INT_TO_STRING_COLUMN: - return getIntToStringColumn(); - - case COMPLEX_COLUMN: - return getComplexColumn(); - - } - 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 BOOL_COLUMN: - return isSetBoolColumn(); - case BYTE_COLUMN: - return isSetByteColumn(); - case SHORT_COLUMN: - return isSetShortColumn(); - case INT_COLUMN: - return isSetIntColumn(); - case LONG_COLUMN: - return isSetLongColumn(); - case DOUBLE_COLUMN: - return isSetDoubleColumn(); - case BINARY_COLUMN: - return isSetBinaryColumn(); - case STRING_COLUMN: - return isSetStringColumn(); - case ENUM_COLUMN: - return isSetEnumColumn(); - case MAYBE_BOOL_COLUMN: - return isSetMaybeBoolColumn(); - case MAYBE_BYTE_COLUMN: - return isSetMaybeByteColumn(); - case MAYBE_SHORT_COLUMN: - return isSetMaybeShortColumn(); - case MAYBE_INT_COLUMN: - return isSetMaybeIntColumn(); - case MAYBE_LONG_COLUMN: - return isSetMaybeLongColumn(); - case MAYBE_DOUBLE_COLUMN: - return isSetMaybeDoubleColumn(); - case MAYBE_BINARY_COLUMN: - return isSetMaybeBinaryColumn(); - case MAYBE_STRING_COLUMN: - return isSetMaybeStringColumn(); - case MAYBE_ENUM_COLUMN: - return isSetMaybeEnumColumn(); - case STRINGS_COLUMN: - return isSetStringsColumn(); - case INT_SET_COLUMN: - return isSetIntSetColumn(); - case INT_TO_STRING_COLUMN: - return isSetIntToStringColumn(); - case COMPLEX_COLUMN: - return isSetComplexColumn(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof ParquetThriftCompat) - return this.equals((ParquetThriftCompat)that); - return false; - } - - public boolean equals(ParquetThriftCompat that) { - if (that == null) - return false; - - boolean this_present_boolColumn = true; - boolean that_present_boolColumn = true; - if (this_present_boolColumn || that_present_boolColumn) { - if (!(this_present_boolColumn && that_present_boolColumn)) - return false; - if (this.boolColumn != that.boolColumn) - return false; - } - - boolean this_present_byteColumn = true; - boolean that_present_byteColumn = true; - if (this_present_byteColumn || that_present_byteColumn) { - if (!(this_present_byteColumn && that_present_byteColumn)) - return false; - if (this.byteColumn != that.byteColumn) - return false; - } - - boolean this_present_shortColumn = true; - boolean that_present_shortColumn = true; - if (this_present_shortColumn || that_present_shortColumn) { - if (!(this_present_shortColumn && that_present_shortColumn)) - return false; - if (this.shortColumn != that.shortColumn) - return false; - } - - boolean this_present_intColumn = true; - boolean that_present_intColumn = true; - if (this_present_intColumn || that_present_intColumn) { - if (!(this_present_intColumn && that_present_intColumn)) - return false; - if (this.intColumn != that.intColumn) - return false; - } - - boolean this_present_longColumn = true; - boolean that_present_longColumn = true; - if (this_present_longColumn || that_present_longColumn) { - if (!(this_present_longColumn && that_present_longColumn)) - return false; - if (this.longColumn != that.longColumn) - return false; - } - - boolean this_present_doubleColumn = true; - boolean that_present_doubleColumn = true; - if (this_present_doubleColumn || that_present_doubleColumn) { - if (!(this_present_doubleColumn && that_present_doubleColumn)) - return false; - if (this.doubleColumn != that.doubleColumn) - return false; - } - - boolean this_present_binaryColumn = true && this.isSetBinaryColumn(); - boolean that_present_binaryColumn = true && that.isSetBinaryColumn(); - if (this_present_binaryColumn || that_present_binaryColumn) { - if (!(this_present_binaryColumn && that_present_binaryColumn)) - return false; - if (!this.binaryColumn.equals(that.binaryColumn)) - return false; - } - - boolean this_present_stringColumn = true && this.isSetStringColumn(); - boolean that_present_stringColumn = true && that.isSetStringColumn(); - if (this_present_stringColumn || that_present_stringColumn) { - if (!(this_present_stringColumn && that_present_stringColumn)) - return false; - if (!this.stringColumn.equals(that.stringColumn)) - return false; - } - - boolean this_present_enumColumn = true && this.isSetEnumColumn(); - boolean that_present_enumColumn = true && that.isSetEnumColumn(); - if (this_present_enumColumn || that_present_enumColumn) { - if (!(this_present_enumColumn && that_present_enumColumn)) - return false; - if (!this.enumColumn.equals(that.enumColumn)) - return false; - } - - boolean this_present_maybeBoolColumn = true && this.isSetMaybeBoolColumn(); - boolean that_present_maybeBoolColumn = true && that.isSetMaybeBoolColumn(); - if (this_present_maybeBoolColumn || that_present_maybeBoolColumn) { - if (!(this_present_maybeBoolColumn && that_present_maybeBoolColumn)) - return false; - if (this.maybeBoolColumn != that.maybeBoolColumn) - return false; - } - - boolean this_present_maybeByteColumn = true && this.isSetMaybeByteColumn(); - boolean that_present_maybeByteColumn = true && that.isSetMaybeByteColumn(); - if (this_present_maybeByteColumn || that_present_maybeByteColumn) { - if (!(this_present_maybeByteColumn && that_present_maybeByteColumn)) - return false; - if (this.maybeByteColumn != that.maybeByteColumn) - return false; - } - - boolean this_present_maybeShortColumn = true && this.isSetMaybeShortColumn(); - boolean that_present_maybeShortColumn = true && that.isSetMaybeShortColumn(); - if (this_present_maybeShortColumn || that_present_maybeShortColumn) { - if (!(this_present_maybeShortColumn && that_present_maybeShortColumn)) - return false; - if (this.maybeShortColumn != that.maybeShortColumn) - return false; - } - - boolean this_present_maybeIntColumn = true && this.isSetMaybeIntColumn(); - boolean that_present_maybeIntColumn = true && that.isSetMaybeIntColumn(); - if (this_present_maybeIntColumn || that_present_maybeIntColumn) { - if (!(this_present_maybeIntColumn && that_present_maybeIntColumn)) - return false; - if (this.maybeIntColumn != that.maybeIntColumn) - return false; - } - - boolean this_present_maybeLongColumn = true && this.isSetMaybeLongColumn(); - boolean that_present_maybeLongColumn = true && that.isSetMaybeLongColumn(); - if (this_present_maybeLongColumn || that_present_maybeLongColumn) { - if (!(this_present_maybeLongColumn && that_present_maybeLongColumn)) - return false; - if (this.maybeLongColumn != that.maybeLongColumn) - return false; - } - - boolean this_present_maybeDoubleColumn = true && this.isSetMaybeDoubleColumn(); - boolean that_present_maybeDoubleColumn = true && that.isSetMaybeDoubleColumn(); - if (this_present_maybeDoubleColumn || that_present_maybeDoubleColumn) { - if (!(this_present_maybeDoubleColumn && that_present_maybeDoubleColumn)) - return false; - if (this.maybeDoubleColumn != that.maybeDoubleColumn) - return false; - } - - boolean this_present_maybeBinaryColumn = true && this.isSetMaybeBinaryColumn(); - boolean that_present_maybeBinaryColumn = true && that.isSetMaybeBinaryColumn(); - if (this_present_maybeBinaryColumn || that_present_maybeBinaryColumn) { - if (!(this_present_maybeBinaryColumn && that_present_maybeBinaryColumn)) - return false; - if (!this.maybeBinaryColumn.equals(that.maybeBinaryColumn)) - return false; - } - - boolean this_present_maybeStringColumn = true && this.isSetMaybeStringColumn(); - boolean that_present_maybeStringColumn = true && that.isSetMaybeStringColumn(); - if (this_present_maybeStringColumn || that_present_maybeStringColumn) { - if (!(this_present_maybeStringColumn && that_present_maybeStringColumn)) - return false; - if (!this.maybeStringColumn.equals(that.maybeStringColumn)) - return false; - } - - boolean this_present_maybeEnumColumn = true && this.isSetMaybeEnumColumn(); - boolean that_present_maybeEnumColumn = true && that.isSetMaybeEnumColumn(); - if (this_present_maybeEnumColumn || that_present_maybeEnumColumn) { - if (!(this_present_maybeEnumColumn && that_present_maybeEnumColumn)) - return false; - if (!this.maybeEnumColumn.equals(that.maybeEnumColumn)) - return false; - } - - boolean this_present_stringsColumn = true && this.isSetStringsColumn(); - boolean that_present_stringsColumn = true && that.isSetStringsColumn(); - if (this_present_stringsColumn || that_present_stringsColumn) { - if (!(this_present_stringsColumn && that_present_stringsColumn)) - return false; - if (!this.stringsColumn.equals(that.stringsColumn)) - return false; - } - - boolean this_present_intSetColumn = true && this.isSetIntSetColumn(); - boolean that_present_intSetColumn = true && that.isSetIntSetColumn(); - if (this_present_intSetColumn || that_present_intSetColumn) { - if (!(this_present_intSetColumn && that_present_intSetColumn)) - return false; - if (!this.intSetColumn.equals(that.intSetColumn)) - return false; - } - - boolean this_present_intToStringColumn = true && this.isSetIntToStringColumn(); - boolean that_present_intToStringColumn = true && that.isSetIntToStringColumn(); - if (this_present_intToStringColumn || that_present_intToStringColumn) { - if (!(this_present_intToStringColumn && that_present_intToStringColumn)) - return false; - if (!this.intToStringColumn.equals(that.intToStringColumn)) - return false; - } - - boolean this_present_complexColumn = true && this.isSetComplexColumn(); - boolean that_present_complexColumn = true && that.isSetComplexColumn(); - if (this_present_complexColumn || that_present_complexColumn) { - if (!(this_present_complexColumn && that_present_complexColumn)) - return false; - if (!this.complexColumn.equals(that.complexColumn)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_boolColumn = true; - list.add(present_boolColumn); - if (present_boolColumn) - list.add(boolColumn); - - boolean present_byteColumn = true; - list.add(present_byteColumn); - if (present_byteColumn) - list.add(byteColumn); - - boolean present_shortColumn = true; - list.add(present_shortColumn); - if (present_shortColumn) - list.add(shortColumn); - - boolean present_intColumn = true; - list.add(present_intColumn); - if (present_intColumn) - list.add(intColumn); - - boolean present_longColumn = true; - list.add(present_longColumn); - if (present_longColumn) - list.add(longColumn); - - boolean present_doubleColumn = true; - list.add(present_doubleColumn); - if (present_doubleColumn) - list.add(doubleColumn); - - boolean present_binaryColumn = true && (isSetBinaryColumn()); - list.add(present_binaryColumn); - if (present_binaryColumn) - list.add(binaryColumn); - - boolean present_stringColumn = true && (isSetStringColumn()); - list.add(present_stringColumn); - if (present_stringColumn) - list.add(stringColumn); - - boolean present_enumColumn = true && (isSetEnumColumn()); - list.add(present_enumColumn); - if (present_enumColumn) - list.add(enumColumn.getValue()); - - boolean present_maybeBoolColumn = true && (isSetMaybeBoolColumn()); - list.add(present_maybeBoolColumn); - if (present_maybeBoolColumn) - list.add(maybeBoolColumn); - - boolean present_maybeByteColumn = true && (isSetMaybeByteColumn()); - list.add(present_maybeByteColumn); - if (present_maybeByteColumn) - list.add(maybeByteColumn); - - boolean present_maybeShortColumn = true && (isSetMaybeShortColumn()); - list.add(present_maybeShortColumn); - if (present_maybeShortColumn) - list.add(maybeShortColumn); - - boolean present_maybeIntColumn = true && (isSetMaybeIntColumn()); - list.add(present_maybeIntColumn); - if (present_maybeIntColumn) - list.add(maybeIntColumn); - - boolean present_maybeLongColumn = true && (isSetMaybeLongColumn()); - list.add(present_maybeLongColumn); - if (present_maybeLongColumn) - list.add(maybeLongColumn); - - boolean present_maybeDoubleColumn = true && (isSetMaybeDoubleColumn()); - list.add(present_maybeDoubleColumn); - if (present_maybeDoubleColumn) - list.add(maybeDoubleColumn); - - boolean present_maybeBinaryColumn = true && (isSetMaybeBinaryColumn()); - list.add(present_maybeBinaryColumn); - if (present_maybeBinaryColumn) - list.add(maybeBinaryColumn); - - boolean present_maybeStringColumn = true && (isSetMaybeStringColumn()); - list.add(present_maybeStringColumn); - if (present_maybeStringColumn) - list.add(maybeStringColumn); - - boolean present_maybeEnumColumn = true && (isSetMaybeEnumColumn()); - list.add(present_maybeEnumColumn); - if (present_maybeEnumColumn) - list.add(maybeEnumColumn.getValue()); - - boolean present_stringsColumn = true && (isSetStringsColumn()); - list.add(present_stringsColumn); - if (present_stringsColumn) - list.add(stringsColumn); - - boolean present_intSetColumn = true && (isSetIntSetColumn()); - list.add(present_intSetColumn); - if (present_intSetColumn) - list.add(intSetColumn); - - boolean present_intToStringColumn = true && (isSetIntToStringColumn()); - list.add(present_intToStringColumn); - if (present_intToStringColumn) - list.add(intToStringColumn); - - boolean present_complexColumn = true && (isSetComplexColumn()); - list.add(present_complexColumn); - if (present_complexColumn) - list.add(complexColumn); - - return list.hashCode(); - } - - @Override - public int compareTo(ParquetThriftCompat other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetBoolColumn()).compareTo(other.isSetBoolColumn()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetBoolColumn()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.boolColumn, other.boolColumn); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetByteColumn()).compareTo(other.isSetByteColumn()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetByteColumn()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.byteColumn, other.byteColumn); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetShortColumn()).compareTo(other.isSetShortColumn()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetShortColumn()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.shortColumn, other.shortColumn); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetIntColumn()).compareTo(other.isSetIntColumn()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetIntColumn()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.intColumn, other.intColumn); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetLongColumn()).compareTo(other.isSetLongColumn()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetLongColumn()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.longColumn, other.longColumn); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetDoubleColumn()).compareTo(other.isSetDoubleColumn()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetDoubleColumn()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.doubleColumn, other.doubleColumn); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetBinaryColumn()).compareTo(other.isSetBinaryColumn()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetBinaryColumn()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.binaryColumn, other.binaryColumn); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetStringColumn()).compareTo(other.isSetStringColumn()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStringColumn()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stringColumn, other.stringColumn); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetEnumColumn()).compareTo(other.isSetEnumColumn()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetEnumColumn()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.enumColumn, other.enumColumn); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetMaybeBoolColumn()).compareTo(other.isSetMaybeBoolColumn()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetMaybeBoolColumn()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maybeBoolColumn, other.maybeBoolColumn); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetMaybeByteColumn()).compareTo(other.isSetMaybeByteColumn()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetMaybeByteColumn()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maybeByteColumn, other.maybeByteColumn); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetMaybeShortColumn()).compareTo(other.isSetMaybeShortColumn()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetMaybeShortColumn()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maybeShortColumn, other.maybeShortColumn); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetMaybeIntColumn()).compareTo(other.isSetMaybeIntColumn()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetMaybeIntColumn()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maybeIntColumn, other.maybeIntColumn); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetMaybeLongColumn()).compareTo(other.isSetMaybeLongColumn()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetMaybeLongColumn()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maybeLongColumn, other.maybeLongColumn); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetMaybeDoubleColumn()).compareTo(other.isSetMaybeDoubleColumn()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetMaybeDoubleColumn()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maybeDoubleColumn, other.maybeDoubleColumn); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetMaybeBinaryColumn()).compareTo(other.isSetMaybeBinaryColumn()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetMaybeBinaryColumn()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maybeBinaryColumn, other.maybeBinaryColumn); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetMaybeStringColumn()).compareTo(other.isSetMaybeStringColumn()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetMaybeStringColumn()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maybeStringColumn, other.maybeStringColumn); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetMaybeEnumColumn()).compareTo(other.isSetMaybeEnumColumn()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetMaybeEnumColumn()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maybeEnumColumn, other.maybeEnumColumn); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetStringsColumn()).compareTo(other.isSetStringsColumn()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStringsColumn()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stringsColumn, other.stringsColumn); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetIntSetColumn()).compareTo(other.isSetIntSetColumn()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetIntSetColumn()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.intSetColumn, other.intSetColumn); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetIntToStringColumn()).compareTo(other.isSetIntToStringColumn()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetIntToStringColumn()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.intToStringColumn, other.intToStringColumn); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetComplexColumn()).compareTo(other.isSetComplexColumn()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetComplexColumn()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.complexColumn, other.complexColumn); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("ParquetThriftCompat("); - boolean first = true; - - sb.append("boolColumn:"); - sb.append(this.boolColumn); - first = false; - if (!first) sb.append(", "); - sb.append("byteColumn:"); - sb.append(this.byteColumn); - first = false; - if (!first) sb.append(", "); - sb.append("shortColumn:"); - sb.append(this.shortColumn); - first = false; - if (!first) sb.append(", "); - sb.append("intColumn:"); - sb.append(this.intColumn); - first = false; - if (!first) sb.append(", "); - sb.append("longColumn:"); - sb.append(this.longColumn); - first = false; - if (!first) sb.append(", "); - sb.append("doubleColumn:"); - sb.append(this.doubleColumn); - first = false; - if (!first) sb.append(", "); - sb.append("binaryColumn:"); - if (this.binaryColumn == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.binaryColumn, sb); - } - first = false; - if (!first) sb.append(", "); - sb.append("stringColumn:"); - if (this.stringColumn == null) { - sb.append("null"); - } else { - sb.append(this.stringColumn); - } - first = false; - if (!first) sb.append(", "); - sb.append("enumColumn:"); - if (this.enumColumn == null) { - sb.append("null"); - } else { - sb.append(this.enumColumn); - } - first = false; - if (isSetMaybeBoolColumn()) { - if (!first) sb.append(", "); - sb.append("maybeBoolColumn:"); - sb.append(this.maybeBoolColumn); - first = false; - } - if (isSetMaybeByteColumn()) { - if (!first) sb.append(", "); - sb.append("maybeByteColumn:"); - sb.append(this.maybeByteColumn); - first = false; - } - if (isSetMaybeShortColumn()) { - if (!first) sb.append(", "); - sb.append("maybeShortColumn:"); - sb.append(this.maybeShortColumn); - first = false; - } - if (isSetMaybeIntColumn()) { - if (!first) sb.append(", "); - sb.append("maybeIntColumn:"); - sb.append(this.maybeIntColumn); - first = false; - } - if (isSetMaybeLongColumn()) { - if (!first) sb.append(", "); - sb.append("maybeLongColumn:"); - sb.append(this.maybeLongColumn); - first = false; - } - if (isSetMaybeDoubleColumn()) { - if (!first) sb.append(", "); - sb.append("maybeDoubleColumn:"); - sb.append(this.maybeDoubleColumn); - first = false; - } - if (isSetMaybeBinaryColumn()) { - if (!first) sb.append(", "); - sb.append("maybeBinaryColumn:"); - if (this.maybeBinaryColumn == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.maybeBinaryColumn, sb); - } - first = false; - } - if (isSetMaybeStringColumn()) { - if (!first) sb.append(", "); - sb.append("maybeStringColumn:"); - if (this.maybeStringColumn == null) { - sb.append("null"); - } else { - sb.append(this.maybeStringColumn); - } - first = false; - } - if (isSetMaybeEnumColumn()) { - if (!first) sb.append(", "); - sb.append("maybeEnumColumn:"); - if (this.maybeEnumColumn == null) { - sb.append("null"); - } else { - sb.append(this.maybeEnumColumn); - } - first = false; - } - if (!first) sb.append(", "); - sb.append("stringsColumn:"); - if (this.stringsColumn == null) { - sb.append("null"); - } else { - sb.append(this.stringsColumn); - } - first = false; - if (!first) sb.append(", "); - sb.append("intSetColumn:"); - if (this.intSetColumn == null) { - sb.append("null"); - } else { - sb.append(this.intSetColumn); - } - first = false; - if (!first) sb.append(", "); - sb.append("intToStringColumn:"); - if (this.intToStringColumn == null) { - sb.append("null"); - } else { - sb.append(this.intToStringColumn); - } - first = false; - if (!first) sb.append(", "); - sb.append("complexColumn:"); - if (this.complexColumn == null) { - sb.append("null"); - } else { - sb.append(this.complexColumn); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // alas, we cannot check 'boolColumn' because it's a primitive and you chose the non-beans generator. - // alas, we cannot check 'byteColumn' because it's a primitive and you chose the non-beans generator. - // alas, we cannot check 'shortColumn' because it's a primitive and you chose the non-beans generator. - // alas, we cannot check 'intColumn' because it's a primitive and you chose the non-beans generator. - // alas, we cannot check 'longColumn' because it's a primitive and you chose the non-beans generator. - // alas, we cannot check 'doubleColumn' because it's a primitive and you chose the non-beans generator. - if (binaryColumn == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'binaryColumn' was not present! Struct: " + toString()); - } - if (stringColumn == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'stringColumn' was not present! Struct: " + toString()); - } - if (enumColumn == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'enumColumn' was not present! Struct: " + toString()); - } - if (stringsColumn == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'stringsColumn' was not present! Struct: " + toString()); - } - if (intSetColumn == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'intSetColumn' was not present! Struct: " + toString()); - } - if (intToStringColumn == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'intToStringColumn' was not present! Struct: " + toString()); - } - if (complexColumn == null) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'complexColumn' 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, 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 ParquetThriftCompatStandardSchemeFactory implements SchemeFactory { - public ParquetThriftCompatStandardScheme getScheme() { - return new ParquetThriftCompatStandardScheme(); - } - } - - private static class ParquetThriftCompatStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, ParquetThriftCompat 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: // BOOL_COLUMN - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.boolColumn = iprot.readBool(); - struct.setBoolColumnIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // BYTE_COLUMN - if (schemeField.type == org.apache.thrift.protocol.TType.BYTE) { - struct.byteColumn = iprot.readByte(); - struct.setByteColumnIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // SHORT_COLUMN - if (schemeField.type == org.apache.thrift.protocol.TType.I16) { - struct.shortColumn = iprot.readI16(); - struct.setShortColumnIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // INT_COLUMN - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.intColumn = iprot.readI32(); - struct.setIntColumnIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // LONG_COLUMN - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.longColumn = iprot.readI64(); - struct.setLongColumnIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 6: // DOUBLE_COLUMN - if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) { - struct.doubleColumn = iprot.readDouble(); - struct.setDoubleColumnIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 7: // BINARY_COLUMN - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.binaryColumn = iprot.readBinary(); - struct.setBinaryColumnIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 8: // STRING_COLUMN - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.stringColumn = iprot.readString(); - struct.setStringColumnIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 9: // ENUM_COLUMN - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.enumColumn = org.apache.spark.sql.parquet.test.thrift.Suit.findByValue(iprot.readI32()); - struct.setEnumColumnIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 10: // MAYBE_BOOL_COLUMN - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.maybeBoolColumn = iprot.readBool(); - struct.setMaybeBoolColumnIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 11: // MAYBE_BYTE_COLUMN - if (schemeField.type == org.apache.thrift.protocol.TType.BYTE) { - struct.maybeByteColumn = iprot.readByte(); - struct.setMaybeByteColumnIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 12: // MAYBE_SHORT_COLUMN - if (schemeField.type == org.apache.thrift.protocol.TType.I16) { - struct.maybeShortColumn = iprot.readI16(); - struct.setMaybeShortColumnIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 13: // MAYBE_INT_COLUMN - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.maybeIntColumn = iprot.readI32(); - struct.setMaybeIntColumnIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 14: // MAYBE_LONG_COLUMN - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.maybeLongColumn = iprot.readI64(); - struct.setMaybeLongColumnIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 15: // MAYBE_DOUBLE_COLUMN - if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) { - struct.maybeDoubleColumn = iprot.readDouble(); - struct.setMaybeDoubleColumnIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 16: // MAYBE_BINARY_COLUMN - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.maybeBinaryColumn = iprot.readBinary(); - struct.setMaybeBinaryColumnIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 17: // MAYBE_STRING_COLUMN - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.maybeStringColumn = iprot.readString(); - struct.setMaybeStringColumnIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 18: // MAYBE_ENUM_COLUMN - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.maybeEnumColumn = org.apache.spark.sql.parquet.test.thrift.Suit.findByValue(iprot.readI32()); - struct.setMaybeEnumColumnIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 19: // STRINGS_COLUMN - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list8 = iprot.readListBegin(); - struct.stringsColumn = new ArrayList(_list8.size); - String _elem9; - for (int _i10 = 0; _i10 < _list8.size; ++_i10) - { - _elem9 = iprot.readString(); - struct.stringsColumn.add(_elem9); - } - iprot.readListEnd(); - } - struct.setStringsColumnIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 20: // INT_SET_COLUMN - if (schemeField.type == org.apache.thrift.protocol.TType.SET) { - { - org.apache.thrift.protocol.TSet _set11 = iprot.readSetBegin(); - struct.intSetColumn = new HashSet(2*_set11.size); - int _elem12; - for (int _i13 = 0; _i13 < _set11.size; ++_i13) - { - _elem12 = iprot.readI32(); - struct.intSetColumn.add(_elem12); - } - iprot.readSetEnd(); - } - struct.setIntSetColumnIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 21: // INT_TO_STRING_COLUMN - if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map14 = iprot.readMapBegin(); - struct.intToStringColumn = new HashMap(2*_map14.size); - int _key15; - String _val16; - for (int _i17 = 0; _i17 < _map14.size; ++_i17) - { - _key15 = iprot.readI32(); - _val16 = iprot.readString(); - struct.intToStringColumn.put(_key15, _val16); - } - iprot.readMapEnd(); - } - struct.setIntToStringColumnIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 22: // COMPLEX_COLUMN - if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map18 = iprot.readMapBegin(); - struct.complexColumn = new HashMap>(2*_map18.size); - int _key19; - List _val20; - for (int _i21 = 0; _i21 < _map18.size; ++_i21) - { - _key19 = iprot.readI32(); - { - org.apache.thrift.protocol.TList _list22 = iprot.readListBegin(); - _val20 = new ArrayList(_list22.size); - Nested _elem23; - for (int _i24 = 0; _i24 < _list22.size; ++_i24) - { - _elem23 = new Nested(); - _elem23.read(iprot); - _val20.add(_elem23); - } - iprot.readListEnd(); - } - struct.complexColumn.put(_key19, _val20); - } - iprot.readMapEnd(); - } - struct.setComplexColumnIsSet(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.isSetBoolColumn()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'boolColumn' was not found in serialized data! Struct: " + toString()); - } - if (!struct.isSetByteColumn()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'byteColumn' was not found in serialized data! Struct: " + toString()); - } - if (!struct.isSetShortColumn()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'shortColumn' was not found in serialized data! Struct: " + toString()); - } - if (!struct.isSetIntColumn()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'intColumn' was not found in serialized data! Struct: " + toString()); - } - if (!struct.isSetLongColumn()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'longColumn' was not found in serialized data! Struct: " + toString()); - } - if (!struct.isSetDoubleColumn()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'doubleColumn' was not found in serialized data! Struct: " + toString()); - } - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, ParquetThriftCompat struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(BOOL_COLUMN_FIELD_DESC); - oprot.writeBool(struct.boolColumn); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(BYTE_COLUMN_FIELD_DESC); - oprot.writeByte(struct.byteColumn); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(SHORT_COLUMN_FIELD_DESC); - oprot.writeI16(struct.shortColumn); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(INT_COLUMN_FIELD_DESC); - oprot.writeI32(struct.intColumn); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(LONG_COLUMN_FIELD_DESC); - oprot.writeI64(struct.longColumn); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(DOUBLE_COLUMN_FIELD_DESC); - oprot.writeDouble(struct.doubleColumn); - oprot.writeFieldEnd(); - if (struct.binaryColumn != null) { - oprot.writeFieldBegin(BINARY_COLUMN_FIELD_DESC); - oprot.writeBinary(struct.binaryColumn); - oprot.writeFieldEnd(); - } - if (struct.stringColumn != null) { - oprot.writeFieldBegin(STRING_COLUMN_FIELD_DESC); - oprot.writeString(struct.stringColumn); - oprot.writeFieldEnd(); - } - if (struct.enumColumn != null) { - oprot.writeFieldBegin(ENUM_COLUMN_FIELD_DESC); - oprot.writeI32(struct.enumColumn.getValue()); - oprot.writeFieldEnd(); - } - if (struct.isSetMaybeBoolColumn()) { - oprot.writeFieldBegin(MAYBE_BOOL_COLUMN_FIELD_DESC); - oprot.writeBool(struct.maybeBoolColumn); - oprot.writeFieldEnd(); - } - if (struct.isSetMaybeByteColumn()) { - oprot.writeFieldBegin(MAYBE_BYTE_COLUMN_FIELD_DESC); - oprot.writeByte(struct.maybeByteColumn); - oprot.writeFieldEnd(); - } - if (struct.isSetMaybeShortColumn()) { - oprot.writeFieldBegin(MAYBE_SHORT_COLUMN_FIELD_DESC); - oprot.writeI16(struct.maybeShortColumn); - oprot.writeFieldEnd(); - } - if (struct.isSetMaybeIntColumn()) { - oprot.writeFieldBegin(MAYBE_INT_COLUMN_FIELD_DESC); - oprot.writeI32(struct.maybeIntColumn); - oprot.writeFieldEnd(); - } - if (struct.isSetMaybeLongColumn()) { - oprot.writeFieldBegin(MAYBE_LONG_COLUMN_FIELD_DESC); - oprot.writeI64(struct.maybeLongColumn); - oprot.writeFieldEnd(); - } - if (struct.isSetMaybeDoubleColumn()) { - oprot.writeFieldBegin(MAYBE_DOUBLE_COLUMN_FIELD_DESC); - oprot.writeDouble(struct.maybeDoubleColumn); - oprot.writeFieldEnd(); - } - if (struct.maybeBinaryColumn != null) { - if (struct.isSetMaybeBinaryColumn()) { - oprot.writeFieldBegin(MAYBE_BINARY_COLUMN_FIELD_DESC); - oprot.writeBinary(struct.maybeBinaryColumn); - oprot.writeFieldEnd(); - } - } - if (struct.maybeStringColumn != null) { - if (struct.isSetMaybeStringColumn()) { - oprot.writeFieldBegin(MAYBE_STRING_COLUMN_FIELD_DESC); - oprot.writeString(struct.maybeStringColumn); - oprot.writeFieldEnd(); - } - } - if (struct.maybeEnumColumn != null) { - if (struct.isSetMaybeEnumColumn()) { - oprot.writeFieldBegin(MAYBE_ENUM_COLUMN_FIELD_DESC); - oprot.writeI32(struct.maybeEnumColumn.getValue()); - oprot.writeFieldEnd(); - } - } - if (struct.stringsColumn != null) { - oprot.writeFieldBegin(STRINGS_COLUMN_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.stringsColumn.size())); - for (String _iter25 : struct.stringsColumn) - { - oprot.writeString(_iter25); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (struct.intSetColumn != null) { - oprot.writeFieldBegin(INT_SET_COLUMN_FIELD_DESC); - { - oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I32, struct.intSetColumn.size())); - for (int _iter26 : struct.intSetColumn) - { - oprot.writeI32(_iter26); - } - oprot.writeSetEnd(); - } - oprot.writeFieldEnd(); - } - if (struct.intToStringColumn != null) { - oprot.writeFieldBegin(INT_TO_STRING_COLUMN_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.STRING, struct.intToStringColumn.size())); - for (Map.Entry _iter27 : struct.intToStringColumn.entrySet()) - { - oprot.writeI32(_iter27.getKey()); - oprot.writeString(_iter27.getValue()); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - if (struct.complexColumn != null) { - oprot.writeFieldBegin(COMPLEX_COLUMN_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.LIST, struct.complexColumn.size())); - for (Map.Entry> _iter28 : struct.complexColumn.entrySet()) - { - oprot.writeI32(_iter28.getKey()); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, _iter28.getValue().size())); - for (Nested _iter29 : _iter28.getValue()) - { - _iter29.write(oprot); - } - oprot.writeListEnd(); - } - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class ParquetThriftCompatTupleSchemeFactory implements SchemeFactory { - public ParquetThriftCompatTupleScheme getScheme() { - return new ParquetThriftCompatTupleScheme(); - } - } - - private static class ParquetThriftCompatTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, ParquetThriftCompat struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - oprot.writeBool(struct.boolColumn); - oprot.writeByte(struct.byteColumn); - oprot.writeI16(struct.shortColumn); - oprot.writeI32(struct.intColumn); - oprot.writeI64(struct.longColumn); - oprot.writeDouble(struct.doubleColumn); - oprot.writeBinary(struct.binaryColumn); - oprot.writeString(struct.stringColumn); - oprot.writeI32(struct.enumColumn.getValue()); - { - oprot.writeI32(struct.stringsColumn.size()); - for (String _iter30 : struct.stringsColumn) - { - oprot.writeString(_iter30); - } - } - { - oprot.writeI32(struct.intSetColumn.size()); - for (int _iter31 : struct.intSetColumn) - { - oprot.writeI32(_iter31); - } - } - { - oprot.writeI32(struct.intToStringColumn.size()); - for (Map.Entry _iter32 : struct.intToStringColumn.entrySet()) - { - oprot.writeI32(_iter32.getKey()); - oprot.writeString(_iter32.getValue()); - } - } - { - oprot.writeI32(struct.complexColumn.size()); - for (Map.Entry> _iter33 : struct.complexColumn.entrySet()) - { - oprot.writeI32(_iter33.getKey()); - { - oprot.writeI32(_iter33.getValue().size()); - for (Nested _iter34 : _iter33.getValue()) - { - _iter34.write(oprot); - } - } - } - } - BitSet optionals = new BitSet(); - if (struct.isSetMaybeBoolColumn()) { - optionals.set(0); - } - if (struct.isSetMaybeByteColumn()) { - optionals.set(1); - } - if (struct.isSetMaybeShortColumn()) { - optionals.set(2); - } - if (struct.isSetMaybeIntColumn()) { - optionals.set(3); - } - if (struct.isSetMaybeLongColumn()) { - optionals.set(4); - } - if (struct.isSetMaybeDoubleColumn()) { - optionals.set(5); - } - if (struct.isSetMaybeBinaryColumn()) { - optionals.set(6); - } - if (struct.isSetMaybeStringColumn()) { - optionals.set(7); - } - if (struct.isSetMaybeEnumColumn()) { - optionals.set(8); - } - oprot.writeBitSet(optionals, 9); - if (struct.isSetMaybeBoolColumn()) { - oprot.writeBool(struct.maybeBoolColumn); - } - if (struct.isSetMaybeByteColumn()) { - oprot.writeByte(struct.maybeByteColumn); - } - if (struct.isSetMaybeShortColumn()) { - oprot.writeI16(struct.maybeShortColumn); - } - if (struct.isSetMaybeIntColumn()) { - oprot.writeI32(struct.maybeIntColumn); - } - if (struct.isSetMaybeLongColumn()) { - oprot.writeI64(struct.maybeLongColumn); - } - if (struct.isSetMaybeDoubleColumn()) { - oprot.writeDouble(struct.maybeDoubleColumn); - } - if (struct.isSetMaybeBinaryColumn()) { - oprot.writeBinary(struct.maybeBinaryColumn); - } - if (struct.isSetMaybeStringColumn()) { - oprot.writeString(struct.maybeStringColumn); - } - if (struct.isSetMaybeEnumColumn()) { - oprot.writeI32(struct.maybeEnumColumn.getValue()); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, ParquetThriftCompat struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.boolColumn = iprot.readBool(); - struct.setBoolColumnIsSet(true); - struct.byteColumn = iprot.readByte(); - struct.setByteColumnIsSet(true); - struct.shortColumn = iprot.readI16(); - struct.setShortColumnIsSet(true); - struct.intColumn = iprot.readI32(); - struct.setIntColumnIsSet(true); - struct.longColumn = iprot.readI64(); - struct.setLongColumnIsSet(true); - struct.doubleColumn = iprot.readDouble(); - struct.setDoubleColumnIsSet(true); - struct.binaryColumn = iprot.readBinary(); - struct.setBinaryColumnIsSet(true); - struct.stringColumn = iprot.readString(); - struct.setStringColumnIsSet(true); - struct.enumColumn = org.apache.spark.sql.parquet.test.thrift.Suit.findByValue(iprot.readI32()); - struct.setEnumColumnIsSet(true); - { - org.apache.thrift.protocol.TList _list35 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.stringsColumn = new ArrayList(_list35.size); - String _elem36; - for (int _i37 = 0; _i37 < _list35.size; ++_i37) - { - _elem36 = iprot.readString(); - struct.stringsColumn.add(_elem36); - } - } - struct.setStringsColumnIsSet(true); - { - org.apache.thrift.protocol.TSet _set38 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I32, iprot.readI32()); - struct.intSetColumn = new HashSet(2*_set38.size); - int _elem39; - for (int _i40 = 0; _i40 < _set38.size; ++_i40) - { - _elem39 = iprot.readI32(); - struct.intSetColumn.add(_elem39); - } - } - struct.setIntSetColumnIsSet(true); - { - org.apache.thrift.protocol.TMap _map41 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.intToStringColumn = new HashMap(2*_map41.size); - int _key42; - String _val43; - for (int _i44 = 0; _i44 < _map41.size; ++_i44) - { - _key42 = iprot.readI32(); - _val43 = iprot.readString(); - struct.intToStringColumn.put(_key42, _val43); - } - } - struct.setIntToStringColumnIsSet(true); - { - org.apache.thrift.protocol.TMap _map45 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.LIST, iprot.readI32()); - struct.complexColumn = new HashMap>(2*_map45.size); - int _key46; - List _val47; - for (int _i48 = 0; _i48 < _map45.size; ++_i48) - { - _key46 = iprot.readI32(); - { - org.apache.thrift.protocol.TList _list49 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - _val47 = new ArrayList(_list49.size); - Nested _elem50; - for (int _i51 = 0; _i51 < _list49.size; ++_i51) - { - _elem50 = new Nested(); - _elem50.read(iprot); - _val47.add(_elem50); - } - } - struct.complexColumn.put(_key46, _val47); - } - } - struct.setComplexColumnIsSet(true); - BitSet incoming = iprot.readBitSet(9); - if (incoming.get(0)) { - struct.maybeBoolColumn = iprot.readBool(); - struct.setMaybeBoolColumnIsSet(true); - } - if (incoming.get(1)) { - struct.maybeByteColumn = iprot.readByte(); - struct.setMaybeByteColumnIsSet(true); - } - if (incoming.get(2)) { - struct.maybeShortColumn = iprot.readI16(); - struct.setMaybeShortColumnIsSet(true); - } - if (incoming.get(3)) { - struct.maybeIntColumn = iprot.readI32(); - struct.setMaybeIntColumnIsSet(true); - } - if (incoming.get(4)) { - struct.maybeLongColumn = iprot.readI64(); - struct.setMaybeLongColumnIsSet(true); - } - if (incoming.get(5)) { - struct.maybeDoubleColumn = iprot.readDouble(); - struct.setMaybeDoubleColumnIsSet(true); - } - if (incoming.get(6)) { - struct.maybeBinaryColumn = iprot.readBinary(); - struct.setMaybeBinaryColumnIsSet(true); - } - if (incoming.get(7)) { - struct.maybeStringColumn = iprot.readString(); - struct.setMaybeStringColumnIsSet(true); - } - if (incoming.get(8)) { - struct.maybeEnumColumn = org.apache.spark.sql.parquet.test.thrift.Suit.findByValue(iprot.readI32()); - struct.setMaybeEnumColumnIsSet(true); - } - } - } - -} - diff --git a/sql/core/src/test/gen-java/org/apache/spark/sql/parquet/test/thrift/Suit.java b/sql/core/src/test/gen-java/org/apache/spark/sql/parquet/test/thrift/Suit.java deleted file mode 100644 index 5315c6aae9..0000000000 --- a/sql/core/src/test/gen-java/org/apache/spark/sql/parquet/test/thrift/Suit.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.2) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.sql.parquet.test.thrift; - - -import java.util.Map; -import java.util.HashMap; -import org.apache.thrift.TEnum; - -public enum Suit implements org.apache.thrift.TEnum { - SPADES(0), - HEARTS(1), - DIAMONDS(2), - CLUBS(3); - - private final int value; - - private Suit(int value) { - this.value = value; - } - - /** - * Get the integer value of this enum value, as defined in the Thrift IDL. - */ - public int getValue() { - return value; - } - - /** - * Find a the enum type by its integer value, as defined in the Thrift IDL. - * @return null if the value is not found. - */ - public static Suit findByValue(int value) { - switch (value) { - case 0: - return SPADES; - case 1: - return HEARTS; - case 2: - return DIAMONDS; - case 3: - return CLUBS; - default: - return null; - } - } -} diff --git a/sql/core/src/test/resources/parquet-thrift-compat.snappy.parquet b/sql/core/src/test/resources/parquet-thrift-compat.snappy.parquet new file mode 100755 index 0000000000..837e4876ee Binary files /dev/null and b/sql/core/src/test/resources/parquet-thrift-compat.snappy.parquet differ diff --git a/sql/core/src/test/scala/org/apache/spark/sql/parquet/ParquetThriftCompatibilitySuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/parquet/ParquetThriftCompatibilitySuite.scala index d22066cabc..1c532d7879 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/parquet/ParquetThriftCompatibilitySuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/parquet/ParquetThriftCompatibilitySuite.scala @@ -17,16 +17,6 @@ package org.apache.spark.sql.parquet -import java.nio.ByteBuffer -import java.util.{List => JList, Map => JMap} - -import scala.collection.JavaConversions._ - -import org.apache.hadoop.fs.Path -import org.apache.parquet.hadoop.metadata.CompressionCodecName -import org.apache.parquet.thrift.ThriftParquetWriter - -import org.apache.spark.sql.parquet.test.thrift.{Nested, ParquetThriftCompat, Suit} import org.apache.spark.sql.test.TestSQLContext import org.apache.spark.sql.{Row, SQLContext} @@ -35,28 +25,20 @@ class ParquetThriftCompatibilitySuite extends ParquetCompatibilityTest { override val sqlContext: SQLContext = TestSQLContext - override protected def beforeAll(): Unit = { - super.beforeAll() - - val writer = - new ThriftParquetWriter[ParquetThriftCompat]( - new Path(parquetStore.getCanonicalPath), - classOf[ParquetThriftCompat], - CompressionCodecName.SNAPPY) - - (0 until 10).foreach(i => writer.write(makeParquetThriftCompat(i))) - writer.close() - } + private val parquetFilePath = + Thread.currentThread().getContextClassLoader.getResource("parquet-thrift-compat.snappy.parquet") test("Read Parquet file generated by parquet-thrift") { logInfo( s"""Schema of the Parquet file written by parquet-thrift: - |${readParquetSchema(parquetStore.getCanonicalPath)} + |${readParquetSchema(parquetFilePath.toString)} """.stripMargin) - checkAnswer(sqlContext.read.parquet(parquetStore.getCanonicalPath), (0 until 10).map { i => + checkAnswer(sqlContext.read.parquet(parquetFilePath.toString), (0 until 10).map { i => def nullable[T <: AnyRef]: ( => T) => T = makeNullable[T](i) + val suits = Array("SPADES", "HEARTS", "DIAMONDS", "CLUBS") + Row( i % 2 == 0, i.toByte, @@ -70,7 +52,7 @@ class ParquetThriftCompatibilitySuite extends ParquetCompatibilityTest { s"val_$i", s"val_$i", // Thrift ENUM values are converted to Parquet binaries containing UTF-8 strings - Suit.values()(i % 4).name(), + suits(i % 4), nullable(i % 2 == 0: java.lang.Boolean), nullable(i.toByte: java.lang.Byte), @@ -80,7 +62,7 @@ class ParquetThriftCompatibilitySuite extends ParquetCompatibilityTest { nullable(i.toDouble + 0.2d: java.lang.Double), nullable(s"val_$i"), nullable(s"val_$i"), - nullable(Suit.values()(i % 4).name()), + nullable(suits(i % 4)), Seq.tabulate(3)(n => s"arr_${i + n}"), // Thrift `SET`s are converted to Parquet `LIST`s @@ -93,48 +75,4 @@ class ParquetThriftCompatibilitySuite extends ParquetCompatibilityTest { }.toMap) }) } - - def makeParquetThriftCompat(i: Int): ParquetThriftCompat = { - def makeComplexColumn(i: Int): JMap[Integer, JList[Nested]] = { - mapAsJavaMap(Seq.tabulate(3) { n => - (i + n: Integer) -> seqAsJavaList(Seq.tabulate(3) { m => - new Nested( - seqAsJavaList(Seq.tabulate(3)(j => i + j + m)), - s"val_${i + m}") - }) - }.toMap) - } - - val value = - new ParquetThriftCompat( - i % 2 == 0, - i.toByte, - (i + 1).toShort, - i + 2, - i.toLong * 10, - i.toDouble + 0.2d, - ByteBuffer.wrap(s"val_$i".getBytes), - s"val_$i", - Suit.values()(i % 4), - - seqAsJavaList(Seq.tabulate(3)(n => s"arr_${i + n}")), - setAsJavaSet(Set(i)), - mapAsJavaMap(Seq.tabulate(3)(n => (i + n: Integer) -> s"val_${i + n}").toMap), - makeComplexColumn(i)) - - if (i % 3 == 0) { - value - } else { - value - .setMaybeBoolColumn(i % 2 == 0) - .setMaybeByteColumn(i.toByte) - .setMaybeShortColumn((i + 1).toShort) - .setMaybeIntColumn(i + 2) - .setMaybeLongColumn(i.toLong * 10) - .setMaybeDoubleColumn(i.toDouble + 0.2d) - .setMaybeBinaryColumn(ByteBuffer.wrap(s"val_$i".getBytes)) - .setMaybeStringColumn(s"val_$i") - .setMaybeEnumColumn(Suit.values()(i % 4)) - } - } } -- cgit v1.2.3