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