OmniSciDB  ca0c39ec8f
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TargetInfo.h File Reference
#include "sqldefs.h"
#include "sqltypes.h"
#include "../Analyzer/Analyzer.h"
+ Include dependency graph for TargetInfo.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  TargetInfo
 

Namespaces

 target_info
 

Functions

const Analyzer::AggExprcast_to_agg_expr (const Analyzer::Expr *target_expr)
 
const Analyzer::AggExprcast_to_agg_expr (const std::shared_ptr< Analyzer::Expr > target_expr)
 
bool target_expr_has_varlen_projection (const Analyzer::Expr *target_expr)
 
bool target_expr_has_varlen_projection (const std::shared_ptr< Analyzer::Expr > target_expr)
 
bool is_agg_domain_range_equivalent (const SQLAgg &agg_kind)
 
TargetInfo target_info::get_target_info_impl (const Analyzer::Expr *target_expr, const bool bigint_count)
 
TargetInfo get_target_info (const Analyzer::Expr *target_expr, const bool bigint_count)
 
TargetInfo get_target_info (const std::shared_ptr< Analyzer::Expr > target_expr, const bool bigint_count)
 
bool is_distinct_target (const TargetInfo &target_info)
 
bool takes_float_argument (const TargetInfo &target_info)
 

Function Documentation

const Analyzer::AggExpr* cast_to_agg_expr ( const Analyzer::Expr target_expr)
inline

Definition at line 31 of file TargetInfo.h.

Referenced by target_info::get_target_info_impl().

31  {
32  return dynamic_cast<const Analyzer::AggExpr*>(target_expr);
33 }

+ Here is the caller graph for this function:

const Analyzer::AggExpr* cast_to_agg_expr ( const std::shared_ptr< Analyzer::Expr target_expr)
inline

Definition at line 35 of file TargetInfo.h.

36  {
37  return dynamic_cast<const Analyzer::AggExpr*>(target_expr.get());
38 }
TargetInfo get_target_info ( const Analyzer::Expr target_expr,
const bool  bigint_count 
)
inline

Definition at line 97 of file TargetInfo.h.

References target_info::get_target_info_impl().

Referenced by QueryMemoryInitializer::allocateCountDistinctBuffers(), GroupByAndAggregate::codegenApproxQuantile(), GroupByAndAggregate::codegenCountDistinct(), ColSlotContext::ColSlotContext(), RelAlgExecutor::createSortInputWorkUnit(), anonymous_namespace{RelAlgExecutor.cpp}::decide_approx_count_distinct_implementation(), Executor::executePlanWithoutGroupBy(), anonymous_namespace{Execute.cpp}::fill_entries_for_empty_input(), anonymous_namespace{QueryMemoryDescriptor.cpp}::get_col_byte_widths(), get_heap_key_slot_index(), anonymous_namespace{GroupByAndAggregate.cpp}::get_keyless_info(), Executor::getDeviceTypeForTargets(), anonymous_namespace{GroupByAndAggregate.cpp}::has_count_distinct(), init_agg_val_vec(), anonymous_namespace{GroupByAndAggregate.cpp}::init_count_distinct_descriptors(), QueryMemoryInitializer::initColumnarGroups(), TargetExprCodegenBuilder::operator()(), anonymous_namespace{Execute.cpp}::GetTargetInfo::operator()(), and target_exprs_to_infos().

98  {
99  return target_info::get_target_info_impl(target_expr, bigint_count);
100 }
TargetInfo get_target_info_impl(const Analyzer::Expr *target_expr, const bool bigint_count)
Definition: TargetInfo.cpp:20

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

TargetInfo get_target_info ( const std::shared_ptr< Analyzer::Expr target_expr,
const bool  bigint_count 
)
inline

Definition at line 102 of file TargetInfo.h.

References target_info::get_target_info_impl().

103  {
104  return target_info::get_target_info_impl(target_expr.get(), bigint_count);
105 }
TargetInfo get_target_info_impl(const Analyzer::Expr *target_expr, const bool bigint_count)
Definition: TargetInfo.cpp:20

+ Here is the call graph for this function:

bool is_agg_domain_range_equivalent ( const SQLAgg agg_kind)
inline

Returns true if the aggregate function always returns a value in the domain of the argument. Returns false otherwise.

Definition at line 79 of file TargetInfo.h.

References kMAX, kMIN, kSAMPLE, and kSINGLE_VALUE.

Referenced by TargetExprCodegen::codegenAggregate(), and get_compact_type().

79  {
80  switch (agg_kind) {
81  case kMIN:
82  case kMAX:
83  case kSINGLE_VALUE:
84  case kSAMPLE:
85  return true;
86  default:
87  break;
88  }
89  return false;
90 }
Definition: sqldefs.h:74
Definition: sqldefs.h:75

+ Here is the caller graph for this function:

bool takes_float_argument ( const TargetInfo target_info)
inline

Definition at line 111 of file TargetInfo.h.

References TargetInfo::agg_arg_type, TargetInfo::agg_kind, SQLTypeInfo::get_type(), TargetInfo::is_agg, kAVG, kFLOAT, kMAX, kMIN, kSINGLE_VALUE, and kSUM.

Referenced by anonymous_namespace{ResultSetSortImpl.cu}::baseline_sort_fp(), TargetExprCodegen::codegenAggregate(), Executor::executePlanWithoutGroupBy(), anonymous_namespace{Execute.cpp}::fill_entries_for_empty_input(), anonymous_namespace{GroupByAndAggregate.cpp}::get_keyless_info(), init_agg_val_vec(), result_set::initialize_target_values_for_storage(), anonymous_namespace{ResultSetIteration.cpp}::make_avg_target_value(), ResultSet::ResultSetComparator< BUFFER_ITERATOR_TYPE >::operator()(), ResultSetReductionJIT::reduceOneSlot(), ResultSetStorage::reduceOneSlot(), ResultSetStorage::reduceOneSlotSingleValue(), and ResultSetStorage::reduceSingleRow().

111  {
112  return target_info.is_agg &&
113  (target_info.agg_kind == kAVG || target_info.agg_kind == kSUM ||
114  target_info.agg_kind == kMIN || target_info.agg_kind == kMAX ||
115  target_info.agg_kind == kSINGLE_VALUE) &&
116  target_info.agg_arg_type.get_type() == kFLOAT;
117 }
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:379
SQLTypeInfo agg_arg_type
Definition: TargetInfo.h:53
Definition: sqldefs.h:74
bool is_agg
Definition: TargetInfo.h:50
Definition: sqldefs.h:76
SQLAgg agg_kind
Definition: TargetInfo.h:51
Definition: sqldefs.h:75
Definition: sqldefs.h:73

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool target_expr_has_varlen_projection ( const Analyzer::Expr target_expr)
inline

Definition at line 40 of file TargetInfo.h.

Referenced by target_info::get_target_info_impl().

40  {
41  return !(dynamic_cast<const Analyzer::GeoExpr*>(target_expr) == nullptr);
42 }

+ Here is the caller graph for this function:

bool target_expr_has_varlen_projection ( const std::shared_ptr< Analyzer::Expr target_expr)
inline

Definition at line 44 of file TargetInfo.h.

45  {
46  return !(dynamic_cast<const Analyzer::GeoExpr*>(target_expr.get()) == nullptr);
47 }