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 TDeviceType(object):
20  CPU = 0
21  GPU = 1
22 
23  _VALUES_TO_NAMES = {
24  0: "CPU",
25  1: "GPU",
26  }
27 
28  _NAMES_TO_VALUES = {
29  "CPU": 0,
30  "GPU": 1,
31  }
32 
33 
34 class TDatumType(object):
35  SMALLINT = 0
36  INT = 1
37  BIGINT = 2
38  FLOAT = 3
39  DECIMAL = 4
40  DOUBLE = 5
41  STR = 6
42  TIME = 7
43  TIMESTAMP = 8
44  DATE = 9
45  BOOL = 10
46  INTERVAL_DAY_TIME = 11
47  INTERVAL_YEAR_MONTH = 12
48  POINT = 13
49  LINESTRING = 14
50  POLYGON = 15
51  MULTIPOLYGON = 16
52  TINYINT = 17
53  GEOMETRY = 18
54  GEOGRAPHY = 19
55  MULTILINESTRING = 20
56  MULTIPOINT = 21
57 
58  _VALUES_TO_NAMES = {
59  0: "SMALLINT",
60  1: "INT",
61  2: "BIGINT",
62  3: "FLOAT",
63  4: "DECIMAL",
64  5: "DOUBLE",
65  6: "STR",
66  7: "TIME",
67  8: "TIMESTAMP",
68  9: "DATE",
69  10: "BOOL",
70  11: "INTERVAL_DAY_TIME",
71  12: "INTERVAL_YEAR_MONTH",
72  13: "POINT",
73  14: "LINESTRING",
74  15: "POLYGON",
75  16: "MULTIPOLYGON",
76  17: "TINYINT",
77  18: "GEOMETRY",
78  19: "GEOGRAPHY",
79  20: "MULTILINESTRING",
80  21: "MULTIPOINT",
81  }
82 
83  _NAMES_TO_VALUES = {
84  "SMALLINT": 0,
85  "INT": 1,
86  "BIGINT": 2,
87  "FLOAT": 3,
88  "DECIMAL": 4,
89  "DOUBLE": 5,
90  "STR": 6,
91  "TIME": 7,
92  "TIMESTAMP": 8,
93  "DATE": 9,
94  "BOOL": 10,
95  "INTERVAL_DAY_TIME": 11,
96  "INTERVAL_YEAR_MONTH": 12,
97  "POINT": 13,
98  "LINESTRING": 14,
99  "POLYGON": 15,
100  "MULTIPOLYGON": 16,
101  "TINYINT": 17,
102  "GEOMETRY": 18,
103  "GEOGRAPHY": 19,
104  "MULTILINESTRING": 20,
105  "MULTIPOINT": 21,
106  }
107 
108 
109 class TEncodingType(object):
110  NONE = 0
111  FIXED = 1
112  RL = 2
113  DIFF = 3
114  DICT = 4
115  SPARSE = 5
116  GEOINT = 6
117  DATE_IN_DAYS = 7
118  ARRAY = 8
119  ARRAY_DICT = 9
120 
121  _VALUES_TO_NAMES = {
122  0: "NONE",
123  1: "FIXED",
124  2: "RL",
125  3: "DIFF",
126  4: "DICT",
127  5: "SPARSE",
128  6: "GEOINT",
129  7: "DATE_IN_DAYS",
130  8: "ARRAY",
131  9: "ARRAY_DICT",
132  }
133 
134  _NAMES_TO_VALUES = {
135  "NONE": 0,
136  "FIXED": 1,
137  "RL": 2,
138  "DIFF": 3,
139  "DICT": 4,
140  "SPARSE": 5,
141  "GEOINT": 6,
142  "DATE_IN_DAYS": 7,
143  "ARRAY": 8,
144  "ARRAY_DICT": 9,
145  }
146 
147 
148 class TStringDictKey(object):
149  """
150  Attributes:
151  - db_id
152  - dict_id
153 
154  """
155 
156 
157  def __init__(self, db_id=None, dict_id=None,):
158  self.db_id = db_id
159  self.dict_id = dict_id
160 
161  def read(self, iprot):
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])
164  return
165  iprot.readStructBegin()
166  while True:
167  (fname, ftype, fid) = iprot.readFieldBegin()
168  if ftype == TType.STOP:
169  break
170  if fid == 1:
171  if ftype == TType.I32:
172  self.db_id = iprot.readI32()
173  else:
174  iprot.skip(ftype)
175  elif fid == 2:
176  if ftype == TType.I32:
177  self.dict_id = iprot.readI32()
178  else:
179  iprot.skip(ftype)
180  else:
181  iprot.skip(ftype)
182  iprot.readFieldEnd()
183  iprot.readStructEnd()
184 
185  def write(self, oprot):
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]))
188  return
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()
194  if self.dict_id is not None:
195  oprot.writeFieldBegin('dict_id', TType.I32, 2)
196  oprot.writeI32(self.dict_id)
197  oprot.writeFieldEnd()
198  oprot.writeFieldStop()
199  oprot.writeStructEnd()
200 
201  def validate(self):
202  return
203 
204  def __repr__(self):
205  L = ['%s=%r' % (key, value)
206  for key, value in self.__dict__.items()]
207  return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
208 
209  def __eq__(self, other):
210  return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
211 
212  def __ne__(self, other):
213  return not (self == other)
214 
215 
216 class TTypeInfo(object):
217  """
218  Attributes:
219  - type
220  - encoding
221  - nullable
222  - is_array
223  - precision
224  - scale
225  - comp_param
226  - size
227  - dict_key
228 
229  """
230 
231 
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,):
233  self.type = type
234  self.encoding = encoding
235  self.nullable = nullable
236  self.is_array = is_array
237  self.precision = precision
238  self.scale = scale
239  self.comp_param = comp_param
240  self.size = size
241  self.dict_key = dict_key
242 
243  def read(self, iprot):
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])
246  return
247  iprot.readStructBegin()
248  while True:
249  (fname, ftype, fid) = iprot.readFieldBegin()
250  if ftype == TType.STOP:
251  break
252  if fid == 1:
253  if ftype == TType.I32:
254  self.type = iprot.readI32()
255  else:
256  iprot.skip(ftype)
257  elif fid == 4:
258  if ftype == TType.I32:
259  self.encoding = iprot.readI32()
260  else:
261  iprot.skip(ftype)
262  elif fid == 2:
263  if ftype == TType.BOOL:
264  self.nullable = iprot.readBool()
265  else:
266  iprot.skip(ftype)
267  elif fid == 3:
268  if ftype == TType.BOOL:
269  self.is_array = iprot.readBool()
270  else:
271  iprot.skip(ftype)
272  elif fid == 5:
273  if ftype == TType.I32:
274  self.precision = iprot.readI32()
275  else:
276  iprot.skip(ftype)
277  elif fid == 6:
278  if ftype == TType.I32:
279  self.scale = iprot.readI32()
280  else:
281  iprot.skip(ftype)
282  elif fid == 7:
283  if ftype == TType.I32:
284  self.comp_param = iprot.readI32()
285  else:
286  iprot.skip(ftype)
287  elif fid == 8:
288  if ftype == TType.I32:
289  self.size = iprot.readI32()
290  else:
291  iprot.skip(ftype)
292  elif fid == 9:
293  if ftype == TType.STRUCT:
294  self.dict_key = TStringDictKey()
295  self.dict_key.read(iprot)
296  else:
297  iprot.skip(ftype)
298  else:
299  iprot.skip(ftype)
300  iprot.readFieldEnd()
301  iprot.readStructEnd()
302 
303  def write(self, oprot):
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]))
306  return
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()
312  if self.nullable is not None:
313  oprot.writeFieldBegin('nullable', TType.BOOL, 2)
314  oprot.writeBool(self.nullable)
315  oprot.writeFieldEnd()
316  if self.is_array is not None:
317  oprot.writeFieldBegin('is_array', TType.BOOL, 3)
318  oprot.writeBool(self.is_array)
319  oprot.writeFieldEnd()
320  if self.encoding is not None:
321  oprot.writeFieldBegin('encoding', TType.I32, 4)
322  oprot.writeI32(self.encoding)
323  oprot.writeFieldEnd()
324  if self.precision is not None:
325  oprot.writeFieldBegin('precision', TType.I32, 5)
326  oprot.writeI32(self.precision)
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()
332  if self.comp_param is not None:
333  oprot.writeFieldBegin('comp_param', TType.I32, 7)
334  oprot.writeI32(self.comp_param)
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()
340  if self.dict_key is not None:
341  oprot.writeFieldBegin('dict_key', TType.STRUCT, 9)
342  self.dict_key.write(oprot)
343  oprot.writeFieldEnd()
344  oprot.writeFieldStop()
345  oprot.writeStructEnd()
346 
347  def validate(self):
348  return
349 
350  def __repr__(self):
351  L = ['%s=%r' % (key, value)
352  for key, value in self.__dict__.items()]
353  return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
354 
355  def __eq__(self, other):
356  return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
357 
358  def __ne__(self, other):
359  return not (self == other)
360 all_structs.append(TStringDictKey)
361 TStringDictKey.thrift_spec = (
362  None, # 0
363  (1, TType.I32, 'db_id', None, None, ), # 1
364  (2, TType.I32, 'dict_id', None, None, ), # 2
365 )
366 all_structs.append(TTypeInfo)
367 TTypeInfo.thrift_spec = (
368  None, # 0
369  (1, TType.I32, 'type', None, None, ), # 1
370  (2, TType.BOOL, 'nullable', None, None, ), # 2
371  (3, TType.BOOL, 'is_array', None, None, ), # 3
372  (4, TType.I32, 'encoding', None, None, ), # 4
373  (5, TType.I32, 'precision', None, None, ), # 5
374  (6, TType.I32, 'scale', None, None, ), # 6
375  (7, TType.I32, 'comp_param', None, None, ), # 7
376  (8, TType.I32, 'size', None, -1, ), # 8
377  (9, TType.STRUCT, 'dict_key', [TStringDictKey, None], None, ), # 9
378 )
379 fix_spec(all_structs)
380 del all_structs
std::string join(T const &container, std::string const &delim)