OmniSciDB  a5dc49c757
 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 92 of file TargetInfo.h.

References target_info::get_target_info_impl().

Referenced by QueryMemoryInitializer::allocateCountDistinctBuffers(), QueryMemoryInitializer::calculateCountDistinctBufferSize(), anonymous_namespace{QueryMemoryInitializer.cpp}::check_count_distinct_expr_metadata(), 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().

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

References target_info::get_target_info_impl().

98  {
99  return target_info::get_target_info_impl(target_expr.get(), 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:

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 83 of file TargetInfo.h.

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

83  {
84  return shared::is_any<kMIN, kMAX, kSINGLE_VALUE, kSAMPLE, kMODE, kCOUNT_IF>(agg_kind);
85 }

+ Here is the caller graph for this function:

bool is_distinct_target ( const TargetInfo target_info)
inline

Definition at line 102 of file TargetInfo.h.

References TargetInfo::agg_kind, TargetInfo::is_distinct, and kAPPROX_COUNT_DISTINCT.

Referenced by QueryMemoryInitializer::allocateCountDistinctBuffers(), QueryMemoryInitializer::calculateCountDistinctBufferSize(), anonymous_namespace{QueryMemoryInitializer.cpp}::check_count_distinct_expr_metadata(), TargetExprCodegen::codegenAggregate(), Executor::executePlanWithoutGroupBy(), anonymous_namespace{GroupByAndAggregate.cpp}::get_keyless_info(), ResultSet::getSupportedSingleSlotTargetBitmap(), ResultSet::getTargetValueFromBufferRowwise(), anonymous_namespace{GroupByAndAggregate.cpp}::has_count_distinct(), anonymous_namespace{GroupByAndAggregate.cpp}::init_count_distinct_descriptors(), QueryMemoryInitializer::initColumnarGroups(), ResultSet::makeTargetValue(), ResultSet::ResultSetComparator< BUFFER_ITERATOR_TYPE >::materializeCountDistinctColumns(), ResultSet::ResultSetComparator< BUFFER_ITERATOR_TYPE >::operator()(), ResultSetReductionJIT::reduceOneAggregateSlot(), ResultSetStorage::reduceOneSlot(), ResultSetStorage::reduceSingleRow(), and ThriftSerializers::takes_arg().

102  {
103  return target_info.is_distinct || target_info.agg_kind == kAPPROX_COUNT_DISTINCT;
104 }
SQLAgg agg_kind
Definition: TargetInfo.h:51
bool is_distinct
Definition: TargetInfo.h:55

+ Here is the caller graph for this function:

bool takes_float_argument ( const TargetInfo target_info)
inline

Definition at line 106 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().

106  {
107  return target_info.is_agg && target_info.agg_arg_type.get_type() == kFLOAT &&
108  shared::is_any<kAVG, kSUM, kSUM_IF, kMIN, kMAX, kSINGLE_VALUE, kMODE>(
109  target_info.agg_kind);
110 }
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:391
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 }