hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hashut...@apache.org
Subject svn commit: r1525254 [4/4] - in /hive/branches/vectorization: ./ beeline/src/java/org/apache/hive/beeline/ beeline/src/test/org/apache/hive/beeline/src/test/ jdbc/src/java/org/apache/hive/jdbc/ jdbc/src/test/org/apache/hive/jdbc/ ql/src/java/org/apache...
Date Sat, 21 Sep 2013 15:49:50 GMT
Modified: hive/branches/vectorization/service/src/gen/thrift/gen-py/TCLIService/ttypes.py
URL: http://svn.apache.org/viewvc/hive/branches/vectorization/service/src/gen/thrift/gen-py/TCLIService/ttypes.py?rev=1525254&r1=1525253&r2=1525254&view=diff
==============================================================================
--- hive/branches/vectorization/service/src/gen/thrift/gen-py/TCLIService/ttypes.py (original)
+++ hive/branches/vectorization/service/src/gen/thrift/gen-py/TCLIService/ttypes.py Sat Sep
21 15:49:49 2013
@@ -19,15 +19,18 @@ except:
 class TProtocolVersion:
   HIVE_CLI_SERVICE_PROTOCOL_V1 = 0
   HIVE_CLI_SERVICE_PROTOCOL_V2 = 1
+  HIVE_CLI_SERVICE_PROTOCOL_V3 = 2
 
   _VALUES_TO_NAMES = {
     0: "HIVE_CLI_SERVICE_PROTOCOL_V1",
     1: "HIVE_CLI_SERVICE_PROTOCOL_V2",
+    2: "HIVE_CLI_SERVICE_PROTOCOL_V3",
   }
 
   _NAMES_TO_VALUES = {
     "HIVE_CLI_SERVICE_PROTOCOL_V1": 0,
     "HIVE_CLI_SERVICE_PROTOCOL_V2": 1,
+    "HIVE_CLI_SERVICE_PROTOCOL_V3": 2,
   }
 
 class TTypeId:
@@ -49,6 +52,7 @@ class TTypeId:
   DECIMAL_TYPE = 15
   NULL_TYPE = 16
   DATE_TYPE = 17
+  VARCHAR_TYPE = 18
 
   _VALUES_TO_NAMES = {
     0: "BOOLEAN_TYPE",
@@ -69,6 +73,7 @@ class TTypeId:
     15: "DECIMAL_TYPE",
     16: "NULL_TYPE",
     17: "DATE_TYPE",
+    18: "VARCHAR_TYPE",
   }
 
   _NAMES_TO_VALUES = {
@@ -90,6 +95,7 @@ class TTypeId:
     "DECIMAL_TYPE": 15,
     "NULL_TYPE": 16,
     "DATE_TYPE": 17,
+    "VARCHAR_TYPE": 18,
   }
 
 class TStatusCode:
@@ -358,19 +364,167 @@ class TFetchOrientation:
   }
 
 
+class TTypeQualifierValue:
+  """
+  Attributes:
+   - i32Value
+   - stringValue
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.I32, 'i32Value', None, None, ), # 1
+    (2, TType.STRING, 'stringValue', None, None, ), # 2
+  )
+
+  def __init__(self, i32Value=None, stringValue=None,):
+    self.i32Value = i32Value
+    self.stringValue = stringValue
+
+  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.i32Value = iprot.readI32();
+        else:
+          iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRING:
+          self.stringValue = 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('TTypeQualifierValue')
+    if self.i32Value is not None:
+      oprot.writeFieldBegin('i32Value', TType.I32, 1)
+      oprot.writeI32(self.i32Value)
+      oprot.writeFieldEnd()
+    if self.stringValue is not None:
+      oprot.writeFieldBegin('stringValue', TType.STRING, 2)
+      oprot.writeString(self.stringValue)
+      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 TTypeQualifiers:
+  """
+  Attributes:
+   - qualifiers
+  """
+
+  thrift_spec = (
+    None, # 0
+    (1, TType.MAP, 'qualifiers', (TType.STRING,None,TType.STRUCT,(TTypeQualifierValue, TTypeQualifierValue.thrift_spec)),
None, ), # 1
+  )
+
+  def __init__(self, qualifiers=None,):
+    self.qualifiers = qualifiers
+
+  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.MAP:
+          self.qualifiers = {}
+          (_ktype1, _vtype2, _size0 ) = iprot.readMapBegin() 
+          for _i4 in xrange(_size0):
+            _key5 = iprot.readString();
+            _val6 = TTypeQualifierValue()
+            _val6.read(iprot)
+            self.qualifiers[_key5] = _val6
+          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('TTypeQualifiers')
+    if self.qualifiers is not None:
+      oprot.writeFieldBegin('qualifiers', TType.MAP, 1)
+      oprot.writeMapBegin(TType.STRING, TType.STRUCT, len(self.qualifiers))
+      for kiter7,viter8 in self.qualifiers.items():
+        oprot.writeString(kiter7)
+        viter8.write(oprot)
+      oprot.writeMapEnd()
+      oprot.writeFieldEnd()
+    oprot.writeFieldStop()
+    oprot.writeStructEnd()
+
+  def validate(self):
+    if self.qualifiers is None:
+      raise TProtocol.TProtocolException(message='Required field qualifiers 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 TPrimitiveTypeEntry:
   """
   Attributes:
    - type
+   - typeQualifiers
   """
 
   thrift_spec = (
     None, # 0
     (1, TType.I32, 'type', None, None, ), # 1
+    (2, TType.STRUCT, 'typeQualifiers', (TTypeQualifiers, TTypeQualifiers.thrift_spec), None,
), # 2
   )
 
-  def __init__(self, type=None,):
+  def __init__(self, type=None, typeQualifiers=None,):
     self.type = type
+    self.typeQualifiers = typeQualifiers
 
   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:
@@ -386,6 +540,12 @@ class TPrimitiveTypeEntry:
           self.type = iprot.readI32();
         else:
           iprot.skip(ftype)
+      elif fid == 2:
+        if ftype == TType.STRUCT:
+          self.typeQualifiers = TTypeQualifiers()
+          self.typeQualifiers.read(iprot)
+        else:
+          iprot.skip(ftype)
       else:
         iprot.skip(ftype)
       iprot.readFieldEnd()
@@ -400,6 +560,10 @@ class TPrimitiveTypeEntry:
       oprot.writeFieldBegin('type', TType.I32, 1)
       oprot.writeI32(self.type)
       oprot.writeFieldEnd()
+    if self.typeQualifiers is not None:
+      oprot.writeFieldBegin('typeQualifiers', TType.STRUCT, 2)
+      self.typeQualifiers.write(oprot)
+      oprot.writeFieldEnd()
     oprot.writeFieldStop()
     oprot.writeStructEnd()
 
@@ -584,11 +748,11 @@ class TStructTypeEntry:
       if fid == 1:
         if ftype == TType.MAP:
           self.nameToTypePtr = {}
-          (_ktype1, _vtype2, _size0 ) = iprot.readMapBegin() 
-          for _i4 in xrange(_size0):
-            _key5 = iprot.readString();
-            _val6 = iprot.readI32();
-            self.nameToTypePtr[_key5] = _val6
+          (_ktype10, _vtype11, _size9 ) = iprot.readMapBegin() 
+          for _i13 in xrange(_size9):
+            _key14 = iprot.readString();
+            _val15 = iprot.readI32();
+            self.nameToTypePtr[_key14] = _val15
           iprot.readMapEnd()
         else:
           iprot.skip(ftype)
@@ -605,9 +769,9 @@ class TStructTypeEntry:
     if self.nameToTypePtr is not None:
       oprot.writeFieldBegin('nameToTypePtr', TType.MAP, 1)
       oprot.writeMapBegin(TType.STRING, TType.I32, len(self.nameToTypePtr))
-      for kiter7,viter8 in self.nameToTypePtr.items():
-        oprot.writeString(kiter7)
-        oprot.writeI32(viter8)
+      for kiter16,viter17 in self.nameToTypePtr.items():
+        oprot.writeString(kiter16)
+        oprot.writeI32(viter17)
       oprot.writeMapEnd()
       oprot.writeFieldEnd()
     oprot.writeFieldStop()
@@ -656,11 +820,11 @@ class TUnionTypeEntry:
       if fid == 1:
         if ftype == TType.MAP:
           self.nameToTypePtr = {}
-          (_ktype10, _vtype11, _size9 ) = iprot.readMapBegin() 
-          for _i13 in xrange(_size9):
-            _key14 = iprot.readString();
-            _val15 = iprot.readI32();
-            self.nameToTypePtr[_key14] = _val15
+          (_ktype19, _vtype20, _size18 ) = iprot.readMapBegin() 
+          for _i22 in xrange(_size18):
+            _key23 = iprot.readString();
+            _val24 = iprot.readI32();
+            self.nameToTypePtr[_key23] = _val24
           iprot.readMapEnd()
         else:
           iprot.skip(ftype)
@@ -677,9 +841,9 @@ class TUnionTypeEntry:
     if self.nameToTypePtr is not None:
       oprot.writeFieldBegin('nameToTypePtr', TType.MAP, 1)
       oprot.writeMapBegin(TType.STRING, TType.I32, len(self.nameToTypePtr))
-      for kiter16,viter17 in self.nameToTypePtr.items():
-        oprot.writeString(kiter16)
-        oprot.writeI32(viter17)
+      for kiter25,viter26 in self.nameToTypePtr.items():
+        oprot.writeString(kiter25)
+        oprot.writeI32(viter26)
       oprot.writeMapEnd()
       oprot.writeFieldEnd()
     oprot.writeFieldStop()
@@ -916,11 +1080,11 @@ class TTypeDesc:
       if fid == 1:
         if ftype == TType.LIST:
           self.types = []
-          (_etype21, _size18) = iprot.readListBegin()
-          for _i22 in xrange(_size18):
-            _elem23 = TTypeEntry()
-            _elem23.read(iprot)
-            self.types.append(_elem23)
+          (_etype30, _size27) = iprot.readListBegin()
+          for _i31 in xrange(_size27):
+            _elem32 = TTypeEntry()
+            _elem32.read(iprot)
+            self.types.append(_elem32)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
@@ -937,8 +1101,8 @@ class TTypeDesc:
     if self.types is not None:
       oprot.writeFieldBegin('types', TType.LIST, 1)
       oprot.writeListBegin(TType.STRUCT, len(self.types))
-      for iter24 in self.types:
-        iter24.write(oprot)
+      for iter33 in self.types:
+        iter33.write(oprot)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     oprot.writeFieldStop()
@@ -1090,11 +1254,11 @@ class TTableSchema:
       if fid == 1:
         if ftype == TType.LIST:
           self.columns = []
-          (_etype28, _size25) = iprot.readListBegin()
-          for _i29 in xrange(_size25):
-            _elem30 = TColumnDesc()
-            _elem30.read(iprot)
-            self.columns.append(_elem30)
+          (_etype37, _size34) = iprot.readListBegin()
+          for _i38 in xrange(_size34):
+            _elem39 = TColumnDesc()
+            _elem39.read(iprot)
+            self.columns.append(_elem39)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
@@ -1111,8 +1275,8 @@ class TTableSchema:
     if self.columns is not None:
       oprot.writeFieldBegin('columns', TType.LIST, 1)
       oprot.writeListBegin(TType.STRUCT, len(self.columns))
-      for iter31 in self.columns:
-        iter31.write(oprot)
+      for iter40 in self.columns:
+        iter40.write(oprot)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     oprot.writeFieldStop()
@@ -1599,77 +1763,77 @@ class TColumn:
       if fid == 1:
         if ftype == TType.LIST:
           self.boolColumn = []
-          (_etype35, _size32) = iprot.readListBegin()
-          for _i36 in xrange(_size32):
-            _elem37 = TBoolValue()
-            _elem37.read(iprot)
-            self.boolColumn.append(_elem37)
+          (_etype44, _size41) = iprot.readListBegin()
+          for _i45 in xrange(_size41):
+            _elem46 = TBoolValue()
+            _elem46.read(iprot)
+            self.boolColumn.append(_elem46)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
       elif fid == 2:
         if ftype == TType.LIST:
           self.byteColumn = []
-          (_etype41, _size38) = iprot.readListBegin()
-          for _i42 in xrange(_size38):
-            _elem43 = TByteValue()
-            _elem43.read(iprot)
-            self.byteColumn.append(_elem43)
+          (_etype50, _size47) = iprot.readListBegin()
+          for _i51 in xrange(_size47):
+            _elem52 = TByteValue()
+            _elem52.read(iprot)
+            self.byteColumn.append(_elem52)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
       elif fid == 3:
         if ftype == TType.LIST:
           self.i16Column = []
-          (_etype47, _size44) = iprot.readListBegin()
-          for _i48 in xrange(_size44):
-            _elem49 = TI16Value()
-            _elem49.read(iprot)
-            self.i16Column.append(_elem49)
+          (_etype56, _size53) = iprot.readListBegin()
+          for _i57 in xrange(_size53):
+            _elem58 = TI16Value()
+            _elem58.read(iprot)
+            self.i16Column.append(_elem58)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
       elif fid == 4:
         if ftype == TType.LIST:
           self.i32Column = []
-          (_etype53, _size50) = iprot.readListBegin()
-          for _i54 in xrange(_size50):
-            _elem55 = TI32Value()
-            _elem55.read(iprot)
-            self.i32Column.append(_elem55)
+          (_etype62, _size59) = iprot.readListBegin()
+          for _i63 in xrange(_size59):
+            _elem64 = TI32Value()
+            _elem64.read(iprot)
+            self.i32Column.append(_elem64)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
       elif fid == 5:
         if ftype == TType.LIST:
           self.i64Column = []
-          (_etype59, _size56) = iprot.readListBegin()
-          for _i60 in xrange(_size56):
-            _elem61 = TI64Value()
-            _elem61.read(iprot)
-            self.i64Column.append(_elem61)
+          (_etype68, _size65) = iprot.readListBegin()
+          for _i69 in xrange(_size65):
+            _elem70 = TI64Value()
+            _elem70.read(iprot)
+            self.i64Column.append(_elem70)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
       elif fid == 6:
         if ftype == TType.LIST:
           self.doubleColumn = []
-          (_etype65, _size62) = iprot.readListBegin()
-          for _i66 in xrange(_size62):
-            _elem67 = TDoubleValue()
-            _elem67.read(iprot)
-            self.doubleColumn.append(_elem67)
+          (_etype74, _size71) = iprot.readListBegin()
+          for _i75 in xrange(_size71):
+            _elem76 = TDoubleValue()
+            _elem76.read(iprot)
+            self.doubleColumn.append(_elem76)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
       elif fid == 7:
         if ftype == TType.LIST:
           self.stringColumn = []
-          (_etype71, _size68) = iprot.readListBegin()
-          for _i72 in xrange(_size68):
-            _elem73 = TStringValue()
-            _elem73.read(iprot)
-            self.stringColumn.append(_elem73)
+          (_etype80, _size77) = iprot.readListBegin()
+          for _i81 in xrange(_size77):
+            _elem82 = TStringValue()
+            _elem82.read(iprot)
+            self.stringColumn.append(_elem82)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
@@ -1686,50 +1850,50 @@ class TColumn:
     if self.boolColumn is not None:
       oprot.writeFieldBegin('boolColumn', TType.LIST, 1)
       oprot.writeListBegin(TType.STRUCT, len(self.boolColumn))
-      for iter74 in self.boolColumn:
-        iter74.write(oprot)
+      for iter83 in self.boolColumn:
+        iter83.write(oprot)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     if self.byteColumn is not None:
       oprot.writeFieldBegin('byteColumn', TType.LIST, 2)
       oprot.writeListBegin(TType.STRUCT, len(self.byteColumn))
-      for iter75 in self.byteColumn:
-        iter75.write(oprot)
+      for iter84 in self.byteColumn:
+        iter84.write(oprot)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     if self.i16Column is not None:
       oprot.writeFieldBegin('i16Column', TType.LIST, 3)
       oprot.writeListBegin(TType.STRUCT, len(self.i16Column))
-      for iter76 in self.i16Column:
-        iter76.write(oprot)
+      for iter85 in self.i16Column:
+        iter85.write(oprot)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     if self.i32Column is not None:
       oprot.writeFieldBegin('i32Column', TType.LIST, 4)
       oprot.writeListBegin(TType.STRUCT, len(self.i32Column))
-      for iter77 in self.i32Column:
-        iter77.write(oprot)
+      for iter86 in self.i32Column:
+        iter86.write(oprot)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     if self.i64Column is not None:
       oprot.writeFieldBegin('i64Column', TType.LIST, 5)
       oprot.writeListBegin(TType.STRUCT, len(self.i64Column))
-      for iter78 in self.i64Column:
-        iter78.write(oprot)
+      for iter87 in self.i64Column:
+        iter87.write(oprot)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     if self.doubleColumn is not None:
       oprot.writeFieldBegin('doubleColumn', TType.LIST, 6)
       oprot.writeListBegin(TType.STRUCT, len(self.doubleColumn))
-      for iter79 in self.doubleColumn:
-        iter79.write(oprot)
+      for iter88 in self.doubleColumn:
+        iter88.write(oprot)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     if self.stringColumn is not None:
       oprot.writeFieldBegin('stringColumn', TType.LIST, 7)
       oprot.writeListBegin(TType.STRUCT, len(self.stringColumn))
-      for iter80 in self.stringColumn:
-        iter80.write(oprot)
+      for iter89 in self.stringColumn:
+        iter89.write(oprot)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     oprot.writeFieldStop()
@@ -1915,11 +2079,11 @@ class TRow:
       if fid == 1:
         if ftype == TType.LIST:
           self.colVals = []
-          (_etype84, _size81) = iprot.readListBegin()
-          for _i85 in xrange(_size81):
-            _elem86 = TColumnValue()
-            _elem86.read(iprot)
-            self.colVals.append(_elem86)
+          (_etype93, _size90) = iprot.readListBegin()
+          for _i94 in xrange(_size90):
+            _elem95 = TColumnValue()
+            _elem95.read(iprot)
+            self.colVals.append(_elem95)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
@@ -1936,8 +2100,8 @@ class TRow:
     if self.colVals is not None:
       oprot.writeFieldBegin('colVals', TType.LIST, 1)
       oprot.writeListBegin(TType.STRUCT, len(self.colVals))
-      for iter87 in self.colVals:
-        iter87.write(oprot)
+      for iter96 in self.colVals:
+        iter96.write(oprot)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     oprot.writeFieldStop()
@@ -1997,22 +2161,22 @@ class TRowSet:
       elif fid == 2:
         if ftype == TType.LIST:
           self.rows = []
-          (_etype91, _size88) = iprot.readListBegin()
-          for _i92 in xrange(_size88):
-            _elem93 = TRow()
-            _elem93.read(iprot)
-            self.rows.append(_elem93)
+          (_etype100, _size97) = iprot.readListBegin()
+          for _i101 in xrange(_size97):
+            _elem102 = TRow()
+            _elem102.read(iprot)
+            self.rows.append(_elem102)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
       elif fid == 3:
         if ftype == TType.LIST:
           self.columns = []
-          (_etype97, _size94) = iprot.readListBegin()
-          for _i98 in xrange(_size94):
-            _elem99 = TColumn()
-            _elem99.read(iprot)
-            self.columns.append(_elem99)
+          (_etype106, _size103) = iprot.readListBegin()
+          for _i107 in xrange(_size103):
+            _elem108 = TColumn()
+            _elem108.read(iprot)
+            self.columns.append(_elem108)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
@@ -2033,15 +2197,15 @@ class TRowSet:
     if self.rows is not None:
       oprot.writeFieldBegin('rows', TType.LIST, 2)
       oprot.writeListBegin(TType.STRUCT, len(self.rows))
-      for iter100 in self.rows:
-        iter100.write(oprot)
+      for iter109 in self.rows:
+        iter109.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 iter101 in self.columns:
-        iter101.write(oprot)
+      for iter110 in self.columns:
+        iter110.write(oprot)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     oprot.writeFieldStop()
@@ -2109,10 +2273,10 @@ class TStatus:
       elif fid == 2:
         if ftype == TType.LIST:
           self.infoMessages = []
-          (_etype105, _size102) = iprot.readListBegin()
-          for _i106 in xrange(_size102):
-            _elem107 = iprot.readString();
-            self.infoMessages.append(_elem107)
+          (_etype114, _size111) = iprot.readListBegin()
+          for _i115 in xrange(_size111):
+            _elem116 = iprot.readString();
+            self.infoMessages.append(_elem116)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
@@ -2148,8 +2312,8 @@ class TStatus:
     if self.infoMessages is not None:
       oprot.writeFieldBegin('infoMessages', TType.LIST, 2)
       oprot.writeListBegin(TType.STRING, len(self.infoMessages))
-      for iter108 in self.infoMessages:
-        oprot.writeString(iter108)
+      for iter117 in self.infoMessages:
+        oprot.writeString(iter117)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     if self.sqlState is not None:
@@ -2437,7 +2601,7 @@ class TOpenSessionReq:
 
   thrift_spec = (
     None, # 0
-    (1, TType.I32, 'client_protocol', None,     1, ), # 1
+    (1, TType.I32, 'client_protocol', None,     2, ), # 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
@@ -2476,11 +2640,11 @@ class TOpenSessionReq:
       elif fid == 4:
         if ftype == TType.MAP:
           self.configuration = {}
-          (_ktype110, _vtype111, _size109 ) = iprot.readMapBegin() 
-          for _i113 in xrange(_size109):
-            _key114 = iprot.readString();
-            _val115 = iprot.readString();
-            self.configuration[_key114] = _val115
+          (_ktype119, _vtype120, _size118 ) = iprot.readMapBegin() 
+          for _i122 in xrange(_size118):
+            _key123 = iprot.readString();
+            _val124 = iprot.readString();
+            self.configuration[_key123] = _val124
           iprot.readMapEnd()
         else:
           iprot.skip(ftype)
@@ -2509,9 +2673,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 kiter116,viter117 in self.configuration.items():
-        oprot.writeString(kiter116)
-        oprot.writeString(viter117)
+      for kiter125,viter126 in self.configuration.items():
+        oprot.writeString(kiter125)
+        oprot.writeString(viter126)
       oprot.writeMapEnd()
       oprot.writeFieldEnd()
     oprot.writeFieldStop()
@@ -2546,7 +2710,7 @@ class TOpenSessionResp:
   thrift_spec = (
     None, # 0
     (1, TType.STRUCT, 'status', (TStatus, TStatus.thrift_spec), None, ), # 1
-    (2, TType.I32, 'serverProtocolVersion', None,     1, ), # 2
+    (2, TType.I32, 'serverProtocolVersion', None,     2, ), # 2
     (3, TType.STRUCT, 'sessionHandle', (TSessionHandle, TSessionHandle.thrift_spec), None,
), # 3
     (4, TType.MAP, 'configuration', (TType.STRING,None,TType.STRING,None), None, ), # 4
   )
@@ -2586,11 +2750,11 @@ class TOpenSessionResp:
       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
+          (_ktype128, _vtype129, _size127 ) = iprot.readMapBegin() 
+          for _i131 in xrange(_size127):
+            _key132 = iprot.readString();
+            _val133 = iprot.readString();
+            self.configuration[_key132] = _val133
           iprot.readMapEnd()
         else:
           iprot.skip(ftype)
@@ -2619,9 +2783,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 kiter125,viter126 in self.configuration.items():
-        oprot.writeString(kiter125)
-        oprot.writeString(viter126)
+      for kiter134,viter135 in self.configuration.items():
+        oprot.writeString(kiter134)
+        oprot.writeString(viter135)
       oprot.writeMapEnd()
       oprot.writeFieldEnd()
     oprot.writeFieldStop()
@@ -3093,11 +3257,11 @@ class TExecuteStatementReq:
       elif fid == 3:
         if ftype == TType.MAP:
           self.confOverlay = {}
-          (_ktype128, _vtype129, _size127 ) = iprot.readMapBegin() 
-          for _i131 in xrange(_size127):
-            _key132 = iprot.readString();
-            _val133 = iprot.readString();
-            self.confOverlay[_key132] = _val133
+          (_ktype137, _vtype138, _size136 ) = iprot.readMapBegin() 
+          for _i140 in xrange(_size136):
+            _key141 = iprot.readString();
+            _val142 = iprot.readString();
+            self.confOverlay[_key141] = _val142
           iprot.readMapEnd()
         else:
           iprot.skip(ftype)
@@ -3127,9 +3291,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 kiter134,viter135 in self.confOverlay.items():
-        oprot.writeString(kiter134)
-        oprot.writeString(viter135)
+      for kiter143,viter144 in self.confOverlay.items():
+        oprot.writeString(kiter143)
+        oprot.writeString(viter144)
       oprot.writeMapEnd()
       oprot.writeFieldEnd()
     if self.runAsync is not None:
@@ -3734,10 +3898,10 @@ class TGetTablesReq:
       elif fid == 5:
         if ftype == TType.LIST:
           self.tableTypes = []
-          (_etype139, _size136) = iprot.readListBegin()
-          for _i140 in xrange(_size136):
-            _elem141 = iprot.readString();
-            self.tableTypes.append(_elem141)
+          (_etype148, _size145) = iprot.readListBegin()
+          for _i149 in xrange(_size145):
+            _elem150 = iprot.readString();
+            self.tableTypes.append(_elem150)
           iprot.readListEnd()
         else:
           iprot.skip(ftype)
@@ -3770,8 +3934,8 @@ class TGetTablesReq:
     if self.tableTypes is not None:
       oprot.writeFieldBegin('tableTypes', TType.LIST, 5)
       oprot.writeListBegin(TType.STRING, len(self.tableTypes))
-      for iter142 in self.tableTypes:
-        oprot.writeString(iter142)
+      for iter151 in self.tableTypes:
+        oprot.writeString(iter151)
       oprot.writeListEnd()
       oprot.writeFieldEnd()
     oprot.writeFieldStop()

Modified: hive/branches/vectorization/service/src/gen/thrift/gen-rb/t_c_l_i_service_constants.rb
URL: http://svn.apache.org/viewvc/hive/branches/vectorization/service/src/gen/thrift/gen-rb/t_c_l_i_service_constants.rb?rev=1525254&r1=1525253&r2=1525254&view=diff
==============================================================================
--- hive/branches/vectorization/service/src/gen/thrift/gen-rb/t_c_l_i_service_constants.rb
(original)
+++ hive/branches/vectorization/service/src/gen/thrift/gen-rb/t_c_l_i_service_constants.rb
Sat Sep 21 15:49:49 2013
@@ -21,6 +21,7 @@ PRIMITIVE_TYPES = Set.new([
     15,
     16,
     17,
+    18,
 ])
 
 COMPLEX_TYPES = Set.new([
@@ -54,5 +55,8 @@ TYPE_NAMES = {
     15 => %q"DECIMAL",
     16 => %q"NULL",
     17 => %q"DATE",
+    18 => %q"VARCHAR",
 }
 
+CHARACTER_MAXIMUM_LENGTH = %q"characterMaximumLength"
+

Modified: hive/branches/vectorization/service/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb
URL: http://svn.apache.org/viewvc/hive/branches/vectorization/service/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb?rev=1525254&r1=1525253&r2=1525254&view=diff
==============================================================================
--- hive/branches/vectorization/service/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb (original)
+++ hive/branches/vectorization/service/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb Sat
Sep 21 15:49:49 2013
@@ -9,8 +9,9 @@ require 'thrift'
 module TProtocolVersion
   HIVE_CLI_SERVICE_PROTOCOL_V1 = 0
   HIVE_CLI_SERVICE_PROTOCOL_V2 = 1
-  VALUE_MAP = {0 => "HIVE_CLI_SERVICE_PROTOCOL_V1", 1 => "HIVE_CLI_SERVICE_PROTOCOL_V2"}
-  VALID_VALUES = Set.new([HIVE_CLI_SERVICE_PROTOCOL_V1, HIVE_CLI_SERVICE_PROTOCOL_V2]).freeze
+  HIVE_CLI_SERVICE_PROTOCOL_V3 = 2
+  VALUE_MAP = {0 => "HIVE_CLI_SERVICE_PROTOCOL_V1", 1 => "HIVE_CLI_SERVICE_PROTOCOL_V2",
2 => "HIVE_CLI_SERVICE_PROTOCOL_V3"}
+  VALID_VALUES = Set.new([HIVE_CLI_SERVICE_PROTOCOL_V1, HIVE_CLI_SERVICE_PROTOCOL_V2, HIVE_CLI_SERVICE_PROTOCOL_V3]).freeze
 end
 
 module TTypeId
@@ -32,8 +33,9 @@ module TTypeId
   DECIMAL_TYPE = 15
   NULL_TYPE = 16
   DATE_TYPE = 17
-  VALUE_MAP = {0 => "BOOLEAN_TYPE", 1 => "TINYINT_TYPE", 2 => "SMALLINT_TYPE", 3
=> "INT_TYPE", 4 => "BIGINT_TYPE", 5 => "FLOAT_TYPE", 6 => "DOUBLE_TYPE", 7 =>
"STRING_TYPE", 8 => "TIMESTAMP_TYPE", 9 => "BINARY_TYPE", 10 => "ARRAY_TYPE", 11
=> "MAP_TYPE", 12 => "STRUCT_TYPE", 13 => "UNION_TYPE", 14 => "USER_DEFINED_TYPE",
15 => "DECIMAL_TYPE", 16 => "NULL_TYPE", 17 => "DATE_TYPE"}
-  VALID_VALUES = Set.new([BOOLEAN_TYPE, TINYINT_TYPE, SMALLINT_TYPE, INT_TYPE, BIGINT_TYPE,
FLOAT_TYPE, DOUBLE_TYPE, STRING_TYPE, TIMESTAMP_TYPE, BINARY_TYPE, ARRAY_TYPE, MAP_TYPE, STRUCT_TYPE,
UNION_TYPE, USER_DEFINED_TYPE, DECIMAL_TYPE, NULL_TYPE, DATE_TYPE]).freeze
+  VARCHAR_TYPE = 18
+  VALUE_MAP = {0 => "BOOLEAN_TYPE", 1 => "TINYINT_TYPE", 2 => "SMALLINT_TYPE", 3
=> "INT_TYPE", 4 => "BIGINT_TYPE", 5 => "FLOAT_TYPE", 6 => "DOUBLE_TYPE", 7 =>
"STRING_TYPE", 8 => "TIMESTAMP_TYPE", 9 => "BINARY_TYPE", 10 => "ARRAY_TYPE", 11
=> "MAP_TYPE", 12 => "STRUCT_TYPE", 13 => "UNION_TYPE", 14 => "USER_DEFINED_TYPE",
15 => "DECIMAL_TYPE", 16 => "NULL_TYPE", 17 => "DATE_TYPE", 18 => "VARCHAR_TYPE"}
+  VALID_VALUES = Set.new([BOOLEAN_TYPE, TINYINT_TYPE, SMALLINT_TYPE, INT_TYPE, BIGINT_TYPE,
FLOAT_TYPE, DOUBLE_TYPE, STRING_TYPE, TIMESTAMP_TYPE, BINARY_TYPE, ARRAY_TYPE, MAP_TYPE, STRUCT_TYPE,
UNION_TYPE, USER_DEFINED_TYPE, DECIMAL_TYPE, NULL_TYPE, DATE_TYPE, VARCHAR_TYPE]).freeze
 end
 
 module TStatusCode
@@ -136,12 +138,60 @@ module TFetchOrientation
   VALID_VALUES = Set.new([FETCH_NEXT, FETCH_PRIOR, FETCH_RELATIVE, FETCH_ABSOLUTE, FETCH_FIRST,
FETCH_LAST]).freeze
 end
 
+class TTypeQualifierValue < ::Thrift::Union
+  include ::Thrift::Struct_Union
+  class << self
+    def i32Value(val)
+      TTypeQualifierValue.new(:i32Value, val)
+    end
+
+    def stringValue(val)
+      TTypeQualifierValue.new(:stringValue, val)
+    end
+  end
+
+  I32VALUE = 1
+  STRINGVALUE = 2
+
+  FIELDS = {
+    I32VALUE => {:type => ::Thrift::Types::I32, :name => 'i32Value', :optional =>
true},
+    STRINGVALUE => {:type => ::Thrift::Types::STRING, :name => 'stringValue', :optional
=> true}
+  }
+
+  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 TTypeQualifiers
+  include ::Thrift::Struct, ::Thrift::Struct_Union
+  QUALIFIERS = 1
+
+  FIELDS = {
+    QUALIFIERS => {:type => ::Thrift::Types::MAP, :name => 'qualifiers', :key =>
{:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRUCT,
:class => ::TTypeQualifierValue}}
+  }
+
+  def struct_fields; FIELDS; end
+
+  def validate
+    raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required
field qualifiers is unset!') unless @qualifiers
+  end
+
+  ::Thrift::Struct.generate_accessors self
+end
+
 class TPrimitiveTypeEntry
   include ::Thrift::Struct, ::Thrift::Struct_Union
   TYPE = 1
+  TYPEQUALIFIERS = 2
 
   FIELDS = {
-    TYPE => {:type => ::Thrift::Types::I32, :name => 'type', :enum_class => ::TTypeId}
+    TYPE => {:type => ::Thrift::Types::I32, :name => 'type', :enum_class => ::TTypeId},
+    TYPEQUALIFIERS => {:type => ::Thrift::Types::STRUCT, :name => 'typeQualifiers',
:class => ::TTypeQualifiers, :optional => true}
   }
 
   def struct_fields; FIELDS; end
@@ -726,7 +776,7 @@ class TOpenSessionReq
   CONFIGURATION = 4
 
   FIELDS = {
-    CLIENT_PROTOCOL => {:type => ::Thrift::Types::I32, :name => 'client_protocol',
:default =>     1, :enum_class => ::TProtocolVersion},
+    CLIENT_PROTOCOL => {:type => ::Thrift::Types::I32, :name => 'client_protocol',
:default =>     2, :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}
@@ -753,7 +803,7 @@ class TOpenSessionResp
 
   FIELDS = {
     STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class =>
::TStatus},
-    SERVERPROTOCOLVERSION => {:type => ::Thrift::Types::I32, :name => 'serverProtocolVersion',
:default =>     1, :enum_class => ::TProtocolVersion},
+    SERVERPROTOCOLVERSION => {:type => ::Thrift::Types::I32, :name => 'serverProtocolVersion',
:default =>     2, :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/vectorization/service/src/java/org/apache/hive/service/cli/ColumnDescriptor.java
URL: http://svn.apache.org/viewvc/hive/branches/vectorization/service/src/java/org/apache/hive/service/cli/ColumnDescriptor.java?rev=1525254&r1=1525253&r2=1525254&view=diff
==============================================================================
--- hive/branches/vectorization/service/src/java/org/apache/hive/service/cli/ColumnDescriptor.java
(original)
+++ hive/branches/vectorization/service/src/java/org/apache/hive/service/cli/ColumnDescriptor.java
Sat Sep 21 15:49:49 2013
@@ -55,6 +55,8 @@ public class ColumnDescriptor {
   }
 
   public static ColumnDescriptor newPrimitiveColumnDescriptor(String name, String comment,
Type type, int position) {
+    // Current usage looks like it's only for metadata columns, but if that changes then
+    // this method may need to require a type qualifiers aruments.
     return new ColumnDescriptor(name, comment, new TypeDescriptor(type), position);
   }
 

Modified: hive/branches/vectorization/service/src/java/org/apache/hive/service/cli/ColumnValue.java
URL: http://svn.apache.org/viewvc/hive/branches/vectorization/service/src/java/org/apache/hive/service/cli/ColumnValue.java?rev=1525254&r1=1525253&r2=1525254&view=diff
==============================================================================
--- hive/branches/vectorization/service/src/java/org/apache/hive/service/cli/ColumnValue.java
(original)
+++ hive/branches/vectorization/service/src/java/org/apache/hive/service/cli/ColumnValue.java
Sat Sep 21 15:49:49 2013
@@ -22,6 +22,7 @@ import java.sql.Date;
 import java.sql.Timestamp;
 
 import org.apache.hadoop.hive.common.type.HiveDecimal;
+import org.apache.hadoop.hive.common.type.HiveVarchar;
 import org.apache.hive.service.cli.thrift.TBoolValue;
 import org.apache.hive.service.cli.thrift.TByteValue;
 import org.apache.hive.service.cli.thrift.TColumnValue;
@@ -118,6 +119,14 @@ public class ColumnValue {
     return new ColumnValue(TColumnValue.stringVal(tStringValue));
   }
 
+  public static ColumnValue stringValue(HiveVarchar value) {
+    TStringValue tStringValue = new TStringValue();
+    if (value != null) {
+      tStringValue.setValue(value.toString());
+    }
+    return new ColumnValue(TColumnValue.stringVal(tStringValue));
+  }
+
   public static ColumnValue dateValue(Date value) {
     TStringValue tStringValue = new TStringValue();
     if (value != null) {
@@ -160,6 +169,8 @@ public class ColumnValue {
       return doubleValue((Double)value);
     case STRING_TYPE:
       return stringValue((String)value);
+    case VARCHAR_TYPE:
+      return stringValue((HiveVarchar)value);
     case DATE_TYPE:
       return dateValue((Date)value);
     case TIMESTAMP_TYPE:

Modified: hive/branches/vectorization/service/src/java/org/apache/hive/service/cli/Type.java
URL: http://svn.apache.org/viewvc/hive/branches/vectorization/service/src/java/org/apache/hive/service/cli/Type.java?rev=1525254&r1=1525253&r2=1525254&view=diff
==============================================================================
--- hive/branches/vectorization/service/src/java/org/apache/hive/service/cli/Type.java (original)
+++ hive/branches/vectorization/service/src/java/org/apache/hive/service/cli/Type.java Sat
Sep 21 15:49:49 2013
@@ -54,6 +54,10 @@ public enum Type {
   STRING_TYPE("STRING",
       java.sql.Types.VARCHAR,
       TTypeId.STRING_TYPE),
+  VARCHAR_TYPE("VARCHAR",
+      java.sql.Types.VARCHAR,
+      TTypeId.VARCHAR_TYPE,
+      true, false, false),
   DATE_TYPE("DATE",
       java.sql.Types.DATE,
       TTypeId.DATE_TYPE),
@@ -66,7 +70,7 @@ public enum Type {
   DECIMAL_TYPE("DECIMAL",
       java.sql.Types.DECIMAL,
       TTypeId.DECIMAL_TYPE,
-      false, false),
+      true, false, false),
   ARRAY_TYPE("ARRAY",
       java.sql.Types.VARCHAR,
       TTypeId.STRING_TYPE,
@@ -91,26 +95,35 @@ public enum Type {
   private final String name;
   private final TTypeId tType;
   private final int javaSQLType;
+  private final boolean isQualified;
   private final boolean isComplex;
   private final boolean isCollection;
 
-
-  Type(String name, int javaSQLType, TTypeId tType, boolean isComplex, boolean isCollection)
{
+  Type(String name, int javaSQLType, TTypeId tType, boolean isQualified, boolean isComplex,
boolean isCollection) {
     this.name = name;
     this.javaSQLType = javaSQLType;
     this.tType = tType;
+    this.isQualified = isQualified;
     this.isComplex = isComplex;
     this.isCollection = isCollection;
   }
 
+  Type(String name, int javaSQLType, TTypeId tType, boolean isComplex, boolean isCollection)
{
+    this(name, javaSQLType, tType, false, isComplex, isCollection);
+  }
+
   Type(String name, int javaSqlType, TTypeId tType) {
-    this(name, javaSqlType, tType, false, false);
+    this(name, javaSqlType, tType, false, false, false);
   }
 
   public boolean isPrimitiveType() {
     return !isComplex;
   }
 
+  public boolean isQualifiedType() {
+    return isQualified;
+  }
+
   public boolean isComplexType() {
     return isComplex;
   }
@@ -135,7 +148,7 @@ public enum Type {
     for (Type type : values()) {
       if (name.equalsIgnoreCase(type.name)) {
         return type;
-      } else if (type.isComplexType()) {
+      } else if (type.isQualifiedType() || type.isComplexType()) {
         if (name.toUpperCase().startsWith(type.name)) {
             return type;
         }

Modified: hive/branches/vectorization/service/src/java/org/apache/hive/service/cli/TypeDescriptor.java
URL: http://svn.apache.org/viewvc/hive/branches/vectorization/service/src/java/org/apache/hive/service/cli/TypeDescriptor.java?rev=1525254&r1=1525253&r2=1525254&view=diff
==============================================================================
--- hive/branches/vectorization/service/src/java/org/apache/hive/service/cli/TypeDescriptor.java
(original)
+++ hive/branches/vectorization/service/src/java/org/apache/hive/service/cli/TypeDescriptor.java
Sat Sep 21 15:49:49 2013
@@ -20,6 +20,11 @@ package org.apache.hive.service.cli;
 
 import java.util.List;
 
+import org.apache.hadoop.hive.metastore.api.FieldSchema;
+import org.apache.hadoop.hive.serde2.typeinfo.BaseTypeParams;
+import org.apache.hadoop.hive.serde2.typeinfo.PrimitiveTypeInfo;
+import org.apache.hadoop.hive.serde2.typeinfo.TypeInfo;
+import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory;
 import org.apache.hive.service.cli.thrift.TPrimitiveTypeEntry;
 import org.apache.hive.service.cli.thrift.TTypeDesc;
 import org.apache.hive.service.cli.thrift.TTypeEntry;
@@ -32,6 +37,7 @@ public class TypeDescriptor {
 
   private final Type type;
   private String typeName = null;
+  private TypeQualifiers typeQualifiers = null;
 
   public TypeDescriptor(Type type) {
     this.type = type;
@@ -41,12 +47,21 @@ public class TypeDescriptor {
     List<TTypeEntry> tTypeEntries = tTypeDesc.getTypes();
     TPrimitiveTypeEntry top = tTypeEntries.get(0).getPrimitiveEntry();
     this.type = Type.getType(top.getType());
+    if (top.isSetTypeQualifiers()) {
+      setTypeQualifiers(TypeQualifiers.fromTTypeQualifiers(top.getTypeQualifiers()));
+    }
   }
 
   public TypeDescriptor(String typeName) {
     this.type = Type.getType(typeName);
     if (this.type.isComplexType()) {
       this.typeName = typeName;
+    } else if (this.type.isQualifiedType()) {
+      TypeInfo pti = TypeInfoFactory.getPrimitiveTypeInfo(typeName);
+      BaseTypeParams typeParams = ((PrimitiveTypeInfo) pti).getTypeParams();
+      if (typeParams != null) {
+        setTypeQualifiers(TypeQualifiers.fromBaseTypeParams(typeParams));
+      }
     }
   }
 
@@ -55,7 +70,12 @@ public class TypeDescriptor {
   }
 
   public TTypeDesc toTTypeDesc() {
-    TTypeEntry entry = TTypeEntry.primitiveEntry(new TPrimitiveTypeEntry(type.toTType()));
+    TPrimitiveTypeEntry primitiveEntry = new TPrimitiveTypeEntry(type.toTType());
+    if (getTypeQualifiers() != null) {
+      primitiveEntry.setTypeQualifiers(getTypeQualifiers().toTTypeQualifiers());
+    }
+    TTypeEntry entry = TTypeEntry.primitiveEntry(primitiveEntry);
+
     TTypeDesc desc = new TTypeDesc();
     desc.addToTypes(entry);
     return desc;
@@ -68,4 +88,12 @@ public class TypeDescriptor {
       return type.getName();
     }
   }
+
+  public TypeQualifiers getTypeQualifiers() {
+    return typeQualifiers;
+  }
+
+  public void setTypeQualifiers(TypeQualifiers typeQualifiers) {
+    this.typeQualifiers = typeQualifiers;
+  }
 }



Mime
View raw message