You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by gu...@apache.org on 2014/01/03 19:37:36 UTC
svn commit: r1555193 [5/6] - in /hive/branches/tez: ./
ant/src/org/apache/hadoop/hive/ant/
common/src/java/org/apache/hadoop/hive/common/type/
common/src/test/org/apache/hadoop/hive/common/type/
itests/hive-unit/src/test/java/org/apache/hadoop/hive/jdb...
Modified: hive/branches/tez/service/src/gen/thrift/gen-py/TCLIService/ttypes.py
URL: http://svn.apache.org/viewvc/hive/branches/tez/service/src/gen/thrift/gen-py/TCLIService/ttypes.py?rev=1555193&r1=1555192&r2=1555193&view=diff
==============================================================================
--- hive/branches/tez/service/src/gen/thrift/gen-py/TCLIService/ttypes.py (original)
+++ hive/branches/tez/service/src/gen/thrift/gen-py/TCLIService/ttypes.py Fri Jan 3 18:37:34 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/branches/tez/service/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb
URL: http://svn.apache.org/viewvc/hive/branches/tez/service/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb?rev=1555193&r1=1555192&r2=1555193&view=diff
==============================================================================
--- hive/branches/tez/service/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb (original)
+++ hive/branches/tez/service/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb Fri Jan 3 18:37:34 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/branches/tez/service/src/java/org/apache/hive/service/cli/CLIService.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/service/src/java/org/apache/hive/service/cli/CLIService.java?rev=1555193&r1=1555192&r2=1555193&view=diff
==============================================================================
--- hive/branches/tez/service/src/java/org/apache/hive/service/cli/CLIService.java (original)
+++ hive/branches/tez/service/src/java/org/apache/hive/service/cli/CLIService.java Fri Jan 3 18:37:34 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;
}
Modified: hive/branches/tez/service/src/java/org/apache/hive/service/cli/ColumnValue.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/service/src/java/org/apache/hive/service/cli/ColumnValue.java?rev=1555193&r1=1555192&r2=1555193&view=diff
==============================================================================
--- hive/branches/tez/service/src/java/org/apache/hive/service/cli/ColumnValue.java (original)
+++ hive/branches/tez/service/src/java/org/apache/hive/service/cli/ColumnValue.java Fri Jan 3 18:37:34 2014
@@ -18,6 +18,7 @@
package org.apache.hive.service.cli;
+import java.math.BigDecimal;
import java.sql.Date;
import java.sql.Timestamp;
@@ -34,133 +35,116 @@ import org.apache.hive.service.cli.thrif
import org.apache.hive.service.cli.thrift.TStringValue;
/**
- * ColumnValue.
+ * Protocols before HIVE_CLI_SERVICE_PROTOCOL_V6 (used by RowBasedSet)
*
*/
public class ColumnValue {
- public static final TColumnValue NULL = new TColumnValue();
-
- static {
- NULL.setStringVal(new TStringValue());
- }
-
- // TODO: replace this with a non-Thrift implementation
- private final TColumnValue tColumnValue;
-
- public ColumnValue(TColumnValue tColumnValue) {
- this.tColumnValue = new TColumnValue(tColumnValue);
- }
-
- private static boolean isNull(Object value) {
- return (value == null);
- }
-
- public static ColumnValue booleanValue(Boolean value) {
+ private static TColumnValue booleanValue(Boolean value) {
TBoolValue tBoolValue = new TBoolValue();
if (value != null) {
tBoolValue.setValue(value);
}
- return new ColumnValue(TColumnValue.boolVal(tBoolValue));
+ return TColumnValue.boolVal(tBoolValue);
}
- public static ColumnValue byteValue(Byte value) {
+ private static TColumnValue byteValue(Byte value) {
TByteValue tByteValue = new TByteValue();
if (value != null) {
tByteValue.setValue(value);
}
- return new ColumnValue(TColumnValue.byteVal(tByteValue));
+ return TColumnValue.byteVal(tByteValue);
}
- public static ColumnValue shortValue(Short value) {
+ private static TColumnValue shortValue(Short value) {
TI16Value tI16Value = new TI16Value();
if (value != null) {
tI16Value.setValue(value);
}
- return new ColumnValue(TColumnValue.i16Val(tI16Value));
+ return TColumnValue.i16Val(tI16Value);
}
- public static ColumnValue intValue(Integer value) {
+ private static TColumnValue intValue(Integer value) {
TI32Value tI32Value = new TI32Value();
if (value != null) {
tI32Value.setValue(value);
}
- return new ColumnValue(TColumnValue.i32Val(tI32Value));
+ return TColumnValue.i32Val(tI32Value);
}
- public static ColumnValue longValue(Long value) {
+ private static TColumnValue longValue(Long value) {
TI64Value tI64Value = new TI64Value();
if (value != null) {
tI64Value.setValue(value);
}
- return new ColumnValue(TColumnValue.i64Val(tI64Value));
+ return TColumnValue.i64Val(tI64Value);
}
- public static ColumnValue floatValue(Float value) {
+ private static TColumnValue floatValue(Float value) {
TDoubleValue tDoubleValue = new TDoubleValue();
if (value != null) {
tDoubleValue.setValue(value);
}
- return new ColumnValue(TColumnValue.doubleVal(tDoubleValue));
+ return TColumnValue.doubleVal(tDoubleValue);
}
- public static ColumnValue doubleValue(Double value) {
+ private static TColumnValue doubleValue(Double value) {
TDoubleValue tDoubleValue = new TDoubleValue();
if (value != null) {
tDoubleValue.setValue(value);
}
- return new ColumnValue(TColumnValue.doubleVal(tDoubleValue));
+ return TColumnValue.doubleVal(tDoubleValue);
}
- public static ColumnValue stringValue(String value) {
+ private static TColumnValue stringValue(String value) {
TStringValue tStringValue = new TStringValue();
if (value != null) {
tStringValue.setValue(value);
}
- return new ColumnValue(TColumnValue.stringVal(tStringValue));
+ return TColumnValue.stringVal(tStringValue);
}
- public static ColumnValue stringValue(HiveChar value) {
+ private static TColumnValue stringValue(HiveChar value) {
TStringValue tStringValue = new TStringValue();
if (value != null) {
tStringValue.setValue(value.toString());
}
- return new ColumnValue(TColumnValue.stringVal(tStringValue));
+ return TColumnValue.stringVal(tStringValue);
}
- public static ColumnValue stringValue(HiveVarchar value) {
+ private static TColumnValue stringValue(HiveVarchar value) {
TStringValue tStringValue = new TStringValue();
if (value != null) {
tStringValue.setValue(value.toString());
}
- return new ColumnValue(TColumnValue.stringVal(tStringValue));
+ return TColumnValue.stringVal(tStringValue);
}
- public static ColumnValue dateValue(Date value) {
+ private static TColumnValue dateValue(Date value) {
TStringValue tStringValue = new TStringValue();
if (value != null) {
tStringValue.setValue(value.toString());
}
- return new ColumnValue(TColumnValue.stringVal(tStringValue));
+ return new TColumnValue(TColumnValue.stringVal(tStringValue));
}
- public static ColumnValue timestampValue(Timestamp value) {
+ private static TColumnValue timestampValue(Timestamp value) {
TStringValue tStringValue = new TStringValue();
if (value != null) {
tStringValue.setValue(value.toString());
}
- return new ColumnValue(TColumnValue.stringVal(tStringValue));
+ return TColumnValue.stringVal(tStringValue);
}
- public static ColumnValue stringValue(HiveDecimal value) {
+ private static TColumnValue stringValue(HiveDecimal value) {
TStringValue tStrValue = new TStringValue();
if (value != null) {
tStrValue.setValue(value.toString());
}
- return new ColumnValue(TColumnValue.stringVal(tStrValue));
+ return TColumnValue.stringVal(tStrValue);
}
- public static ColumnValue newColumnValue(Type type, Object value) {
+ public static TColumnValue toTColumnValue(Type type, Object value) {
switch (type) {
case BOOLEAN_TYPE:
return booleanValue((Boolean)value);
@@ -189,6 +173,7 @@ public class ColumnValue {
case DECIMAL_TYPE:
return stringValue(((HiveDecimal)value));
case BINARY_TYPE:
+ return stringValue((String)value);
case ARRAY_TYPE:
case MAP_TYPE:
case STRUCT_TYPE:
@@ -200,8 +185,101 @@ public class ColumnValue {
}
}
- public TColumnValue toTColumnValue() {
- return new TColumnValue(tColumnValue);
+ private static Boolean getBooleanValue(TBoolValue tBoolValue) {
+ if (tBoolValue.isSetValue()) {
+ return tBoolValue.isValue();
+ }
+ return null;
+ }
+
+ private static Byte getByteValue(TByteValue tByteValue) {
+ if (tByteValue.isSetValue()) {
+ return tByteValue.getValue();
+ }
+ return null;
+ }
+
+ private static Short getShortValue(TI16Value tI16Value) {
+ if (tI16Value.isSetValue()) {
+ return tI16Value.getValue();
+ }
+ return null;
+ }
+
+ private static Integer getIntegerValue(TI32Value tI32Value) {
+ if (tI32Value.isSetValue()) {
+ return tI32Value.getValue();
+ }
+ return null;
+ }
+
+ private static Long getLongValue(TI64Value tI64Value) {
+ if (tI64Value.isSetValue()) {
+ return tI64Value.getValue();
+ }
+ return null;
+ }
+
+ private static Double getDoubleValue(TDoubleValue tDoubleValue) {
+ if (tDoubleValue.isSetValue()) {
+ return tDoubleValue.getValue();
+ }
+ return null;
}
+ private static String getStringValue(TStringValue tStringValue) {
+ if (tStringValue.isSetValue()) {
+ return tStringValue.getValue();
+ }
+ return null;
+ }
+
+ private static Date getDateValue(TStringValue tStringValue) {
+ if (tStringValue.isSetValue()) {
+ return Date.valueOf(tStringValue.getValue());
+ }
+ return null;
+ }
+
+ private static Timestamp getTimestampValue(TStringValue tStringValue) {
+ if (tStringValue.isSetValue()) {
+ return Timestamp.valueOf(tStringValue.getValue());
+ }
+ return null;
+ }
+
+ private static byte[] getBinaryValue(TStringValue tString) {
+ if (tString.isSetValue()) {
+ return tString.getValue().getBytes();
+ }
+ return null;
+ }
+
+ private static BigDecimal getBigDecimalValue(TStringValue tStringValue) {
+ if (tStringValue.isSetValue()) {
+ return new BigDecimal(tStringValue.getValue());
+ }
+ return null;
+ }
+
+ public static Object toColumnValue(TColumnValue value) {
+ TColumnValue._Fields field = value.getSetField();
+ switch (field) {
+ case BOOL_VAL:
+ return getBooleanValue(value.getBoolVal());
+ case BYTE_VAL:
+ return getByteValue(value.getByteVal());
+ case I16_VAL:
+ return getShortValue(value.getI16Val());
+ case I32_VAL:
+ return getIntegerValue(value.getI32Val());
+ case I64_VAL:
+ return getLongValue(value.getI64Val());
+ case DOUBLE_VAL:
+ return getDoubleValue(value.getDoubleVal());
+ case STRING_VAL:
+ return getStringValue(value.getStringVal());
+ }
+ throw new IllegalArgumentException("never");
+ }
}
Modified: hive/branches/tez/service/src/java/org/apache/hive/service/cli/OperationHandle.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/service/src/java/org/apache/hive/service/cli/OperationHandle.java?rev=1555193&r1=1555192&r2=1555193&view=diff
==============================================================================
--- hive/branches/tez/service/src/java/org/apache/hive/service/cli/OperationHandle.java (original)
+++ hive/branches/tez/service/src/java/org/apache/hive/service/cli/OperationHandle.java Fri Jan 3 18:37:34 2014
@@ -18,27 +18,30 @@
package org.apache.hive.service.cli;
import org.apache.hive.service.cli.thrift.TOperationHandle;
-
+import org.apache.hive.service.cli.thrift.TProtocolVersion;
public class OperationHandle extends Handle {
- private OperationType opType = OperationType.EXECUTE_STATEMENT;
+ private final OperationType opType;
+ private final TProtocolVersion protocol;
private boolean hasResultSet = false;
- public OperationHandle() {
- // TODO: make this type abstract
- super();
- }
-
- public OperationHandle(OperationType opType) {
+ public OperationHandle(OperationType opType, TProtocolVersion protocol) {
super();
this.opType = opType;
+ this.protocol = protocol;
}
+ // dummy handle for ThriftCLIService
public OperationHandle(TOperationHandle tOperationHandle) {
+ this(tOperationHandle, TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V1);
+ }
+
+ public OperationHandle(TOperationHandle tOperationHandle, TProtocolVersion protocol) {
super(tOperationHandle.getOperationId());
this.opType = OperationType.getOperationType(tOperationHandle.getOperationType());
this.hasResultSet = tOperationHandle.isHasResultSet();
+ this.protocol = protocol;
}
public OperationType getOperationType() {
@@ -61,6 +64,10 @@ public class OperationHandle extends Han
return tOperationHandle;
}
+ public TProtocolVersion getProtocolVersion() {
+ return protocol;
+ }
+
@Override
public int hashCode() {
final int prime = 31;
Modified: hive/branches/tez/service/src/java/org/apache/hive/service/cli/RowSet.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/service/src/java/org/apache/hive/service/cli/RowSet.java?rev=1555193&r1=1555192&r2=1555193&view=diff
==============================================================================
--- hive/branches/tez/service/src/java/org/apache/hive/service/cli/RowSet.java (original)
+++ hive/branches/tez/service/src/java/org/apache/hive/service/cli/RowSet.java Fri Jan 3 18:37:34 2014
@@ -18,107 +18,21 @@
package org.apache.hive.service.cli;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.hive.service.cli.thrift.TRow;
import org.apache.hive.service.cli.thrift.TRowSet;
-/**
- * RowSet.
- *
- */
-public class RowSet {
-
- private long startOffset = 0;
- private boolean hasMoreResults = false;
- private List<Row> rows;
-
- public RowSet() {
- rows = new ArrayList<Row>();
- }
-
- public RowSet(TRowSet tRowSet) {
- this();
- startOffset = tRowSet.getStartRowOffset();
- for (TRow tRow : tRowSet.getRows()) {
- rows.add(new Row(tRow));
- }
- }
-
- public RowSet(List<Row> rows, long startOffset) {
- this();
- this.rows.addAll(rows);
- this.startOffset = startOffset;
- }
-
- public RowSet addRow(Row row) {
- rows.add(row);
- return this;
- }
-
- public RowSet addRow(TableSchema schema, Object[] fields) {
- return addRow(new Row(schema, fields));
- }
-
- public RowSet extractSubset(int maxRows) {
- int numRows = rows.size();
- maxRows = (maxRows <= numRows) ? maxRows : numRows;
- RowSet result = new RowSet(rows.subList(0, maxRows), startOffset);
- rows = new ArrayList<Row>(rows.subList(maxRows, numRows));
- startOffset += result.getSize();
- return result;
- }
-
- public long getStartOffset() {
- return startOffset;
- }
-
- public RowSet setStartOffset(long startOffset) {
- this.startOffset = startOffset;
- return this;
- }
-
- public boolean getHasMoreResults() {
- return hasMoreResults;
- }
-
- public RowSet setHasMoreResults(boolean hasMoreResults) {
- this.hasMoreResults = hasMoreResults;
- return this;
- }
-
- public int getSize() {
- return rows.size();
- }
-
- public TRowSet toTRowSet() {
- TRowSet tRowSet = new TRowSet();
- tRowSet.setStartRowOffset(startOffset);
- List<TRow> tRows = new ArrayList<TRow>();
- for (Row row : rows) {
- tRows.add(row.toTRow());
- }
- tRowSet.setRows(tRows);
-
- /*
- //List<Boolean> booleanColumn = new ArrayList<Boolean>();
- //List<Byte> byteColumn = new ArrayList<Byte>();
- //List<Short> shortColumn = new ArrayList<Short>();
- List<Integer> integerColumn = new ArrayList<Integer>();
-
- integerColumn.add(1);
- //integerColumn.add(null);
- integerColumn.add(3);
- //integerColumn.add(null);
-
-
- TColumnUnion column = TColumnUnion.i32Column(integerColumn);
- List<TColumnUnion> columns = new ArrayList<TColumnUnion>();
- columns.add(column);
- tRowSet.setColumns(columns);
- */
+public interface RowSet extends Iterable<Object[]> {
+
+ RowSet addRow(Object[] fields);
+
+ RowSet extractSubset(int maxRows);
+
+ int numColumns();
+
+ int numRows();
+
+ long getStartOffset();
+
+ void setStartOffset(long startOffset);
- return tRowSet;
- }
+ TRowSet toTRowSet();
}
Modified: hive/branches/tez/service/src/java/org/apache/hive/service/cli/SessionHandle.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/service/src/java/org/apache/hive/service/cli/SessionHandle.java?rev=1555193&r1=1555192&r2=1555193&view=diff
==============================================================================
--- hive/branches/tez/service/src/java/org/apache/hive/service/cli/SessionHandle.java (original)
+++ hive/branches/tez/service/src/java/org/apache/hive/service/cli/SessionHandle.java Fri Jan 3 18:37:34 2014
@@ -20,6 +20,7 @@ package org.apache.hive.service.cli;
import java.util.UUID;
+import org.apache.hive.service.cli.thrift.TProtocolVersion;
import org.apache.hive.service.cli.thrift.TSessionHandle;
@@ -29,16 +30,20 @@ import org.apache.hive.service.cli.thrif
*/
public class SessionHandle extends Handle {
- public SessionHandle() {
- super();
- }
+ private final TProtocolVersion protocol;
- public SessionHandle(HandleIdentifier handleId) {
- super(handleId);
+ public SessionHandle(TProtocolVersion protocol) {
+ this.protocol = protocol;
}
+ // dummy handle for ThriftCLIService
public SessionHandle(TSessionHandle tSessionHandle) {
+ this(tSessionHandle, TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V1);
+ }
+
+ public SessionHandle(TSessionHandle tSessionHandle, TProtocolVersion protocol) {
super(tSessionHandle.getSessionId());
+ this.protocol = protocol;
}
public UUID getSessionId() {
@@ -51,6 +56,10 @@ public class SessionHandle extends Handl
return tSessionHandle;
}
+ public TProtocolVersion getProtocolVersion() {
+ return protocol;
+ }
+
@Override
public String toString() {
return "SessionHandle [" + getHandleIdentifier() + "]";
Modified: hive/branches/tez/service/src/java/org/apache/hive/service/cli/TableSchema.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/service/src/java/org/apache/hive/service/cli/TableSchema.java?rev=1555193&r1=1555192&r2=1555193&view=diff
==============================================================================
--- hive/branches/tez/service/src/java/org/apache/hive/service/cli/TableSchema.java (original)
+++ hive/branches/tez/service/src/java/org/apache/hive/service/cli/TableSchema.java Fri Jan 3 18:37:34 2014
@@ -82,6 +82,14 @@ public class TableSchema {
return tTableSchema;
}
+ public Type[] toTypes() {
+ Type[] types = new Type[columns.size()];
+ for (int i = 0; i < types.length; i++) {
+ types[i] = columns.get(i).getType();
+ }
+ return types;
+ }
+
public TableSchema addPrimitiveColumn(String columnName, Type columnType, String columnComment) {
columns.add(ColumnDescriptor.newPrimitiveColumnDescriptor(columnName, columnComment, columnType, columns.size() + 1));
return this;
Modified: hive/branches/tez/service/src/java/org/apache/hive/service/cli/operation/GetCatalogsOperation.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/service/src/java/org/apache/hive/service/cli/operation/GetCatalogsOperation.java?rev=1555193&r1=1555192&r2=1555193&view=diff
==============================================================================
--- hive/branches/tez/service/src/java/org/apache/hive/service/cli/operation/GetCatalogsOperation.java (original)
+++ hive/branches/tez/service/src/java/org/apache/hive/service/cli/operation/GetCatalogsOperation.java Fri Jan 3 18:37:34 2014
@@ -18,13 +18,12 @@
package org.apache.hive.service.cli.operation;
-import java.util.EnumSet;
-
import org.apache.hive.service.cli.FetchOrientation;
import org.apache.hive.service.cli.HiveSQLException;
import org.apache.hive.service.cli.OperationState;
import org.apache.hive.service.cli.OperationType;
import org.apache.hive.service.cli.RowSet;
+import org.apache.hive.service.cli.RowSetFactory;
import org.apache.hive.service.cli.TableSchema;
import org.apache.hive.service.cli.session.HiveSession;
@@ -36,10 +35,11 @@ public class GetCatalogsOperation extend
private static final TableSchema RESULT_SET_SCHEMA = new TableSchema()
.addStringColumn("TABLE_CAT", "Catalog name. NULL if not applicable.");
- private final RowSet rowSet = new RowSet();
+ private final RowSet rowSet;
protected GetCatalogsOperation(HiveSession parentSession) {
super(parentSession, OperationType.GET_CATALOGS);
+ rowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion());
}
/* (non-Javadoc)
Modified: hive/branches/tez/service/src/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/service/src/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java?rev=1555193&r1=1555192&r2=1555193&view=diff
==============================================================================
--- hive/branches/tez/service/src/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java (original)
+++ hive/branches/tez/service/src/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java Fri Jan 3 18:37:34 2014
@@ -20,7 +20,6 @@ package org.apache.hive.service.cli.oper
import java.sql.DatabaseMetaData;
import java.util.Collections;
-import java.util.EnumSet;
import java.util.List;
import java.util.regex.Pattern;
@@ -32,6 +31,7 @@ import org.apache.hive.service.cli.HiveS
import org.apache.hive.service.cli.OperationState;
import org.apache.hive.service.cli.OperationType;
import org.apache.hive.service.cli.RowSet;
+import org.apache.hive.service.cli.RowSetFactory;
import org.apache.hive.service.cli.TableSchema;
import org.apache.hive.service.cli.Type;
import org.apache.hive.service.cli.session.HiveSession;
@@ -102,7 +102,7 @@ public class GetColumnsOperation extends
private final String tableName;
private final String columnName;
- private final RowSet rowSet = new RowSet();
+ private final RowSet rowSet;
protected GetColumnsOperation(HiveSession parentSession, String catalogName, String schemaName,
String tableName, String columnName) {
@@ -111,6 +111,7 @@ public class GetColumnsOperation extends
this.schemaName = schemaName;
this.tableName = tableName;
this.columnName = columnName;
+ this.rowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion());
}
/* (non-Javadoc)
@@ -165,7 +166,7 @@ public class GetColumnsOperation extends
null, // SOURCE_DATA_TYPE
"NO", // IS_AUTO_INCREMENT
};
- rowSet.addRow(RESULT_SET_SCHEMA, rowData);
+ rowSet.addRow(rowData);
}
}
}
Modified: hive/branches/tez/service/src/java/org/apache/hive/service/cli/operation/GetFunctionsOperation.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/service/src/java/org/apache/hive/service/cli/operation/GetFunctionsOperation.java?rev=1555193&r1=1555192&r2=1555193&view=diff
==============================================================================
--- hive/branches/tez/service/src/java/org/apache/hive/service/cli/operation/GetFunctionsOperation.java (original)
+++ hive/branches/tez/service/src/java/org/apache/hive/service/cli/operation/GetFunctionsOperation.java Fri Jan 3 18:37:34 2014
@@ -19,7 +19,6 @@
package org.apache.hive.service.cli.operation;
import java.sql.DatabaseMetaData;
-import java.util.EnumSet;
import java.util.Set;
import org.apache.hadoop.hive.ql.exec.FunctionInfo;
@@ -30,6 +29,7 @@ import org.apache.hive.service.cli.HiveS
import org.apache.hive.service.cli.OperationState;
import org.apache.hive.service.cli.OperationType;
import org.apache.hive.service.cli.RowSet;
+import org.apache.hive.service.cli.RowSetFactory;
import org.apache.hive.service.cli.TableSchema;
import org.apache.hive.service.cli.Type;
import org.apache.hive.service.cli.session.HiveSession;
@@ -57,7 +57,7 @@ public class GetFunctionsOperation exten
private final String schemaName;
private final String functionName;
- private final RowSet rowSet = new RowSet();
+ private final RowSet rowSet;
public GetFunctionsOperation(HiveSession parentSession,
String catalogName, String schemaName, String functionName) {
@@ -65,6 +65,7 @@ public class GetFunctionsOperation exten
this.catalogName = catalogName;
this.schemaName = schemaName;
this.functionName = functionName;
+ this.rowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion());
}
/* (non-Javadoc)
@@ -90,7 +91,7 @@ public class GetFunctionsOperation exten
: DatabaseMetaData.functionNoTable), // FUNCTION_TYPE
functionInfo.getClass().getCanonicalName()
};
- rowSet.addRow(RESULT_SET_SCHEMA, rowData);
+ rowSet.addRow(rowData);
}
}
setState(OperationState.FINISHED);
Modified: hive/branches/tez/service/src/java/org/apache/hive/service/cli/operation/GetSchemasOperation.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/service/src/java/org/apache/hive/service/cli/operation/GetSchemasOperation.java?rev=1555193&r1=1555192&r2=1555193&view=diff
==============================================================================
--- hive/branches/tez/service/src/java/org/apache/hive/service/cli/operation/GetSchemasOperation.java (original)
+++ hive/branches/tez/service/src/java/org/apache/hive/service/cli/operation/GetSchemasOperation.java Fri Jan 3 18:37:34 2014
@@ -18,14 +18,13 @@
package org.apache.hive.service.cli.operation;
-import java.util.EnumSet;
-
import org.apache.hadoop.hive.metastore.IMetaStoreClient;
import org.apache.hive.service.cli.FetchOrientation;
import org.apache.hive.service.cli.HiveSQLException;
import org.apache.hive.service.cli.OperationState;
import org.apache.hive.service.cli.OperationType;
import org.apache.hive.service.cli.RowSet;
+import org.apache.hive.service.cli.RowSetFactory;
import org.apache.hive.service.cli.TableSchema;
import org.apache.hive.service.cli.session.HiveSession;
@@ -48,6 +47,7 @@ public class GetSchemasOperation extends
super(parentSession, OperationType.GET_SCHEMAS);
this.catalogName = catalogName;
this.schemaName = schemaName;
+ this.rowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion());
}
/* (non-Javadoc)
@@ -56,12 +56,11 @@ public class GetSchemasOperation extends
@Override
public void run() throws HiveSQLException {
setState(OperationState.RUNNING);
- rowSet = new RowSet();
try {
IMetaStoreClient metastoreClient = getParentSession().getMetaStoreClient();
String schemaPattern = convertSchemaPattern(schemaName);
for (String dbName : metastoreClient.getDatabases(schemaPattern)) {
- rowSet.addRow(RESULT_SET_SCHEMA, new Object[] {dbName, DEFAULT_HIVE_CATALOG});
+ rowSet.addRow(new Object[] {dbName, DEFAULT_HIVE_CATALOG});
}
setState(OperationState.FINISHED);
} catch (Exception e) {
Modified: hive/branches/tez/service/src/java/org/apache/hive/service/cli/operation/GetTableTypesOperation.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/service/src/java/org/apache/hive/service/cli/operation/GetTableTypesOperation.java?rev=1555193&r1=1555192&r2=1555193&view=diff
==============================================================================
--- hive/branches/tez/service/src/java/org/apache/hive/service/cli/operation/GetTableTypesOperation.java (original)
+++ hive/branches/tez/service/src/java/org/apache/hive/service/cli/operation/GetTableTypesOperation.java Fri Jan 3 18:37:34 2014
@@ -18,7 +18,6 @@
package org.apache.hive.service.cli.operation;
-import java.util.EnumSet;
import org.apache.hadoop.hive.conf.HiveConf;
import org.apache.hadoop.hive.metastore.TableType;
import org.apache.hive.service.cli.FetchOrientation;
@@ -26,6 +25,7 @@ import org.apache.hive.service.cli.HiveS
import org.apache.hive.service.cli.OperationState;
import org.apache.hive.service.cli.OperationType;
import org.apache.hive.service.cli.RowSet;
+import org.apache.hive.service.cli.RowSetFactory;
import org.apache.hive.service.cli.TableSchema;
import org.apache.hive.service.cli.session.HiveSession;
@@ -38,7 +38,7 @@ public class GetTableTypesOperation exte
protected static TableSchema RESULT_SET_SCHEMA = new TableSchema()
.addStringColumn("TABLE_TYPE", "Table type name.");
- private RowSet rowSet;
+ private final RowSet rowSet;
private final TableTypeMapping tableTypeMapping;
protected GetTableTypesOperation(HiveSession parentSession) {
@@ -47,6 +47,7 @@ public class GetTableTypesOperation exte
getVar(HiveConf.ConfVars.HIVE_SERVER2_TABLE_TYPE_MAPPING);
tableTypeMapping =
TableTypeMappingFactory.getTableTypeMapping(tableMappingStr);
+ rowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion());
}
/* (non-Javadoc)
@@ -56,10 +57,8 @@ public class GetTableTypesOperation exte
public void run() throws HiveSQLException {
setState(OperationState.RUNNING);
try {
- rowSet = new RowSet();
for (TableType type : TableType.values()) {
- rowSet.addRow(RESULT_SET_SCHEMA,
- new String[] {tableTypeMapping.mapToClientType(type.toString())});
+ rowSet.addRow(new String[] {tableTypeMapping.mapToClientType(type.toString())});
}
setState(OperationState.FINISHED);
} catch (Exception e) {
Modified: hive/branches/tez/service/src/java/org/apache/hive/service/cli/operation/GetTablesOperation.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/service/src/java/org/apache/hive/service/cli/operation/GetTablesOperation.java?rev=1555193&r1=1555192&r2=1555193&view=diff
==============================================================================
--- hive/branches/tez/service/src/java/org/apache/hive/service/cli/operation/GetTablesOperation.java (original)
+++ hive/branches/tez/service/src/java/org/apache/hive/service/cli/operation/GetTablesOperation.java Fri Jan 3 18:37:34 2014
@@ -19,7 +19,6 @@
package org.apache.hive.service.cli.operation;
import java.util.ArrayList;
-import java.util.EnumSet;
import java.util.List;
import org.apache.hadoop.hive.conf.HiveConf;
@@ -30,6 +29,7 @@ import org.apache.hive.service.cli.HiveS
import org.apache.hive.service.cli.OperationState;
import org.apache.hive.service.cli.OperationType;
import org.apache.hive.service.cli.RowSet;
+import org.apache.hive.service.cli.RowSetFactory;
import org.apache.hive.service.cli.TableSchema;
import org.apache.hive.service.cli.session.HiveSession;
@@ -43,7 +43,7 @@ public class GetTablesOperation extends
private final String schemaName;
private final String tableName;
private final List<String> tableTypes = new ArrayList<String>();
- private final RowSet rowSet = new RowSet();
+ private final RowSet rowSet;
private final TableTypeMapping tableTypeMapping;
@@ -68,6 +68,7 @@ public class GetTablesOperation extends
if (tableTypes != null) {
this.tableTypes.addAll(tableTypes);
}
+ this.rowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion());
}
/* (non-Javadoc)
@@ -92,7 +93,7 @@ public class GetTablesOperation extends
};
if (tableTypes.isEmpty() || tableTypes.contains(
tableTypeMapping.mapToClientType(table.getTableType()))) {
- rowSet.addRow(RESULT_SET_SCHEMA, rowData);
+ rowSet.addRow(rowData);
}
}
}
Modified: hive/branches/tez/service/src/java/org/apache/hive/service/cli/operation/GetTypeInfoOperation.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/service/src/java/org/apache/hive/service/cli/operation/GetTypeInfoOperation.java?rev=1555193&r1=1555192&r2=1555193&view=diff
==============================================================================
--- hive/branches/tez/service/src/java/org/apache/hive/service/cli/operation/GetTypeInfoOperation.java (original)
+++ hive/branches/tez/service/src/java/org/apache/hive/service/cli/operation/GetTypeInfoOperation.java Fri Jan 3 18:37:34 2014
@@ -18,13 +18,12 @@
package org.apache.hive.service.cli.operation;
-import java.util.EnumSet;
-
import org.apache.hive.service.cli.FetchOrientation;
import org.apache.hive.service.cli.HiveSQLException;
import org.apache.hive.service.cli.OperationState;
import org.apache.hive.service.cli.OperationType;
import org.apache.hive.service.cli.RowSet;
+import org.apache.hive.service.cli.RowSetFactory;
import org.apache.hive.service.cli.TableSchema;
import org.apache.hive.service.cli.Type;
import org.apache.hive.service.cli.session.HiveSession;
@@ -73,10 +72,11 @@ public class GetTypeInfoOperation extend
.addPrimitiveColumn("NUM_PREC_RADIX", Type.INT_TYPE,
"Usually 2 or 10");
- private final RowSet rowSet = new RowSet();
+ private final RowSet rowSet;
protected GetTypeInfoOperation(HiveSession parentSession) {
super(parentSession, OperationType.GET_TYPE_INFO);
+ rowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion());
}
/* (non-Javadoc)
@@ -107,7 +107,7 @@ public class GetTypeInfoOperation extend
null, // SQL_DATETIME_SUB, unused
type.getNumPrecRadix() //NUM_PREC_RADIX
};
- rowSet.addRow(RESULT_SET_SCHEMA, rowData);
+ rowSet.addRow(rowData);
}
setState(OperationState.FINISHED);
} catch (Exception e) {
Modified: hive/branches/tez/service/src/java/org/apache/hive/service/cli/operation/HiveCommandOperation.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/service/src/java/org/apache/hive/service/cli/operation/HiveCommandOperation.java?rev=1555193&r1=1555192&r2=1555193&view=diff
==============================================================================
--- hive/branches/tez/service/src/java/org/apache/hive/service/cli/operation/HiveCommandOperation.java (original)
+++ hive/branches/tez/service/src/java/org/apache/hive/service/cli/operation/HiveCommandOperation.java Fri Jan 3 18:37:34 2014
@@ -27,7 +27,6 @@ import java.io.IOException;
import java.io.PrintStream;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
-import java.util.EnumSet;
import java.util.List;
import java.util.Map;
@@ -40,6 +39,7 @@ import org.apache.hive.service.cli.Fetch
import org.apache.hive.service.cli.HiveSQLException;
import org.apache.hive.service.cli.OperationState;
import org.apache.hive.service.cli.RowSet;
+import org.apache.hive.service.cli.RowSetFactory;
import org.apache.hive.service.cli.TableSchema;
import org.apache.hive.service.cli.session.HiveSession;
@@ -158,10 +158,10 @@ public class HiveCommandOperation extend
resetResultReader();
}
List<String> rows = readResults((int) maxRows);
- RowSet rowSet = new RowSet();
+ RowSet rowSet = RowSetFactory.create(resultSchema, getProtocolVersion());
for (String row : rows) {
- rowSet.addRow(resultSchema, new String[] {row});
+ rowSet.addRow(new String[] {row});
}
return rowSet;
}
Modified: hive/branches/tez/service/src/java/org/apache/hive/service/cli/operation/Operation.java
URL: http://svn.apache.org/viewvc/hive/branches/tez/service/src/java/org/apache/hive/service/cli/operation/Operation.java?rev=1555193&r1=1555192&r2=1555193&view=diff
==============================================================================
--- hive/branches/tez/service/src/java/org/apache/hive/service/cli/operation/Operation.java (original)
+++ hive/branches/tez/service/src/java/org/apache/hive/service/cli/operation/Operation.java Fri Jan 3 18:37:34 2014
@@ -31,7 +31,7 @@ import org.apache.hive.service.cli.Opera
import org.apache.hive.service.cli.RowSet;
import org.apache.hive.service.cli.TableSchema;
import org.apache.hive.service.cli.session.HiveSession;
-
+import org.apache.hive.service.cli.thrift.TProtocolVersion;
public abstract class Operation {
@@ -50,7 +50,7 @@ public abstract class Operation {
protected Operation(HiveSession parentSession, OperationType opType) {
super();
this.parentSession = parentSession;
- opHandle = new OperationHandle(opType);
+ this.opHandle = new OperationHandle(opType, parentSession.getProtocolVersion());
}
public void setConfiguration(HiveConf configuration) {
@@ -69,6 +69,10 @@ public abstract class Operation {
return opHandle;
}
+ public TProtocolVersion getProtocolVersion() {
+ return opHandle.getProtocolVersion();
+ }
+
public OperationType getType() {
return opHandle.getOperationType();
}