OmniSciDB  a987f07e93
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
anonymous_namespace{RelAlgExecutor.cpp}::anonymous_namespace{RelAlgExecutor.cpp} Namespace Reference

Functions

void conditionally_change_arg_to_int_type (size_t target_expr_idx, std::shared_ptr< Analyzer::Expr > &target_expr, std::unordered_map< size_t, SQLTypeInfo > &target_exprs_type_infos)
 

Function Documentation

void anonymous_namespace{RelAlgExecutor.cpp}::anonymous_namespace{RelAlgExecutor.cpp}::conditionally_change_arg_to_int_type ( size_t  target_expr_idx,
std::shared_ptr< Analyzer::Expr > &  target_expr,
std::unordered_map< size_t, SQLTypeInfo > &  target_exprs_type_infos 
)

Definition at line 1871 of file RelAlgExecutor.cpp.

References CHECK, SQLTypeInfo::get_compression(), get_int_type_by_size(), SQLTypeInfo::get_notnull(), SQLTypeInfo::get_size(), SQLTypeInfo::get_type(), kARRAY, kENCODING_DATE_IN_DAYS, and Analyzer::Expr::set_type_info().

Referenced by anonymous_namespace{RelAlgExecutor.cpp}::translate_targets().

1874  {
1875  auto* agg_expr = dynamic_cast<Analyzer::AggExpr*>(target_expr.get());
1876  CHECK(agg_expr);
1877  if (agg_expr->get_is_distinct()) {
1878  SQLTypeInfo const& ti = agg_expr->get_arg()->get_type_info();
1879  if (ti.get_type() != kARRAY && ti.get_compression() == kENCODING_DATE_IN_DAYS) {
1880  target_exprs_type_infos.emplace(target_expr_idx, ti);
1881  target_expr = target_expr->deep_copy();
1882  auto* arg = dynamic_cast<Analyzer::AggExpr*>(target_expr.get())->get_arg();
1884  return;
1885  }
1886  }
1887  target_exprs_type_infos.emplace(target_expr_idx, target_expr->get_type_info());
1888 }
HOST DEVICE int get_size() const
Definition: sqltypes.h:390
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:380
void set_type_info(const SQLTypeInfo &ti)
Definition: Analyzer.h:84
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:388
SQLTypes get_int_type_by_size(size_t const nbytes)
Definition: sqltypes.h:1188
#define CHECK(condition)
Definition: Logger.h:289
HOST DEVICE bool get_notnull() const
Definition: sqltypes.h:387

+ Here is the call graph for this function:

+ Here is the caller graph for this function: