OmniSciDB  ca0c39ec8f
 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 "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, const Catalog_Namespace::Catalog &cat)
 
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 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)
 

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 370 of file GroupByAndAggregate.cpp.

Referenced by GroupByAndAggregate::codegenAggArg().

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

Definition at line 366 of file GroupByAndAggregate.cpp.

Referenced by GroupByAndAggregate::codegenOutputSlot().

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

Definition at line 368 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 1732 of file GroupByAndAggregate.cpp.

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

1732  {
1733  auto* t_digest = reinterpret_cast<quantile::TDigest*>(*agg);
1734  t_digest->allocate();
1735  t_digest->add(val);
1736 }
DEVICE void allocate()
Definition: quantile.h:601

+ Here is the call graph for this function:

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

Definition at line 1720 of file GroupByAndAggregate.cpp.

Referenced by agg_count_distinct_skip_val().

1720  {
1721  reinterpret_cast<CountDistinctSet*>(*agg)->insert(val);
1722 }
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 1724 of file GroupByAndAggregate.cpp.

References agg_count_distinct().

1726  {
1727  if (val != skip_val) {
1728  agg_count_distinct(agg, val);
1729  }
1730 }
RUNTIME_EXPORT void agg_count_distinct(int64_t *agg, const int64_t val)

+ Here is the call graph for this function:

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

Definition at line 63 of file GroupByAndAggregate.cpp.

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

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

Definition at line 70 of file GroupByAndAggregate.cpp.

References Bitmap, Invalid, and UnorderedSet.

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

Definition at line 88 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.

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

Variable Documentation

bool g_cluster false

Definition at line 52 of file GroupByAndAggregate.cpp.

size_t g_leaf_count

Definition at line 76 of file ParserNode.cpp.

size_t g_watchdog_baseline_max_groups {120000000}