OmniSciDB  343343d194
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ThriftSerializers Namespace Reference

Functions

TResultSetLayout::type layout_to_thrift (const QueryDescriptionType layout)
 
QueryDescriptionType layout_from_thrift (const TResultSetLayout::type layout)
 
TAggKind::type agg_kind_to_thrift (const SQLAgg agg)
 
SQLAgg agg_kind_from_thrift (const TAggKind::type agg)
 
TTypeInfo type_info_to_thrift (const SQLTypeInfo &ti)
 
bool takes_arg (const TargetInfo &target_info)
 
TTargetInfo target_info_to_thrift (const TargetInfo &target_info)
 
TargetInfo target_info_from_thrift (const TTargetInfo &thrift_target_info)
 
std::vector< TTargetInfo > target_infos_to_thrift (const std::vector< TargetInfo > &targets)
 
std::vector< TargetInfotarget_infos_from_thrift (const std::vector< TTargetInfo > &thrift_targets)
 
TCountDistinctImplType::type count_distinct_impl_type_to_thrift (const CountDistinctImplType impl_type)
 
TCountDistinctDescriptor count_distinct_descriptor_to_thrift (const CountDistinctDescriptor &count_distinct_descriptor)
 
CountDistinctImplType count_distinct_impl_type_from_thrift (const TCountDistinctImplType::type impl_type)
 
CountDistinctDescriptor count_distinct_descriptor_from_thrift (const TCountDistinctDescriptor &thrift_count_distinct_descriptor)
 

Function Documentation

SQLAgg ThriftSerializers::agg_kind_from_thrift ( const TAggKind::type  agg)
inline

Definition at line 98 of file ThriftSerializers.h.

References AVG, CHECK, COUNT, MAX, MIN, SUM, and UNTHRIFT_AGGKIND_CASE.

Referenced by target_info_from_thrift().

98  {
99  switch (agg) {
101  UNTHRIFT_AGGKIND_CASE(COUNT)
105  UNTHRIFT_AGGKIND_CASE(APPROX_COUNT_DISTINCT)
106  UNTHRIFT_AGGKIND_CASE(SAMPLE)
107  default:
108  CHECK(false);
109  }
110  abort();
111 }
#define UNTHRIFT_AGGKIND_CASE(kind)
bool g_enable_debug_timer false
Definition: Execute.cpp:68
#define CHECK(condition)
Definition: Logger.h:187

+ Here is the caller graph for this function:

TAggKind::type ThriftSerializers::agg_kind_to_thrift ( const SQLAgg  agg)
inline

Definition at line 77 of file ThriftSerializers.h.

References AVG, CHECK, COUNT, MAX, MIN, SUM, and THRIFT_AGGKIND_CASE.

Referenced by target_info_to_thrift().

77  {
78  switch (agg) {
80  THRIFT_AGGKIND_CASE(COUNT)
84  THRIFT_AGGKIND_CASE(APPROX_COUNT_DISTINCT)
85  THRIFT_AGGKIND_CASE(SAMPLE)
86  default:
87  CHECK(false);
88  }
89  abort();
90 }
bool g_enable_debug_timer false
Definition: Execute.cpp:68
#define CHECK(condition)
Definition: Logger.h:187
#define THRIFT_AGGKIND_CASE(kind)

+ Here is the caller graph for this function:

CountDistinctDescriptor ThriftSerializers::count_distinct_descriptor_from_thrift ( const TCountDistinctDescriptor &  thrift_count_distinct_descriptor)
inline

Definition at line 231 of file ThriftSerializers.h.

References CountDistinctDescriptor::approximate, CountDistinctDescriptor::bitmap_sz_bits, count_distinct_impl_type_from_thrift(), CPU, CountDistinctDescriptor::device_type, GPU, CountDistinctDescriptor::impl_type_, CountDistinctDescriptor::min_val, and CountDistinctDescriptor::sub_bitmap_count.

232  {
233  CountDistinctDescriptor count_distinct_descriptor;
234  count_distinct_descriptor.impl_type_ =
235  count_distinct_impl_type_from_thrift(thrift_count_distinct_descriptor.impl_type);
236  count_distinct_descriptor.min_val = thrift_count_distinct_descriptor.min_val;
237  count_distinct_descriptor.bitmap_sz_bits =
238  thrift_count_distinct_descriptor.bitmap_sz_bits;
239  count_distinct_descriptor.approximate = thrift_count_distinct_descriptor.approximate;
240  count_distinct_descriptor.device_type =
241  thrift_count_distinct_descriptor.device_type == TDeviceType::GPU
244  count_distinct_descriptor.sub_bitmap_count =
245  thrift_count_distinct_descriptor.sub_bitmap_count;
246  return count_distinct_descriptor;
247 }
CountDistinctImplType impl_type_
CountDistinctImplType count_distinct_impl_type_from_thrift(const TCountDistinctImplType::type impl_type)

