9 from thrift.Thrift
import TType, TMessageType, TFrozenDict, TException, TApplicationException
10 from thrift.protocol.TProtocol
import TProtocolException
11 from thrift.TRecursive
import fix_spec
15 from thrift.transport
import TTransport
46 INTERVAL_DAY_TIME = 11
47 INTERVAL_YEAR_MONTH = 12
68 11:
"INTERVAL_DAY_TIME",
69 12:
"INTERVAL_YEAR_MONTH",
91 "INTERVAL_DAY_TIME": 11,
92 "INTERVAL_YEAR_MONTH": 12,
151 def __init__(self, type=None, encoding=None, nullable=None, is_array=None, precision=None, scale=None, comp_param=None, size=-1,):
162 if iprot._fast_decode
is not None and isinstance(iprot.trans, TTransport.CReadableTransport)
and self.thrift_spec
is not None:
163 iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
165 iprot.readStructBegin()
167 (fname, ftype, fid) = iprot.readFieldBegin()
168 if ftype == TType.STOP:
171 if ftype == TType.I32:
172 self.
type = iprot.readI32()
176 if ftype == TType.I32:
181 if ftype == TType.BOOL:
186 if ftype == TType.BOOL:
191 if ftype == TType.I32:
196 if ftype == TType.I32:
197 self.
scale = iprot.readI32()
201 if ftype == TType.I32:
206 if ftype == TType.I32:
207 self.
size = iprot.readI32()
213 iprot.readStructEnd()
216 if oprot._fast_encode
is not None and self.thrift_spec
is not None:
217 oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
219 oprot.writeStructBegin(
'TTypeInfo')
220 if self.
type is not None:
221 oprot.writeFieldBegin(
'type', TType.I32, 1)
222 oprot.writeI32(self.
type)
223 oprot.writeFieldEnd()
225 oprot.writeFieldBegin(
'nullable', TType.BOOL, 2)
227 oprot.writeFieldEnd()
229 oprot.writeFieldBegin(
'is_array', TType.BOOL, 3)
231 oprot.writeFieldEnd()
233 oprot.writeFieldBegin(
'encoding', TType.I32, 4)
235 oprot.writeFieldEnd()
237 oprot.writeFieldBegin(
'precision', TType.I32, 5)
239 oprot.writeFieldEnd()
240 if self.
scale is not None:
241 oprot.writeFieldBegin(
'scale', TType.I32, 6)
242 oprot.writeI32(self.
scale)
243 oprot.writeFieldEnd()
245 oprot.writeFieldBegin(
'comp_param', TType.I32, 7)
247 oprot.writeFieldEnd()
248 if self.
size is not None:
249 oprot.writeFieldBegin(
'size', TType.I32, 8)
250 oprot.writeI32(self.
size)
251 oprot.writeFieldEnd()
252 oprot.writeFieldStop()
253 oprot.writeStructEnd()
259 L = [
'%s=%r' % (key, value)
260 for key, value
in self.__dict__.items()]
261 return '%s(%s)' % (self.__class__.__name__,
', '.
join(L))
264 return isinstance(other, self.__class__)
and self.
__dict__ == other.__dict__
267 return not (self == other)
268 all_structs.append(TTypeInfo)
269 TTypeInfo.thrift_spec = (
271 (1, TType.I32,
'type',
None,
None, ),
272 (2, TType.BOOL,
'nullable',
None,
None, ),
273 (3, TType.BOOL,
'is_array',
None,
None, ),
274 (4, TType.I32,
'encoding',
None,
None, ),
275 (5, TType.I32,
'precision',
None,
None, ),
276 (6, TType.I32,
'scale',
None,
None, ),
277 (7, TType.I32,
'comp_param',
None,
None, ),
278 (8, TType.I32,
'size',
None, -1, ),
280 fix_spec(all_structs)