OmniSciDB  b28c0d5765
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TargetInfo.h File Reference
#include "Analyzer/Analyzer.h"
#include "misc.h"
#include "sqldefs.h"
#include "sqltypes.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 88 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().

89  {
90  return target_info::get_target_info_impl(target_expr, bigint_count);
91 }
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 93 of file TargetInfo.h.

References target_info::get_target_info_impl().

94  {
95  return target_info::get_target_info_impl(target_expr.get(), bigint_count);
96 }
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.

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

79  {
80  return shared::is_any<kMIN, kMAX, kSINGLE_VALUE, kSAMPLE, kMODE, kCOUNT_IF>(agg_kind);
81 }

+ Here is the caller graph for this function:

bool takes_float_argument ( const TargetInfo target_info)
inline

Definition at line 102 of file TargetInfo.h.

References TargetInfo::agg_arg_type, TargetInfo::agg_kind, SQLTypeInfo::get_type(), TargetInfo::is_agg, and kFLOAT.

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().

102  {
103  return target_info.is_agg && target_info.agg_arg_type.get_type() == kFLOAT &&
104  shared::is_any<kAVG, kSUM, kMIN, kMAX, kSINGLE_VALUE, kMODE>(
105  target_info.agg_kind);
106 }
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:380
SQLTypeInfo agg_arg_type
Definition: TargetInfo.h:53
bool is_agg
Definition: TargetInfo.h:50
SQLAgg agg_kind
Definition: TargetInfo.h:51

+ 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 }