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
63 ColumnTextEncodingDict = 43
64 ColumnListTextEncodingDict = 44
72 ColumnArrayDouble = 52
74 ColumnListArrayInt8 = 54
75 ColumnListArrayInt16 = 55
76 ColumnListArrayInt32 = 56
77 ColumnListArrayInt64 = 57
78 ColumnListArrayFloat = 58
79 ColumnListArrayDouble = 59
80 ColumnListArrayBool = 60
81 GeoMultiLineString = 61
82 ArrayTextEncodingNone = 62
83 ColumnTextEncodingNone = 63
84 ColumnListTextEncodingNone = 64
85 ColumnArrayTextEncodingNone = 65
86 ColumnListArrayTextEncodingNone = 66
87 ArrayTextEncodingDict = 67
88 ColumnArrayTextEncodingDict = 68
89 ColumnListArrayTextEncodingDict = 69
92 YearMonthTimeInterval = 72
94 ColumnGeoLineString = 74
96 ColumnGeoMultiPoint = 76
97 ColumnGeoMultiLineString = 77
98 ColumnGeoMultiPolygon = 78
99 ColumnListGeoPoint = 79
100 ColumnListGeoLineString = 80
101 ColumnListGeoPolygon = 81
102 ColumnListGeoMultiPoint = 82
103 ColumnListGeoMultiLineString = 83
104 ColumnListGeoMultiPolygon = 84
133 26:
"GeoMultiPolygon",
141 34:
"TextEncodingNone",
142 35:
"TextEncodingDict",
143 36:
"ColumnListInt8",
144 37:
"ColumnListInt16",
145 38:
"ColumnListInt32",
146 39:
"ColumnListInt64",
147 40:
"ColumnListFloat",
148 41:
"ColumnListDouble",
149 42:
"ColumnListBool",
150 43:
"ColumnTextEncodingDict",
151 44:
"ColumnListTextEncodingDict",
152 45:
"ColumnTimestamp",
154 47:
"ColumnArrayInt8",
155 48:
"ColumnArrayInt16",
156 49:
"ColumnArrayInt32",
157 50:
"ColumnArrayInt64",
158 51:
"ColumnArrayFloat",
159 52:
"ColumnArrayDouble",
160 53:
"ColumnArrayBool",
161 54:
"ColumnListArrayInt8",
162 55:
"ColumnListArrayInt16",
163 56:
"ColumnListArrayInt32",
164 57:
"ColumnListArrayInt64",
165 58:
"ColumnListArrayFloat",
166 59:
"ColumnListArrayDouble",
167 60:
"ColumnListArrayBool",
168 61:
"GeoMultiLineString",
169 62:
"ArrayTextEncodingNone",
170 63:
"ColumnTextEncodingNone",
171 64:
"ColumnListTextEncodingNone",
172 65:
"ColumnArrayTextEncodingNone",
173 66:
"ColumnListArrayTextEncodingNone",
174 67:
"ArrayTextEncodingDict",
175 68:
"ColumnArrayTextEncodingDict",
176 69:
"ColumnListArrayTextEncodingDict",
178 71:
"DayTimeInterval",
179 72:
"YearMonthTimeInterval",
180 73:
"ColumnGeoPoint",
181 74:
"ColumnGeoLineString",
182 75:
"ColumnGeoPolygon",
183 76:
"ColumnGeoMultiPoint",
184 77:
"ColumnGeoMultiLineString",
185 78:
"ColumnGeoMultiPolygon",
186 79:
"ColumnListGeoPoint",
187 80:
"ColumnListGeoLineString",
188 81:
"ColumnListGeoPolygon",
189 82:
"ColumnListGeoMultiPoint",
190 83:
"ColumnListGeoMultiLineString",
191 84:
"ColumnListGeoMultiPolygon",
221 "GeoMultiPolygon": 26,
229 "TextEncodingNone": 34,
230 "TextEncodingDict": 35,
231 "ColumnListInt8": 36,
232 "ColumnListInt16": 37,
233 "ColumnListInt32": 38,
234 "ColumnListInt64": 39,
235 "ColumnListFloat": 40,
236 "ColumnListDouble": 41,
237 "ColumnListBool": 42,
238 "ColumnTextEncodingDict": 43,
239 "ColumnListTextEncodingDict": 44,
240 "ColumnTimestamp": 45,
242 "ColumnArrayInt8": 47,
243 "ColumnArrayInt16": 48,
244 "ColumnArrayInt32": 49,
245 "ColumnArrayInt64": 50,
246 "ColumnArrayFloat": 51,
247 "ColumnArrayDouble": 52,
248 "ColumnArrayBool": 53,
249 "ColumnListArrayInt8": 54,
250 "ColumnListArrayInt16": 55,
251 "ColumnListArrayInt32": 56,
252 "ColumnListArrayInt64": 57,
253 "ColumnListArrayFloat": 58,
254 "ColumnListArrayDouble": 59,
255 "ColumnListArrayBool": 60,
256 "GeoMultiLineString": 61,
257 "ArrayTextEncodingNone": 62,
258 "ColumnTextEncodingNone": 63,
259 "ColumnListTextEncodingNone": 64,
260 "ColumnArrayTextEncodingNone": 65,
261 "ColumnListArrayTextEncodingNone": 66,
262 "ArrayTextEncodingDict": 67,
263 "ColumnArrayTextEncodingDict": 68,
264 "ColumnListArrayTextEncodingDict": 69,
266 "DayTimeInterval": 71,
267 "YearMonthTimeInterval": 72,
268 "ColumnGeoPoint": 73,
269 "ColumnGeoLineString": 74,
270 "ColumnGeoPolygon": 75,
271 "ColumnGeoMultiPoint": 76,
272 "ColumnGeoMultiLineString": 77,
273 "ColumnGeoMultiPolygon": 78,
274 "ColumnListGeoPoint": 79,
275 "ColumnListGeoLineString": 80,
276 "ColumnListGeoPolygon": 81,
277 "ColumnListGeoMultiPoint": 82,
278 "ColumnListGeoMultiLineString": 83,
279 "ColumnListGeoMultiPolygon": 84,
285 kUserSpecifiedConstantParameter = 1
286 kUserSpecifiedRowMultiplier = 2
287 kTableFunctionSpecifiedParameter = 3
288 kPreFlightParameter = 4
292 1:
"kUserSpecifiedConstantParameter",
293 2:
"kUserSpecifiedRowMultiplier",
294 3:
"kTableFunctionSpecifiedParameter",
295 4:
"kPreFlightParameter",
300 "kUserSpecifiedConstantParameter": 1,
301 "kUserSpecifiedRowMultiplier": 2,
302 "kTableFunctionSpecifiedParameter": 3,
303 "kPreFlightParameter": 4,
318 def __init__(self, name=None, argTypes=None, retType=None, annotations=None,):
325 if iprot._fast_decode
is not None and isinstance(iprot.trans, TTransport.CReadableTransport)
and self.thrift_spec
is not None:
326 iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
328 iprot.readStructBegin()
330 (fname, ftype, fid) = iprot.readFieldBegin()
331 if ftype == TType.STOP:
334 if ftype == TType.STRING:
335 self.
name = iprot.readString().decode(
'utf-8', errors=
'replace')
if sys.version_info[0] == 2
else iprot.readString()
339 if ftype == TType.LIST:
341 (_etype3, _size0) = iprot.readListBegin()
342 for _i4
in range(_size0):
343 _elem5 = iprot.readI32()
344 self.argTypes.append(_elem5)
349 if ftype == TType.I32:
354 if ftype == TType.LIST:
356 (_etype9, _size6) = iprot.readListBegin()
357 for _i10
in range(_size6):
359 (_ktype13, _vtype14, _size12) = iprot.readMapBegin()
360 for _i16
in range(_size12):
361 _key17 = iprot.readString().decode(
'utf-8', errors=
'replace')
if sys.version_info[0] == 2
else iprot.readString()
362 _val18 = iprot.readString().decode(
'utf-8', errors=
'replace')
if sys.version_info[0] == 2
else iprot.readString()
363 _elem11[_key17] = _val18
365 self.annotations.append(_elem11)
372 iprot.readStructEnd()
375 if oprot._fast_encode
is not None and self.thrift_spec
is not None:
376 oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
378 oprot.writeStructBegin(
'TUserDefinedFunction')
379 if self.
name is not None:
380 oprot.writeFieldBegin(
'name', TType.STRING, 1)
381 oprot.writeString(self.name.encode(
'utf-8')
if sys.version_info[0] == 2
else self.
name)
382 oprot.writeFieldEnd()
384 oprot.writeFieldBegin(
'argTypes', TType.LIST, 2)
385 oprot.writeListBegin(TType.I32, len(self.
argTypes))
387 oprot.writeI32(iter19)
389 oprot.writeFieldEnd()
391 oprot.writeFieldBegin(
'retType', TType.I32, 3)
393 oprot.writeFieldEnd()
395 oprot.writeFieldBegin(
'annotations', TType.LIST, 4)
396 oprot.writeListBegin(TType.MAP, len(self.
annotations))
398 oprot.writeMapBegin(TType.STRING, TType.STRING, len(iter20))
399 for kiter21, viter22
in iter20.items():
400 oprot.writeString(kiter21.encode(
'utf-8')
if sys.version_info[0] == 2
else kiter21)
401 oprot.writeString(viter22.encode(
'utf-8')
if sys.version_info[0] == 2
else viter22)
404 oprot.writeFieldEnd()
405 oprot.writeFieldStop()
406 oprot.writeStructEnd()
412 L = [
'%s=%r' % (key, value)
413 for key, value
in self.__dict__.items()]
414 return '%s(%s)' % (self.__class__.__name__,
', '.
join(L))
417 return isinstance(other, self.__class__)
and self.
__dict__ == other.__dict__
420 return not (self == other)
437 def __init__(self, name=None, sizerType=None, sizerArgPos=None, inputArgTypes=None, outputArgTypes=None, sqlArgTypes=None, annotations=None,):
447 if iprot._fast_decode
is not None and isinstance(iprot.trans, TTransport.CReadableTransport)
and self.thrift_spec
is not None:
448 iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
450 iprot.readStructBegin()
452 (fname, ftype, fid) = iprot.readFieldBegin()
453 if ftype == TType.STOP:
456 if ftype == TType.STRING:
457 self.
name = iprot.readString().decode(
'utf-8', errors=
'replace')
if sys.version_info[0] == 2
else iprot.readString()
461 if ftype == TType.I32:
466 if ftype == TType.I32:
471 if ftype == TType.LIST:
473 (_etype26, _size23) = iprot.readListBegin()
474 for _i27
in range(_size23):
475 _elem28 = iprot.readI32()
476 self.inputArgTypes.append(_elem28)
481 if ftype == TType.LIST:
483 (_etype32, _size29) = iprot.readListBegin()
484 for _i33
in range(_size29):
485 _elem34 = iprot.readI32()
486 self.outputArgTypes.append(_elem34)
491 if ftype == TType.LIST:
493 (_etype38, _size35) = iprot.readListBegin()
494 for _i39
in range(_size35):
495 _elem40 = iprot.readI32()
496 self.sqlArgTypes.append(_elem40)
501 if ftype == TType.LIST:
503 (_etype44, _size41) = iprot.readListBegin()
504 for _i45
in range(_size41):
506 (_ktype48, _vtype49, _size47) = iprot.readMapBegin()
507 for _i51
in range(_size47):
508 _key52 = iprot.readString().decode(
'utf-8', errors=
'replace')
if sys.version_info[0] == 2
else iprot.readString()
509 _val53 = iprot.readString().decode(
'utf-8', errors=
'replace')
if sys.version_info[0] == 2
else iprot.readString()
510 _elem46[_key52] = _val53
512 self.annotations.append(_elem46)
519 iprot.readStructEnd()
522 if oprot._fast_encode
is not None and self.thrift_spec
is not None:
523 oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
525 oprot.writeStructBegin(
'TUserDefinedTableFunction')
526 if self.
name is not None:
527 oprot.writeFieldBegin(
'name', TType.STRING, 1)
528 oprot.writeString(self.name.encode(
'utf-8')
if sys.version_info[0] == 2
else self.
name)
529 oprot.writeFieldEnd()
531 oprot.writeFieldBegin(
'sizerType', TType.I32, 2)
533 oprot.writeFieldEnd()
535 oprot.writeFieldBegin(
'sizerArgPos', TType.I32, 3)
537 oprot.writeFieldEnd()
539 oprot.writeFieldBegin(
'inputArgTypes', TType.LIST, 4)
542 oprot.writeI32(iter54)
544 oprot.writeFieldEnd()
546 oprot.writeFieldBegin(
'outputArgTypes', TType.LIST, 5)
549 oprot.writeI32(iter55)
551 oprot.writeFieldEnd()
553 oprot.writeFieldBegin(
'sqlArgTypes', TType.LIST, 6)
554 oprot.writeListBegin(TType.I32, len(self.
sqlArgTypes))
556 oprot.writeI32(iter56)
558 oprot.writeFieldEnd()
560 oprot.writeFieldBegin(
'annotations', TType.LIST, 7)
561 oprot.writeListBegin(TType.MAP, len(self.
annotations))
563 oprot.writeMapBegin(TType.STRING, TType.STRING, len(iter57))
564 for kiter58, viter59
in iter57.items():
565 oprot.writeString(kiter58.encode(
'utf-8')
if sys.version_info[0] == 2
else kiter58)
566 oprot.writeString(viter59.encode(
'utf-8')
if sys.version_info[0] == 2
else viter59)
569 oprot.writeFieldEnd()
570 oprot.writeFieldStop()
571 oprot.writeStructEnd()
577 L = [
'%s=%r' % (key, value)
578 for key, value
in self.__dict__.items()]
579 return '%s(%s)' % (self.__class__.__name__,
', '.
join(L))
582 return isinstance(other, self.__class__)
and self.
__dict__ == other.__dict__
585 return not (self == other)
586 all_structs.append(TUserDefinedFunction)
587 TUserDefinedFunction.thrift_spec = (
589 (1, TType.STRING,
'name',
'UTF8',
None, ),
590 (2, TType.LIST,
'argTypes', (TType.I32,
None,
False),
None, ),
591 (3, TType.I32,
'retType',
None,
None, ),
592 (4, TType.LIST,
'annotations', (TType.MAP, (TType.STRING,
'UTF8', TType.STRING,
'UTF8',
False),
False),
None, ),
594 all_structs.append(TUserDefinedTableFunction)
595 TUserDefinedTableFunction.thrift_spec = (
597 (1, TType.STRING,
'name',
'UTF8',
None, ),
598 (2, TType.I32,
'sizerType',
None,
None, ),
599 (3, TType.I32,
'sizerArgPos',
None,
None, ),
600 (4, TType.LIST,
'inputArgTypes', (TType.I32,
None,
False),
None, ),
601 (5, TType.LIST,
'outputArgTypes', (TType.I32,
None,
False),
None, ),
602 (6, TType.LIST,
'sqlArgTypes', (TType.I32,
None,
False),
None, ),
603 (7, TType.LIST,
'annotations', (TType.MAP, (TType.STRING,
'UTF8', TType.STRING,
'UTF8',
False),
False),
None, ),
605 fix_spec(all_structs)