OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ttypes.py
Go to the documentation of this file.
1 #
2 # Autogenerated by Thrift Compiler (0.16.0)
3 #
4 # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 #
6 # options string: py
7 #
8 
9 from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
10 from thrift.protocol.TProtocol import TProtocolException
11 from thrift.TRecursive import fix_spec
12 
13 import sys
14 
15 from thrift.transport import TTransport
16 all_structs = []
17 
18 
19 class TExtArgumentType(object):
20  Int8 = 0
21  Int16 = 1
22  Int32 = 2
23  Int64 = 3
24  Float = 4
25  Double = 5
26  Void = 6
27  PInt8 = 7
28  PInt16 = 8
29  PInt32 = 9
30  PInt64 = 10
31  PFloat = 11
32  PDouble = 12
33  PBool = 13
34  Bool = 14
35  ArrayInt8 = 15
36  ArrayInt16 = 16
37  ArrayInt32 = 17
38  ArrayInt64 = 18
39  ArrayFloat = 19
40  ArrayDouble = 20
41  ArrayBool = 21
42  GeoPoint = 22
43  GeoLineString = 23
44  Cursor = 24
45  GeoPolygon = 25
46  GeoMultiPolygon = 26
47  ColumnInt8 = 27
48  ColumnInt16 = 28
49  ColumnInt32 = 29
50  ColumnInt64 = 30
51  ColumnFloat = 31
52  ColumnDouble = 32
53  ColumnBool = 33
54  TextEncodingNone = 34
55  TextEncodingDict = 35
56  ColumnListInt8 = 36
57  ColumnListInt16 = 37
58  ColumnListInt32 = 38
59  ColumnListInt64 = 39
60  ColumnListFloat = 40
61  ColumnListDouble = 41
62  ColumnListBool = 42
63  ColumnTextEncodingDict = 43
64  ColumnListTextEncodingDict = 44
65  ColumnTimestamp = 45
66  Timestamp = 46
67  ColumnArrayInt8 = 47
68  ColumnArrayInt16 = 48
69  ColumnArrayInt32 = 49
70  ColumnArrayInt64 = 50
71  ColumnArrayFloat = 51
72  ColumnArrayDouble = 52
73  ColumnArrayBool = 53
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
90  GeoMultiPoint = 70
91  DayTimeInterval = 71
92  YearMonthTimeInterval = 72
93  ColumnGeoPoint = 73
94  ColumnGeoLineString = 74
95  ColumnGeoPolygon = 75
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
105 
106  _VALUES_TO_NAMES = {
107  0: "Int8",
108  1: "Int16",
109  2: "Int32",
110  3: "Int64",
111  4: "Float",
112  5: "Double",
113  6: "Void",
114  7: "PInt8",
115  8: "PInt16",
116  9: "PInt32",
117  10: "PInt64",
118  11: "PFloat",
119  12: "PDouble",
120  13: "PBool",
121  14: "Bool",
122  15: "ArrayInt8",
123  16: "ArrayInt16",
124  17: "ArrayInt32",
125  18: "ArrayInt64",
126  19: "ArrayFloat",
127  20: "ArrayDouble",
128  21: "ArrayBool",
129  22: "GeoPoint",
130  23: "GeoLineString",
131  24: "Cursor",
132  25: "GeoPolygon",
133  26: "GeoMultiPolygon",
134  27: "ColumnInt8",
135  28: "ColumnInt16",
136  29: "ColumnInt32",
137  30: "ColumnInt64",
138  31: "ColumnFloat",
139  32: "ColumnDouble",
140  33: "ColumnBool",
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",
153  46: "Timestamp",
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",
177  70: "GeoMultiPoint",
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",
192  }
193 
194  _NAMES_TO_VALUES = {
195  "Int8": 0,
196  "Int16": 1,
197  "Int32": 2,
198  "Int64": 3,
199  "Float": 4,
200  "Double": 5,
201  "Void": 6,
202  "PInt8": 7,
203  "PInt16": 8,
204  "PInt32": 9,
205  "PInt64": 10,
206  "PFloat": 11,
207  "PDouble": 12,
208  "PBool": 13,
209  "Bool": 14,
210  "ArrayInt8": 15,
211  "ArrayInt16": 16,
212  "ArrayInt32": 17,
213  "ArrayInt64": 18,
214  "ArrayFloat": 19,
215  "ArrayDouble": 20,
216  "ArrayBool": 21,
217  "GeoPoint": 22,
218  "GeoLineString": 23,
219  "Cursor": 24,
220  "GeoPolygon": 25,
221  "GeoMultiPolygon": 26,
222  "ColumnInt8": 27,
223  "ColumnInt16": 28,
224  "ColumnInt32": 29,
225  "ColumnInt64": 30,
226  "ColumnFloat": 31,
227  "ColumnDouble": 32,
228  "ColumnBool": 33,
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,
241  "Timestamp": 46,
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,
265  "GeoMultiPoint": 70,
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,
280  }
281 
282 
283 class TOutputBufferSizeType(object):
284  kConstant = 0
285  kUserSpecifiedConstantParameter = 1
286  kUserSpecifiedRowMultiplier = 2
287  kTableFunctionSpecifiedParameter = 3
288  kPreFlightParameter = 4
289 
290  _VALUES_TO_NAMES = {
291  0: "kConstant",
292  1: "kUserSpecifiedConstantParameter",
293  2: "kUserSpecifiedRowMultiplier",
294  3: "kTableFunctionSpecifiedParameter",
295  4: "kPreFlightParameter",
296  }
297 
298  _NAMES_TO_VALUES = {
299  "kConstant": 0,
300  "kUserSpecifiedConstantParameter": 1,
301  "kUserSpecifiedRowMultiplier": 2,
302  "kTableFunctionSpecifiedParameter": 3,
303  "kPreFlightParameter": 4,
304  }
305 
306 
307 class TUserDefinedFunction(object):
308  """
309  Attributes:
310  - name
311  - argTypes
312  - retType
313  - annotations
314 
315  """
316 
317 
318  def __init__(self, name=None, argTypes=None, retType=None, annotations=None,):
319  self.name = name
320  self.argTypes = argTypes
321  self.retType = retType
322  self.annotations = annotations
323 
324  def read(self, iprot):
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])
327  return
328  iprot.readStructBegin()
329  while True:
330  (fname, ftype, fid) = iprot.readFieldBegin()
331  if ftype == TType.STOP:
332  break
333  if fid == 1:
334  if ftype == TType.STRING:
335  self.name = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
336  else:
337  iprot.skip(ftype)
338  elif fid == 2:
339  if ftype == TType.LIST:
340  self.argTypes = []
341  (_etype3, _size0) = iprot.readListBegin()
342  for _i4 in range(_size0):
343  _elem5 = iprot.readI32()
344  self.argTypes.append(_elem5)
345  iprot.readListEnd()
346  else:
347  iprot.skip(ftype)
348  elif fid == 3:
349  if ftype == TType.I32:
350  self.retType = iprot.readI32()
351  else:
352  iprot.skip(ftype)
353  elif fid == 4:
354  if ftype == TType.LIST:
355  self.annotations = []
356  (_etype9, _size6) = iprot.readListBegin()
357  for _i10 in range(_size6):
358  _elem11 = {}
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
364  iprot.readMapEnd()
365  self.annotations.append(_elem11)
366  iprot.readListEnd()
367  else:
368  iprot.skip(ftype)
369  else:
370  iprot.skip(ftype)
371  iprot.readFieldEnd()
372  iprot.readStructEnd()
373 
374  def write(self, oprot):
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]))
377  return
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()
383  if self.argTypes is not None:
384  oprot.writeFieldBegin('argTypes', TType.LIST, 2)
385  oprot.writeListBegin(TType.I32, len(self.argTypes))
386  for iter19 in self.argTypes:
387  oprot.writeI32(iter19)
388  oprot.writeListEnd()
389  oprot.writeFieldEnd()
390  if self.retType is not None:
391  oprot.writeFieldBegin('retType', TType.I32, 3)
392  oprot.writeI32(self.retType)
393  oprot.writeFieldEnd()
394  if self.annotations is not None:
395  oprot.writeFieldBegin('annotations', TType.LIST, 4)
396  oprot.writeListBegin(TType.MAP, len(self.annotations))
397  for iter20 in 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)
402  oprot.writeMapEnd()
403  oprot.writeListEnd()
404  oprot.writeFieldEnd()
405  oprot.writeFieldStop()
406  oprot.writeStructEnd()
407 
408  def validate(self):
409  return
410 
411  def __repr__(self):
412  L = ['%s=%r' % (key, value)
413  for key, value in self.__dict__.items()]
414  return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
415 
416  def __eq__(self, other):
417  return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
418 
419  def __ne__(self, other):
420  return not (self == other)
421 
422 
424  """
425  Attributes:
426  - name
427  - sizerType
428  - sizerArgPos
429  - inputArgTypes
430  - outputArgTypes
431  - sqlArgTypes
432  - annotations
433 
434  """
435 
436 
437  def __init__(self, name=None, sizerType=None, sizerArgPos=None, inputArgTypes=None, outputArgTypes=None, sqlArgTypes=None, annotations=None,):
438  self.name = name
439  self.sizerType = sizerType
440  self.sizerArgPos = sizerArgPos
441  self.inputArgTypes = inputArgTypes
442  self.outputArgTypes = outputArgTypes
443  self.sqlArgTypes = sqlArgTypes
444  self.annotations = annotations
445 
446  def read(self, iprot):
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])
449  return
450  iprot.readStructBegin()
451  while True:
452  (fname, ftype, fid) = iprot.readFieldBegin()
453  if ftype == TType.STOP:
454  break
455  if fid == 1:
456  if ftype == TType.STRING:
457  self.name = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
458  else:
459  iprot.skip(ftype)
460  elif fid == 2:
461  if ftype == TType.I32:
462  self.sizerType = iprot.readI32()
463  else:
464  iprot.skip(ftype)
465  elif fid == 3:
466  if ftype == TType.I32:
467  self.sizerArgPos = iprot.readI32()
468  else:
469  iprot.skip(ftype)
470  elif fid == 4:
471  if ftype == TType.LIST:
472  self.inputArgTypes = []
473  (_etype26, _size23) = iprot.readListBegin()
474  for _i27 in range(_size23):
475  _elem28 = iprot.readI32()
476  self.inputArgTypes.append(_elem28)
477  iprot.readListEnd()
478  else:
479  iprot.skip(ftype)
480  elif fid == 5:
481  if ftype == TType.LIST:
482  self.outputArgTypes = []
483  (_etype32, _size29) = iprot.readListBegin()
484  for _i33 in range(_size29):
485  _elem34 = iprot.readI32()
486  self.outputArgTypes.append(_elem34)
487  iprot.readListEnd()
488  else:
489  iprot.skip(ftype)
490  elif fid == 6:
491  if ftype == TType.LIST:
492  self.sqlArgTypes = []
493  (_etype38, _size35) = iprot.readListBegin()
494  for _i39 in range(_size35):
495  _elem40 = iprot.readI32()
496  self.sqlArgTypes.append(_elem40)
497  iprot.readListEnd()
498  else:
499  iprot.skip(ftype)
500  elif fid == 7:
501  if ftype == TType.LIST:
502  self.annotations = []
503  (_etype44, _size41) = iprot.readListBegin()
504  for _i45 in range(_size41):
505  _elem46 = {}
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
511  iprot.readMapEnd()
512  self.annotations.append(_elem46)
513  iprot.readListEnd()
514  else:
515  iprot.skip(ftype)
516  else:
517  iprot.skip(ftype)
518  iprot.readFieldEnd()
519  iprot.readStructEnd()
520 
521  def write(self, oprot):
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]))
524  return
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()
530  if self.sizerType is not None:
531  oprot.writeFieldBegin('sizerType', TType.I32, 2)
532  oprot.writeI32(self.sizerType)
533  oprot.writeFieldEnd()
534  if self.sizerArgPos is not None:
535  oprot.writeFieldBegin('sizerArgPos', TType.I32, 3)
536  oprot.writeI32(self.sizerArgPos)
537  oprot.writeFieldEnd()
538  if self.inputArgTypes is not None:
539  oprot.writeFieldBegin('inputArgTypes', TType.LIST, 4)
540  oprot.writeListBegin(TType.I32, len(self.inputArgTypes))
541  for iter54 in self.inputArgTypes:
542  oprot.writeI32(iter54)
543  oprot.writeListEnd()
544  oprot.writeFieldEnd()
545  if self.outputArgTypes is not None:
546  oprot.writeFieldBegin('outputArgTypes', TType.LIST, 5)
547  oprot.writeListBegin(TType.I32, len(self.outputArgTypes))
548  for iter55 in self.outputArgTypes:
549  oprot.writeI32(iter55)
550  oprot.writeListEnd()
551  oprot.writeFieldEnd()
552  if self.sqlArgTypes is not None:
553  oprot.writeFieldBegin('sqlArgTypes', TType.LIST, 6)
554  oprot.writeListBegin(TType.I32, len(self.sqlArgTypes))
555  for iter56 in self.sqlArgTypes:
556  oprot.writeI32(iter56)
557  oprot.writeListEnd()
558  oprot.writeFieldEnd()
559  if self.annotations is not None:
560  oprot.writeFieldBegin('annotations', TType.LIST, 7)
561  oprot.writeListBegin(TType.MAP, len(self.annotations))
562  for iter57 in 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)
567  oprot.writeMapEnd()
568  oprot.writeListEnd()
569  oprot.writeFieldEnd()
570  oprot.writeFieldStop()
571  oprot.writeStructEnd()
572 
573  def validate(self):
574  return
575 
576  def __repr__(self):
577  L = ['%s=%r' % (key, value)
578  for key, value in self.__dict__.items()]
579  return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
580 
581  def __eq__(self, other):
582  return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
583 
584  def __ne__(self, other):
585  return not (self == other)
586 all_structs.append(TUserDefinedFunction)
587 TUserDefinedFunction.thrift_spec = (
588  None, # 0
589  (1, TType.STRING, 'name', 'UTF8', None, ), # 1
590  (2, TType.LIST, 'argTypes', (TType.I32, None, False), None, ), # 2
591  (3, TType.I32, 'retType', None, None, ), # 3
592  (4, TType.LIST, 'annotations', (TType.MAP, (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), False), None, ), # 4
593 )
594 all_structs.append(TUserDefinedTableFunction)
595 TUserDefinedTableFunction.thrift_spec = (
596  None, # 0
597  (1, TType.STRING, 'name', 'UTF8', None, ), # 1
598  (2, TType.I32, 'sizerType', None, None, ), # 2
599  (3, TType.I32, 'sizerArgPos', None, None, ), # 3
600  (4, TType.LIST, 'inputArgTypes', (TType.I32, None, False), None, ), # 4
601  (5, TType.LIST, 'outputArgTypes', (TType.I32, None, False), None, ), # 5
602  (6, TType.LIST, 'sqlArgTypes', (TType.I32, None, False), None, ), # 6
603  (7, TType.LIST, 'annotations', (TType.MAP, (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), False), None, ), # 7
604 )
605 fix_spec(all_structs)
606 del all_structs
std::string join(T const &container, std::string const &delim)