+ Here is the call graph for this function:

TCountDistinctDescriptor ThriftSerializers::count_distinct_descriptor_to_thrift ( const CountDistinctDescriptor count_distinct_descriptor)
inline

Definition at line 196 of file ThriftSerializers.h.

References CountDistinctDescriptor::approximate, CountDistinctDescriptor::bitmap_sz_bits, count_distinct_impl_type_to_thrift(), CPU, CountDistinctDescriptor::device_type, GPU, CountDistinctDescriptor::impl_type_, CountDistinctDescriptor::min_val, and CountDistinctDescriptor::sub_bitmap_count.

197  {
198  TCountDistinctDescriptor thrift_count_distinct_descriptor;
199  thrift_count_distinct_descriptor.impl_type =
200  count_distinct_impl_type_to_thrift(count_distinct_descriptor.impl_type_);
201  thrift_count_distinct_descriptor.min_val = count_distinct_descriptor.min_val;
202  thrift_count_distinct_descriptor.bitmap_sz_bits =
203  count_distinct_descriptor.bitmap_sz_bits;
204  thrift_count_distinct_descriptor.approximate = count_distinct_descriptor.approximate;
205  thrift_count_distinct_descriptor.device_type =
206  count_distinct_descriptor.device_type == ExecutorDeviceType::GPU ? TDeviceType::GPU
208  thrift_count_distinct_descriptor.sub_bitmap_count =
209  count_distinct_descriptor.sub_bitmap_count;
210  return thrift_count_distinct_descriptor;
211 }
TCountDistinctImplType::type count_distinct_impl_type_to_thrift(const CountDistinctImplType impl_type)
CountDistinctImplType impl_type_

+ Here is the call graph for this function:

CountDistinctImplType ThriftSerializers::count_distinct_impl_type_from_thrift ( const TCountDistinctImplType::type  impl_type)
inline

Definition at line 217 of file ThriftSerializers.h.

References Bitmap, CHECK, Invalid, StdSet, and UNTHRIFT_COUNTDESCRIPTORIMPL_CASE.

Referenced by count_distinct_descriptor_from_thrift().

218  {
219  switch (impl_type) {
223  default:
224  CHECK(false);
225  }
226  abort();
227 }
#define UNTHRIFT_COUNTDESCRIPTORIMPL_CASE(kind)
bool g_enable_debug_timer false
Definition: Execute.cpp:68
#define CHECK(condition)
Definition: Logger.h:187

+ Here is the caller graph for this function:

TCountDistinctImplType::type ThriftSerializers::count_distinct_impl_type_to_thrift ( const CountDistinctImplType  impl_type)
inline

Definition at line 182 of file ThriftSerializers.h.

References Bitmap, CHECK, Invalid, StdSet, and THRIFT_COUNTDESCRIPTORIMPL_CASE.

Referenced by count_distinct_descriptor_to_thrift().

183  {
184  switch (impl_type) {
188  default:
189  CHECK(false);
190  }
191  abort();
192 }
#define THRIFT_COUNTDESCRIPTORIMPL_CASE(kind)
bool g_enable_debug_timer false
Definition: Execute.cpp:68
#define CHECK(condition)
Definition: Logger.h:187

+ Here is the caller graph for this function:

QueryDescriptionType ThriftSerializers::layout_from_thrift ( const TResultSetLayout::type  layout)
inline

Definition at line 59 of file ThriftSerializers.h.

References CHECK, GroupByBaselineHash, GroupByPerfectHash, NonGroupedAggregate, Projection, and UNTHRIFT_LAYOUT_CASE.

59  {
60  switch (layout) {
61  UNTHRIFT_LAYOUT_CASE(GroupByPerfectHash)
62  UNTHRIFT_LAYOUT_CASE(GroupByBaselineHash)
63  UNTHRIFT_LAYOUT_CASE(Projection)
64  UNTHRIFT_LAYOUT_CASE(NonGroupedAggregate)
65  default:
66  CHECK(false);
67  }
68  abort();
69 }
bool g_enable_debug_timer false
Definition: Execute.cpp:68
#define CHECK(condition)
Definition: Logger.h:187
#define UNTHRIFT_LAYOUT_CASE(layout)
TResultSetLayout::type ThriftSerializers::layout_to_thrift ( const QueryDescriptionType  layout)
inline

