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
70 11:
"INTERVAL_DAY_TIME",
71 12:
"INTERVAL_YEAR_MONTH",
79 20:
"MULTILINESTRING",
95 "INTERVAL_DAY_TIME": 11,
96 "INTERVAL_YEAR_MONTH": 12,
104 "MULTILINESTRING": 20,
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.
db_id = iprot.readI32()
176 if ftype == TType.I32:
183 iprot.readStructEnd()
186 if oprot._fast_encode
is not None and self.thrift_spec
is not None:
187 oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
189 oprot.writeStructBegin(
'TStringDictKey')
190 if self.
db_id is not None:
191 oprot.writeFieldBegin(
'db_id', TType.I32, 1)
192 oprot.writeI32(self.
db_id)
193 oprot.writeFieldEnd()
195 oprot.writeFieldBegin(
'dict_id', TType.I32, 2)
197 oprot.writeFieldEnd()
198 oprot.writeFieldStop()
199 oprot.writeStructEnd()
205 L = [
'%s=%r' % (key, value)
206 for key, value
in self.__dict__.items()]
207 return '%s(%s)' % (self.__class__.__name__,
', '.
join(L))
210 return isinstance(other, self.__class__)
and self.
__dict__ == other.__dict__
213 return not (self == other)
232 def __init__(self, type=None, encoding=None, nullable=None, is_array=None, precision=None, scale=None, comp_param=None, size=-1, dict_key=None,):
244 if iprot._fast_decode
is not None and isinstance(iprot.trans, TTransport.CReadableTransport)
and self.thrift_spec
is not None:
245 iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
247 iprot.readStructBegin()
249 (fname, ftype, fid) = iprot.readFieldBegin()
250 if ftype == TType.STOP:
253 if ftype == TType.I32:
254 self.
type = iprot.readI32()
258 if ftype == TType.I32:
263 if ftype == TType.BOOL:
268 if ftype == TType.BOOL:
273 if ftype == TType.I32:
278 if ftype == TType.I32:
279 self.
scale = iprot.readI32()
283 if ftype == TType.I32:
288 if ftype == TType.I32:
289 self.
size = iprot.readI32()
293 if ftype == TType.STRUCT:
295 self.dict_key.read(iprot)
301 iprot.readStructEnd()
304 if oprot._fast_encode
is not None and self.thrift_spec
is not None:
305 oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
307 oprot.writeStructBegin(
'TTypeInfo')
308 if self.
type is not None:
309 oprot.writeFieldBegin(
'type', TType.I32, 1)
310 oprot.writeI32(self.
type)
311 oprot.writeFieldEnd()
313 oprot.writeFieldBegin(
'nullable', TType.BOOL, 2)
315 oprot.writeFieldEnd()
317 oprot.writeFieldBegin(
'is_array', TType.BOOL, 3)
319 oprot.writeFieldEnd()
321 oprot.writeFieldBegin(
'encoding', TType.I32, 4)
323 oprot.writeFieldEnd()
325 oprot.writeFieldBegin(
'precision', TType.I32, 5)
327 oprot.writeFieldEnd()
328 if self.
scale is not None:
329 oprot.writeFieldBegin(
'scale', TType.I32, 6)
330 oprot.writeI32(self.
scale)
331 oprot.writeFieldEnd()
333 oprot.writeFieldBegin(
'comp_param', TType.I32, 7)
335 oprot.writeFieldEnd()
336 if self.
size is not None:
337 oprot.writeFieldBegin(
'size', TType.I32, 8)
338 oprot.writeI32(self.
size)
339 oprot.writeFieldEnd()
341 oprot.writeFieldBegin(
'dict_key', TType.STRUCT, 9)
342 self.dict_key.write(oprot)
343 oprot.writeFieldEnd()
344 oprot.writeFieldStop()
345 oprot.writeStructEnd()
351 L = [
'%s=%r' % (key, value)
352 for key, value
in self.__dict__.items()]
353 return '%s(%s)' % (self.__class__.__name__,
', '.
join(L))
356 return isinstance(other, self.__class__)
and self.
__dict__ == other.__dict__
359 return not (self == other)
360 all_structs.append(TStringDictKey)
361 TStringDictKey.thrift_spec = (
363 (1, TType.I32,
'db_id',
None,
None, ),
364 (2, TType.I32,
'dict_id',
None,
None, ),
366 all_structs.append(TTypeInfo)
367 TTypeInfo.thrift_spec = (
369 (1, TType.I32,
'type',
None,
None, ),
370 (2, TType.BOOL,
'nullable',
None,
None, ),
371 (3, TType.BOOL,
'is_array',
None,
None, ),
372 (4, TType.I32,
'encoding',
None,
None, ),
373 (5, TType.I32,
'precision',
None,
None, ),
374 (6, TType.I32,
'scale',
None,
None, ),
375 (7, TType.I32,
'comp_param',
None,
None, ),
376 (8, TType.I32,
'size',
None, -1, ),
377 (9, TType.STRUCT,
'dict_key', [TStringDictKey,
None],
None, ),
379 fix_spec(all_structs)