OmniSciDB  340b00dbf6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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 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 
56  _VALUES_TO_NAMES = {
57  0: "SMALLINT",
58  1: "INT",
59  2: "BIGINT",
60  3: "FLOAT",
61  4: "DECIMAL",
62  5: "DOUBLE",
63  6: "STR",
64  7: "TIME",
65  8: "TIMESTAMP",
66  9: "DATE",
67  10: "BOOL",
68  11: "INTERVAL_DAY_TIME",
69  12: "INTERVAL_YEAR_MONTH",
70  13: "POINT",
71  14: "LINESTRING",
72  15: "POLYGON",
73  16: "MULTIPOLYGON",
74  17: "TINYINT",
75  18: "GEOMETRY",
76  19: "GEOGRAPHY",
77  }
78 
79  _NAMES_TO_VALUES = {
80  "SMALLINT": 0,
81  "INT": 1,
82  "BIGINT": 2,
83  "FLOAT": 3,
84  "DECIMAL": 4,
85  "DOUBLE": 5,
86  "STR": 6,
87  "TIME": 7,
88  "TIMESTAMP": 8,
89  "DATE": 9,
90  "BOOL": 10,
91  "INTERVAL_DAY_TIME": 11,
92  "INTERVAL_YEAR_MONTH": 12,
93  "POINT": 13,
94  "LINESTRING": 14,
95  "POLYGON": 15,
96  "MULTIPOLYGON": 16,
97  "TINYINT": 17,
98  "GEOMETRY": 18,
99  "GEOGRAPHY": 19,
100  }
101 
102 
103 class TEncodingType(object):
104  NONE = 0
105  FIXED = 1
106  RL = 2
107  DIFF = 3
108  DICT = 4
109  SPARSE = 5
110  GEOINT = 6
111  DATE_IN_DAYS = 7
112 
113  _VALUES_TO_NAMES = {
114  0: "NONE",
115  1: "FIXED",
116  2: "RL",
117  3: "DIFF",
118  4: "DICT",
119  5: "SPARSE",
120  6: "GEOINT",
121  7: "DATE_IN_DAYS",
122  }
123 
124  _NAMES_TO_VALUES = {
125  "NONE": 0,
126  "FIXED": 1,
127  "RL": 2,
128  "DIFF": 3,
129  "DICT": 4,
130  "SPARSE": 5,
131  "GEOINT": 6,
132  "DATE_IN_DAYS": 7,
133  }
134 
135 
136 class TTypeInfo(object):
137  """
138  Attributes:
139  - type
140  - encoding
141  - nullable
142  - is_array
143  - precision
144  - scale
145  - comp_param
146  - size
147 
148  """
149 
150 
151  def __init__(self, type=None, encoding=None, nullable=None, is_array=None, precision=None, scale=None, comp_param=None, size=-1,):
152  self.type = type
153  self.encoding = encoding
154  self.nullable = nullable
155  self.is_array = is_array
156  self.precision = precision
157  self.scale = scale
158  self.comp_param = comp_param
159  self.size = size
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.type = iprot.readI32()
173  else:
174  iprot.skip(ftype)
175  elif fid == 4:
176  if ftype == TType.I32:
177  self.encoding = iprot.readI32()
178  else:
179  iprot.skip(ftype)
180  elif fid == 2:
181  if ftype == TType.BOOL:
182  self.nullable = iprot.readBool()
183  else:
184  iprot.skip(ftype)
185  elif fid == 3:
186  if ftype == TType.BOOL:
187  self.is_array = iprot.readBool()
188  else:
189  iprot.skip(ftype)
190  elif fid == 5:
191  if ftype == TType.I32:
192  self.precision = iprot.readI32()
193  else:
194  iprot.skip(ftype)
195  elif fid == 6:
196  if ftype == TType.I32:
197  self.scale = iprot.readI32()
198  else:
199  iprot.skip(ftype)
200  elif fid == 7:
201  if ftype == TType.I32:
202  self.comp_param = iprot.readI32()
203  else:
204  iprot.skip(ftype)
205  elif fid == 8:
206  if ftype == TType.I32:
207  self.size = iprot.readI32()
208  else:
209  iprot.skip(ftype)
210  else:
211  iprot.skip(ftype)
212  iprot.readFieldEnd()
213  iprot.readStructEnd()
214 
215  def write(self, oprot):
216  if oprot._fast_encode is not None and self.thrift_spec is not None:
217  oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
218  return
219  oprot.writeStructBegin('TTypeInfo')
220  if self.type is not None:
221  oprot.writeFieldBegin('type', TType.I32, 1)
222  oprot.writeI32(self.type)
223  oprot.writeFieldEnd()
224  if self.nullable is not None:
225  oprot.writeFieldBegin('nullable', TType.BOOL, 2)
226  oprot.writeBool(self.nullable)
227  oprot.writeFieldEnd()
228  if self.is_array is not None:
229  oprot.writeFieldBegin('is_array', TType.BOOL, 3)
230  oprot.writeBool(self.is_array)
231  oprot.writeFieldEnd()
232  if self.encoding is not None:
233  oprot.writeFieldBegin('encoding', TType.I32, 4)
234  oprot.writeI32(self.encoding)
235  oprot.writeFieldEnd()
236  if self.precision is not None:
237  oprot.writeFieldBegin('precision', TType.I32, 5)
238  oprot.writeI32(self.precision)
239  oprot.writeFieldEnd()
240  if self.scale is not None:
241  oprot.writeFieldBegin('scale', TType.I32, 6)
242  oprot.writeI32(self.scale)
243  oprot.writeFieldEnd()
244  if self.comp_param is not None:
245  oprot.writeFieldBegin('comp_param', TType.I32, 7)
246  oprot.writeI32(self.comp_param)
247  oprot.writeFieldEnd()
248  if self.size is not None:
249  oprot.writeFieldBegin('size', TType.I32, 8)
250  oprot.writeI32(self.size)
251  oprot.writeFieldEnd()
252  oprot.writeFieldStop()
253  oprot.writeStructEnd()
254 
255  def validate(self):
256  return
257 
258  def __repr__(self):
259  L = ['%s=%r' % (key, value)
260  for key, value in self.__dict__.items()]
261  return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
262 
263  def __eq__(self, other):
264  return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
265 
266  def __ne__(self, other):
267  return not (self == other)
268 all_structs.append(TTypeInfo)
269 TTypeInfo.thrift_spec = (
270  None, # 0
271  (1, TType.I32, 'type', None, None, ), # 1
272  (2, TType.BOOL, 'nullable', None, None, ), # 2
273  (3, TType.BOOL, 'is_array', None, None, ), # 3
274  (4, TType.I32, 'encoding', None, None, ), # 4
275  (5, TType.I32, 'precision', None, None, ), # 5
276  (6, TType.I32, 'scale', None, None, ), # 6
277  (7, TType.I32, 'comp_param', None, None, ), # 7
278  (8, TType.I32, 'size', None, -1, ), # 8
279 )
280 fix_spec(all_structs)
281 del all_structs
std::string join(T const &container, std::string const &delim)