Definition at line 41 of file ThriftSerializers.h.

References CHECK, GroupByBaselineHash, GroupByPerfectHash, NonGroupedAggregate, Projection, and THRIFT_LAYOUT_CASE.

41  {
42  switch (layout) {
43  THRIFT_LAYOUT_CASE(GroupByPerfectHash)
44  THRIFT_LAYOUT_CASE(GroupByBaselineHash)
45  THRIFT_LAYOUT_CASE(Projection)
46  THRIFT_LAYOUT_CASE(NonGroupedAggregate)
47  default:
48  CHECK(false);
49  }
50  abort();
51 }
bool g_enable_debug_timer false
Definition: Execute.cpp:68
#define CHECK(condition)
Definition: Logger.h:187
#define THRIFT_LAYOUT_CASE(layout)
bool ThriftSerializers::takes_arg ( const TargetInfo target_info)
inline

Definition at line 129 of file ThriftSerializers.h.

References TargetInfo::agg_kind, TargetInfo::is_agg, is_distinct_target(), and kCOUNT.

Referenced by target_info_from_thrift(), target_info_to_thrift(), anonymous_namespace{CalciteAdapter.cpp}::CalciteAdapter::translateAggregate(), and RelAlgTranslator::translateAggregateRex().

129  {
130  return target_info.is_agg &&
131  (target_info.agg_kind != kCOUNT || is_distinct_target(target_info));
132 }
bool is_agg
Definition: TargetInfo.h:40
bool is_distinct_target(const TargetInfo &target_info)
Definition: TargetInfo.h:116
SQLAgg agg_kind
Definition: TargetInfo.h:41
Definition: sqldefs.h:71

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

TargetInfo ThriftSerializers::target_info_from_thrift ( const TTargetInfo &  thrift_target_info)
inline

Definition at line 147 of file ThriftSerializers.h.

References TargetInfo::agg_arg_type, TargetInfo::agg_kind, agg_kind_from_thrift(), TargetInfo::is_agg, TargetInfo::is_distinct, kNULLT, TargetInfo::skip_null_val, TargetInfo::sql_type, takes_arg(), and type_info_from_thrift().

Referenced by target_infos_from_thrift().

147  {
148  TargetInfo target_info;
149  target_info.is_agg = thrift_target_info.is_agg;
150  target_info.agg_kind = agg_kind_from_thrift(thrift_target_info.kind);
151  target_info.sql_type = type_info_from_thrift(thrift_target_info.type);
152  target_info.is_distinct = thrift_target_info.is_distinct;
153  target_info.agg_arg_type = takes_arg(target_info)
154  ? type_info_from_thrift(thrift_target_info.arg_type)
156  target_info.skip_null_val = thrift_target_info.skip_nulls;
157  return target_info;
158 }
SQLTypeInfo sql_type
Definition: TargetInfo.h:42
bool skip_null_val
Definition: TargetInfo.h:44
SQLTypeInfo agg_arg_type
Definition: TargetInfo.h:43
bool is_agg
Definition: TargetInfo.h:40
SQLTypeInfo type_info_from_thrift(const TTypeInfo &thrift_ti, const bool strip_geo_encoding=false)
SQLAgg agg_kind_from_thrift(const TAggKind::type agg)
SQLAgg agg_kind
Definition: TargetInfo.h:41
bool takes_arg(const TargetInfo &target_info)
bool g_enable_debug_timer false
Definition: Execute.cpp:68
bool is_distinct
Definition: TargetInfo.h:45

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

TTargetInfo ThriftSerializers::target_info_to_thrift ( const TargetInfo target_info)
inline

Definition at line 134 of file ThriftSerializers.h.

References TargetInfo::agg_arg_type, TargetInfo::agg_kind, agg_kind_to_thrift(), TargetInfo::is_agg, TargetInfo::is_distinct, TargetInfo::skip_null_val, TargetInfo::sql_type, takes_arg(), and type_info_to_thrift().

Referenced by target_infos_to_thrift().

