OmniSciDB  471d68cefb
 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.13.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 
66  _VALUES_TO_NAMES = {
67  0: "Int8",
68  1: "Int16",
69  2: "Int32",
70  3: "Int64",
71  4: "Float",
72  5: "Double",
73  6: "Void",
74  7: "PInt8",
75  8: "PInt16",
76  9: "PInt32",
77  10: "PInt64",
78  11: "PFloat",
79  12: "PDouble",
80  13: "PBool",
81  14: "Bool",
82  15: "ArrayInt8",
83  16: "ArrayInt16",
84  17: "ArrayInt32",
85  18: "ArrayInt64",
86  19: "ArrayFloat",
87  20: "ArrayDouble",
88  21: "ArrayBool",
89  22: "GeoPoint",
90  23: "GeoLineString",
91  24: "Cursor",
92  25: "GeoPolygon",
93  26: "GeoMultiPolygon",
94  27: "ColumnInt8",
95  28: "ColumnInt16",
96  29: "ColumnInt32",
97  30: "ColumnInt64",
98  31: "ColumnFloat",
99  32: "ColumnDouble",
100  33: "ColumnBool",
101  34: "TextEncodingNone",
102  35: "TextEncodingDict",
103  36: "ColumnListInt8",
104  37: "ColumnListInt16",
105  38: "ColumnListInt32",
106  39: "ColumnListInt64",
107  40: "ColumnListFloat",
108  41: "ColumnListDouble",
109  42: "ColumnListBool",
110  43: "ColumnTextEncodingDict",
111  44: "ColumnListTextEncodingDict",
112  }
113 
114  _NAMES_TO_VALUES = {
115  "Int8": 0,
116  "Int16": 1,
117  "Int32": 2,
118  "Int64": 3,
119  "Float": 4,
120  "Double": 5,
121  "Void": 6,
122  "PInt8": 7,
123  "PInt16": 8,
124  "PInt32": 9,
125  "PInt64": 10,
126  "PFloat": 11,
127  "PDouble": 12,
128  "PBool": 13,
129  "Bool": 14,
130  "ArrayInt8": 15,
131  "ArrayInt16": 16,
132  "ArrayInt32": 17,
133  "ArrayInt64": 18,
134  "ArrayFloat": 19,
135  "ArrayDouble": 20,
136  "ArrayBool": 21,
137  "GeoPoint": 22,
138  "GeoLineString": 23,
139  "Cursor": 24,
140  "GeoPolygon": 25,
141  "GeoMultiPolygon": 26,
142  "ColumnInt8": 27,
143  "ColumnInt16": 28,
144  "ColumnInt32": 29,
145  "ColumnInt64": 30,
146  "ColumnFloat": 31,
147  "ColumnDouble": 32,
148  "ColumnBool": 33,
149  "TextEncodingNone": 34,
150  "TextEncodingDict": 35,
151  "ColumnListInt8": 36,
152  "ColumnListInt16": 37,
153  "ColumnListInt32": 38,
154  "ColumnListInt64": 39,
155  "ColumnListFloat": 40,
156  "ColumnListDouble": 41,
157  "ColumnListBool": 42,
158  "ColumnTextEncodingDict": 43,
159  "ColumnListTextEncodingDict": 44,
160  }
161 
162 
163 class TOutputBufferSizeType(object):
164  kConstant = 0
165  kUserSpecifiedConstantParameter = 1
166  kUserSpecifiedRowMultiplier = 2
167  kTableFunctionSpecifiedParameter = 3
168 
169  _VALUES_TO_NAMES = {
170  0: "kConstant",
171  1: "kUserSpecifiedConstantParameter",
172  2: "kUserSpecifiedRowMultiplier",
173  3: "kTableFunctionSpecifiedParameter",
174  }
175 
176  _NAMES_TO_VALUES = {
177  "kConstant": 0,
178  "kUserSpecifiedConstantParameter": 1,
179  "kUserSpecifiedRowMultiplier": 2,
180  "kTableFunctionSpecifiedParameter": 3,
181  }
182 
183 
184 class TUserDefinedFunction(object):
185  """
186  Attributes:
187  - name
188  - argTypes
189  - retType
190 
191  """
192 
193 
194  def __init__(self, name=None, argTypes=None, retType=None,):
195  self.name = name
196  self.argTypes = argTypes
197  self.retType = retType
198 
199  def read(self, iprot):
200  if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
201  iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
202  return
203  iprot.readStructBegin()
204  while True:
205  (fname, ftype, fid) = iprot.readFieldBegin()
206  if ftype == TType.STOP:
207  break
208  if fid == 1:
209  if ftype == TType.STRING:
210  self.name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
211  else:
212  iprot.skip(ftype)
213  elif fid == 2:
214  if ftype == TType.LIST:
215  self.argTypes = []
216  (_etype3, _size0) = iprot.readListBegin()
217  for _i4 in range(_size0):
218  _elem5 = iprot.readI32()
219  self.argTypes.append(_elem5)
220  iprot.readListEnd()
221  else:
222  iprot.skip(ftype)
223  elif fid == 3:
224  if ftype == TType.I32:
225  self.retType = iprot.readI32()
226  else:
227  iprot.skip(ftype)
228  else:
229  iprot.skip(ftype)
230  iprot.readFieldEnd()
231  iprot.readStructEnd()
232 
233  def write(self, oprot):
234  if oprot._fast_encode is not None and self.thrift_spec is not None:
235  oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
236  return
237  oprot.writeStructBegin('TUserDefinedFunction')
238  if self.name is not None:
239  oprot.writeFieldBegin('name', TType.STRING, 1)
240  oprot.writeString(self.name.encode('utf-8') if sys.version_info[0] == 2 else self.name)
241  oprot.writeFieldEnd()
242  if self.argTypes is not None:
243  oprot.writeFieldBegin('argTypes', TType.LIST, 2)
244  oprot.writeListBegin(TType.I32, len(self.argTypes))
245  for iter6 in self.argTypes:
246  oprot.writeI32(iter6)
247  oprot.writeListEnd()
248  oprot.writeFieldEnd()
249  if self.retType is not None:
250  oprot.writeFieldBegin('retType', TType.I32, 3)
251  oprot.writeI32(self.retType)
252  oprot.writeFieldEnd()
253  oprot.writeFieldStop()
254  oprot.writeStructEnd()
255 
256  def validate(self):
257  return
258 
259  def __repr__(self):
260  L = ['%s=%r' % (key, value)
261  for key, value in self.__dict__.items()]
262  return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
263 
264  def __eq__(self, other):
265  return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
266 
267  def __ne__(self, other):
268  return not (self == other)
269 
270 
272  """
273  Attributes:
274  - name
275  - sizerType
276  - sizerArgPos
277  - inputArgTypes
278  - outputArgTypes
279  - sqlArgTypes
280  - annotations
281 
282  """
283 
284 
285  def __init__(self, name=None, sizerType=None, sizerArgPos=None, inputArgTypes=None, outputArgTypes=None, sqlArgTypes=None, annotations=None,):
286  self.name = name
287  self.sizerType = sizerType
288  self.sizerArgPos = sizerArgPos
289  self.inputArgTypes = inputArgTypes
290  self.outputArgTypes = outputArgTypes
291  self.sqlArgTypes = sqlArgTypes
292  self.annotations = annotations
293 
294  def read(self, iprot):
295  if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
296  iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
297  return
298  iprot.readStructBegin()
299  while True:
300  (fname, ftype, fid) = iprot.readFieldBegin()
301  if ftype == TType.STOP:
302  break
303  if fid == 1:
304  if ftype == TType.STRING:
305  self.name = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
306  else:
307  iprot.skip(ftype)
308  elif fid == 2:
309  if ftype == TType.I32:
310  self.sizerType = iprot.readI32()
311  else:
312  iprot.skip(ftype)
313  elif fid == 3:
314  if ftype == TType.I32:
315  self.sizerArgPos = iprot.readI32()
316  else:
317  iprot.skip(ftype)
318  elif fid == 4:
319  if ftype == TType.LIST:
320  self.inputArgTypes = []
321  (_etype10, _size7) = iprot.readListBegin()
322  for _i11 in range(_size7):
323  _elem12 = iprot.readI32()
324  self.inputArgTypes.append(_elem12)
325  iprot.readListEnd()
326  else:
327  iprot.skip(ftype)
328  elif fid == 5:
329  if ftype == TType.LIST:
330  self.outputArgTypes = []
331  (_etype16, _size13) = iprot.readListBegin()
332  for _i17 in range(_size13):
333  _elem18 = iprot.readI32()
334  self.outputArgTypes.append(_elem18)
335  iprot.readListEnd()
336  else:
337  iprot.skip(ftype)
338  elif fid == 6:
339  if ftype == TType.LIST:
340  self.sqlArgTypes = []
341  (_etype22, _size19) = iprot.readListBegin()
342  for _i23 in range(_size19):
343  _elem24 = iprot.readI32()
344  self.sqlArgTypes.append(_elem24)
345  iprot.readListEnd()
346  else:
347  iprot.skip(ftype)
348  elif fid == 7:
349  if ftype == TType.LIST:
350  self.annotations = []
351  (_etype28, _size25) = iprot.readListBegin()
352  for _i29 in range(_size25):
353  _elem30 = {}
354  (_ktype32, _vtype33, _size31) = iprot.readMapBegin()
355  for _i35 in range(_size31):
356  _key36 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
357  _val37 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString()
358  _elem30[_key36] = _val37
359  iprot.readMapEnd()
360  self.annotations.append(_elem30)
361  iprot.readListEnd()
362  else:
363  iprot.skip(ftype)
364  else:
365  iprot.skip(ftype)
366  iprot.readFieldEnd()
367  iprot.readStructEnd()
368 
369  def write(self, oprot):
370  if oprot._fast_encode is not None and self.thrift_spec is not None:
371  oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
372  return
373  oprot.writeStructBegin('TUserDefinedTableFunction')
374  if self.name is not None:
375  oprot.writeFieldBegin('name', TType.STRING, 1)
376  oprot.writeString(self.name.encode('utf-8') if sys.version_info[0] == 2 else self.name)
377  oprot.writeFieldEnd()
378  if self.sizerType is not None:
379  oprot.writeFieldBegin('sizerType', TType.I32, 2)
380  oprot.writeI32(self.sizerType)
381  oprot.writeFieldEnd()
382  if self.sizerArgPos is not None:
383  oprot.writeFieldBegin('sizerArgPos', TType.I32, 3)
384  oprot.writeI32(self.sizerArgPos)
385  oprot.writeFieldEnd()
386  if self.inputArgTypes is not None:
387  oprot.writeFieldBegin('inputArgTypes', TType.LIST, 4)
388  oprot.writeListBegin(TType.I32, len(self.inputArgTypes))
389  for iter38 in self.inputArgTypes:
390  oprot.writeI32(iter38)
391  oprot.writeListEnd()
392  oprot.writeFieldEnd()
393  if self.outputArgTypes is not None:
394  oprot.writeFieldBegin('outputArgTypes', TType.LIST, 5)
395  oprot.writeListBegin(TType.I32, len(self.outputArgTypes))
396  for iter39 in self.outputArgTypes:
397  oprot.writeI32(iter39)
398  oprot.writeListEnd()
399  oprot.writeFieldEnd()
400  if self.sqlArgTypes is not None:
401  oprot.writeFieldBegin('sqlArgTypes', TType.LIST, 6)
402  oprot.writeListBegin(TType.I32, len(self.sqlArgTypes))
403  for iter40 in self.sqlArgTypes:
404  oprot.writeI32(iter40)
405  oprot.writeListEnd()
406  oprot.writeFieldEnd()
407  if self.annotations is not None:
408  oprot.writeFieldBegin('annotations', TType.LIST, 7)
409  oprot.writeListBegin(TType.MAP, len(self.annotations))
410  for iter41 in self.annotations:
411  oprot.writeMapBegin(TType.STRING, TType.STRING, len(iter41))
412  for kiter42, viter43 in iter41.items():
413  oprot.writeString(kiter42.encode('utf-8') if sys.version_info[0] == 2 else kiter42)
414  oprot.writeString(viter43.encode('utf-8') if sys.version_info[0] == 2 else viter43)
415  oprot.writeMapEnd()
416  oprot.writeListEnd()
417  oprot.writeFieldEnd()
418  oprot.writeFieldStop()
419  oprot.writeStructEnd()
420 
421  def validate(self):
422  return
423 
424  def __repr__(self):
425  L = ['%s=%r' % (key, value)
426  for key, value in self.__dict__.items()]
427  return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
428 
429  def __eq__(self, other):
430  return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
431 
432  def __ne__(self, other):
433  return not (self == other)
434 all_structs.append(TUserDefinedFunction)
435 TUserDefinedFunction.thrift_spec = (
436  None, # 0
437  (1, TType.STRING, 'name', 'UTF8', None, ), # 1
438  (2, TType.LIST, 'argTypes', (TType.I32, None, False), None, ), # 2
439  (3, TType.I32, 'retType', None, None, ), # 3
440 )
441 all_structs.append(TUserDefinedTableFunction)
442 TUserDefinedTableFunction.thrift_spec = (
443  None, # 0
444  (1, TType.STRING, 'name', 'UTF8', None, ), # 1
445  (2, TType.I32, 'sizerType', None, None, ), # 2
446  (3, TType.I32, 'sizerArgPos', None, None, ), # 3
447  (4, TType.LIST, 'inputArgTypes', (TType.I32, None, False), None, ), # 4
448  (5, TType.LIST, 'outputArgTypes', (TType.I32, None, False), None, ), # 5
449  (6, TType.LIST, 'sqlArgTypes', (TType.I32, None, False), None, ), # 6
450  (7, TType.LIST, 'annotations', (TType.MAP, (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), False), None, ), # 7
451 )
452 fix_spec(all_structs)
453 del all_structs
std::string join(T const &container, std::string const &delim)