OmniSciDB  c1a53651b2
 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
15 
16 from thrift.transport import TTransport
17 all_structs = []
18 
19 
20 class TResultSetLayout(object):
21  GroupByPerfectHash = 0
22  GroupByBaselineHash = 1
23  Projection = 2
24  NonGroupedAggregate = 3
25 
26  _VALUES_TO_NAMES = {
27  0: "GroupByPerfectHash",
28  1: "GroupByBaselineHash",
29  2: "Projection",
30  3: "NonGroupedAggregate",
31  }
32 
33  _NAMES_TO_VALUES = {
34  "GroupByPerfectHash": 0,
35  "GroupByBaselineHash": 1,
36  "Projection": 2,
37  "NonGroupedAggregate": 3,
38  }
39 
40 
41 class TCountDistinctImplType(object):
42  Invalid = 0
43  Bitmap = 1
44  UnorderedSet = 2
45 
46  _VALUES_TO_NAMES = {
47  0: "Invalid",
48  1: "Bitmap",
49  2: "UnorderedSet",
50  }
51 
52  _NAMES_TO_VALUES = {
53  "Invalid": 0,
54  "Bitmap": 1,
55  "UnorderedSet": 2,
56  }
57 
58 
59 class TAggKind(object):
60  AVG = 0
61  MIN = 1
62  MAX = 2
63  SUM = 3
64  COUNT = 4
65  APPROX_COUNT_DISTINCT = 5
66  SAMPLE = 6
67  SINGLE_VALUE = 7
68 
69  _VALUES_TO_NAMES = {
70  0: "AVG",
71  1: "MIN",
72  2: "MAX",
73  3: "SUM",
74  4: "COUNT",
75  5: "APPROX_COUNT_DISTINCT",
76  6: "SAMPLE",
77  7: "SINGLE_VALUE",
78  }
79 
80  _NAMES_TO_VALUES = {
81  "AVG": 0,
82  "MIN": 1,
83  "MAX": 2,
84  "SUM": 3,
85  "COUNT": 4,
86  "APPROX_COUNT_DISTINCT": 5,
87  "SAMPLE": 6,
88  "SINGLE_VALUE": 7,
89  }
90 
91 
92 class TSlotSize(object):
93  """
94  Attributes:
95  - padded
96  - logical
97 
98  """
99 
100 
101  def __init__(self, padded=None, logical=None,):
102  self.padded = padded
103  self.logical = logical
104 
105  def read(self, iprot):
106  if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
107  iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
108  return
109  iprot.readStructBegin()
110  while True:
111  (fname, ftype, fid) = iprot.readFieldBegin()
112  if ftype == TType.STOP:
113  break
114  if fid == 1:
115  if ftype == TType.I16:
116  self.padded = iprot.readI16()
117  else:
118  iprot.skip(ftype)
119  elif fid == 2:
120  if ftype == TType.I16:
121  self.logical = iprot.readI16()
122  else:
123  iprot.skip(ftype)
124  else:
125  iprot.skip(ftype)
126  iprot.readFieldEnd()
127  iprot.readStructEnd()
128 
129  def write(self, oprot):
130  if oprot._fast_encode is not None and self.thrift_spec is not None:
131  oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
132  return
133  oprot.writeStructBegin('TSlotSize')
134  if self.padded is not None:
135  oprot.writeFieldBegin('padded', TType.I16, 1)
136  oprot.writeI16(self.padded)
137  oprot.writeFieldEnd()
138  if self.logical is not None:
139  oprot.writeFieldBegin('logical', TType.I16, 2)
140  oprot.writeI16(self.logical)
141  oprot.writeFieldEnd()
142  oprot.writeFieldStop()
143  oprot.writeStructEnd()
144 
145  def validate(self):
146  return
147 
148  def __repr__(self):
149  L = ['%s=%r' % (key, value)
150  for key, value in self.__dict__.items()]
151  return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
152 
153  def __eq__(self, other):
154  return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
155 
156  def __ne__(self, other):
157  return not (self == other)
158 
159 
160 class TColSlotContext(object):
161  """
162  Attributes:
163  - slot_sizes
164  - col_to_slot_map
165 
166  """
167 
168 
169  def __init__(self, slot_sizes=None, col_to_slot_map=None,):
170  self.slot_sizes = slot_sizes
171  self.col_to_slot_map = col_to_slot_map
172 
173  def read(self, iprot):
174  if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
175  iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
176  return
177  iprot.readStructBegin()
178  while True:
179  (fname, ftype, fid) = iprot.readFieldBegin()
180  if ftype == TType.STOP:
181  break
182  if fid == 1:
183  if ftype == TType.LIST:
184  self.slot_sizes = []
185  (_etype3, _size0) = iprot.readListBegin()
186  for _i4 in range(_size0):
187  _elem5 = TSlotSize()
188  _elem5.read(iprot)
189  self.slot_sizes.append(_elem5)
190  iprot.readListEnd()
191  else:
192  iprot.skip(ftype)
193  elif fid == 2:
194  if ftype == TType.LIST:
195  self.col_to_slot_map = []
196  (_etype9, _size6) = iprot.readListBegin()
197  for _i10 in range(_size6):
198  _elem11 = []
199  (_etype15, _size12) = iprot.readListBegin()
200  for _i16 in range(_size12):
201  _elem17 = iprot.readI32()
202  _elem11.append(_elem17)
203  iprot.readListEnd()
204  self.col_to_slot_map.append(_elem11)
205  iprot.readListEnd()
206  else:
207  iprot.skip(ftype)
208  else:
209  iprot.skip(ftype)
210  iprot.readFieldEnd()
211  iprot.readStructEnd()
212 
213  def write(self, oprot):
214  if oprot._fast_encode is not None and self.thrift_spec is not None:
215  oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
216  return
217  oprot.writeStructBegin('TColSlotContext')
218  if self.slot_sizes is not None:
219  oprot.writeFieldBegin('slot_sizes', TType.LIST, 1)
220  oprot.writeListBegin(TType.STRUCT, len(self.slot_sizes))
221  for iter18 in self.slot_sizes:
222  iter18.write(oprot)
223  oprot.writeListEnd()
224  oprot.writeFieldEnd()
225  if self.col_to_slot_map is not None:
226  oprot.writeFieldBegin('col_to_slot_map', TType.LIST, 2)
227  oprot.writeListBegin(TType.LIST, len(self.col_to_slot_map))
228  for iter19 in self.col_to_slot_map:
229  oprot.writeListBegin(TType.I32, len(iter19))
230  for iter20 in iter19:
231  oprot.writeI32(iter20)
232  oprot.writeListEnd()
233  oprot.writeListEnd()
234  oprot.writeFieldEnd()
235  oprot.writeFieldStop()
236  oprot.writeStructEnd()
237 
238  def validate(self):
239  return
240 
241  def __repr__(self):
242  L = ['%s=%r' % (key, value)
243  for key, value in self.__dict__.items()]
244  return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
245 
246  def __eq__(self, other):
247  return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
248 
249  def __ne__(self, other):
250  return not (self == other)
251 
252 
254  """
255  Attributes:
256  - impl_type
257  - min_val
258  - bitmap_sz_bits
259  - approximate
260  - device_type
261  - sub_bitmap_count
262 
263  """
264 
265 
266  def __init__(self, impl_type=None, min_val=None, bitmap_sz_bits=None, approximate=None, device_type=None, sub_bitmap_count=None,):
267  self.impl_type = impl_type
268  self.min_val = min_val
269  self.bitmap_sz_bits = bitmap_sz_bits
270  self.approximate = approximate
271  self.device_type = device_type
272  self.sub_bitmap_count = sub_bitmap_count
273 
274  def read(self, iprot):
275  if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
276  iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
277  return
278  iprot.readStructBegin()
279  while True:
280  (fname, ftype, fid) = iprot.readFieldBegin()
281  if ftype == TType.STOP:
282  break
283  if fid == 1:
284  if ftype == TType.I32:
285  self.impl_type = iprot.readI32()
286  else:
287  iprot.skip(ftype)
288  elif fid == 2:
289  if ftype == TType.I64:
290  self.min_val = iprot.readI64()
291  else:
292  iprot.skip(ftype)
293  elif fid == 3:
294  if ftype == TType.I64:
295  self.bitmap_sz_bits = iprot.readI64()
296  else:
297  iprot.skip(ftype)
298  elif fid == 4:
299  if ftype == TType.BOOL:
300  self.approximate = iprot.readBool()
301  else:
302  iprot.skip(ftype)
303  elif fid == 5:
304  if ftype == TType.I32:
305  self.device_type = iprot.readI32()
306  else:
307  iprot.skip(ftype)
308  elif fid == 6:
309  if ftype == TType.I64:
310  self.sub_bitmap_count = iprot.readI64()
311  else:
312  iprot.skip(ftype)
313  else:
314  iprot.skip(ftype)
315  iprot.readFieldEnd()
316  iprot.readStructEnd()
317 
318  def write(self, oprot):
319  if oprot._fast_encode is not None and self.thrift_spec is not None:
320  oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
321  return
322  oprot.writeStructBegin('TCountDistinctDescriptor')
323  if self.impl_type is not None:
324  oprot.writeFieldBegin('impl_type', TType.I32, 1)
325  oprot.writeI32(self.impl_type)
326  oprot.writeFieldEnd()
327  if self.min_val is not None:
328  oprot.writeFieldBegin('min_val', TType.I64, 2)
329  oprot.writeI64(self.min_val)
330  oprot.writeFieldEnd()
331  if self.bitmap_sz_bits is not None:
332  oprot.writeFieldBegin('bitmap_sz_bits', TType.I64, 3)
333  oprot.writeI64(self.bitmap_sz_bits)
334  oprot.writeFieldEnd()
335  if self.approximate is not None:
336  oprot.writeFieldBegin('approximate', TType.BOOL, 4)
337  oprot.writeBool(self.approximate)
338  oprot.writeFieldEnd()
339  if self.device_type is not None:
340  oprot.writeFieldBegin('device_type', TType.I32, 5)
341  oprot.writeI32(self.device_type)
342  oprot.writeFieldEnd()
343  if self.sub_bitmap_count is not None:
344  oprot.writeFieldBegin('sub_bitmap_count', TType.I64, 6)
345  oprot.writeI64(self.sub_bitmap_count)
346  oprot.writeFieldEnd()
347  oprot.writeFieldStop()
348  oprot.writeStructEnd()
349 
350  def validate(self):
351  return
352 
353  def __repr__(self):
354  L = ['%s=%r' % (key, value)
355  for key, value in self.__dict__.items()]
356  return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
357 
358  def __eq__(self, other):
359  return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
360 
361  def __ne__(self, other):
362  return not (self == other)
363 
364 
366  """
367  Attributes:
368  - layout
369  - keyless
370  - entry_count
371  - idx_target_as_key
372  - min_val
373  - max_val
374  - bucket
375  - group_col_widths
376  - key_bytewidth
377  - col_slot_context
378  - target_groupby_indices
379  - count_distinct_descriptors
380  - force_4byte_float
381 
382  """
383 
384 
385  def __init__(self, layout=None, keyless=None, entry_count=None, idx_target_as_key=None, min_val=None, max_val=None, bucket=None, group_col_widths=None, key_bytewidth=None, col_slot_context=None, target_groupby_indices=None, count_distinct_descriptors=None, force_4byte_float=None,):
386  self.layout = layout
387  self.keyless = keyless
388  self.entry_count = entry_count
389  self.idx_target_as_key = idx_target_as_key
390  self.min_val = min_val
391  self.max_val = max_val
392  self.bucket = bucket
393  self.group_col_widths = group_col_widths
394  self.key_bytewidth = key_bytewidth
395  self.col_slot_context = col_slot_context
396  self.target_groupby_indices = target_groupby_indices
397  self.count_distinct_descriptors = count_distinct_descriptors
398  self.force_4byte_float = force_4byte_float
399 
400  def read(self, iprot):
401  if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
402  iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
403  return
404  iprot.readStructBegin()
405  while True:
406  (fname, ftype, fid) = iprot.readFieldBegin()
407  if ftype == TType.STOP:
408  break
409  if fid == 1:
410  if ftype == TType.I32:
411  self.layout = iprot.readI32()
412  else:
413  iprot.skip(ftype)
414  elif fid == 2:
415  if ftype == TType.BOOL:
416  self.keyless = iprot.readBool()
417  else:
418  iprot.skip(ftype)
419  elif fid == 3:
420  if ftype == TType.I32:
421  self.entry_count = iprot.readI32()
422  else:
423  iprot.skip(ftype)
424  elif fid == 4:
425  if ftype == TType.I32:
426  self.idx_target_as_key = iprot.readI32()
427  else:
428  iprot.skip(ftype)
429  elif fid == 5:
430  if ftype == TType.I64:
431  self.min_val = iprot.readI64()
432  else:
433  iprot.skip(ftype)
434  elif fid == 6:
435  if ftype == TType.I64:
436  self.max_val = iprot.readI64()
437  else:
438  iprot.skip(ftype)
439  elif fid == 7:
440  if ftype == TType.I64:
441  self.bucket = iprot.readI64()
442  else:
443  iprot.skip(ftype)
444  elif fid == 8:
445  if ftype == TType.LIST:
446  self.group_col_widths = []
447  (_etype24, _size21) = iprot.readListBegin()
448  for _i25 in range(_size21):
449  _elem26 = iprot.readI16()
450  self.group_col_widths.append(_elem26)
451  iprot.readListEnd()
452  else:
453  iprot.skip(ftype)
454  elif fid == 9:
455  if ftype == TType.I16:
456  self.key_bytewidth = iprot.readI16()
457  else:
458  iprot.skip(ftype)
459  elif fid == 10:
460  if ftype == TType.STRUCT:
462  self.col_slot_context.read(iprot)
463  else:
464  iprot.skip(ftype)
465  elif fid == 11:
466  if ftype == TType.LIST:
467  self.target_groupby_indices = []
468  (_etype30, _size27) = iprot.readListBegin()
469  for _i31 in range(_size27):
470  _elem32 = iprot.readI32()
471  self.target_groupby_indices.append(_elem32)
472  iprot.readListEnd()
473  else:
474  iprot.skip(ftype)
475  elif fid == 12:
476  if ftype == TType.LIST:
478  (_etype36, _size33) = iprot.readListBegin()
479  for _i37 in range(_size33):
480  _elem38 = TCountDistinctDescriptor()
481  _elem38.read(iprot)
482  self.count_distinct_descriptors.append(_elem38)
483  iprot.readListEnd()
484  else:
485  iprot.skip(ftype)
486  elif fid == 13:
487  if ftype == TType.BOOL:
488  self.force_4byte_float = iprot.readBool()
489  else:
490  iprot.skip(ftype)
491  else:
492  iprot.skip(ftype)
493  iprot.readFieldEnd()
494  iprot.readStructEnd()
495 
496  def write(self, oprot):
497  if oprot._fast_encode is not None and self.thrift_spec is not None:
498  oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
499  return
500  oprot.writeStructBegin('TResultSetBufferDescriptor')
501  if self.layout is not None:
502  oprot.writeFieldBegin('layout', TType.I32, 1)
503  oprot.writeI32(self.layout)
504  oprot.writeFieldEnd()
505  if self.keyless is not None:
506  oprot.writeFieldBegin('keyless', TType.BOOL, 2)
507  oprot.writeBool(self.keyless)
508  oprot.writeFieldEnd()
509  if self.entry_count is not None:
510  oprot.writeFieldBegin('entry_count', TType.I32, 3)
511  oprot.writeI32(self.entry_count)
512  oprot.writeFieldEnd()
513  if self.idx_target_as_key is not None:
514  oprot.writeFieldBegin('idx_target_as_key', TType.I32, 4)
515  oprot.writeI32(self.idx_target_as_key)
516  oprot.writeFieldEnd()
517  if self.min_val is not None:
518  oprot.writeFieldBegin('min_val', TType.I64, 5)
519  oprot.writeI64(self.min_val)
520  oprot.writeFieldEnd()
521  if self.max_val is not None:
522  oprot.writeFieldBegin('max_val', TType.I64, 6)
523  oprot.writeI64(self.max_val)
524  oprot.writeFieldEnd()
525  if self.bucket is not None:
526  oprot.writeFieldBegin('bucket', TType.I64, 7)
527  oprot.writeI64(self.bucket)
528  oprot.writeFieldEnd()
529  if self.group_col_widths is not None:
530  oprot.writeFieldBegin('group_col_widths', TType.LIST, 8)
531  oprot.writeListBegin(TType.I16, len(self.group_col_widths))
532  for iter39 in self.group_col_widths:
533  oprot.writeI16(iter39)
534  oprot.writeListEnd()
535  oprot.writeFieldEnd()
536  if self.key_bytewidth is not None:
537  oprot.writeFieldBegin('key_bytewidth', TType.I16, 9)
538  oprot.writeI16(self.key_bytewidth)
539  oprot.writeFieldEnd()
540  if self.col_slot_context is not None:
541  oprot.writeFieldBegin('col_slot_context', TType.STRUCT, 10)
542  self.col_slot_context.write(oprot)
543  oprot.writeFieldEnd()
544  if self.target_groupby_indices is not None:
545  oprot.writeFieldBegin('target_groupby_indices', TType.LIST, 11)
546  oprot.writeListBegin(TType.I32, len(self.target_groupby_indices))
547  for iter40 in self.target_groupby_indices:
548  oprot.writeI32(iter40)
549  oprot.writeListEnd()
550  oprot.writeFieldEnd()
551  if self.count_distinct_descriptors is not None:
552  oprot.writeFieldBegin('count_distinct_descriptors', TType.LIST, 12)
553  oprot.writeListBegin(TType.STRUCT, len(self.count_distinct_descriptors))
554  for iter41 in self.count_distinct_descriptors:
555  iter41.write(oprot)
556  oprot.writeListEnd()
557  oprot.writeFieldEnd()
558  if self.force_4byte_float is not None:
559  oprot.writeFieldBegin('force_4byte_float', TType.BOOL, 13)
560  oprot.writeBool(self.force_4byte_float)
561  oprot.writeFieldEnd()
562  oprot.writeFieldStop()
563  oprot.writeStructEnd()
564 
565  def validate(self):
566  return
567 
568  def __repr__(self):
569  L = ['%s=%r' % (key, value)
570  for key, value in self.__dict__.items()]
571  return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
572 
573  def __eq__(self, other):
574  return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
575 
576  def __ne__(self, other):
577  return not (self == other)
578 
579 
580 class TTargetInfo(object):
581  """
582  Attributes:
583  - is_agg
584  - kind
585  - type
586  - arg_type
587  - skip_nulls
588  - is_distinct
589 
590  """
591 
592 
593  def __init__(self, is_agg=None, kind=None, type=None, arg_type=None, skip_nulls=None, is_distinct=None,):
594  self.is_agg = is_agg
595  self.kind = kind
596  self.type = type
597  self.arg_type = arg_type
598  self.skip_nulls = skip_nulls
599  self.is_distinct = is_distinct
600 
601  def read(self, iprot):
602  if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
603  iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
604  return
605  iprot.readStructBegin()
606  while True:
607  (fname, ftype, fid) = iprot.readFieldBegin()
608  if ftype == TType.STOP:
609  break
610  if fid == 1:
611  if ftype == TType.BOOL:
612  self.is_agg = iprot.readBool()
613  else:
614  iprot.skip(ftype)
615  elif fid == 2:
616  if ftype == TType.I32:
617  self.kind = iprot.readI32()
618  else:
619  iprot.skip(ftype)
620  elif fid == 3:
621  if ftype == TType.STRUCT:
623  self.type.read(iprot)
624  else:
625  iprot.skip(ftype)
626  elif fid == 4:
627  if ftype == TType.STRUCT:
629  self.arg_type.read(iprot)
630  else:
631  iprot.skip(ftype)
632  elif fid == 5:
633  if ftype == TType.BOOL:
634  self.skip_nulls = iprot.readBool()
635  else:
636  iprot.skip(ftype)
637  elif fid == 6:
638  if ftype == TType.BOOL:
639  self.is_distinct = iprot.readBool()
640  else:
641  iprot.skip(ftype)
642  else:
643  iprot.skip(ftype)
644  iprot.readFieldEnd()
645  iprot.readStructEnd()
646 
647  def write(self, oprot):
648  if oprot._fast_encode is not None and self.thrift_spec is not None:
649  oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
650  return
651  oprot.writeStructBegin('TTargetInfo')
652  if self.is_agg is not None:
653  oprot.writeFieldBegin('is_agg', TType.BOOL, 1)
654  oprot.writeBool(self.is_agg)
655  oprot.writeFieldEnd()
656  if self.kind is not None:
657  oprot.writeFieldBegin('kind', TType.I32, 2)
658  oprot.writeI32(self.kind)
659  oprot.writeFieldEnd()
660  if self.type is not None:
661  oprot.writeFieldBegin('type', TType.STRUCT, 3)
662  self.type.write(oprot)
663  oprot.writeFieldEnd()
664  if self.arg_type is not None:
665  oprot.writeFieldBegin('arg_type', TType.STRUCT, 4)
666  self.arg_type.write(oprot)
667  oprot.writeFieldEnd()
668  if self.skip_nulls is not None:
669  oprot.writeFieldBegin('skip_nulls', TType.BOOL, 5)
670  oprot.writeBool(self.skip_nulls)
671  oprot.writeFieldEnd()
672  if self.is_distinct is not None:
673  oprot.writeFieldBegin('is_distinct', TType.BOOL, 6)
674  oprot.writeBool(self.is_distinct)
675  oprot.writeFieldEnd()
676  oprot.writeFieldStop()
677  oprot.writeStructEnd()
678 
679  def validate(self):
680  return
681 
682  def __repr__(self):
683  L = ['%s=%r' % (key, value)
684  for key, value in self.__dict__.items()]
685  return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
686 
687  def __eq__(self, other):
688  return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
689 
690  def __ne__(self, other):
691  return not (self == other)
692 
693 
695  """
696  Attributes:
697  - bitmap
698  - sparse_set
699 
700  """
701 
702 
703  def __init__(self, bitmap=None, sparse_set=None,):
704  self.bitmap = bitmap
705  self.sparse_set = sparse_set
706 
707  def read(self, iprot):
708  if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
709  iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
710  return
711  iprot.readStructBegin()
712  while True:
713  (fname, ftype, fid) = iprot.readFieldBegin()
714  if ftype == TType.STOP:
715  break
716  if fid == 1:
717  if ftype == TType.STRING:
718  self.bitmap = iprot.readBinary()
719  else:
720  iprot.skip(ftype)
721  elif fid == 2:
722  if ftype == TType.SET:
723  self.sparse_set = set()
724  (_etype45, _size42) = iprot.readSetBegin()
725  for _i46 in range(_size42):
726  _elem47 = iprot.readI64()
727  self.sparse_set.add(_elem47)
728  iprot.readSetEnd()
729  else:
730  iprot.skip(ftype)
731  else:
732  iprot.skip(ftype)
733  iprot.readFieldEnd()
734  iprot.readStructEnd()
735 
736  def write(self, oprot):
737  if oprot._fast_encode is not None and self.thrift_spec is not None:
738  oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
739  return
740  oprot.writeStructBegin('TCountDistinctSetStorage')
741  if self.bitmap is not None:
742  oprot.writeFieldBegin('bitmap', TType.STRING, 1)
743  oprot.writeBinary(self.bitmap)
744  oprot.writeFieldEnd()
745  if self.sparse_set is not None:
746  oprot.writeFieldBegin('sparse_set', TType.SET, 2)
747  oprot.writeSetBegin(TType.I64, len(self.sparse_set))
748  for iter48 in self.sparse_set:
749  oprot.writeI64(iter48)
750  oprot.writeSetEnd()
751  oprot.writeFieldEnd()
752  oprot.writeFieldStop()
753  oprot.writeStructEnd()
754 
755  def validate(self):
756  return
757 
758  def __repr__(self):
759  L = ['%s=%r' % (key, value)
760  for key, value in self.__dict__.items()]
761  return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
762 
763  def __eq__(self, other):
764  return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
765 
766  def __ne__(self, other):
767  return not (self == other)
768 
769 
770 class TCountDistinctSet(object):
771  """
772  Attributes:
773  - type
774  - storage
775  - remote_ptr
776 
777  """
778 
779 
780  def __init__(self, type=None, storage=None, remote_ptr=None,):
781  self.type = type
782  self.storage = storage
783  self.remote_ptr = remote_ptr
784 
785  def read(self, iprot):
786  if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
787  iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
788  return
789  iprot.readStructBegin()
790  while True:
791  (fname, ftype, fid) = iprot.readFieldBegin()
792  if ftype == TType.STOP:
793  break
794  if fid == 1:
795  if ftype == TType.I32:
796  self.type = iprot.readI32()
797  else:
798  iprot.skip(ftype)
799  elif fid == 2:
800  if ftype == TType.STRUCT:
802  self.storage.read(iprot)
803  else:
804  iprot.skip(ftype)
805  elif fid == 3:
806  if ftype == TType.I64:
807  self.remote_ptr = iprot.readI64()
808  else:
809  iprot.skip(ftype)
810  else:
811  iprot.skip(ftype)
812  iprot.readFieldEnd()
813  iprot.readStructEnd()
814 
815  def write(self, oprot):
816  if oprot._fast_encode is not None and self.thrift_spec is not None:
817  oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
818  return
819  oprot.writeStructBegin('TCountDistinctSet')
820  if self.type is not None:
821  oprot.writeFieldBegin('type', TType.I32, 1)
822  oprot.writeI32(self.type)
823  oprot.writeFieldEnd()
824  if self.storage is not None:
825  oprot.writeFieldBegin('storage', TType.STRUCT, 2)
826  self.storage.write(oprot)
827  oprot.writeFieldEnd()
828  if self.remote_ptr is not None:
829  oprot.writeFieldBegin('remote_ptr', TType.I64, 3)
830  oprot.writeI64(self.remote_ptr)
831  oprot.writeFieldEnd()
832  oprot.writeFieldStop()
833  oprot.writeStructEnd()
834 
835  def validate(self):
836  return
837 
838  def __repr__(self):
839  L = ['%s=%r' % (key, value)
840  for key, value in self.__dict__.items()]
841  return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
842 
843  def __eq__(self, other):
844  return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
845 
846  def __ne__(self, other):
847  return not (self == other)
848 
849 
850 class TSerializedRows(object):
851  """
852  Attributes:
853  - buffers
854  - buffer_lengths
855  - buffers_total_size
856  - total_compression_time_ms
857  - descriptor
858  - targets
859  - target_init_vals
860  - varlen_buffer
861  - count_distinct_sets
862  - explanation
863 
864  """
865 
866 
867  def __init__(self, buffers=None, buffer_lengths=None, buffers_total_size=None, total_compression_time_ms=None, descriptor=None, targets=None, target_init_vals=None, varlen_buffer=None, count_distinct_sets=None, explanation=None,):
868  self.buffers = buffers
869  self.buffer_lengths = buffer_lengths
870  self.buffers_total_size = buffers_total_size
871  self.total_compression_time_ms = total_compression_time_ms
872  self.descriptor = descriptor
873  self.targets = targets
874  self.target_init_vals = target_init_vals
875  self.varlen_buffer = varlen_buffer
876  self.count_distinct_sets = count_distinct_sets
877  self.explanation = explanation
878 
879  def read(self, iprot):
880  if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None:
881  iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec])
882  return
883  iprot.readStructBegin()
884  while True:
885  (fname, ftype, fid) = iprot.readFieldBegin()
886  if ftype == TType.STOP:
887  break
888  if fid == 1:
889  if ftype == TType.LIST:
890  self.buffers = []
891  (_etype52, _size49) = iprot.readListBegin()
892  for _i53 in range(_size49):
893  _elem54 = iprot.readBinary()
894  self.buffers.append(_elem54)
895  iprot.readListEnd()
896  else:
897  iprot.skip(ftype)
898  elif fid == 2:
899  if ftype == TType.LIST:
900  self.buffer_lengths = []
901  (_etype58, _size55) = iprot.readListBegin()
902  for _i59 in range(_size55):
903  _elem60 = iprot.readI64()
904  self.buffer_lengths.append(_elem60)
905  iprot.readListEnd()
906  else:
907  iprot.skip(ftype)
908  elif fid == 3:
909  if ftype == TType.I64:
910  self.buffers_total_size = iprot.readI64()
911  else:
912  iprot.skip(ftype)
913  elif fid == 4:
914  if ftype == TType.I32:
915  self.total_compression_time_ms = iprot.readI32()
916  else:
917  iprot.skip(ftype)
918  elif fid == 5:
919  if ftype == TType.STRUCT:
921  self.descriptor.read(iprot)
922  else:
923  iprot.skip(ftype)
924  elif fid == 6:
925  if ftype == TType.LIST:
926  self.targets = []
927  (_etype64, _size61) = iprot.readListBegin()
928  for _i65 in range(_size61):
929  _elem66 = TTargetInfo()
930  _elem66.read(iprot)
931  self.targets.append(_elem66)
932  iprot.readListEnd()
933  else:
934  iprot.skip(ftype)
935  elif fid == 7:
936  if ftype == TType.LIST:
937  self.target_init_vals = []
938  (_etype70, _size67) = iprot.readListBegin()
939  for _i71 in range(_size67):
940  _elem72 = iprot.readI64()
941  self.target_init_vals.append(_elem72)
942  iprot.readListEnd()
943  else:
944  iprot.skip(ftype)
945  elif fid == 8:
946  if ftype == TType.LIST:
947  self.varlen_buffer = []
948  (_etype76, _size73) = iprot.readListBegin()
949  for _i77 in range(_size73):
950  _elem78 = iprot.readBinary()
951  self.varlen_buffer.append(_elem78)
952  iprot.readListEnd()
953  else:
954  iprot.skip(ftype)
955  elif fid == 9:
956  if ftype == TType.LIST:
957  self.count_distinct_sets = []
958  (_etype82, _size79) = iprot.readListBegin()
959  for _i83 in range(_size79):
960  _elem84 = TCountDistinctSet()
961  _elem84.read(iprot)
962  self.count_distinct_sets.append(_elem84)
963  iprot.readListEnd()
964  else:
965  iprot.skip(ftype)
966  elif fid == 10:
967  if ftype == TType.STRING:
968  self.explanation = iprot.readString().decode('utf-8', errors='replace') if sys.version_info[0] == 2 else iprot.readString()
969  else:
970  iprot.skip(ftype)
971  else:
972  iprot.skip(ftype)
973  iprot.readFieldEnd()
974  iprot.readStructEnd()
975 
976  def write(self, oprot):
977  if oprot._fast_encode is not None and self.thrift_spec is not None:
978  oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
979  return
980  oprot.writeStructBegin('TSerializedRows')
981  if self.buffers is not None:
982  oprot.writeFieldBegin('buffers', TType.LIST, 1)
983  oprot.writeListBegin(TType.STRING, len(self.buffers))
984  for iter85 in self.buffers:
985  oprot.writeBinary(iter85)
986  oprot.writeListEnd()
987  oprot.writeFieldEnd()
988  if self.buffer_lengths is not None:
989  oprot.writeFieldBegin('buffer_lengths', TType.LIST, 2)
990  oprot.writeListBegin(TType.I64, len(self.buffer_lengths))
991  for iter86 in self.buffer_lengths:
992  oprot.writeI64(iter86)
993  oprot.writeListEnd()
994  oprot.writeFieldEnd()
995  if self.buffers_total_size is not None:
996  oprot.writeFieldBegin('buffers_total_size', TType.I64, 3)
997  oprot.writeI64(self.buffers_total_size)
998  oprot.writeFieldEnd()
999  if self.total_compression_time_ms is not None:
1000  oprot.writeFieldBegin('total_compression_time_ms', TType.I32, 4)
1001  oprot.writeI32(self.total_compression_time_ms)
1002  oprot.writeFieldEnd()
1003  if self.descriptor is not None:
1004  oprot.writeFieldBegin('descriptor', TType.STRUCT, 5)
1005  self.descriptor.write(oprot)
1006  oprot.writeFieldEnd()
1007  if self.targets is not None:
1008  oprot.writeFieldBegin('targets', TType.LIST, 6)
1009  oprot.writeListBegin(TType.STRUCT, len(self.targets))
1010  for iter87 in self.targets:
1011  iter87.write(oprot)
1012  oprot.writeListEnd()
1013  oprot.writeFieldEnd()
1014  if self.target_init_vals is not None:
1015  oprot.writeFieldBegin('target_init_vals', TType.LIST, 7)
1016  oprot.writeListBegin(TType.I64, len(self.target_init_vals))
1017  for iter88 in self.target_init_vals:
1018  oprot.writeI64(iter88)
1019  oprot.writeListEnd()
1020  oprot.writeFieldEnd()
1021  if self.varlen_buffer is not None:
1022  oprot.writeFieldBegin('varlen_buffer', TType.LIST, 8)
1023  oprot.writeListBegin(TType.STRING, len(self.varlen_buffer))
1024  for iter89 in self.varlen_buffer:
1025  oprot.writeBinary(iter89)
1026  oprot.writeListEnd()
1027  oprot.writeFieldEnd()
1028  if self.count_distinct_sets is not None:
1029  oprot.writeFieldBegin('count_distinct_sets', TType.LIST, 9)
1030  oprot.writeListBegin(TType.STRUCT, len(self.count_distinct_sets))
1031  for iter90 in self.count_distinct_sets:
1032  iter90.write(oprot)
1033  oprot.writeListEnd()
1034  oprot.writeFieldEnd()
1035  if self.explanation is not None:
1036  oprot.writeFieldBegin('explanation', TType.STRING, 10)
1037  oprot.writeString(self.explanation.encode('utf-8') if sys.version_info[0] == 2 else self.explanation)
1038  oprot.writeFieldEnd()
1039  oprot.writeFieldStop()
1040  oprot.writeStructEnd()
1041 
1042  def validate(self):
1043  return
1044 
1045  def __repr__(self):
1046  L = ['%s=%r' % (key, value)
1047  for key, value in self.__dict__.items()]
1048  return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
1049 
1050  def __eq__(self, other):
1051  return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
1052 
1053  def __ne__(self, other):
1054  return not (self == other)
1055 all_structs.append(TSlotSize)
1056 TSlotSize.thrift_spec = (
1057  None, # 0
1058  (1, TType.I16, 'padded', None, None, ), # 1
1059  (2, TType.I16, 'logical', None, None, ), # 2
1060 )
1061 all_structs.append(TColSlotContext)
1062 TColSlotContext.thrift_spec = (
1063  None, # 0
1064  (1, TType.LIST, 'slot_sizes', (TType.STRUCT, [TSlotSize, None], False), None, ), # 1
1065  (2, TType.LIST, 'col_to_slot_map', (TType.LIST, (TType.I32, None, False), False), None, ), # 2
1066 )
1067 all_structs.append(TCountDistinctDescriptor)
1068 TCountDistinctDescriptor.thrift_spec = (
1069  None, # 0
1070  (1, TType.I32, 'impl_type', None, None, ), # 1
1071  (2, TType.I64, 'min_val', None, None, ), # 2
1072  (3, TType.I64, 'bitmap_sz_bits', None, None, ), # 3
1073  (4, TType.BOOL, 'approximate', None, None, ), # 4
1074  (5, TType.I32, 'device_type', None, None, ), # 5
1075  (6, TType.I64, 'sub_bitmap_count', None, None, ), # 6
1076 )
1077 all_structs.append(TResultSetBufferDescriptor)
1078 TResultSetBufferDescriptor.thrift_spec = (
1079  None, # 0
1080  (1, TType.I32, 'layout', None, None, ), # 1
1081  (2, TType.BOOL, 'keyless', None, None, ), # 2
1082  (3, TType.I32, 'entry_count', None, None, ), # 3
1083  (4, TType.I32, 'idx_target_as_key', None, None, ), # 4
1084  (5, TType.I64, 'min_val', None, None, ), # 5
1085  (6, TType.I64, 'max_val', None, None, ), # 6
1086  (7, TType.I64, 'bucket', None, None, ), # 7
1087  (8, TType.LIST, 'group_col_widths', (TType.I16, None, False), None, ), # 8
1088  (9, TType.I16, 'key_bytewidth', None, None, ), # 9
1089  (10, TType.STRUCT, 'col_slot_context', [TColSlotContext, None], None, ), # 10
1090  (11, TType.LIST, 'target_groupby_indices', (TType.I32, None, False), None, ), # 11
1091  (12, TType.LIST, 'count_distinct_descriptors', (TType.STRUCT, [TCountDistinctDescriptor, None], False), None, ), # 12
1092  (13, TType.BOOL, 'force_4byte_float', None, None, ), # 13
1093 )
1094 all_structs.append(TTargetInfo)
1095 TTargetInfo.thrift_spec = (
1096  None, # 0
1097  (1, TType.BOOL, 'is_agg', None, None, ), # 1
1098  (2, TType.I32, 'kind', None, None, ), # 2
1099  (3, TType.STRUCT, 'type', [heavydb.common.ttypes.TTypeInfo, None], None,), # 3
1100  (4, TType.STRUCT, 'arg_type', [heavydb.common.ttypes.TTypeInfo, None], None,), # 4
1101  (5, TType.BOOL, 'skip_nulls', None, None, ), # 5
1102  (6, TType.BOOL, 'is_distinct', None, None, ), # 6
1103 )
1104 all_structs.append(TCountDistinctSetStorage)
1105 TCountDistinctSetStorage.thrift_spec = (
1106  None, # 0
1107  (1, TType.STRING, 'bitmap', 'BINARY', None, ), # 1
1108  (2, TType.SET, 'sparse_set', (TType.I64, None, False), None, ), # 2
1109 )
1110 all_structs.append(TCountDistinctSet)
1111 TCountDistinctSet.thrift_spec = (
1112  None, # 0
1113  (1, TType.I32, 'type', None, None, ), # 1
1114  (2, TType.STRUCT, 'storage', [TCountDistinctSetStorage, None], None, ), # 2
1115  (3, TType.I64, 'remote_ptr', None, None, ), # 3
1116 )
1117 all_structs.append(TSerializedRows)
1118 TSerializedRows.thrift_spec = (
1119  None, # 0
1120  (1, TType.LIST, 'buffers', (TType.STRING, 'BINARY', False), None, ), # 1
1121  (2, TType.LIST, 'buffer_lengths', (TType.I64, None, False), None, ), # 2
1122  (3, TType.I64, 'buffers_total_size', None, None, ), # 3
1123  (4, TType.I32, 'total_compression_time_ms', None, None, ), # 4
1124  (5, TType.STRUCT, 'descriptor', [TResultSetBufferDescriptor, None], None, ), # 5
1125  (6, TType.LIST, 'targets', (TType.STRUCT, [TTargetInfo, None], False), None, ), # 6
1126  (7, TType.LIST, 'target_init_vals', (TType.I64, None, False), None, ), # 7
1127  (8, TType.LIST, 'varlen_buffer', (TType.STRING, 'BINARY', False), None, ), # 8
1128  (9, TType.LIST, 'count_distinct_sets', (TType.STRUCT, [TCountDistinctSet, None], False), None, ), # 9
1129  (10, TType.STRING, 'explanation', 'UTF8', None, ), # 10
1130 )
1131 fix_spec(all_structs)
1132 del all_structs
std::string join(T const &container, std::string const &delim)