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