Modified: hive/trunk/serde/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/serde2/thrift/test/MiniStruct.java URL: http://svn.apache.org/viewvc/hive/trunk/serde/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/serde2/thrift/test/MiniStruct.java?rev=1471260&r1=1471259&r2=1471260&view=diff ============================================================================== --- hive/trunk/serde/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/serde2/thrift/test/MiniStruct.java (original) +++ hive/trunk/serde/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/serde2/thrift/test/MiniStruct.java Wed Apr 24 06:06:06 2013 @@ -6,6 +6,7 @@ */ package org.apache.hadoop.hive.serde2.thrift.test; +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; @@ -286,7 +287,19 @@ public class MiniStruct implements org.a @Override public int hashCode() { - return 0; + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_my_string = true && (isSetMy_string()); + builder.append(present_my_string); + if (present_my_string) + builder.append(my_string); + + boolean present_my_enum = true && (isSetMy_enum()); + builder.append(present_my_enum); + if (present_my_enum) + builder.append(my_enum.getValue()); + + return builder.toHashCode(); } public int compareTo(MiniStruct other) {
Added: hive/trunk/serde/src/gen/thrift/gen-php/Types.php URL: http://svn.apache.org/viewvc/hive/trunk/serde/src/gen/thrift/gen-php/Types.php?rev=1471260&view=auto ============================================================================== --- hive/trunk/serde/src/gen/thrift/gen-php/Types.php (added) +++ hive/trunk/serde/src/gen/thrift/gen-php/Types.php Wed Apr 24 06:06:06 2013 @@ -0,0 +1,231 @@ +<?php +namespace ; + +/** + * Autogenerated by Thrift Compiler (0.9.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +use Thrift\Base\TBase; +use Thrift\Type\TType; +use Thrift\Type\TMessageType; +use Thrift\Exception\TException; +use Thrift\Exception\TProtocolException; +use Thrift\Protocol\TProtocol; +use Thrift\Exception\TApplicationException; + + +class InnerStruct { + static $_TSPEC; + + public $field0 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'field0', + 'type' => TType::I32, + ), + ); + } + if (is_array($vals)) { + if (isset($vals['field0'])) { + $this->field0 = $vals['field0']; + } + } + } + + public function getName() { + return 'InnerStruct'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::I32) { + $xfer += $input->readI32($this->field0); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('InnerStruct'); + if ($this->field0 !== null) { + $xfer += $output->writeFieldBegin('field0', TType::I32, 1); + $xfer += $output->writeI32($this->field0); + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +class ThriftTestObj { + static $_TSPEC; + + public $field1 = null; + public $field2 = null; + public $field3 = null; + + public function __construct($vals=null) { + if (!isset(self::$_TSPEC)) { + self::$_TSPEC = array( + 1 => array( + 'var' => 'field1', + 'type' => TType::I32, + ), + 2 => array( + 'var' => 'field2', + 'type' => TType::STRING, + ), + 3 => array( + 'var' => 'field3', + 'type' => TType::LST, + 'etype' => TType::STRUCT, + 'elem' => array( + 'type' => TType::STRUCT, + 'class' => '\InnerStruct', + ), + ), + ); + } + if (is_array($vals)) { + if (isset($vals['field1'])) { + $this->field1 = $vals['field1']; + } + if (isset($vals['field2'])) { + $this->field2 = $vals['field2']; + } + if (isset($vals['field3'])) { + $this->field3 = $vals['field3']; + } + } + } + + public function getName() { + return 'ThriftTestObj'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::I32) { + $xfer += $input->readI32($this->field1); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->field2); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::LST) { + $this->field3 = array(); + $_size0 = 0; + $_etype3 = 0; + $xfer += $input->readListBegin($_etype3, $_size0); + for ($_i4 = 0; $_i4 < $_size0; ++$_i4) + { + $elem5 = null; + $elem5 = new \InnerStruct(); + $xfer += $elem5->read($input); + $this->field3 []= $elem5; + } + $xfer += $input->readListEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('ThriftTestObj'); + if ($this->field1 !== null) { + $xfer += $output->writeFieldBegin('field1', TType::I32, 1); + $xfer += $output->writeI32($this->field1); + $xfer += $output->writeFieldEnd(); + } + if ($this->field2 !== null) { + $xfer += $output->writeFieldBegin('field2', TType::STRING, 2); + $xfer += $output->writeString($this->field2); + $xfer += $output->writeFieldEnd(); + } + if ($this->field3 !== null) { + if (!is_array($this->field3)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('field3', TType::LST, 3); + { + $output->writeListBegin(TType::STRUCT, count($this->field3)); + { + foreach ($this->field3 as $iter6) + { + $xfer += $iter6->write($output); + } + } + $output->writeListEnd(); + } + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + + Added: hive/trunk/serde/src/gen/thrift/gen-py/complex/__init__.py URL: http://svn.apache.org/viewvc/hive/trunk/serde/src/gen/thrift/gen-py/complex/__init__.py?rev=1471260&view=auto ============================================================================== --- hive/trunk/serde/src/gen/thrift/gen-py/complex/__init__.py (added) +++ hive/trunk/serde/src/gen/thrift/gen-py/complex/__init__.py Wed Apr 24 06:06:06 2013 @@ -0,0 +1 @@ +__all__ = ['ttypes', 'constants'] Added: hive/trunk/serde/src/gen/thrift/gen-py/complex/constants.py URL: http://svn.apache.org/viewvc/hive/trunk/serde/src/gen/thrift/gen-py/complex/constants.py?rev=1471260&view=auto ============================================================================== --- hive/trunk/serde/src/gen/thrift/gen-py/complex/constants.py (added) +++ hive/trunk/serde/src/gen/thrift/gen-py/complex/constants.py Wed Apr 24 06:06:06 2013 @@ -0,0 +1,11 @@ +# +# Autogenerated by Thrift Compiler (0.9.0) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# +# options string: py +# + +from thrift.Thrift import TType, TMessageType, TException, TApplicationException +from ttypes import * + Added: hive/trunk/serde/src/gen/thrift/gen-py/complex/ttypes.py URL: http://svn.apache.org/viewvc/hive/trunk/serde/src/gen/thrift/gen-py/complex/ttypes.py?rev=1471260&view=auto ============================================================================== --- hive/trunk/serde/src/gen/thrift/gen-py/complex/ttypes.py (added) +++ hive/trunk/serde/src/gen/thrift/gen-py/complex/ttypes.py Wed Apr 24 06:06:06 2013 @@ -0,0 +1,257 @@ +# +# Autogenerated by Thrift Compiler (0.9.0) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# +# options string: py +# + +from thrift.Thrift import TType, TMessageType, TException, TApplicationException + +from thrift.transport import TTransport +from thrift.protocol import TBinaryProtocol, TProtocol +try: + from thrift.protocol import fastbinary +except: + fastbinary = None + + + +class IntString: + """ + Attributes: + - myint + - myString + - underscore_int + """ + + thrift_spec = ( + None, # 0 + (1, TType.I32, 'myint', None, None, ), # 1 + (2, TType.STRING, 'myString', None, None, ), # 2 + (3, TType.I32, 'underscore_int', None, None, ), # 3 + ) + + def __init__(self, myint=None, myString=None, underscore_int=None,): + self.myint = myint + self.myString = myString + self.underscore_int = underscore_int + + 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.I32: + self.myint = iprot.readI32(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.myString = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.I32: + self.underscore_int = iprot.readI32(); + 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('IntString') + if self.myint is not None: + oprot.writeFieldBegin('myint', TType.I32, 1) + oprot.writeI32(self.myint) + oprot.writeFieldEnd() + if self.myString is not None: + oprot.writeFieldBegin('myString', TType.STRING, 2) + oprot.writeString(self.myString) + oprot.writeFieldEnd() + if self.underscore_int is not None: + oprot.writeFieldBegin('underscore_int', TType.I32, 3) + oprot.writeI32(self.underscore_int) + 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 Complex: + """ + Attributes: + - aint + - aString + - lint + - lString + - lintString + - mStringString + """ + + thrift_spec = ( + None, # 0 + (1, TType.I32, 'aint', None, None, ), # 1 + (2, TType.STRING, 'aString', None, None, ), # 2 + (3, TType.LIST, 'lint', (TType.I32,None), None, ), # 3 + (4, TType.LIST, 'lString', (TType.STRING,None), None, ), # 4 + (5, TType.LIST, 'lintString', (TType.STRUCT,(IntString, IntString.thrift_spec)), None, ), # 5 + (6, TType.MAP, 'mStringString', (TType.STRING,None,TType.STRING,None), None, ), # 6 + ) + + def __init__(self, aint=None, aString=None, lint=None, lString=None, lintString=None, mStringString=None,): + self.aint = aint + self.aString = aString + self.lint = lint + self.lString = lString + self.lintString = lintString + self.mStringString = mStringString + + 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.I32: + self.aint = iprot.readI32(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.aString = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.LIST: + self.lint = [] + (_etype3, _size0) = iprot.readListBegin() + for _i4 in xrange(_size0): + _elem5 = iprot.readI32(); + self.lint.append(_elem5) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.LIST: + self.lString = [] + (_etype9, _size6) = iprot.readListBegin() + for _i10 in xrange(_size6): + _elem11 = iprot.readString(); + self.lString.append(_elem11) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.LIST: + self.lintString = [] + (_etype15, _size12) = iprot.readListBegin() + for _i16 in xrange(_size12): + _elem17 = IntString() + _elem17.read(iprot) + self.lintString.append(_elem17) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 6: + if ftype == TType.MAP: + self.mStringString = {} + (_ktype19, _vtype20, _size18 ) = iprot.readMapBegin() + for _i22 in xrange(_size18): + _key23 = iprot.readString(); + _val24 = iprot.readString(); + self.mStringString[_key23] = _val24 + iprot.readMapEnd() + 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('Complex') + if self.aint is not None: + oprot.writeFieldBegin('aint', TType.I32, 1) + oprot.writeI32(self.aint) + oprot.writeFieldEnd() + if self.aString is not None: + oprot.writeFieldBegin('aString', TType.STRING, 2) + oprot.writeString(self.aString) + oprot.writeFieldEnd() + if self.lint is not None: + oprot.writeFieldBegin('lint', TType.LIST, 3) + oprot.writeListBegin(TType.I32, len(self.lint)) + for iter25 in self.lint: + oprot.writeI32(iter25) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.lString is not None: + oprot.writeFieldBegin('lString', TType.LIST, 4) + oprot.writeListBegin(TType.STRING, len(self.lString)) + for iter26 in self.lString: + oprot.writeString(iter26) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.lintString is not None: + oprot.writeFieldBegin('lintString', TType.LIST, 5) + oprot.writeListBegin(TType.STRUCT, len(self.lintString)) + for iter27 in self.lintString: + iter27.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.mStringString is not None: + oprot.writeFieldBegin('mStringString', TType.MAP, 6) + oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.mStringString)) + for kiter28,viter29 in self.mStringString.items(): + oprot.writeString(kiter28) + oprot.writeString(viter29) + oprot.writeMapEnd() + 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) Added: hive/trunk/serde/src/gen/thrift/gen-py/megastruct/__init__.py URL: http://svn.apache.org/viewvc/hive/trunk/serde/src/gen/thrift/gen-py/megastruct/__init__.py?rev=1471260&view=auto ============================================================================== --- hive/trunk/serde/src/gen/thrift/gen-py/megastruct/__init__.py (added) +++ hive/trunk/serde/src/gen/thrift/gen-py/megastruct/__init__.py Wed Apr 24 06:06:06 2013 @@ -0,0 +1 @@ +__all__ = ['ttypes', 'constants'] Added: hive/trunk/serde/src/gen/thrift/gen-py/megastruct/constants.py URL: http://svn.apache.org/viewvc/hive/trunk/serde/src/gen/thrift/gen-py/megastruct/constants.py?rev=1471260&view=auto ============================================================================== --- hive/trunk/serde/src/gen/thrift/gen-py/megastruct/constants.py (added) +++ hive/trunk/serde/src/gen/thrift/gen-py/megastruct/constants.py Wed Apr 24 06:06:06 2013 @@ -0,0 +1,11 @@ +# +# Autogenerated by Thrift Compiler (0.9.0) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# +# options string: py +# + +from thrift.Thrift import TType, TMessageType, TException, TApplicationException +from ttypes import * + Added: hive/trunk/serde/src/gen/thrift/gen-py/megastruct/ttypes.py URL: http://svn.apache.org/viewvc/hive/trunk/serde/src/gen/thrift/gen-py/megastruct/ttypes.py?rev=1471260&view=auto ============================================================================== --- hive/trunk/serde/src/gen/thrift/gen-py/megastruct/ttypes.py (added) +++ hive/trunk/serde/src/gen/thrift/gen-py/megastruct/ttypes.py Wed Apr 24 06:06:06 2013 @@ -0,0 +1,520 @@ +# +# Autogenerated by Thrift Compiler (0.9.0) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# +# options string: py +# + +from thrift.Thrift import TType, TMessageType, TException, TApplicationException + +from thrift.transport import TTransport +from thrift.protocol import TBinaryProtocol, TProtocol +try: + from thrift.protocol import fastbinary +except: + fastbinary = None + + +class MyEnum: + LLAMA = 1 + ALPACA = 2 + + _VALUES_TO_NAMES = { + 1: "LLAMA", + 2: "ALPACA", + } + + _NAMES_TO_VALUES = { + "LLAMA": 1, + "ALPACA": 2, + } + + +class MiniStruct: + """ + Attributes: + - my_string + - my_enum + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'my_string', None, None, ), # 1 + (2, TType.I32, 'my_enum', None, None, ), # 2 + ) + + def __init__(self, my_string=None, my_enum=None,): + self.my_string = my_string + self.my_enum = my_enum + + 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.STRING: + self.my_string = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.I32: + self.my_enum = iprot.readI32(); + 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('MiniStruct') + if self.my_string is not None: + oprot.writeFieldBegin('my_string', TType.STRING, 1) + oprot.writeString(self.my_string) + oprot.writeFieldEnd() + if self.my_enum is not None: + oprot.writeFieldBegin('my_enum', TType.I32, 2) + oprot.writeI32(self.my_enum) + 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 MegaStruct: + """ + Attributes: + - my_bool + - my_byte + - my_16bit_int + - my_32bit_int + - my_64bit_int + - my_double + - my_string + - my_binary + - my_string_string_map + - my_string_enum_map + - my_enum_string_map + - my_enum_struct_map + - my_enum_stringlist_map + - my_enum_structlist_map + - my_stringlist + - my_structlist + - my_enumlist + - my_stringset + - my_enumset + - my_structset + """ + + thrift_spec = ( + None, # 0 + (1, TType.BOOL, 'my_bool', None, None, ), # 1 + (2, TType.BYTE, 'my_byte', None, None, ), # 2 + (3, TType.I16, 'my_16bit_int', None, None, ), # 3 + (4, TType.I32, 'my_32bit_int', None, None, ), # 4 + (5, TType.I64, 'my_64bit_int', None, None, ), # 5 + (6, TType.DOUBLE, 'my_double', None, None, ), # 6 + (7, TType.STRING, 'my_string', None, None, ), # 7 + (8, TType.STRING, 'my_binary', None, None, ), # 8 + (9, TType.MAP, 'my_string_string_map', (TType.STRING,None,TType.STRING,None), None, ), # 9 + (10, TType.MAP, 'my_string_enum_map', (TType.STRING,None,TType.I32,None), None, ), # 10 + (11, TType.MAP, 'my_enum_string_map', (TType.I32,None,TType.STRING,None), None, ), # 11 + (12, TType.MAP, 'my_enum_struct_map', (TType.I32,None,TType.STRUCT,(MiniStruct, MiniStruct.thrift_spec)), None, ), # 12 + (13, TType.MAP, 'my_enum_stringlist_map', (TType.I32,None,TType.LIST,(TType.STRING,None)), None, ), # 13 + (14, TType.MAP, 'my_enum_structlist_map', (TType.I32,None,TType.LIST,(TType.STRUCT,(MiniStruct, MiniStruct.thrift_spec))), None, ), # 14 + (15, TType.LIST, 'my_stringlist', (TType.STRING,None), None, ), # 15 + (16, TType.LIST, 'my_structlist', (TType.STRUCT,(MiniStruct, MiniStruct.thrift_spec)), None, ), # 16 + (17, TType.LIST, 'my_enumlist', (TType.I32,None), None, ), # 17 + (18, TType.SET, 'my_stringset', (TType.STRING,None), None, ), # 18 + (19, TType.SET, 'my_enumset', (TType.I32,None), None, ), # 19 + (20, TType.SET, 'my_structset', (TType.STRUCT,(MiniStruct, MiniStruct.thrift_spec)), None, ), # 20 + ) + + def __init__(self, my_bool=None, my_byte=None, my_16bit_int=None, my_32bit_int=None, my_64bit_int=None, my_double=None, my_string=None, my_binary=None, my_string_string_map=None, my_string_enum_map=None, my_enum_string_map=None, my_enum_struct_map=None, my_enum_stringlist_map=None, my_enum_structlist_map=None, my_stringlist=None, my_structlist=None, my_enumlist=None, my_stringset=None, my_enumset=None, my_structset=None,): + self.my_bool = my_bool + self.my_byte = my_byte + self.my_16bit_int = my_16bit_int + self.my_32bit_int = my_32bit_int + self.my_64bit_int = my_64bit_int + self.my_double = my_double + self.my_string = my_string + self.my_binary = my_binary + self.my_string_string_map = my_string_string_map + self.my_string_enum_map = my_string_enum_map + self.my_enum_string_map = my_enum_string_map + self.my_enum_struct_map = my_enum_struct_map + self.my_enum_stringlist_map = my_enum_stringlist_map + self.my_enum_structlist_map = my_enum_structlist_map + self.my_stringlist = my_stringlist + self.my_structlist = my_structlist + self.my_enumlist = my_enumlist + self.my_stringset = my_stringset + self.my_enumset = my_enumset + self.my_structset = my_structset + + 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.BOOL: + self.my_bool = iprot.readBool(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.BYTE: + self.my_byte = iprot.readByte(); + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.I16: + self.my_16bit_int = iprot.readI16(); + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.I32: + self.my_32bit_int = iprot.readI32(); + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.I64: + self.my_64bit_int = iprot.readI64(); + else: + iprot.skip(ftype) + elif fid == 6: + if ftype == TType.DOUBLE: + self.my_double = iprot.readDouble(); + else: + iprot.skip(ftype) + elif fid == 7: + if ftype == TType.STRING: + self.my_string = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 8: + if ftype == TType.STRING: + self.my_binary = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 9: + if ftype == TType.MAP: + self.my_string_string_map = {} + (_ktype1, _vtype2, _size0 ) = iprot.readMapBegin() + for _i4 in xrange(_size0): + _key5 = iprot.readString(); + _val6 = iprot.readString(); + self.my_string_string_map[_key5] = _val6 + iprot.readMapEnd() + else: + iprot.skip(ftype) + elif fid == 10: + if ftype == TType.MAP: + self.my_string_enum_map = {} + (_ktype8, _vtype9, _size7 ) = iprot.readMapBegin() + for _i11 in xrange(_size7): + _key12 = iprot.readString(); + _val13 = iprot.readI32(); + self.my_string_enum_map[_key12] = _val13 + iprot.readMapEnd() + else: + iprot.skip(ftype) + elif fid == 11: + if ftype == TType.MAP: + self.my_enum_string_map = {} + (_ktype15, _vtype16, _size14 ) = iprot.readMapBegin() + for _i18 in xrange(_size14): + _key19 = iprot.readI32(); + _val20 = iprot.readString(); + self.my_enum_string_map[_key19] = _val20 + iprot.readMapEnd() + else: + iprot.skip(ftype) + elif fid == 12: + if ftype == TType.MAP: + self.my_enum_struct_map = {} + (_ktype22, _vtype23, _size21 ) = iprot.readMapBegin() + for _i25 in xrange(_size21): + _key26 = iprot.readI32(); + _val27 = MiniStruct() + _val27.read(iprot) + self.my_enum_struct_map[_key26] = _val27 + iprot.readMapEnd() + else: + iprot.skip(ftype) + elif fid == 13: + if ftype == TType.MAP: + self.my_enum_stringlist_map = {} + (_ktype29, _vtype30, _size28 ) = iprot.readMapBegin() + for _i32 in xrange(_size28): + _key33 = iprot.readI32(); + _val34 = [] + (_etype38, _size35) = iprot.readListBegin() + for _i39 in xrange(_size35): + _elem40 = iprot.readString(); + _val34.append(_elem40) + iprot.readListEnd() + self.my_enum_stringlist_map[_key33] = _val34 + iprot.readMapEnd() + else: + iprot.skip(ftype) + elif fid == 14: + if ftype == TType.MAP: + self.my_enum_structlist_map = {} + (_ktype42, _vtype43, _size41 ) = iprot.readMapBegin() + for _i45 in xrange(_size41): + _key46 = iprot.readI32(); + _val47 = [] + (_etype51, _size48) = iprot.readListBegin() + for _i52 in xrange(_size48): + _elem53 = MiniStruct() + _elem53.read(iprot) + _val47.append(_elem53) + iprot.readListEnd() + self.my_enum_structlist_map[_key46] = _val47 + iprot.readMapEnd() + else: + iprot.skip(ftype) + elif fid == 15: + if ftype == TType.LIST: + self.my_stringlist = [] + (_etype57, _size54) = iprot.readListBegin() + for _i58 in xrange(_size54): + _elem59 = iprot.readString(); + self.my_stringlist.append(_elem59) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 16: + if ftype == TType.LIST: + self.my_structlist = [] + (_etype63, _size60) = iprot.readListBegin() + for _i64 in xrange(_size60): + _elem65 = MiniStruct() + _elem65.read(iprot) + self.my_structlist.append(_elem65) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 17: + if ftype == TType.LIST: + self.my_enumlist = [] + (_etype69, _size66) = iprot.readListBegin() + for _i70 in xrange(_size66): + _elem71 = iprot.readI32(); + self.my_enumlist.append(_elem71) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 18: + if ftype == TType.SET: + self.my_stringset = set() + (_etype75, _size72) = iprot.readSetBegin() + for _i76 in xrange(_size72): + _elem77 = iprot.readString(); + self.my_stringset.add(_elem77) + iprot.readSetEnd() + else: + iprot.skip(ftype) + elif fid == 19: + if ftype == TType.SET: + self.my_enumset = set() + (_etype81, _size78) = iprot.readSetBegin() + for _i82 in xrange(_size78): + _elem83 = iprot.readI32(); + self.my_enumset.add(_elem83) + iprot.readSetEnd() + else: + iprot.skip(ftype) + elif fid == 20: + if ftype == TType.SET: + self.my_structset = set() + (_etype87, _size84) = iprot.readSetBegin() + for _i88 in xrange(_size84): + _elem89 = MiniStruct() + _elem89.read(iprot) + self.my_structset.add(_elem89) + iprot.readSetEnd() + 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('MegaStruct') + if self.my_bool is not None: + oprot.writeFieldBegin('my_bool', TType.BOOL, 1) + oprot.writeBool(self.my_bool) + oprot.writeFieldEnd() + if self.my_byte is not None: + oprot.writeFieldBegin('my_byte', TType.BYTE, 2) + oprot.writeByte(self.my_byte) + oprot.writeFieldEnd() + if self.my_16bit_int is not None: + oprot.writeFieldBegin('my_16bit_int', TType.I16, 3) + oprot.writeI16(self.my_16bit_int) + oprot.writeFieldEnd() + if self.my_32bit_int is not None: + oprot.writeFieldBegin('my_32bit_int', TType.I32, 4) + oprot.writeI32(self.my_32bit_int) + oprot.writeFieldEnd() + if self.my_64bit_int is not None: + oprot.writeFieldBegin('my_64bit_int', TType.I64, 5) + oprot.writeI64(self.my_64bit_int) + oprot.writeFieldEnd() + if self.my_double is not None: + oprot.writeFieldBegin('my_double', TType.DOUBLE, 6) + oprot.writeDouble(self.my_double) + oprot.writeFieldEnd() + if self.my_string is not None: + oprot.writeFieldBegin('my_string', TType.STRING, 7) + oprot.writeString(self.my_string) + oprot.writeFieldEnd() + if self.my_binary is not None: + oprot.writeFieldBegin('my_binary', TType.STRING, 8) + oprot.writeString(self.my_binary) + oprot.writeFieldEnd() + if self.my_string_string_map is not None: + oprot.writeFieldBegin('my_string_string_map', TType.MAP, 9) + oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.my_string_string_map)) + for kiter90,viter91 in self.my_string_string_map.items(): + oprot.writeString(kiter90) + oprot.writeString(viter91) + oprot.writeMapEnd() + oprot.writeFieldEnd() + if self.my_string_enum_map is not None: + oprot.writeFieldBegin('my_string_enum_map', TType.MAP, 10) + oprot.writeMapBegin(TType.STRING, TType.I32, len(self.my_string_enum_map)) + for kiter92,viter93 in self.my_string_enum_map.items(): + oprot.writeString(kiter92) + oprot.writeI32(viter93) + oprot.writeMapEnd() + oprot.writeFieldEnd() + if self.my_enum_string_map is not None: + oprot.writeFieldBegin('my_enum_string_map', TType.MAP, 11) + oprot.writeMapBegin(TType.I32, TType.STRING, len(self.my_enum_string_map)) + for kiter94,viter95 in self.my_enum_string_map.items(): + oprot.writeI32(kiter94) + oprot.writeString(viter95) + oprot.writeMapEnd() + oprot.writeFieldEnd() + if self.my_enum_struct_map is not None: + oprot.writeFieldBegin('my_enum_struct_map', TType.MAP, 12) + oprot.writeMapBegin(TType.I32, TType.STRUCT, len(self.my_enum_struct_map)) + for kiter96,viter97 in self.my_enum_struct_map.items(): + oprot.writeI32(kiter96) + viter97.write(oprot) + oprot.writeMapEnd() + oprot.writeFieldEnd() + if self.my_enum_stringlist_map is not None: + oprot.writeFieldBegin('my_enum_stringlist_map', TType.MAP, 13) + oprot.writeMapBegin(TType.I32, TType.LIST, len(self.my_enum_stringlist_map)) + for kiter98,viter99 in self.my_enum_stringlist_map.items(): + oprot.writeI32(kiter98) + oprot.writeListBegin(TType.STRING, len(viter99)) + for iter100 in viter99: + oprot.writeString(iter100) + oprot.writeListEnd() + oprot.writeMapEnd() + oprot.writeFieldEnd() + if self.my_enum_structlist_map is not None: + oprot.writeFieldBegin('my_enum_structlist_map', TType.MAP, 14) + oprot.writeMapBegin(TType.I32, TType.LIST, len(self.my_enum_structlist_map)) + for kiter101,viter102 in self.my_enum_structlist_map.items(): + oprot.writeI32(kiter101) + oprot.writeListBegin(TType.STRUCT, len(viter102)) + for iter103 in viter102: + iter103.write(oprot) + oprot.writeListEnd() + oprot.writeMapEnd() + oprot.writeFieldEnd() + if self.my_stringlist is not None: + oprot.writeFieldBegin('my_stringlist', TType.LIST, 15) + oprot.writeListBegin(TType.STRING, len(self.my_stringlist)) + for iter104 in self.my_stringlist: + oprot.writeString(iter104) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.my_structlist is not None: + oprot.writeFieldBegin('my_structlist', TType.LIST, 16) + oprot.writeListBegin(TType.STRUCT, len(self.my_structlist)) + for iter105 in self.my_structlist: + iter105.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.my_enumlist is not None: + oprot.writeFieldBegin('my_enumlist', TType.LIST, 17) + oprot.writeListBegin(TType.I32, len(self.my_enumlist)) + for iter106 in self.my_enumlist: + oprot.writeI32(iter106) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.my_stringset is not None: + oprot.writeFieldBegin('my_stringset', TType.SET, 18) + oprot.writeSetBegin(TType.STRING, len(self.my_stringset)) + for iter107 in self.my_stringset: + oprot.writeString(iter107) + oprot.writeSetEnd() + oprot.writeFieldEnd() + if self.my_enumset is not None: + oprot.writeFieldBegin('my_enumset', TType.SET, 19) + oprot.writeSetBegin(TType.I32, len(self.my_enumset)) + for iter108 in self.my_enumset: + oprot.writeI32(iter108) + oprot.writeSetEnd() + oprot.writeFieldEnd() + if self.my_structset is not None: + oprot.writeFieldBegin('my_structset', TType.SET, 20) + oprot.writeSetBegin(TType.STRUCT, len(self.my_structset)) + for iter109 in self.my_structset: + iter109.write(oprot) + oprot.writeSetEnd() + 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) Added: hive/trunk/serde/src/gen/thrift/gen-py/testthrift/__init__.py URL: http://svn.apache.org/viewvc/hive/trunk/serde/src/gen/thrift/gen-py/testthrift/__init__.py?rev=1471260&view=auto ============================================================================== --- hive/trunk/serde/src/gen/thrift/gen-py/testthrift/__init__.py (added) +++ hive/trunk/serde/src/gen/thrift/gen-py/testthrift/__init__.py Wed Apr 24 06:06:06 2013 @@ -0,0 +1 @@ +__all__ = ['ttypes', 'constants'] Added: hive/trunk/serde/src/gen/thrift/gen-py/testthrift/constants.py URL: http://svn.apache.org/viewvc/hive/trunk/serde/src/gen/thrift/gen-py/testthrift/constants.py?rev=1471260&view=auto ============================================================================== --- hive/trunk/serde/src/gen/thrift/gen-py/testthrift/constants.py (added) +++ hive/trunk/serde/src/gen/thrift/gen-py/testthrift/constants.py Wed Apr 24 06:06:06 2013 @@ -0,0 +1,11 @@ +# +# Autogenerated by Thrift Compiler (0.9.0) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# +# options string: py +# + +from thrift.Thrift import TType, TMessageType, TException, TApplicationException +from ttypes import * + Added: hive/trunk/serde/src/gen/thrift/gen-py/testthrift/ttypes.py URL: http://svn.apache.org/viewvc/hive/trunk/serde/src/gen/thrift/gen-py/testthrift/ttypes.py?rev=1471260&view=auto ============================================================================== --- hive/trunk/serde/src/gen/thrift/gen-py/testthrift/ttypes.py (added) +++ hive/trunk/serde/src/gen/thrift/gen-py/testthrift/ttypes.py Wed Apr 24 06:06:06 2013 @@ -0,0 +1,171 @@ +# +# Autogenerated by Thrift Compiler (0.9.0) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# +# options string: py +# + +from thrift.Thrift import TType, TMessageType, TException, TApplicationException + +from thrift.transport import TTransport +from thrift.protocol import TBinaryProtocol, TProtocol +try: + from thrift.protocol import fastbinary +except: + fastbinary = None + + + +class InnerStruct: + """ + Attributes: + - field0 + """ + + thrift_spec = ( + None, # 0 + (1, TType.I32, 'field0', None, None, ), # 1 + ) + + def __init__(self, field0=None,): + self.field0 = field0 + + 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.I32: + self.field0 = iprot.readI32(); + 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('InnerStruct') + if self.field0 is not None: + oprot.writeFieldBegin('field0', TType.I32, 1) + oprot.writeI32(self.field0) + 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 ThriftTestObj: + """ + Attributes: + - field1 + - field2 + - field3 + """ + + thrift_spec = ( + None, # 0 + (1, TType.I32, 'field1', None, None, ), # 1 + (2, TType.STRING, 'field2', None, None, ), # 2 + (3, TType.LIST, 'field3', (TType.STRUCT,(InnerStruct, InnerStruct.thrift_spec)), None, ), # 3 + ) + + def __init__(self, field1=None, field2=None, field3=None,): + self.field1 = field1 + self.field2 = field2 + self.field3 = field3 + + 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.I32: + self.field1 = iprot.readI32(); + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.field2 = iprot.readString(); + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.LIST: + self.field3 = [] + (_etype3, _size0) = iprot.readListBegin() + for _i4 in xrange(_size0): + _elem5 = InnerStruct() + _elem5.read(iprot) + self.field3.append(_elem5) + iprot.readListEnd() + 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('ThriftTestObj') + if self.field1 is not None: + oprot.writeFieldBegin('field1', TType.I32, 1) + oprot.writeI32(self.field1) + oprot.writeFieldEnd() + if self.field2 is not None: + oprot.writeFieldBegin('field2', TType.STRING, 2) + oprot.writeString(self.field2) + oprot.writeFieldEnd() + if self.field3 is not None: + oprot.writeFieldBegin('field3', TType.LIST, 3) + oprot.writeListBegin(TType.STRUCT, len(self.field3)) + for iter6 in self.field3: + iter6.write(oprot) + oprot.writeListEnd() + 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) Added: hive/trunk/serde/src/gen/thrift/gen-rb/complex_constants.rb URL: http://svn.apache.org/viewvc/hive/trunk/serde/src/gen/thrift/gen-rb/complex_constants.rb?rev=1471260&view=auto ============================================================================== --- hive/trunk/serde/src/gen/thrift/gen-rb/complex_constants.rb (added) +++ hive/trunk/serde/src/gen/thrift/gen-rb/complex_constants.rb Wed Apr 24 06:06:06 2013 @@ -0,0 +1,9 @@ +# +# Autogenerated by Thrift Compiler (0.9.0) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# + +require 'thrift' +require 'complex_types' + Added: hive/trunk/serde/src/gen/thrift/gen-rb/complex_types.rb URL: http://svn.apache.org/viewvc/hive/trunk/serde/src/gen/thrift/gen-rb/complex_types.rb?rev=1471260&view=auto ============================================================================== --- hive/trunk/serde/src/gen/thrift/gen-rb/complex_types.rb (added) +++ hive/trunk/serde/src/gen/thrift/gen-rb/complex_types.rb Wed Apr 24 06:06:06 2013 @@ -0,0 +1,54 @@ +# +# Autogenerated by Thrift Compiler (0.9.0) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# + +require 'thrift' + +class IntString + include ::Thrift::Struct, ::Thrift::Struct_Union + MYINT = 1 + MYSTRING = 2 + UNDERSCORE_INT = 3 + + FIELDS = { + MYINT => {:type => ::Thrift::Types::I32, :name => 'myint'}, + MYSTRING => {:type => ::Thrift::Types::STRING, :name => 'myString'}, + UNDERSCORE_INT => {:type => ::Thrift::Types::I32, :name => 'underscore_int'} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self +end + +class Complex + include ::Thrift::Struct, ::Thrift::Struct_Union + AINT = 1 + ASTRING = 2 + LINT = 3 + LSTRING = 4 + LINTSTRING = 5 + MSTRINGSTRING = 6 + + FIELDS = { + AINT => {:type => ::Thrift::Types::I32, :name => 'aint'}, + ASTRING => {:type => ::Thrift::Types::STRING, :name => 'aString'}, + LINT => {:type => ::Thrift::Types::LIST, :name => 'lint', :element => {:type => ::Thrift::Types::I32}}, + LSTRING => {:type => ::Thrift::Types::LIST, :name => 'lString', :element => {:type => ::Thrift::Types::STRING}}, + LINTSTRING => {:type => ::Thrift::Types::LIST, :name => 'lintString', :element => {:type => ::Thrift::Types::STRUCT, :class => ::IntString}}, + MSTRINGSTRING => {:type => ::Thrift::Types::MAP, :name => 'mStringString', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self +end + Added: hive/trunk/serde/src/gen/thrift/gen-rb/megastruct_constants.rb URL: http://svn.apache.org/viewvc/hive/trunk/serde/src/gen/thrift/gen-rb/megastruct_constants.rb?rev=1471260&view=auto ============================================================================== --- hive/trunk/serde/src/gen/thrift/gen-rb/megastruct_constants.rb (added) +++ hive/trunk/serde/src/gen/thrift/gen-rb/megastruct_constants.rb Wed Apr 24 06:06:06 2013 @@ -0,0 +1,9 @@ +# +# Autogenerated by Thrift Compiler (0.9.0) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# + +require 'thrift' +require 'megastruct_types' + Added: hive/trunk/serde/src/gen/thrift/gen-rb/megastruct_types.rb URL: http://svn.apache.org/viewvc/hive/trunk/serde/src/gen/thrift/gen-rb/megastruct_types.rb?rev=1471260&view=auto ============================================================================== --- hive/trunk/serde/src/gen/thrift/gen-rb/megastruct_types.rb (added) +++ hive/trunk/serde/src/gen/thrift/gen-rb/megastruct_types.rb Wed Apr 24 06:06:06 2013 @@ -0,0 +1,90 @@ +# +# Autogenerated by Thrift Compiler (0.9.0) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# + +require 'thrift' + +module MyEnum + LLAMA = 1 + ALPACA = 2 + VALUE_MAP = {1 => "LLAMA", 2 => "ALPACA"} + VALID_VALUES = Set.new([LLAMA, ALPACA]).freeze +end + +class MiniStruct + include ::Thrift::Struct, ::Thrift::Struct_Union + MY_STRING = 1 + MY_ENUM = 2 + + FIELDS = { + MY_STRING => {:type => ::Thrift::Types::STRING, :name => 'my_string', :optional => true}, + MY_ENUM => {:type => ::Thrift::Types::I32, :name => 'my_enum', :optional => true, :enum_class => ::MyEnum} + } + + def struct_fields; FIELDS; end + + def validate + unless @my_enum.nil? || ::MyEnum::VALID_VALUES.include?(@my_enum) + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field my_enum!') + end + end + + ::Thrift::Struct.generate_accessors self +end + +class MegaStruct + include ::Thrift::Struct, ::Thrift::Struct_Union + MY_BOOL = 1 + MY_BYTE = 2 + MY_16BIT_INT = 3 + MY_32BIT_INT = 4 + MY_64BIT_INT = 5 + MY_DOUBLE = 6 + MY_STRING = 7 + MY_BINARY = 8 + MY_STRING_STRING_MAP = 9 + MY_STRING_ENUM_MAP = 10 + MY_ENUM_STRING_MAP = 11 + MY_ENUM_STRUCT_MAP = 12 + MY_ENUM_STRINGLIST_MAP = 13 + MY_ENUM_STRUCTLIST_MAP = 14 + MY_STRINGLIST = 15 + MY_STRUCTLIST = 16 + MY_ENUMLIST = 17 + MY_STRINGSET = 18 + MY_ENUMSET = 19 + MY_STRUCTSET = 20 + + FIELDS = { + MY_BOOL => {:type => ::Thrift::Types::BOOL, :name => 'my_bool', :optional => true}, + MY_BYTE => {:type => ::Thrift::Types::BYTE, :name => 'my_byte', :optional => true}, + MY_16BIT_INT => {:type => ::Thrift::Types::I16, :name => 'my_16bit_int', :optional => true}, + MY_32BIT_INT => {:type => ::Thrift::Types::I32, :name => 'my_32bit_int', :optional => true}, + MY_64BIT_INT => {:type => ::Thrift::Types::I64, :name => 'my_64bit_int', :optional => true}, + MY_DOUBLE => {:type => ::Thrift::Types::DOUBLE, :name => 'my_double', :optional => true}, + MY_STRING => {:type => ::Thrift::Types::STRING, :name => 'my_string', :optional => true}, + MY_BINARY => {:type => ::Thrift::Types::STRING, :name => 'my_binary', :binary => true, :optional => true}, + MY_STRING_STRING_MAP => {:type => ::Thrift::Types::MAP, :name => 'my_string_string_map', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}, :optional => true}, + MY_STRING_ENUM_MAP => {:type => ::Thrift::Types::MAP, :name => 'my_string_enum_map', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::I32, :enum_class => ::MyEnum}, :optional => true}, + MY_ENUM_STRING_MAP => {:type => ::Thrift::Types::MAP, :name => 'my_enum_string_map', :key => {:type => ::Thrift::Types::I32, :enum_class => ::MyEnum}, :value => {:type => ::Thrift::Types::STRING}, :optional => true}, + MY_ENUM_STRUCT_MAP => {:type => ::Thrift::Types::MAP, :name => 'my_enum_struct_map', :key => {:type => ::Thrift::Types::I32, :enum_class => ::MyEnum}, :value => {:type => ::Thrift::Types::STRUCT, :class => ::MiniStruct}, :optional => true}, + MY_ENUM_STRINGLIST_MAP => {:type => ::Thrift::Types::MAP, :name => 'my_enum_stringlist_map', :key => {:type => ::Thrift::Types::I32, :enum_class => ::MyEnum}, :value => {:type => ::Thrift::Types::LIST, :element => {:type => ::Thrift::Types::STRING}}, :optional => true}, + MY_ENUM_STRUCTLIST_MAP => {:type => ::Thrift::Types::MAP, :name => 'my_enum_structlist_map', :key => {:type => ::Thrift::Types::I32, :enum_class => ::MyEnum}, :value => {:type => ::Thrift::Types::LIST, :element => {:type => ::Thrift::Types::STRUCT, :class => ::MiniStruct}}, :optional => true}, + MY_STRINGLIST => {:type => ::Thrift::Types::LIST, :name => 'my_stringlist', :element => {:type => ::Thrift::Types::STRING}, :optional => true}, + MY_STRUCTLIST => {:type => ::Thrift::Types::LIST, :name => 'my_structlist', :element => {:type => ::Thrift::Types::STRUCT, :class => ::MiniStruct}, :optional => true}, + MY_ENUMLIST => {:type => ::Thrift::Types::LIST, :name => 'my_enumlist', :element => {:type => ::Thrift::Types::I32, :enum_class => ::MyEnum}, :optional => true}, + MY_STRINGSET => {:type => ::Thrift::Types::SET, :name => 'my_stringset', :element => {:type => ::Thrift::Types::STRING}, :optional => true}, + MY_ENUMSET => {:type => ::Thrift::Types::SET, :name => 'my_enumset', :element => {:type => ::Thrift::Types::I32, :enum_class => ::MyEnum}, :optional => true}, + MY_STRUCTSET => {:type => ::Thrift::Types::SET, :name => 'my_structset', :element => {:type => ::Thrift::Types::STRUCT, :class => ::MiniStruct}, :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self +end + Added: hive/trunk/serde/src/gen/thrift/gen-rb/testthrift_constants.rb URL: http://svn.apache.org/viewvc/hive/trunk/serde/src/gen/thrift/gen-rb/testthrift_constants.rb?rev=1471260&view=auto ============================================================================== --- hive/trunk/serde/src/gen/thrift/gen-rb/testthrift_constants.rb (added) +++ hive/trunk/serde/src/gen/thrift/gen-rb/testthrift_constants.rb Wed Apr 24 06:06:06 2013 @@ -0,0 +1,9 @@ +# +# Autogenerated by Thrift Compiler (0.9.0) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# + +require 'thrift' +require 'testthrift_types' + Added: hive/trunk/serde/src/gen/thrift/gen-rb/testthrift_types.rb URL: http://svn.apache.org/viewvc/hive/trunk/serde/src/gen/thrift/gen-rb/testthrift_types.rb?rev=1471260&view=auto ============================================================================== --- hive/trunk/serde/src/gen/thrift/gen-rb/testthrift_types.rb (added) +++ hive/trunk/serde/src/gen/thrift/gen-rb/testthrift_types.rb Wed Apr 24 06:06:06 2013 @@ -0,0 +1,44 @@ +# +# Autogenerated by Thrift Compiler (0.9.0) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# + +require 'thrift' + +class InnerStruct + include ::Thrift::Struct, ::Thrift::Struct_Union + FIELD0 = 1 + + FIELDS = { + FIELD0 => {:type => ::Thrift::Types::I32, :name => 'field0'} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self +end + +class ThriftTestObj + include ::Thrift::Struct, ::Thrift::Struct_Union + FIELD1 = 1 + FIELD2 = 2 + FIELD3 = 3 + + FIELDS = { + FIELD1 => {:type => ::Thrift::Types::I32, :name => 'field1'}, + FIELD2 => {:type => ::Thrift::Types::STRING, :name => 'field2'}, + FIELD3 => {:type => ::Thrift::Types::LIST, :name => 'field3', :element => {:type => ::Thrift::Types::STRUCT, :class => ::InnerStruct}} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self +end +