134  {
135  TTargetInfo thrift_target_info;
136  thrift_target_info.is_agg = target_info.is_agg;
137  thrift_target_info.kind = agg_kind_to_thrift(target_info.agg_kind);
138  thrift_target_info.type = type_info_to_thrift(target_info.sql_type);
139  thrift_target_info.arg_type = takes_arg(target_info)
140  ? type_info_to_thrift(target_info.agg_arg_type)
141  : thrift_target_info.type;
142  thrift_target_info.skip_nulls = target_info.skip_null_val;
143  thrift_target_info.is_distinct = target_info.is_distinct;
144  return thrift_target_info;
145 }
SQLTypeInfo sql_type
Definition: TargetInfo.h:42
bool skip_null_val
Definition: TargetInfo.h:44
SQLTypeInfo agg_arg_type
Definition: TargetInfo.h:43
bool is_agg
Definition: TargetInfo.h:40
SQLAgg agg_kind
Definition: TargetInfo.h:41
bool takes_arg(const TargetInfo &target_info)
TAggKind::type agg_kind_to_thrift(const SQLAgg agg)
bool is_distinct
Definition: TargetInfo.h:45
TTypeInfo type_info_to_thrift(const SQLTypeInfo &ti)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::vector<TargetInfo> ThriftSerializers::target_infos_from_thrift ( const std::vector< TTargetInfo > &  thrift_targets)
inline

Definition at line 169 of file ThriftSerializers.h.

References target_info_from_thrift().

170  {
171  std::vector<TargetInfo> targets;
172  for (const auto& thrift_target_info : thrift_targets) {
173  targets.push_back(target_info_from_thrift(thrift_target_info));
174  }
175  return targets;
176 }
TargetInfo target_info_from_thrift(const TTargetInfo &thrift_target_info)

+ Here is the call graph for this function:

std::vector<TTargetInfo> ThriftSerializers::target_infos_to_thrift ( const std::vector< TargetInfo > &  targets)
inline

Definition at line 160 of file ThriftSerializers.h.

References target_info_to_thrift().

161  {
162  std::vector<TTargetInfo> thrift_targets;
163  for (const auto& target_info : targets) {
164  thrift_targets.push_back(target_info_to_thrift(target_info));
165  }
166  return thrift_targets;
167 }
TTargetInfo target_info_to_thrift(const TargetInfo &target_info)

+ Here is the call graph for this function:

TTypeInfo ThriftSerializers::type_info_to_thrift ( const SQLTypeInfo ti)
inline

Definition at line 115 of file ThriftSerializers.h.

References encoding_to_thrift(), SQLTypeInfoCore< TYPE_FACET_PACK >::get_comp_param(), SQLTypeInfoCore< TYPE_FACET_PACK >::get_elem_type(), SQLTypeInfoCore< TYPE_FACET_PACK >::get_notnull(), SQLTypeInfoCore< TYPE_FACET_PACK >::get_precision(), SQLTypeInfoCore< TYPE_FACET_PACK >::get_scale(), SQLTypeInfoCore< TYPE_FACET_PACK >::get_size(), SQLTypeInfoCore< TYPE_FACET_PACK >::is_array(), and type_to_thrift().

Referenced by MapDHandler::get_tables_meta(), and target_info_to_thrift().

115  {
116  TTypeInfo thrift_ti;
117  thrift_ti.type =
119  thrift_ti.encoding = encoding_to_thrift(ti);
120  thrift_ti.nullable = !ti.get_notnull();
121  thrift_ti.is_array = ti.is_array();
122  thrift_ti.precision = ti.get_precision();
123  thrift_ti.scale = ti.get_scale();
124  thrift_ti.comp_param = ti.get_comp_param();
125  thrift_ti.size = ti.get_size();
126  return thrift_ti;
127 }
TDatumType::type type_to_thrift(const SQLTypeInfo &type_info)
HOST DEVICE int get_comp_param() const
Definition: sqltypes.h:333
HOST DEVICE int get_scale() const
Definition: sqltypes.h:329
HOST DEVICE int get_size() const
Definition: sqltypes.h:334
bool is_array() const
Definition: sqltypes.h:480
HOST DEVICE bool get_notnull() const
Definition: sqltypes.h:331
int get_precision() const
Definition: sqltypes.h:327
SQLTypeInfoCore get_elem_type() const
Definition: sqltypes.h:654
TEncodingType::type encoding_to_thrift(const SQLTypeInfo &type_info)

+ Here is the call graph for this function:

+ Here is the caller graph for this function: