You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by cw...@apache.org on 2014/01/03 02:34:10 UTC
svn commit: r1554989 [5/6] - in /hive/trunk:
itests/hive-unit/src/test/java/org/apache/hive/jdbc/miniHS2/
jdbc/src/java/org/apache/hive/jdbc/
ql/src/java/org/apache/hadoop/hive/ql/exec/
serde/src/java/org/apache/hadoop/hive/serde2/ service/if/ service/...
Added: hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TStringColumn.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TStringColumn.java?rev=1554989&view=auto
==============================================================================
--- hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TStringColumn.java (added)
+++ hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TStringColumn.java Fri Jan 3 01:34:08 2014
@@ -0,0 +1,548 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+package org.apache.hive.service.cli.thrift;
+
+import org.apache.commons.lang.builder.HashCodeBuilder;
+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 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 org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class TStringColumn implements org.apache.thrift.TBase<TStringColumn, TStringColumn._Fields>, java.io.Serializable, Cloneable {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TStringColumn");
+
+ private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1);
+ private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new TStringColumnStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new TStringColumnTupleSchemeFactory());
+ }
+
+ private List<String> values; // required
+ private ByteBuffer nulls; // 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 {
+ VALUES((short)1, "values"),
+ NULLS((short)2, "nulls");
+
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ 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: // VALUES
+ return VALUES;
+ case 2: // NULLS
+ return NULLS;
+ 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.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", 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.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TStringColumn.class, metaDataMap);
+ }
+
+ public TStringColumn() {
+ }
+
+ public TStringColumn(
+ List<String> values,
+ ByteBuffer nulls)
+ {
+ this();
+ this.values = values;
+ this.nulls = nulls;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public TStringColumn(TStringColumn other) {
+ if (other.isSetValues()) {
+ List<String> __this__values = new ArrayList<String>();
+ for (String other_element : other.values) {
+ __this__values.add(other_element);
+ }
+ this.values = __this__values;
+ }
+ if (other.isSetNulls()) {
+ this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls);
+;
+ }
+ }
+
+ public TStringColumn deepCopy() {
+ return new TStringColumn(this);
+ }
+
+ @Override
+ public void clear() {
+ this.values = null;
+ this.nulls = null;
+ }
+
+ public int getValuesSize() {
+ return (this.values == null) ? 0 : this.values.size();
+ }
+
+ public java.util.Iterator<String> getValuesIterator() {
+ return (this.values == null) ? null : this.values.iterator();
+ }
+
+ public void addToValues(String elem) {
+ if (this.values == null) {
+ this.values = new ArrayList<String>();
+ }
+ this.values.add(elem);
+ }
+
+ public List<String> getValues() {
+ return this.values;
+ }
+
+ public void setValues(List<String> values) {
+ this.values = values;
+ }
+
+ public void unsetValues() {
+ this.values = null;
+ }
+
+ /** Returns true if field values is set (has been assigned a value) and false otherwise */
+ public boolean isSetValues() {
+ return this.values != null;
+ }
+
+ public void setValuesIsSet(boolean value) {
+ if (!value) {
+ this.values = null;
+ }
+ }
+
+ public byte[] getNulls() {
+ setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls));
+ return nulls == null ? null : nulls.array();
+ }
+
+ public ByteBuffer bufferForNulls() {
+ return nulls;
+ }
+
+ public void setNulls(byte[] nulls) {
+ setNulls(nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(nulls));
+ }
+
+ public void setNulls(ByteBuffer nulls) {
+ this.nulls = nulls;
+ }
+
+ public void unsetNulls() {
+ this.nulls = null;
+ }
+
+ /** Returns true if field nulls is set (has been assigned a value) and false otherwise */
+ public boolean isSetNulls() {
+ return this.nulls != null;
+ }
+
+ public void setNullsIsSet(boolean value) {
+ if (!value) {
+ this.nulls = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case VALUES:
+ if (value == null) {
+ unsetValues();
+ } else {
+ setValues((List<String>)value);
+ }
+ break;
+
+ case NULLS:
+ if (value == null) {
+ unsetNulls();
+ } else {
+ setNulls((ByteBuffer)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case VALUES:
+ return getValues();
+
+ case NULLS:
+ return getNulls();
+
+ }
+ 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 VALUES:
+ return isSetValues();
+ case NULLS:
+ return isSetNulls();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof TStringColumn)
+ return this.equals((TStringColumn)that);
+ return false;
+ }
+
+ public boolean equals(TStringColumn that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_values = true && this.isSetValues();
+ boolean that_present_values = true && that.isSetValues();
+ if (this_present_values || that_present_values) {
+ if (!(this_present_values && that_present_values))
+ return false;
+ if (!this.values.equals(that.values))
+ return false;
+ }
+
+ boolean this_present_nulls = true && this.isSetNulls();
+ boolean that_present_nulls = true && that.isSetNulls();
+ if (this_present_nulls || that_present_nulls) {
+ if (!(this_present_nulls && that_present_nulls))
+ return false;
+ if (!this.nulls.equals(that.nulls))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ HashCodeBuilder builder = new HashCodeBuilder();
+
+ boolean present_values = true && (isSetValues());
+ builder.append(present_values);
+ if (present_values)
+ builder.append(values);
+
+ boolean present_nulls = true && (isSetNulls());
+ builder.append(present_nulls);
+ if (present_nulls)
+ builder.append(nulls);
+
+ return builder.toHashCode();
+ }
+
+ public int compareTo(TStringColumn other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+ TStringColumn typedOther = (TStringColumn)other;
+
+ lastComparison = Boolean.valueOf(isSetValues()).compareTo(typedOther.isSetValues());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetValues()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, typedOther.values);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetNulls()).compareTo(typedOther.isSetNulls());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetNulls()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, typedOther.nulls);
+ 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("TStringColumn(");
+ boolean first = true;
+
+ sb.append("values:");
+ if (this.values == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.values);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("nulls:");
+ if (this.nulls == null) {
+ sb.append("null");
+ } else {
+ org.apache.thrift.TBaseHelper.toString(this.nulls, sb);
+ }
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ if (!isSetValues()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString());
+ }
+
+ if (!isSetNulls()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! 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 TStringColumnStandardSchemeFactory implements SchemeFactory {
+ public TStringColumnStandardScheme getScheme() {
+ return new TStringColumnStandardScheme();
+ }
+ }
+
+ private static class TStringColumnStandardScheme extends StandardScheme<TStringColumn> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, TStringColumn 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: // VALUES
+ if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
+ {
+ org.apache.thrift.protocol.TList _list158 = iprot.readListBegin();
+ struct.values = new ArrayList<String>(_list158.size);
+ for (int _i159 = 0; _i159 < _list158.size; ++_i159)
+ {
+ String _elem160; // required
+ _elem160 = iprot.readString();
+ struct.values.add(_elem160);
+ }
+ iprot.readListEnd();
+ }
+ struct.setValuesIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // NULLS
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.nulls = iprot.readBinary();
+ struct.setNullsIsSet(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();
+ struct.validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, TStringColumn struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.values != null) {
+ oprot.writeFieldBegin(VALUES_FIELD_DESC);
+ {
+ oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.values.size()));
+ for (String _iter161 : struct.values)
+ {
+ oprot.writeString(_iter161);
+ }
+ oprot.writeListEnd();
+ }
+ oprot.writeFieldEnd();
+ }
+ if (struct.nulls != null) {
+ oprot.writeFieldBegin(NULLS_FIELD_DESC);
+ oprot.writeBinary(struct.nulls);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class TStringColumnTupleSchemeFactory implements SchemeFactory {
+ public TStringColumnTupleScheme getScheme() {
+ return new TStringColumnTupleScheme();
+ }
+ }
+
+ private static class TStringColumnTupleScheme extends TupleScheme<TStringColumn> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, TStringColumn struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ {
+ oprot.writeI32(struct.values.size());
+ for (String _iter162 : struct.values)
+ {
+ oprot.writeString(_iter162);
+ }
+ }
+ oprot.writeBinary(struct.nulls);
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, TStringColumn struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ {
+ org.apache.thrift.protocol.TList _list163 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
+ struct.values = new ArrayList<String>(_list163.size);
+ for (int _i164 = 0; _i164 < _list163.size; ++_i164)
+ {
+ String _elem165; // required
+ _elem165 = iprot.readString();
+ struct.values.add(_elem165);
+ }
+ }
+ struct.setValuesIsSet(true);
+ struct.nulls = iprot.readBinary();
+ struct.setNullsIsSet(true);
+ }
+ }
+
+}
+
Modified: hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TTypeQualifiers.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TTypeQualifiers.java?rev=1554989&r1=1554988&r2=1554989&view=diff
==============================================================================
--- hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TTypeQualifiers.java (original)
+++ hive/trunk/service/src/gen/thrift/gen-javabean/org/apache/hive/service/cli/thrift/TTypeQualifiers.java Fri Jan 3 01:34:08 2014
@@ -360,7 +360,7 @@ public class TTypeQualifiers implements
for (int _i1 = 0; _i1 < _map0.size; ++_i1)
{
String _key2; // required
- TTypeQualifierValue _val3; // required
+ TTypeQualifierValue _val3; // optional
_key2 = iprot.readString();
_val3 = new TTypeQualifierValue();
_val3.read(iprot);
@@ -435,7 +435,7 @@ public class TTypeQualifiers implements
for (int _i7 = 0; _i7 < _map6.size; ++_i7)
{
String _key8; // required
- TTypeQualifierValue _val9; // required
+ TTypeQualifierValue _val9; // optional
_key8 = iprot.readString();
_val9 = new TTypeQualifierValue();
_val9.read(iprot);
Modified: hive/trunk/service/src/gen/thrift/gen-py/TCLIService/ttypes.py
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/gen/thrift/gen-py/TCLIService/ttypes.py?rev=1554989&r1=1554988&r2=1554989&view=diff
==============================================================================
--- hive/trunk/service/src/gen/thrift/gen-py/TCLIService/ttypes.py (original)
+++ hive/trunk/service/src/gen/thrift/gen-py/TCLIService/ttypes.py Fri Jan 3 01:34:08 2014
@@ -22,6 +22,7 @@ class TProtocolVersion:
HIVE_CLI_SERVICE_PROTOCOL_V3 = 2
HIVE_CLI_SERVICE_PROTOCOL_V4 = 3
HIVE_CLI_SERVICE_PROTOCOL_V5 = 4
+ HIVE_CLI_SERVICE_PROTOCOL_V6 = 5
_VALUES_TO_NAMES = {
0: "HIVE_CLI_SERVICE_PROTOCOL_V1",
@@ -29,6 +30,7 @@ class TProtocolVersion:
2: "HIVE_CLI_SERVICE_PROTOCOL_V3",
3: "HIVE_CLI_SERVICE_PROTOCOL_V4",
4: "HIVE_CLI_SERVICE_PROTOCOL_V5",
+ 5: "HIVE_CLI_SERVICE_PROTOCOL_V6",
}
_NAMES_TO_VALUES = {
@@ -37,6 +39,7 @@ class TProtocolVersion:
"HIVE_CLI_SERVICE_PROTOCOL_V3": 2,
"HIVE_CLI_SERVICE_PROTOCOL_V4": 3,
"HIVE_CLI_SERVICE_PROTOCOL_V5": 4,
+ "HIVE_CLI_SERVICE_PROTOCOL_V6": 5,
}
class TTypeId:
@@ -2133,6 +2136,830 @@ class TRow:
def __ne__(self, other):
return not (self == other)
+class TBoolColumn:
+ """
+ Attributes:
+ - values
+ - nulls
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.LIST, 'values', (TType.BOOL,None), None, ), # 1
+ (2, TType.STRING, 'nulls', None, None, ), # 2
+ )
+
+ def __init__(self, values=None, nulls=None,):
+ self.values = values
+ self.nulls = nulls
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.LIST:
+ self.values = []
+ (_etype100, _size97) = iprot.readListBegin()
+ for _i101 in xrange(_size97):
+ _elem102 = iprot.readBool();
+ self.values.append(_elem102)
+ iprot.readListEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRING:
+ self.nulls = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('TBoolColumn')
+ if self.values is not None:
+ oprot.writeFieldBegin('values', TType.LIST, 1)
+ oprot.writeListBegin(TType.BOOL, len(self.values))
+ for iter103 in self.values:
+ oprot.writeBool(iter103)
+ oprot.writeListEnd()
+ oprot.writeFieldEnd()
+ if self.nulls is not None:
+ oprot.writeFieldBegin('nulls', TType.STRING, 2)
+ oprot.writeString(self.nulls)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def validate(self):
+ if self.values is None:
+ raise TProtocol.TProtocolException(message='Required field values is unset!')
+ if self.nulls is None:
+ raise TProtocol.TProtocolException(message='Required field nulls is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class TByteColumn:
+ """
+ Attributes:
+ - values
+ - nulls
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.LIST, 'values', (TType.BYTE,None), None, ), # 1
+ (2, TType.STRING, 'nulls', None, None, ), # 2
+ )
+
+ def __init__(self, values=None, nulls=None,):
+ self.values = values
+ self.nulls = nulls
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.LIST:
+ self.values = []
+ (_etype107, _size104) = iprot.readListBegin()
+ for _i108 in xrange(_size104):
+ _elem109 = iprot.readByte();
+ self.values.append(_elem109)
+ iprot.readListEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRING:
+ self.nulls = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('TByteColumn')
+ if self.values is not None:
+ oprot.writeFieldBegin('values', TType.LIST, 1)
+ oprot.writeListBegin(TType.BYTE, len(self.values))
+ for iter110 in self.values:
+ oprot.writeByte(iter110)
+ oprot.writeListEnd()
+ oprot.writeFieldEnd()
+ if self.nulls is not None:
+ oprot.writeFieldBegin('nulls', TType.STRING, 2)
+ oprot.writeString(self.nulls)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def validate(self):
+ if self.values is None:
+ raise TProtocol.TProtocolException(message='Required field values is unset!')
+ if self.nulls is None:
+ raise TProtocol.TProtocolException(message='Required field nulls is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class TI16Column:
+ """
+ Attributes:
+ - values
+ - nulls
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.LIST, 'values', (TType.I16,None), None, ), # 1
+ (2, TType.STRING, 'nulls', None, None, ), # 2
+ )
+
+ def __init__(self, values=None, nulls=None,):
+ self.values = values
+ self.nulls = nulls
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.LIST:
+ self.values = []
+ (_etype114, _size111) = iprot.readListBegin()
+ for _i115 in xrange(_size111):
+ _elem116 = iprot.readI16();
+ self.values.append(_elem116)
+ iprot.readListEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRING:
+ self.nulls = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('TI16Column')
+ if self.values is not None:
+ oprot.writeFieldBegin('values', TType.LIST, 1)
+ oprot.writeListBegin(TType.I16, len(self.values))
+ for iter117 in self.values:
+ oprot.writeI16(iter117)
+ oprot.writeListEnd()
+ oprot.writeFieldEnd()
+ if self.nulls is not None:
+ oprot.writeFieldBegin('nulls', TType.STRING, 2)
+ oprot.writeString(self.nulls)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def validate(self):
+ if self.values is None:
+ raise TProtocol.TProtocolException(message='Required field values is unset!')
+ if self.nulls is None:
+ raise TProtocol.TProtocolException(message='Required field nulls is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class TI32Column:
+ """
+ Attributes:
+ - values
+ - nulls
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.LIST, 'values', (TType.I32,None), None, ), # 1
+ (2, TType.STRING, 'nulls', None, None, ), # 2
+ )
+
+ def __init__(self, values=None, nulls=None,):
+ self.values = values
+ self.nulls = nulls
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.LIST:
+ self.values = []
+ (_etype121, _size118) = iprot.readListBegin()
+ for _i122 in xrange(_size118):
+ _elem123 = iprot.readI32();
+ self.values.append(_elem123)
+ iprot.readListEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRING:
+ self.nulls = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('TI32Column')
+ if self.values is not None:
+ oprot.writeFieldBegin('values', TType.LIST, 1)
+ oprot.writeListBegin(TType.I32, len(self.values))
+ for iter124 in self.values:
+ oprot.writeI32(iter124)
+ oprot.writeListEnd()
+ oprot.writeFieldEnd()
+ if self.nulls is not None:
+ oprot.writeFieldBegin('nulls', TType.STRING, 2)
+ oprot.writeString(self.nulls)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def validate(self):
+ if self.values is None:
+ raise TProtocol.TProtocolException(message='Required field values is unset!')
+ if self.nulls is None:
+ raise TProtocol.TProtocolException(message='Required field nulls is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class TI64Column:
+ """
+ Attributes:
+ - values
+ - nulls
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.LIST, 'values', (TType.I64,None), None, ), # 1
+ (2, TType.STRING, 'nulls', None, None, ), # 2
+ )
+
+ def __init__(self, values=None, nulls=None,):
+ self.values = values
+ self.nulls = nulls
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.LIST:
+ self.values = []
+ (_etype128, _size125) = iprot.readListBegin()
+ for _i129 in xrange(_size125):
+ _elem130 = iprot.readI64();
+ self.values.append(_elem130)
+ iprot.readListEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRING:
+ self.nulls = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('TI64Column')
+ if self.values is not None:
+ oprot.writeFieldBegin('values', TType.LIST, 1)
+ oprot.writeListBegin(TType.I64, len(self.values))
+ for iter131 in self.values:
+ oprot.writeI64(iter131)
+ oprot.writeListEnd()
+ oprot.writeFieldEnd()
+ if self.nulls is not None:
+ oprot.writeFieldBegin('nulls', TType.STRING, 2)
+ oprot.writeString(self.nulls)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def validate(self):
+ if self.values is None:
+ raise TProtocol.TProtocolException(message='Required field values is unset!')
+ if self.nulls is None:
+ raise TProtocol.TProtocolException(message='Required field nulls is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class TDoubleColumn:
+ """
+ Attributes:
+ - values
+ - nulls
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.LIST, 'values', (TType.DOUBLE,None), None, ), # 1
+ (2, TType.STRING, 'nulls', None, None, ), # 2
+ )
+
+ def __init__(self, values=None, nulls=None,):
+ self.values = values
+ self.nulls = nulls
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.LIST:
+ self.values = []
+ (_etype135, _size132) = iprot.readListBegin()
+ for _i136 in xrange(_size132):
+ _elem137 = iprot.readDouble();
+ self.values.append(_elem137)
+ iprot.readListEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRING:
+ self.nulls = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('TDoubleColumn')
+ if self.values is not None:
+ oprot.writeFieldBegin('values', TType.LIST, 1)
+ oprot.writeListBegin(TType.DOUBLE, len(self.values))
+ for iter138 in self.values:
+ oprot.writeDouble(iter138)
+ oprot.writeListEnd()
+ oprot.writeFieldEnd()
+ if self.nulls is not None:
+ oprot.writeFieldBegin('nulls', TType.STRING, 2)
+ oprot.writeString(self.nulls)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def validate(self):
+ if self.values is None:
+ raise TProtocol.TProtocolException(message='Required field values is unset!')
+ if self.nulls is None:
+ raise TProtocol.TProtocolException(message='Required field nulls is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class TStringColumn:
+ """
+ Attributes:
+ - values
+ - nulls
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.LIST, 'values', (TType.STRING,None), None, ), # 1
+ (2, TType.STRING, 'nulls', None, None, ), # 2
+ )
+
+ def __init__(self, values=None, nulls=None,):
+ self.values = values
+ self.nulls = nulls
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.LIST:
+ self.values = []
+ (_etype142, _size139) = iprot.readListBegin()
+ for _i143 in xrange(_size139):
+ _elem144 = iprot.readString();
+ self.values.append(_elem144)
+ iprot.readListEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRING:
+ self.nulls = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('TStringColumn')
+ if self.values is not None:
+ oprot.writeFieldBegin('values', TType.LIST, 1)
+ oprot.writeListBegin(TType.STRING, len(self.values))
+ for iter145 in self.values:
+ oprot.writeString(iter145)
+ oprot.writeListEnd()
+ oprot.writeFieldEnd()
+ if self.nulls is not None:
+ oprot.writeFieldBegin('nulls', TType.STRING, 2)
+ oprot.writeString(self.nulls)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def validate(self):
+ if self.values is None:
+ raise TProtocol.TProtocolException(message='Required field values is unset!')
+ if self.nulls is None:
+ raise TProtocol.TProtocolException(message='Required field nulls is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class TBinaryColumn:
+ """
+ Attributes:
+ - values
+ - nulls
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.LIST, 'values', (TType.STRING,None), None, ), # 1
+ (2, TType.STRING, 'nulls', None, None, ), # 2
+ )
+
+ def __init__(self, values=None, nulls=None,):
+ self.values = values
+ self.nulls = nulls
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.LIST:
+ self.values = []
+ (_etype149, _size146) = iprot.readListBegin()
+ for _i150 in xrange(_size146):
+ _elem151 = iprot.readString();
+ self.values.append(_elem151)
+ iprot.readListEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRING:
+ self.nulls = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('TBinaryColumn')
+ if self.values is not None:
+ oprot.writeFieldBegin('values', TType.LIST, 1)
+ oprot.writeListBegin(TType.STRING, len(self.values))
+ for iter152 in self.values:
+ oprot.writeString(iter152)
+ oprot.writeListEnd()
+ oprot.writeFieldEnd()
+ if self.nulls is not None:
+ oprot.writeFieldBegin('nulls', TType.STRING, 2)
+ oprot.writeString(self.nulls)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def validate(self):
+ if self.values is None:
+ raise TProtocol.TProtocolException(message='Required field values is unset!')
+ if self.nulls is None:
+ raise TProtocol.TProtocolException(message='Required field nulls is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class TColumn:
+ """
+ Attributes:
+ - boolVal
+ - byteVal
+ - i16Val
+ - i32Val
+ - i64Val
+ - doubleVal
+ - stringVal
+ - binaryVal
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRUCT, 'boolVal', (TBoolColumn, TBoolColumn.thrift_spec), None, ), # 1
+ (2, TType.STRUCT, 'byteVal', (TByteColumn, TByteColumn.thrift_spec), None, ), # 2
+ (3, TType.STRUCT, 'i16Val', (TI16Column, TI16Column.thrift_spec), None, ), # 3
+ (4, TType.STRUCT, 'i32Val', (TI32Column, TI32Column.thrift_spec), None, ), # 4
+ (5, TType.STRUCT, 'i64Val', (TI64Column, TI64Column.thrift_spec), None, ), # 5
+ (6, TType.STRUCT, 'doubleVal', (TDoubleColumn, TDoubleColumn.thrift_spec), None, ), # 6
+ (7, TType.STRUCT, 'stringVal', (TStringColumn, TStringColumn.thrift_spec), None, ), # 7
+ (8, TType.STRUCT, 'binaryVal', (TBinaryColumn, TBinaryColumn.thrift_spec), None, ), # 8
+ )
+
+ def __init__(self, boolVal=None, byteVal=None, i16Val=None, i32Val=None, i64Val=None, doubleVal=None, stringVal=None, binaryVal=None,):
+ self.boolVal = boolVal
+ self.byteVal = byteVal
+ self.i16Val = i16Val
+ self.i32Val = i32Val
+ self.i64Val = i64Val
+ self.doubleVal = doubleVal
+ self.stringVal = stringVal
+ self.binaryVal = binaryVal
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRUCT:
+ self.boolVal = TBoolColumn()
+ self.boolVal.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.byteVal = TByteColumn()
+ self.byteVal.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.STRUCT:
+ self.i16Val = TI16Column()
+ self.i16Val.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 4:
+ if ftype == TType.STRUCT:
+ self.i32Val = TI32Column()
+ self.i32Val.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 5:
+ if ftype == TType.STRUCT:
+ self.i64Val = TI64Column()
+ self.i64Val.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 6:
+ if ftype == TType.STRUCT:
+ self.doubleVal = TDoubleColumn()
+ self.doubleVal.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 7:
+ if ftype == TType.STRUCT:
+ self.stringVal = TStringColumn()
+ self.stringVal.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 8:
+ if ftype == TType.STRUCT:
+ self.binaryVal = TBinaryColumn()
+ self.binaryVal.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('TColumn')
+ if self.boolVal is not None:
+ oprot.writeFieldBegin('boolVal', TType.STRUCT, 1)
+ self.boolVal.write(oprot)
+ oprot.writeFieldEnd()
+ if self.byteVal is not None:
+ oprot.writeFieldBegin('byteVal', TType.STRUCT, 2)
+ self.byteVal.write(oprot)
+ oprot.writeFieldEnd()
+ if self.i16Val is not None:
+ oprot.writeFieldBegin('i16Val', TType.STRUCT, 3)
+ self.i16Val.write(oprot)
+ oprot.writeFieldEnd()
+ if self.i32Val is not None:
+ oprot.writeFieldBegin('i32Val', TType.STRUCT, 4)
+ self.i32Val.write(oprot)
+ oprot.writeFieldEnd()
+ if self.i64Val is not None:
+ oprot.writeFieldBegin('i64Val', TType.STRUCT, 5)
+ self.i64Val.write(oprot)
+ oprot.writeFieldEnd()
+ if self.doubleVal is not None:
+ oprot.writeFieldBegin('doubleVal', TType.STRUCT, 6)
+ self.doubleVal.write(oprot)
+ oprot.writeFieldEnd()
+ if self.stringVal is not None:
+ oprot.writeFieldBegin('stringVal', TType.STRUCT, 7)
+ self.stringVal.write(oprot)
+ oprot.writeFieldEnd()
+ if self.binaryVal is not None:
+ oprot.writeFieldBegin('binaryVal', TType.STRUCT, 8)
+ self.binaryVal.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
class TRowSet:
"""
Attributes:
@@ -2170,22 +2997,22 @@ class TRowSet:
elif fid == 2:
if ftype == TType.LIST:
self.rows = []
- (_etype100, _size97) = iprot.readListBegin()
- for _i101 in xrange(_size97):
- _elem102 = TRow()
- _elem102.read(iprot)
- self.rows.append(_elem102)
+ (_etype156, _size153) = iprot.readListBegin()
+ for _i157 in xrange(_size153):
+ _elem158 = TRow()
+ _elem158.read(iprot)
+ self.rows.append(_elem158)
iprot.readListEnd()
else:
iprot.skip(ftype)
elif fid == 3:
if ftype == TType.LIST:
self.columns = []
- (_etype106, _size103) = iprot.readListBegin()
- for _i107 in xrange(_size103):
- _elem108 = TColumn()
- _elem108.read(iprot)
- self.columns.append(_elem108)
+ (_etype162, _size159) = iprot.readListBegin()
+ for _i163 in xrange(_size159):
+ _elem164 = TColumn()
+ _elem164.read(iprot)
+ self.columns.append(_elem164)
iprot.readListEnd()
else:
iprot.skip(ftype)
@@ -2206,15 +3033,15 @@ class TRowSet:
if self.rows is not None:
oprot.writeFieldBegin('rows', TType.LIST, 2)
oprot.writeListBegin(TType.STRUCT, len(self.rows))
- for iter109 in self.rows:
- iter109.write(oprot)
+ for iter165 in self.rows:
+ iter165.write(oprot)
oprot.writeListEnd()
oprot.writeFieldEnd()
if self.columns is not None:
oprot.writeFieldBegin('columns', TType.LIST, 3)
oprot.writeListBegin(TType.STRUCT, len(self.columns))
- for iter110 in self.columns:
- iter110.write(oprot)
+ for iter166 in self.columns:
+ iter166.write(oprot)
oprot.writeListEnd()
oprot.writeFieldEnd()
oprot.writeFieldStop()
@@ -2282,10 +3109,10 @@ class TStatus:
elif fid == 2:
if ftype == TType.LIST:
self.infoMessages = []
- (_etype114, _size111) = iprot.readListBegin()
- for _i115 in xrange(_size111):
- _elem116 = iprot.readString();
- self.infoMessages.append(_elem116)
+ (_etype170, _size167) = iprot.readListBegin()
+ for _i171 in xrange(_size167):
+ _elem172 = iprot.readString();
+ self.infoMessages.append(_elem172)
iprot.readListEnd()
else:
iprot.skip(ftype)
@@ -2321,8 +3148,8 @@ class TStatus:
if self.infoMessages is not None:
oprot.writeFieldBegin('infoMessages', TType.LIST, 2)
oprot.writeListBegin(TType.STRING, len(self.infoMessages))
- for iter117 in self.infoMessages:
- oprot.writeString(iter117)
+ for iter173 in self.infoMessages:
+ oprot.writeString(iter173)
oprot.writeListEnd()
oprot.writeFieldEnd()
if self.sqlState is not None:
@@ -2610,7 +3437,7 @@ class TOpenSessionReq:
thrift_spec = (
None, # 0
- (1, TType.I32, 'client_protocol', None, 4, ), # 1
+ (1, TType.I32, 'client_protocol', None, 5, ), # 1
(2, TType.STRING, 'username', None, None, ), # 2
(3, TType.STRING, 'password', None, None, ), # 3
(4, TType.MAP, 'configuration', (TType.STRING,None,TType.STRING,None), None, ), # 4
@@ -2649,11 +3476,11 @@ class TOpenSessionReq:
elif fid == 4:
if ftype == TType.MAP:
self.configuration = {}
- (_ktype119, _vtype120, _size118 ) = iprot.readMapBegin()
- for _i122 in xrange(_size118):
- _key123 = iprot.readString();
- _val124 = iprot.readString();
- self.configuration[_key123] = _val124
+ (_ktype175, _vtype176, _size174 ) = iprot.readMapBegin()
+ for _i178 in xrange(_size174):
+ _key179 = iprot.readString();
+ _val180 = iprot.readString();
+ self.configuration[_key179] = _val180
iprot.readMapEnd()
else:
iprot.skip(ftype)
@@ -2682,9 +3509,9 @@ class TOpenSessionReq:
if self.configuration is not None:
oprot.writeFieldBegin('configuration', TType.MAP, 4)
oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.configuration))
- for kiter125,viter126 in self.configuration.items():
- oprot.writeString(kiter125)
- oprot.writeString(viter126)
+ for kiter181,viter182 in self.configuration.items():
+ oprot.writeString(kiter181)
+ oprot.writeString(viter182)
oprot.writeMapEnd()
oprot.writeFieldEnd()
oprot.writeFieldStop()
@@ -2719,7 +3546,7 @@ class TOpenSessionResp:
thrift_spec = (
None, # 0
(1, TType.STRUCT, 'status', (TStatus, TStatus.thrift_spec), None, ), # 1
- (2, TType.I32, 'serverProtocolVersion', None, 4, ), # 2
+ (2, TType.I32, 'serverProtocolVersion', None, 5, ), # 2
(3, TType.STRUCT, 'sessionHandle', (TSessionHandle, TSessionHandle.thrift_spec), None, ), # 3
(4, TType.MAP, 'configuration', (TType.STRING,None,TType.STRING,None), None, ), # 4
)
@@ -2759,11 +3586,11 @@ class TOpenSessionResp:
elif fid == 4:
if ftype == TType.MAP:
self.configuration = {}
- (_ktype128, _vtype129, _size127 ) = iprot.readMapBegin()
- for _i131 in xrange(_size127):
- _key132 = iprot.readString();
- _val133 = iprot.readString();
- self.configuration[_key132] = _val133
+ (_ktype184, _vtype185, _size183 ) = iprot.readMapBegin()
+ for _i187 in xrange(_size183):
+ _key188 = iprot.readString();
+ _val189 = iprot.readString();
+ self.configuration[_key188] = _val189
iprot.readMapEnd()
else:
iprot.skip(ftype)
@@ -2792,9 +3619,9 @@ class TOpenSessionResp:
if self.configuration is not None:
oprot.writeFieldBegin('configuration', TType.MAP, 4)
oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.configuration))
- for kiter134,viter135 in self.configuration.items():
- oprot.writeString(kiter134)
- oprot.writeString(viter135)
+ for kiter190,viter191 in self.configuration.items():
+ oprot.writeString(kiter190)
+ oprot.writeString(viter191)
oprot.writeMapEnd()
oprot.writeFieldEnd()
oprot.writeFieldStop()
@@ -3266,11 +4093,11 @@ class TExecuteStatementReq:
elif fid == 3:
if ftype == TType.MAP:
self.confOverlay = {}
- (_ktype137, _vtype138, _size136 ) = iprot.readMapBegin()
- for _i140 in xrange(_size136):
- _key141 = iprot.readString();
- _val142 = iprot.readString();
- self.confOverlay[_key141] = _val142
+ (_ktype193, _vtype194, _size192 ) = iprot.readMapBegin()
+ for _i196 in xrange(_size192):
+ _key197 = iprot.readString();
+ _val198 = iprot.readString();
+ self.confOverlay[_key197] = _val198
iprot.readMapEnd()
else:
iprot.skip(ftype)
@@ -3300,9 +4127,9 @@ class TExecuteStatementReq:
if self.confOverlay is not None:
oprot.writeFieldBegin('confOverlay', TType.MAP, 3)
oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.confOverlay))
- for kiter143,viter144 in self.confOverlay.items():
- oprot.writeString(kiter143)
- oprot.writeString(viter144)
+ for kiter199,viter200 in self.confOverlay.items():
+ oprot.writeString(kiter199)
+ oprot.writeString(viter200)
oprot.writeMapEnd()
oprot.writeFieldEnd()
if self.runAsync is not None:
@@ -3907,10 +4734,10 @@ class TGetTablesReq:
elif fid == 5:
if ftype == TType.LIST:
self.tableTypes = []
- (_etype148, _size145) = iprot.readListBegin()
- for _i149 in xrange(_size145):
- _elem150 = iprot.readString();
- self.tableTypes.append(_elem150)
+ (_etype204, _size201) = iprot.readListBegin()
+ for _i205 in xrange(_size201):
+ _elem206 = iprot.readString();
+ self.tableTypes.append(_elem206)
iprot.readListEnd()
else:
iprot.skip(ftype)
@@ -3943,8 +4770,8 @@ class TGetTablesReq:
if self.tableTypes is not None:
oprot.writeFieldBegin('tableTypes', TType.LIST, 5)
oprot.writeListBegin(TType.STRING, len(self.tableTypes))
- for iter151 in self.tableTypes:
- oprot.writeString(iter151)
+ for iter207 in self.tableTypes:
+ oprot.writeString(iter207)
oprot.writeListEnd()
oprot.writeFieldEnd()
oprot.writeFieldStop()
Modified: hive/trunk/service/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb?rev=1554989&r1=1554988&r2=1554989&view=diff
==============================================================================
--- hive/trunk/service/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb (original)
+++ hive/trunk/service/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb Fri Jan 3 01:34:08 2014
@@ -12,8 +12,9 @@ module TProtocolVersion
HIVE_CLI_SERVICE_PROTOCOL_V3 = 2
HIVE_CLI_SERVICE_PROTOCOL_V4 = 3
HIVE_CLI_SERVICE_PROTOCOL_V5 = 4
- VALUE_MAP = {0 => "HIVE_CLI_SERVICE_PROTOCOL_V1", 1 => "HIVE_CLI_SERVICE_PROTOCOL_V2", 2 => "HIVE_CLI_SERVICE_PROTOCOL_V3", 3 => "HIVE_CLI_SERVICE_PROTOCOL_V4", 4 => "HIVE_CLI_SERVICE_PROTOCOL_V5"}
- VALID_VALUES = Set.new([HIVE_CLI_SERVICE_PROTOCOL_V1, HIVE_CLI_SERVICE_PROTOCOL_V2, HIVE_CLI_SERVICE_PROTOCOL_V3, HIVE_CLI_SERVICE_PROTOCOL_V4, HIVE_CLI_SERVICE_PROTOCOL_V5]).freeze
+ HIVE_CLI_SERVICE_PROTOCOL_V6 = 5
+ VALUE_MAP = {0 => "HIVE_CLI_SERVICE_PROTOCOL_V1", 1 => "HIVE_CLI_SERVICE_PROTOCOL_V2", 2 => "HIVE_CLI_SERVICE_PROTOCOL_V3", 3 => "HIVE_CLI_SERVICE_PROTOCOL_V4", 4 => "HIVE_CLI_SERVICE_PROTOCOL_V5", 5 => "HIVE_CLI_SERVICE_PROTOCOL_V6"}
+ VALID_VALUES = Set.new([HIVE_CLI_SERVICE_PROTOCOL_V1, HIVE_CLI_SERVICE_PROTOCOL_V2, HIVE_CLI_SERVICE_PROTOCOL_V3, HIVE_CLI_SERVICE_PROTOCOL_V4, HIVE_CLI_SERVICE_PROTOCOL_V5, HIVE_CLI_SERVICE_PROTOCOL_V6]).freeze
end
module TTypeId
@@ -656,6 +657,231 @@ class TRow
::Thrift::Struct.generate_accessors self
end
+class TBoolColumn
+ include ::Thrift::Struct, ::Thrift::Struct_Union
+ VALUES = 1
+ NULLS = 2
+
+ FIELDS = {
+ VALUES => {:type => ::Thrift::Types::LIST, :name => 'values', :element => {:type => ::Thrift::Types::BOOL}},
+ NULLS => {:type => ::Thrift::Types::STRING, :name => 'nulls', :binary => true}
+ }
+
+ def struct_fields; FIELDS; end
+
+ def validate
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field values is unset!') unless @values
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field nulls is unset!') unless @nulls
+ end
+
+ ::Thrift::Struct.generate_accessors self
+end
+
+class TByteColumn
+ include ::Thrift::Struct, ::Thrift::Struct_Union
+ VALUES = 1
+ NULLS = 2
+
+ FIELDS = {
+ VALUES => {:type => ::Thrift::Types::LIST, :name => 'values', :element => {:type => ::Thrift::Types::BYTE}},
+ NULLS => {:type => ::Thrift::Types::STRING, :name => 'nulls', :binary => true}
+ }
+
+ def struct_fields; FIELDS; end
+
+ def validate
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field values is unset!') unless @values
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field nulls is unset!') unless @nulls
+ end
+
+ ::Thrift::Struct.generate_accessors self
+end
+
+class TI16Column
+ include ::Thrift::Struct, ::Thrift::Struct_Union
+ VALUES = 1
+ NULLS = 2
+
+ FIELDS = {
+ VALUES => {:type => ::Thrift::Types::LIST, :name => 'values', :element => {:type => ::Thrift::Types::I16}},
+ NULLS => {:type => ::Thrift::Types::STRING, :name => 'nulls', :binary => true}
+ }
+
+ def struct_fields; FIELDS; end
+
+ def validate
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field values is unset!') unless @values
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field nulls is unset!') unless @nulls
+ end
+
+ ::Thrift::Struct.generate_accessors self
+end
+
+class TI32Column
+ include ::Thrift::Struct, ::Thrift::Struct_Union
+ VALUES = 1
+ NULLS = 2
+
+ FIELDS = {
+ VALUES => {:type => ::Thrift::Types::LIST, :name => 'values', :element => {:type => ::Thrift::Types::I32}},
+ NULLS => {:type => ::Thrift::Types::STRING, :name => 'nulls', :binary => true}
+ }
+
+ def struct_fields; FIELDS; end
+
+ def validate
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field values is unset!') unless @values
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field nulls is unset!') unless @nulls
+ end
+
+ ::Thrift::Struct.generate_accessors self
+end
+
+class TI64Column
+ include ::Thrift::Struct, ::Thrift::Struct_Union
+ VALUES = 1
+ NULLS = 2
+
+ FIELDS = {
+ VALUES => {:type => ::Thrift::Types::LIST, :name => 'values', :element => {:type => ::Thrift::Types::I64}},
+ NULLS => {:type => ::Thrift::Types::STRING, :name => 'nulls', :binary => true}
+ }
+
+ def struct_fields; FIELDS; end
+
+ def validate
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field values is unset!') unless @values
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field nulls is unset!') unless @nulls
+ end
+
+ ::Thrift::Struct.generate_accessors self
+end
+
+class TDoubleColumn
+ include ::Thrift::Struct, ::Thrift::Struct_Union
+ VALUES = 1
+ NULLS = 2
+
+ FIELDS = {
+ VALUES => {:type => ::Thrift::Types::LIST, :name => 'values', :element => {:type => ::Thrift::Types::DOUBLE}},
+ NULLS => {:type => ::Thrift::Types::STRING, :name => 'nulls', :binary => true}
+ }
+
+ def struct_fields; FIELDS; end
+
+ def validate
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field values is unset!') unless @values
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field nulls is unset!') unless @nulls
+ end
+
+ ::Thrift::Struct.generate_accessors self
+end
+
+class TStringColumn
+ include ::Thrift::Struct, ::Thrift::Struct_Union
+ VALUES = 1
+ NULLS = 2
+
+ FIELDS = {
+ VALUES => {:type => ::Thrift::Types::LIST, :name => 'values', :element => {:type => ::Thrift::Types::STRING}},
+ NULLS => {:type => ::Thrift::Types::STRING, :name => 'nulls', :binary => true}
+ }
+
+ def struct_fields; FIELDS; end
+
+ def validate
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field values is unset!') unless @values
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field nulls is unset!') unless @nulls
+ end
+
+ ::Thrift::Struct.generate_accessors self
+end
+
+class TBinaryColumn
+ include ::Thrift::Struct, ::Thrift::Struct_Union
+ VALUES = 1
+ NULLS = 2
+
+ FIELDS = {
+ VALUES => {:type => ::Thrift::Types::LIST, :name => 'values', :element => {:type => ::Thrift::Types::STRING, :binary => true}},
+ NULLS => {:type => ::Thrift::Types::STRING, :name => 'nulls', :binary => true}
+ }
+
+ def struct_fields; FIELDS; end
+
+ def validate
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field values is unset!') unless @values
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field nulls is unset!') unless @nulls
+ end
+
+ ::Thrift::Struct.generate_accessors self
+end
+
+class TColumn < ::Thrift::Union
+ include ::Thrift::Struct_Union
+ class << self
+ def boolVal(val)
+ TColumn.new(:boolVal, val)
+ end
+
+ def byteVal(val)
+ TColumn.new(:byteVal, val)
+ end
+
+ def i16Val(val)
+ TColumn.new(:i16Val, val)
+ end
+
+ def i32Val(val)
+ TColumn.new(:i32Val, val)
+ end
+
+ def i64Val(val)
+ TColumn.new(:i64Val, val)
+ end
+
+ def doubleVal(val)
+ TColumn.new(:doubleVal, val)
+ end
+
+ def stringVal(val)
+ TColumn.new(:stringVal, val)
+ end
+
+ def binaryVal(val)
+ TColumn.new(:binaryVal, val)
+ end
+ end
+
+ BOOLVAL = 1
+ BYTEVAL = 2
+ I16VAL = 3
+ I32VAL = 4
+ I64VAL = 5
+ DOUBLEVAL = 6
+ STRINGVAL = 7
+ BINARYVAL = 8
+
+ FIELDS = {
+ BOOLVAL => {:type => ::Thrift::Types::STRUCT, :name => 'boolVal', :class => ::TBoolColumn},
+ BYTEVAL => {:type => ::Thrift::Types::STRUCT, :name => 'byteVal', :class => ::TByteColumn},
+ I16VAL => {:type => ::Thrift::Types::STRUCT, :name => 'i16Val', :class => ::TI16Column},
+ I32VAL => {:type => ::Thrift::Types::STRUCT, :name => 'i32Val', :class => ::TI32Column},
+ I64VAL => {:type => ::Thrift::Types::STRUCT, :name => 'i64Val', :class => ::TI64Column},
+ DOUBLEVAL => {:type => ::Thrift::Types::STRUCT, :name => 'doubleVal', :class => ::TDoubleColumn},
+ STRINGVAL => {:type => ::Thrift::Types::STRUCT, :name => 'stringVal', :class => ::TStringColumn},
+ BINARYVAL => {:type => ::Thrift::Types::STRUCT, :name => 'binaryVal', :class => ::TBinaryColumn}
+ }
+
+ def struct_fields; FIELDS; end
+
+ def validate
+ raise(StandardError, 'Union fields are not set.') if get_set_field.nil? || get_value.nil?
+ end
+
+ ::Thrift::Union.generate_accessors self
+end
+
class TRowSet
include ::Thrift::Struct, ::Thrift::Struct_Union
STARTROWOFFSET = 1
@@ -779,7 +1005,7 @@ class TOpenSessionReq
CONFIGURATION = 4
FIELDS = {
- CLIENT_PROTOCOL => {:type => ::Thrift::Types::I32, :name => 'client_protocol', :default => 4, :enum_class => ::TProtocolVersion},
+ CLIENT_PROTOCOL => {:type => ::Thrift::Types::I32, :name => 'client_protocol', :default => 5, :enum_class => ::TProtocolVersion},
USERNAME => {:type => ::Thrift::Types::STRING, :name => 'username', :optional => true},
PASSWORD => {:type => ::Thrift::Types::STRING, :name => 'password', :optional => true},
CONFIGURATION => {:type => ::Thrift::Types::MAP, :name => 'configuration', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}, :optional => true}
@@ -806,7 +1032,7 @@ class TOpenSessionResp
FIELDS = {
STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus},
- SERVERPROTOCOLVERSION => {:type => ::Thrift::Types::I32, :name => 'serverProtocolVersion', :default => 4, :enum_class => ::TProtocolVersion},
+ SERVERPROTOCOLVERSION => {:type => ::Thrift::Types::I32, :name => 'serverProtocolVersion', :default => 5, :enum_class => ::TProtocolVersion},
SESSIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'sessionHandle', :class => ::TSessionHandle, :optional => true},
CONFIGURATION => {:type => ::Thrift::Types::MAP, :name => 'configuration', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}, :optional => true}
}
Modified: hive/trunk/service/src/java/org/apache/hive/service/cli/CLIService.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/java/org/apache/hive/service/cli/CLIService.java?rev=1554989&r1=1554988&r2=1554989&view=diff
==============================================================================
--- hive/trunk/service/src/java/org/apache/hive/service/cli/CLIService.java (original)
+++ hive/trunk/service/src/java/org/apache/hive/service/cli/CLIService.java Fri Jan 3 01:34:08 2014
@@ -39,6 +39,7 @@ import org.apache.hive.service.Composite
import org.apache.hive.service.ServiceException;
import org.apache.hive.service.auth.HiveAuthFactory;
import org.apache.hive.service.cli.session.SessionManager;
+import org.apache.hive.service.cli.thrift.TProtocolVersion;
/**
* CLIService.
@@ -46,6 +47,13 @@ import org.apache.hive.service.cli.sessi
*/
public class CLIService extends CompositeService implements ICLIService {
+ public static final TProtocolVersion SERVER_VERSION;
+
+ static {
+ TProtocolVersion[] protocols = TProtocolVersion.values();
+ SERVER_VERSION = protocols[protocols.length - 1];
+ }
+
private final Log LOG = LogFactory.getLog(CLIService.class.getName());
private HiveConf hiveConf;
@@ -106,6 +114,21 @@ public class CLIService extends Composit
super.stop();
}
+ public SessionHandle openSession(TProtocolVersion protocol, String username, String password,
+ Map<String, String> configuration) throws HiveSQLException {
+ SessionHandle sessionHandle = sessionManager.openSession(protocol, username, password, configuration, false, null);
+ LOG.info(sessionHandle + ": openSession()");
+ return sessionHandle;
+ }
+
+ public SessionHandle openSessionWithImpersonation(TProtocolVersion protocol, String username,
+ String password, Map<String, String> configuration, String delegationToken)
+ throws HiveSQLException {
+ SessionHandle sessionHandle = sessionManager.openSession(protocol, username, password, configuration,
+ true, delegationToken);
+ LOG.info(sessionHandle + ": openSession()");
+ return sessionHandle;
+ }
/* (non-Javadoc)
* @see org.apache.hive.service.cli.ICLIService#openSession(java.lang.String, java.lang.String, java.util.Map)
@@ -113,7 +136,7 @@ public class CLIService extends Composit
@Override
public SessionHandle openSession(String username, String password, Map<String, String> configuration)
throws HiveSQLException {
- SessionHandle sessionHandle = sessionManager.openSession(username, password, configuration, false, null);
+ SessionHandle sessionHandle = sessionManager.openSession(SERVER_VERSION, username, password, configuration, false, null);
LOG.info(sessionHandle + ": openSession()");
return sessionHandle;
}
@@ -123,9 +146,9 @@ public class CLIService extends Composit
*/
@Override
public SessionHandle openSessionWithImpersonation(String username, String password, Map<String, String> configuration,
- String delegationToken) throws HiveSQLException {
- SessionHandle sessionHandle = sessionManager.openSession(username, password, configuration,
- true, delegationToken);
+ String delegationToken) throws HiveSQLException {
+ SessionHandle sessionHandle = sessionManager.openSession(SERVER_VERSION, username, password, configuration,
+ true, delegationToken);
LOG.info(sessionHandle + ": openSession()");
return sessionHandle;
}
Added: hive/trunk/service/src/java/org/apache/hive/service/cli/Column.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/java/org/apache/hive/service/cli/Column.java?rev=1554989&view=auto
==============================================================================
--- hive/trunk/service/src/java/org/apache/hive/service/cli/Column.java (added)
+++ hive/trunk/service/src/java/org/apache/hive/service/cli/Column.java Fri Jan 3 01:34:08 2014
@@ -0,0 +1,423 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hive.service.cli;
+
+import java.nio.ByteBuffer;
+import java.util.AbstractList;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.BitSet;
+import java.util.List;
+
+import com.google.common.primitives.Booleans;
+import com.google.common.primitives.Bytes;
+import com.google.common.primitives.Doubles;
+import com.google.common.primitives.Ints;
+import com.google.common.primitives.Longs;
+import com.google.common.primitives.Shorts;
+import org.apache.hive.service.cli.thrift.TBinaryColumn;
+import org.apache.hive.service.cli.thrift.TBoolColumn;
+import org.apache.hive.service.cli.thrift.TByteColumn;
+import org.apache.hive.service.cli.thrift.TColumn;
+import org.apache.hive.service.cli.thrift.TDoubleColumn;
+import org.apache.hive.service.cli.thrift.TI16Column;
+import org.apache.hive.service.cli.thrift.TI32Column;
+import org.apache.hive.service.cli.thrift.TI64Column;
+import org.apache.hive.service.cli.thrift.TStringColumn;
+
+/**
+ * Column.
+ */
+public class Column extends AbstractList {
+
+ private static final int DEFAULT_SIZE = 100;
+
+ private final Type type;
+
+ private BitSet nulls;
+
+ private int size;
+ private boolean[] boolVars;
+ private byte[] byteVars;
+ private short[] shortVars;
+ private int[] intVars;
+ private long[] longVars;
+ private double[] doubleVars;
+ private List<String> stringVars;
+ private List<ByteBuffer> binaryVars;
+
+ public Column(Type type, BitSet nulls, Object values) {
+ this.type = type;
+ this.nulls = nulls;
+ if (type == Type.BOOLEAN_TYPE) {
+ boolVars = (boolean[]) values;
+ size = boolVars.length;
+ } else if (type == Type.TINYINT_TYPE) {
+ byteVars = (byte[]) values;
+ size = byteVars.length;
+ } else if (type == Type.SMALLINT_TYPE) {
+ shortVars = (short[]) values;
+ size = shortVars.length;
+ } else if (type == Type.INT_TYPE) {
+ intVars = (int[]) values;
+ size = intVars.length;
+ } else if (type == Type.BIGINT_TYPE) {
+ longVars = (long[]) values;
+ size = longVars.length;
+ } else if (type == Type.DOUBLE_TYPE) {
+ doubleVars = (double[]) values;
+ size = doubleVars.length;
+ } else if (type == Type.BINARY_TYPE) {
+ binaryVars = (List<ByteBuffer>) values;
+ size = binaryVars.size();
+ } else if (type == Type.STRING_TYPE) {
+ stringVars = (List<String>) values;
+ size = stringVars.size();
+ } else {
+ throw new IllegalStateException("invalid union object");
+ }
+ }
+
+ public Column(Type type) {
+ nulls = new BitSet();
+ switch (type) {
+ case BOOLEAN_TYPE:
+ boolVars = new boolean[DEFAULT_SIZE];
+ break;
+ case TINYINT_TYPE:
+ byteVars = new byte[DEFAULT_SIZE];
+ break;
+ case SMALLINT_TYPE:
+ shortVars = new short[DEFAULT_SIZE];
+ break;
+ case INT_TYPE:
+ intVars = new int[DEFAULT_SIZE];
+ break;
+ case BIGINT_TYPE:
+ longVars = new long[DEFAULT_SIZE];
+ break;
+ case FLOAT_TYPE:
+ case DOUBLE_TYPE:
+ type = Type.DOUBLE_TYPE;
+ doubleVars = new double[DEFAULT_SIZE];
+ break;
+ case BINARY_TYPE:
+ binaryVars = new ArrayList<ByteBuffer>();
+ break;
+ default:
+ type = Type.STRING_TYPE;
+ stringVars = new ArrayList<String>();
+ }
+ this.type = type;
+ }
+
+ public Column(TColumn colValues) {
+ if (colValues.isSetBoolVal()) {
+ type = Type.BOOLEAN_TYPE;
+ nulls = toBitset(colValues.getBoolVal().getNulls());
+ boolVars = Booleans.toArray(colValues.getBoolVal().getValues());
+ size = boolVars.length;
+ } else if (colValues.isSetByteVal()) {
+ type = Type.TINYINT_TYPE;
+ nulls = toBitset(colValues.getByteVal().getNulls());
+ byteVars = Bytes.toArray(colValues.getByteVal().getValues());
+ size = byteVars.length;
+ } else if (colValues.isSetI16Val()) {
+ type = Type.SMALLINT_TYPE;
+ nulls = toBitset(colValues.getI16Val().getNulls());
+ shortVars = Shorts.toArray(colValues.getI16Val().getValues());
+ size = shortVars.length;
+ } else if (colValues.isSetI32Val()) {
+ type = Type.INT_TYPE;
+ nulls = toBitset(colValues.getI32Val().getNulls());
+ intVars = Ints.toArray(colValues.getI32Val().getValues());
+ size = intVars.length;
+ } else if (colValues.isSetI64Val()) {
+ type = Type.BIGINT_TYPE;
+ nulls = toBitset(colValues.getI64Val().getNulls());
+ longVars = Longs.toArray(colValues.getI64Val().getValues());
+ size = longVars.length;
+ } else if (colValues.isSetDoubleVal()) {
+ type = Type.DOUBLE_TYPE;
+ nulls = toBitset(colValues.getDoubleVal().getNulls());
+ doubleVars = Doubles.toArray(colValues.getDoubleVal().getValues());
+ size = doubleVars.length;
+ } else if (colValues.isSetBinaryVal()) {
+ type = Type.BINARY_TYPE;
+ nulls = toBitset(colValues.getBinaryVal().getNulls());
+ binaryVars = colValues.getBinaryVal().getValues();
+ size = binaryVars.size();
+ } else if (colValues.isSetStringVal()) {
+ type = Type.STRING_TYPE;
+ nulls = toBitset(colValues.getStringVal().getNulls());
+ stringVars = colValues.getStringVal().getValues();
+ size = stringVars.size();
+ } else {
+ throw new IllegalStateException("invalid union object");
+ }
+ }
+
+ public Column extractSubset(int start, int end) {
+ BitSet subNulls = nulls.get(start, end);
+ if (type == Type.BOOLEAN_TYPE) {
+ Column subset = new Column(type, subNulls, Arrays.copyOfRange(boolVars, start, end));
+ boolVars = Arrays.copyOfRange(boolVars, end, size);
+ nulls = nulls.get(start, size);
+ size = boolVars.length;
+ return subset;
+ }
+ if (type == Type.TINYINT_TYPE) {
+ Column subset = new Column(type, subNulls, Arrays.copyOfRange(byteVars, start, end));
+ byteVars = Arrays.copyOfRange(byteVars, end, size);
+ nulls = nulls.get(start, size);
+ size = byteVars.length;
+ return subset;
+ }
+ if (type == Type.SMALLINT_TYPE) {
+ Column subset = new Column(type, subNulls, Arrays.copyOfRange(shortVars, start, end));
+ shortVars = Arrays.copyOfRange(shortVars, end, size);
+ nulls = nulls.get(start, size);
+ size = shortVars.length;
+ return subset;
+ }
+ if (type == Type.INT_TYPE) {
+ Column subset = new Column(type, subNulls, Arrays.copyOfRange(intVars, start, end));
+ intVars = Arrays.copyOfRange(intVars, end, size);
+ nulls = nulls.get(start, size);
+ size = intVars.length;
+ return subset;
+ }
+ if (type == Type.BIGINT_TYPE) {
+ Column subset = new Column(type, subNulls, Arrays.copyOfRange(longVars, start, end));
+ longVars = Arrays.copyOfRange(longVars, end, size);
+ nulls = nulls.get(start, size);
+ size = longVars.length;
+ return subset;
+ }
+ if (type == Type.DOUBLE_TYPE) {
+ Column subset = new Column(type, subNulls, Arrays.copyOfRange(doubleVars, start, end));
+ doubleVars = Arrays.copyOfRange(doubleVars, end, size);
+ nulls = nulls.get(start, size);
+ size = doubleVars.length;
+ return subset;
+ }
+ if (type == Type.BINARY_TYPE) {
+ Column subset = new Column(type, subNulls, binaryVars.subList(start, end));
+ binaryVars = binaryVars.subList(end, binaryVars.size());
+ nulls = nulls.get(start, size);
+ size = binaryVars.size();
+ return subset;
+ }
+ if (type == Type.STRING_TYPE) {
+ Column subset = new Column(type, subNulls, stringVars.subList(start, end));
+ stringVars = stringVars.subList(end, stringVars.size());
+ nulls = nulls.get(start, size);
+ size = stringVars.size();
+ return subset;
+ }
+ throw new IllegalStateException("invalid union object");
+ }
+
+ private static final byte[] MASKS = new byte[] {
+ 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, (byte)0x80
+ };
+
+ private static BitSet toBitset(byte[] nulls) {
+ BitSet bitset = new BitSet();
+ int bits = nulls.length * 8;
+ for (int i = 0; i < bits; i++) {
+ bitset.set(i, (nulls[i / 8] & MASKS[i % 8]) != 0);
+ }
+ return bitset;
+ }
+
+ private static byte[] toBinary(BitSet bitset) {
+ byte[] nulls = new byte[1 + (bitset.length() / 8)];
+ for (int i = 0; i < bitset.length(); i++) {
+ nulls[i / 8] |= bitset.get(i) ? MASKS[i % 8] : 0;
+ }
+ return nulls;
+ }
+
+ public Type getType() {
+ return type;
+ }
+
+ @Override
+ public Object get(int index) {
+ if (nulls.get(index)) {
+ return null;
+ }
+ switch (type) {
+ case BOOLEAN_TYPE:
+ return boolVars[index];
+ case TINYINT_TYPE:
+ return byteVars[index];
+ case SMALLINT_TYPE:
+ return shortVars[index];
+ case INT_TYPE:
+ return intVars[index];
+ case BIGINT_TYPE:
+ return longVars[index];
+ case DOUBLE_TYPE:
+ return doubleVars[index];
+ case STRING_TYPE:
+ return stringVars.get(index);
+ case BINARY_TYPE:
+ return binaryVars.get(index).array();
+ }
+ return null;
+ }
+
+ @Override
+ public int size() {
+ return size;
+ }
+
+ public TColumn toTColumn() {
+ TColumn value = new TColumn();
+ ByteBuffer nullMasks = ByteBuffer.wrap(toBinary(nulls));
+ switch (type) {
+ case BOOLEAN_TYPE:
+ value.setBoolVal(new TBoolColumn(Booleans.asList(Arrays.copyOfRange(boolVars, 0, size)), nullMasks));
+ break;
+ case TINYINT_TYPE:
+ value.setByteVal(new TByteColumn(Bytes.asList(Arrays.copyOfRange(byteVars, 0, size)), nullMasks));
+ break;
+ case SMALLINT_TYPE:
+ value.setI16Val(new TI16Column(Shorts.asList(Arrays.copyOfRange(shortVars, 0, size)), nullMasks));
+ break;
+ case INT_TYPE:
+ value.setI32Val(new TI32Column(Ints.asList(Arrays.copyOfRange(intVars, 0, size)), nullMasks));
+ break;
+ case BIGINT_TYPE:
+ value.setI64Val(new TI64Column(Longs.asList(Arrays.copyOfRange(longVars, 0, size)), nullMasks));
+ break;
+ case DOUBLE_TYPE:
+ value.setDoubleVal(new TDoubleColumn(Doubles.asList(Arrays.copyOfRange(doubleVars, 0, size)), nullMasks));
+ break;
+ case STRING_TYPE:
+ value.setStringVal(new TStringColumn(stringVars, nullMasks));
+ break;
+ case BINARY_TYPE:
+ value.setBinaryVal(new TBinaryColumn(binaryVars, nullMasks));
+ break;
+ }
+ return value;
+ }
+
+ private static final ByteBuffer EMPTY_BINARY = ByteBuffer.allocate(0);
+ private static final String EMPTY_STRING = "";
+
+ public void addValue(Type type, Object field) {
+ switch (type) {
+ case BOOLEAN_TYPE:
+ nulls.set(size, field == null);
+ boolVars()[size] = field == null ? true : (Boolean)field;
+ break;
+ case TINYINT_TYPE:
+ nulls.set(size, field == null);
+ byteVars()[size] = field == null ? 0 : (Byte) field;
+ break;
+ case SMALLINT_TYPE:
+ nulls.set(size, field == null);
+ shortVars()[size] = field == null ? 0 : (Short)field;
+ break;
+ case INT_TYPE:
+ nulls.set(size, field == null);
+ intVars()[size] = field == null ? 0 : (Integer)field;
+ break;
+ case BIGINT_TYPE:
+ nulls.set(size, field == null);
+ longVars()[size] = field == null ? 0 : (Long)field;
+ break;
+ case FLOAT_TYPE:
+ nulls.set(size, field == null);
+ doubleVars()[size] = field == null ? 0 : ((Float)field).doubleValue();
+ break;
+ case DOUBLE_TYPE:
+ nulls.set(size, field == null);
+ doubleVars()[size] = field == null ? 0 : (Double)field;
+ break;
+ case BINARY_TYPE:
+ nulls.set(binaryVars.size(), field == null);
+ binaryVars.add(field == null ? EMPTY_BINARY : ByteBuffer.wrap((byte[])field));
+ break;
+ default:
+ nulls.set(stringVars.size(), field == null);
+ stringVars.add(field == null ? EMPTY_STRING : String.valueOf(field));
+ break;
+ }
+ size++;
+ }
+
+ private boolean[] boolVars() {
+ if (boolVars.length == size) {
+ boolean[] newVars = new boolean[size << 1];
+ System.arraycopy(boolVars, 0, newVars, 0, size);
+ return boolVars = newVars;
+ }
+ return boolVars;
+ }
+
+ private byte[] byteVars() {
+ if (byteVars.length == size) {
+ byte[] newVars = new byte[size << 1];
+ System.arraycopy(byteVars, 0, newVars, 0, size);
+ return byteVars = newVars;
+ }
+ return byteVars;
+ }
+
+ private short[] shortVars() {
+ if (shortVars.length == size) {
+ short[] newVars = new short[size << 1];
+ System.arraycopy(shortVars, 0, newVars, 0, size);
+ return shortVars = newVars;
+ }
+ return shortVars;
+ }
+
+ private int[] intVars() {
+ if (intVars.length == size) {
+ int[] newVars = new int[size << 1];
+ System.arraycopy(intVars, 0, newVars, 0, size);
+ return intVars = newVars;
+ }
+ return intVars;
+ }
+
+ private long[] longVars() {
+ if (longVars.length == size) {
+ long[] newVars = new long[size << 1];
+ System.arraycopy(longVars, 0, newVars, 0, size);
+ return longVars = newVars;
+ }
+ return longVars;
+ }
+
+ private double[] doubleVars() {
+ if (doubleVars.length == size) {
+ double[] newVars = new double[size << 1];
+ System.arraycopy(doubleVars, 0, newVars, 0, size);
+ return doubleVars = newVars;
+ }
+ return doubleVars;
+ }
+}