OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GroupByAndAggregate.cpp File Reference
#include "GroupByAndAggregate.h"
#include "AggregateUtils.h"
#include "CardinalityEstimator.h"
#include "CodeGenerator.h"
#include "Descriptors/QueryMemoryDescriptor.h"
#include "ExpressionRange.h"
#include "ExpressionRewrite.h"
#include "GpuInitGroups.h"
#include "InPlaceSort.h"
#include "LLVMFunctionAttributesUtil.h"
#include "MaxwellCodegenPatch.h"
#include "OutputBufferInitialization.h"
#include "TargetExprBuilder.h"
#include "../CudaMgr/CudaMgr.h"
#include "../Shared/checked_alloc.h"
#include "../Shared/funcannotations.h"
#include "../Utils/ChunkIter.h"
#include "DataMgr/BufferMgr/BufferMgr.h"
#include "Execute.h"
#include "QueryTemplateGenerator.h"
#include "RuntimeFunctions.h"
#include "Shared/misc.h"
#include "StreamingTopN.h"
#include "TopKSort.h"
#include "WindowContext.h"
#include <llvm/Transforms/Utils/BasicBlockUtils.h>
#include <cstring>
#include <limits>
#include <numeric>
#include <string_view>
#include <thread>
+ Include dependency graph for GroupByAndAggregate.cpp:

Go to the source code of this file.

Namespaces

 anonymous_namespace{GroupByAndAggregate.cpp}
 

Macros

#define LL_CONTEXT   executor_->cgen_state_->context_
 
#define LL_BUILDER   executor_->cgen_state_->ir_builder_
 
#define LL_BOOL(v)   executor_->cgen_state_->llBool(v)
 
#define LL_INT(v)   executor_->cgen_state_->llInt(v)
 
#define LL_FP(v)   executor_->cgen_state_->llFp(v)
 
#define ROW_FUNC   executor_->cgen_state_->row_func_
 
#define CUR_FUNC   executor_->cgen_state_->current_func_
 

Functions

std::ostream & operator<< (std::ostream &out, const ColRangeInfo &info)
 
std::ostream & operator<< (std::ostream &out, const CountDistinctImplType &type)
 
std::ostream & operator<< (std::ostream &out, const CountDistinctDescriptor &desc)
 
int32_t anonymous_namespace{GroupByAndAggregate.cpp}::get_agg_count (const std::vector< Analyzer::Expr * > &target_exprs)
 
bool anonymous_namespace{GroupByAndAggregate.cpp}::expr_is_rowid (const Analyzer::Expr *expr)
 
bool anonymous_namespace{GroupByAndAggregate.cpp}::has_count_distinct (const RelAlgExecutionUnit &ra_exe_unit)
 
bool anonymous_namespace{GroupByAndAggregate.cpp}::is_column_range_too_big_for_perfect_hash (const ColRangeInfo &col_range_info, const int64_t max_entry_count)
 
bool anonymous_namespace{GroupByAndAggregate.cpp}::cardinality_estimate_less_than_column_range (const int64_t cardinality_estimate, const ColRangeInfo &col_range_info)
 
ColRangeInfo anonymous_namespace{GroupByAndAggregate.cpp}::get_expr_range_info (const RelAlgExecutionUnit &ra_exe_unit, const std::vector< InputTableInfo > &query_infos, const Analyzer::Expr *expr, Executor *executor)
 
int64_t anonymous_namespace{GroupByAndAggregate.cpp}::get_bucketed_cardinality_without_nulls (const ColRangeInfo &col_range_info)
 
KeylessInfo anonymous_namespace{GroupByAndAggregate.cpp}::get_keyless_info (const RelAlgExecutionUnit &ra_exe_unit, const std::vector< InputTableInfo > &query_infos, const bool is_group_by, Executor *executor)
 
CountDistinctDescriptors anonymous_namespace{GroupByAndAggregate.cpp}::init_count_distinct_descriptors (const RelAlgExecutionUnit &ra_exe_unit, const std::vector< InputTableInfo > &query_infos, const ColRangeInfo &group_by_range_info, const ExecutorDeviceType device_type, Executor *executor)
 
RUNTIME_EXPORT void agg_count_distinct (int64_t *agg, const int64_t val)
 
RUNTIME_EXPORT void agg_count_distinct_skip_val (int64_t *agg, const int64_t val, const int64_t skip_val)
 
RUNTIME_EXPORT void agg_approx_quantile (int64_t *agg, const double val)
 
RUNTIME_EXPORT void agg_mode_func (int64_t *agg, const int64_t val)
 

Variables

bool g_cluster false
 
bool g_bigint_count {false}
 
int g_hll_precision_bits {11}
 
size_t g_watchdog_baseline_max_groups {120000000}
 
int64_t g_bitmap_memory_limit
 
size_t g_leaf_count
 

Macro Definition Documentation

#define CUR_FUNC   executor_->cgen_state_->current_func_

Definition at line 389 of file GroupByAndAggregate.cpp.

Referenced by GroupByAndAggregate::codegenAggArg().

#define LL_BOOL (   v)    executor_->cgen_state_->llBool(v)

Definition at line 385 of file GroupByAndAggregate.cpp.

Referenced by GroupByAndAggregate::codegenOutputSlot().

#define LL_FP (   v)    executor_->cgen_state_->llFp(v)

Definition at line 387 of file GroupByAndAggregate.cpp.

Referenced by GroupByAndAggregate::codegenOutputSlot().

Function Documentation

RUNTIME_EXPORT void agg_approx_quantile ( int64_t *  agg,
const double  val 
)

Definition at line 1845 of file GroupByAndAggregate.cpp.

References quantile::detail::TDigest< RealType, IndexType >::allocate().

1845  {
1846  auto* t_digest = reinterpret_cast<quantile::TDigest*>(*agg);
1847  t_digest->allocate();
1848  t_digest->add(val);
1849 }
DEVICE void allocate()
Definition: quantile.h:613

+ Here is the call graph for this function:

RUNTIME_EXPORT void agg_count_distinct ( int64_t *  agg,
const int64_t  val 
)

Definition at line 1833 of file GroupByAndAggregate.cpp.

Referenced by agg_count_distinct_skip_val().

1833  {
1834  reinterpret_cast<CountDistinctSet*>(*agg)->insert(val);
1835 }
robin_hood::unordered_set< int64_t > CountDistinctSet
Definition: CountDistinct.h:35

+ Here is the caller graph for this function:

RUNTIME_EXPORT void agg_count_distinct_skip_val ( int64_t *  agg,
const int64_t  val,
const int64_t  skip_val 
)

Definition at line 1837 of file GroupByAndAggregate.cpp.

References agg_count_distinct().

1839  {
1840  if (val != skip_val) {
1841  agg_count_distinct(agg, val);
1842  }
1843 }
RUNTIME_EXPORT void agg_count_distinct(int64_t *agg, const int64_t val)

+ Here is the call graph for this function:

RUNTIME_EXPORT void agg_mode_func ( int64_t *  agg,
const int64_t  val 
)

Definition at line 1851 of file GroupByAndAggregate.cpp.

References AggMode::add().

1851  {
1852  auto* mode_map = reinterpret_cast<AggMode*>(*agg);
1853  mode_map->add(val);
1854 }
void add(Value const value)
Definition: AggMode.h:40

+ Here is the call graph for this function:

std::ostream& operator<< ( std::ostream &  out,
const ColRangeInfo info 
)

Definition at line 64 of file GroupByAndAggregate.cpp.

References ColRangeInfo::bucket, ColRangeInfo::has_nulls, ColRangeInfo::hash_type_, ColRangeInfo::max, and ColRangeInfo::min.

64  {
65  out << "Hash Type = " << info.hash_type_ << " min = " << info.min
66  << " max = " << info.max << " bucket = " << info.bucket
67  << " has_nulls = " << info.has_nulls << "\n";
68  return out;
69 }
QueryDescriptionType hash_type_
std::ostream& operator<< ( std::ostream &  out,
const CountDistinctImplType type 
)

Definition at line 71 of file GroupByAndAggregate.cpp.

References Bitmap, Invalid, and UnorderedSet.

71  {
72  switch (type) {
74  out << "Invalid";
75  break;
77  out << "Bitmap";
78  break;
80  out << "UnorderedSet";
81  break;
82  default:
83  out << "<Unkown Type>";
84  break;
85  }
86  return out;
87 }
std::ostream& operator<< ( std::ostream &  out,
const CountDistinctDescriptor desc 
)

Definition at line 89 of file GroupByAndAggregate.cpp.

References CountDistinctDescriptor::approximate, CountDistinctDescriptor::bitmap_sz_bits, CountDistinctDescriptor::device_type, CountDistinctDescriptor::impl_type_, CountDistinctDescriptor::min_val, and CountDistinctDescriptor::sub_bitmap_count.

89  {
90  out << "Type = " << desc.impl_type_ << " min val = " << desc.min_val
91  << " bitmap_sz_bits = " << desc.bitmap_sz_bits
92  << " bool approximate = " << desc.approximate
93  << " device_type = " << desc.device_type
94  << " sub_bitmap_count = " << desc.sub_bitmap_count;
95  return out;
96 }
CountDistinctImplType impl_type_

Variable Documentation

bool g_cluster false

Definition at line 53 of file GroupByAndAggregate.cpp.

size_t g_leaf_count

Definition at line 78 of file ParserNode.cpp.

size_t g_watchdog_baseline_max_groups {120000000}