OmniSciDB  c07336695a
Execute.h File Reference
#include "AggregatedColRange.h"
#include "BufferCompaction.h"
#include "CartesianProduct.h"
#include "CgenState.h"
#include "CodeCache.h"
#include "DateTimeUtils.h"
#include "Descriptors/QueryFragmentDescriptor.h"
#include "GroupByAndAggregate.h"
#include "JoinHashTable.h"
#include "LoopControlFlow/JoinLoop.h"
#include "NvidiaKernel.h"
#include "PlanState.h"
#include "RelAlgExecutionUnit.h"
#include "RelAlgTranslator.h"
#include "StringDictionaryGenerations.h"
#include "TableGenerations.h"
#include "TargetMetaInfo.h"
#include "WindowContext.h"
#include "../Chunk/Chunk.h"
#include "../Fragmenter/InsertOrderFragmenter.h"
#include "../Planner/Planner.h"
#include "../Shared/MapDParameters.h"
#include "../Shared/measure.h"
#include "../Shared/thread_count.h"
#include "../StringDictionary/LruCache.hpp"
#include "../StringDictionary/StringDictionary.h"
#include "../StringDictionary/StringDictionaryProxy.h"
#include <llvm/IR/Function.h>
#include <llvm/IR/Value.h>
#include <llvm/Linker/Linker.h>
#include <llvm/Transforms/Utils/ValueMapper.h>
#include <rapidjson/document.h>
#include <unistd.h>
#include <algorithm>
#include <condition_variable>
#include <cstddef>
#include <cstdlib>
#include <deque>
#include <functional>
#include <limits>
#include <map>
#include <mutex>
#include <stack>
#include <unordered_map>
#include <unordered_set>
+ Include dependency graph for Execute.h:

Go to the source code of this file.

Classes

class  WatchdogException
 
class  CompilationRetryNoLazyFetch
 
class  CompilationRetryNewScanLimit
 
class  TooManyLiterals
 
class  CompilationRetryNoCompaction
 
class  QueryMustRunOnCpu
 
class  SringConstInResultSet
 
struct  std::hash< std::vector< int > >
 
struct  std::hash< std::pair< int, int > >
 
class  UpdateLogForFragment
 
class  Executor
 
struct  Executor::CompilationResult
 
struct  Executor::FetchResult
 
class  Executor::ExecutionDispatch
 
struct  Executor::JoinHashTableOrError
 
struct  Executor::GroupColLLVMValue
 
class  Executor::FetchCacheAnchor
 

Namespaces

 std
 

Typedefs

using QueryCompilationDescriptorOwned = std::unique_ptr< QueryCompilationDescriptor >
 
using QueryMemoryDescriptorOwned = std::unique_ptr< QueryMemoryDescriptor >
 
using RowDataProvider = Fragmenter_Namespace::RowDataProvider
 
using PerFragmentCB = std::function< void(ResultSetPtr, const Fragmenter_Namespace::FragmentInfo &)>
 

Functions

void read_udf_gpu_module (const std::string &udf_ir_filename)
 
void read_udf_cpu_module (const std::string &udf_ir_filename)
 
bool is_udf_module_present (bool cpu_only=false)
 
void read_rt_udf_gpu_module (const std::string &udf_ir)
 
void read_rt_udf_cpu_module (const std::string &udf_ir)
 
bool is_rt_udf_module_present (bool cpu_only=false)
 
llvm::Value * get_arg_by_name (llvm::Function *func, const std::string &name)
 
uint32_t log2_bytes (const uint32_t bytes)
 
const ColumnDescriptorget_column_descriptor (const int col_id, const int table_id, const Catalog_Namespace::Catalog &cat)
 
const Analyzer::Exprextract_cast_arg (const Analyzer::Expr *expr)
 
std::string numeric_type_name (const SQLTypeInfo &ti)
 
const ColumnDescriptorget_column_descriptor_maybe (const int col_id, const int table_id, const Catalog_Namespace::Catalog &cat)
 
const ResultSetPtrget_temporary_table (const TemporaryTables *temporary_tables, const int table_id)
 
const SQLTypeInfo get_column_type (const int col_id, const int table_id, const ColumnDescriptor *cd, const TemporaryTables *temporary_tables)
 
template<typename PtrTy >
const ColumnarResultsrows_to_columnar_results (std::shared_ptr< RowSetMemoryOwner > row_set_mem_owner, const PtrTy &result, const int number)
 
std::vector< Analyzer::Expr * > get_exprs_not_owned (const std::vector< std::shared_ptr< Analyzer::Expr >> &exprs)
 
const ColumnarResultscolumnarize_result (std::shared_ptr< RowSetMemoryOwner > row_set_mem_owner, const ResultSetPtr &result, const int frag_id)
 
std::string get_null_check_suffix (const SQLTypeInfo &lhs_ti, const SQLTypeInfo &rhs_ti)
 
bool is_unnest (const Analyzer::Expr *expr)
 
bool is_trivial_loop_join (const std::vector< InputTableInfo > &query_infos, const RelAlgExecutionUnit &ra_exe_unit)
 
std::unordered_set< int > get_available_gpus (const Catalog_Namespace::Catalog &cat)
 
size_t get_context_count (const ExecutorDeviceType device_type, const size_t cpu_count, const size_t gpu_count)
 
void register_buffer_with_executor_rsm (int64_t exec, int8_t *buffer)
 
const Analyzer::Exprremove_cast_to_int (const Analyzer::Expr *expr)
 

Variables

bool g_enable_watchdog
 
bool g_enable_dynamic_watchdog
 
unsigned g_dynamic_watchdog_time_limit
 
unsigned g_trivial_loop_join_threshold
 
bool g_from_table_reordering
 
bool g_enable_filter_push_down
 
bool g_allow_cpu_retry
 
bool g_null_div_by_zero
 
bool g_bigint_count
 
bool g_inner_join_fragment_skipping
 
float g_filter_push_down_low_frac
 
float g_filter_push_down_high_frac
 
size_t g_filter_push_down_passing_row_ubound
 
bool g_enable_columnar_output
 
bool g_enable_overlaps_hashjoin
 
size_t g_overlaps_max_table_size_bytes
 
bool g_strip_join_covered_quals
 
size_t g_constrained_by_in_threshold
 
size_t g_big_group_threshold
 
bool g_enable_window_functions
 
size_t g_max_memory_allocation_size
 
double g_bump_allocator_step_reduction
 

Typedef Documentation

◆ PerFragmentCB

using PerFragmentCB = std::function<void(ResultSetPtr, const Fragmenter_Namespace::FragmentInfo&)>

Definition at line 324 of file Execute.h.

◆ QueryCompilationDescriptorOwned

Definition at line 93 of file Execute.h.

◆ QueryMemoryDescriptorOwned

Definition at line 95 of file Execute.h.

◆ RowDataProvider

Function Documentation

◆ columnarize_result()

const ColumnarResults* columnarize_result ( std::shared_ptr< RowSetMemoryOwner row_set_mem_owner,
const ResultSetPtr result,
const int  frag_id 
)
inline

Definition at line 220 of file Execute.h.

References CHECK_EQ, INJECT_TIMER, and rows_to_columnar_results().

Referenced by ColumnFetcher::getOneColumnFragment(), and ColumnFetcher::getResultSetColumn().

223  {
225  CHECK_EQ(0, frag_id);
226  return rows_to_columnar_results(row_set_mem_owner, result, result->colCount());
227 }
#define CHECK_EQ(x, y)
Definition: Logger.h:195
const ColumnarResults * rows_to_columnar_results(std::shared_ptr< RowSetMemoryOwner > row_set_mem_owner, const PtrTy &result, const int number)
Definition: Execute.h:199
#define INJECT_TIMER(DESC)
Definition: measure.h:91
const ColumnarResults * columnarize_result(std::shared_ptr< RowSetMemoryOwner > row_set_mem_owner, const ResultSetPtr &result, const int frag_id)
Definition: Execute.h:220
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ extract_cast_arg()

const Analyzer::Expr* extract_cast_arg ( const Analyzer::Expr expr)
inline

Definition at line 149 of file Execute.h.

References kCAST.

Referenced by CodeGenerator::codegen(), CodeGenerator::createInValuesBitmap(), and anonymous_namespace{ExpressionRewrite.cpp}::OrToInVisitor::visitBinOper().

149  {
150  const auto cast_expr = dynamic_cast<const Analyzer::UOper*>(expr);
151  if (!cast_expr || cast_expr->get_optype() != kCAST) {
152  return expr;
153  }
154  return cast_expr->get_operand();
155 }
Definition: sqldefs.h:49
+ Here is the caller graph for this function:

◆ get_arg_by_name()

llvm::Value* get_arg_by_name ( llvm::Function *  func,
const std::string &  name 
)
inline

Definition at line 114 of file Execute.h.

References CHECK.

Referenced by anonymous_namespace{NativeCodegen.cpp}::bind_pos_placeholders(), Executor::buildJoinLoops(), GroupByAndAggregate::codegen(), JoinHashTable::codegenHashTableLoad(), CodeGenerator::codegenHoistedConstantsLoads(), GroupByAndAggregate::codegenOutputSlot(), CodeGenerator::codegenRowId(), Executor::compileWorkUnit(), Executor::createErrorCheckControlFlow(), GroupByAndAggregate::getAdditionalLiteral(), and Executor::preloadFragOffsets().

114  {
115  for (auto& arg : func->args()) {
116  if (arg.getName() == name) {
117  return &arg;
118  }
119  }
120  CHECK(false);
121  return nullptr;
122 }
#define CHECK(condition)
Definition: Logger.h:187
+ Here is the caller graph for this function:

◆ get_available_gpus()

std::unordered_set<int> get_available_gpus ( const Catalog_Namespace::Catalog cat)

Definition at line 934 of file Execute.cpp.

References CHECK_GT, Data_Namespace::DataMgr::getCudaMgr(), Catalog_Namespace::Catalog::getDataMgr(), CudaMgr_Namespace::CudaMgr::getDeviceCount(), run-benchmark::gpu_count, and Data_Namespace::DataMgr::gpusPresent().

Referenced by Executor::executeWorkUnitImpl(), and is_unnest().

934  {
935  std::unordered_set<int> available_gpus;
936  if (cat.getDataMgr().gpusPresent()) {
938  CHECK_GT(gpu_count, 0);
939  for (int gpu_id = 0; gpu_id < gpu_count; ++gpu_id) {
940  available_gpus.insert(gpu_id);
941  }
942  }
943  return available_gpus;
944 }
Data_Namespace::DataMgr & getDataMgr() const
Definition: Catalog.h:177
int getDeviceCount() const
Definition: CudaMgr.h:81
#define CHECK_GT(x, y)
Definition: Logger.h:199
CudaMgr_Namespace::CudaMgr * getCudaMgr() const
Definition: DataMgr.h:116
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_column_descriptor()

const ColumnDescriptor* get_column_descriptor ( const int  col_id,
const int  table_id,
const Catalog_Namespace::Catalog cat 
)
inline

Definition at line 139 of file Execute.h.

References CHECK, CHECK_GT, and Catalog_Namespace::Catalog::getMetadataForColumn().

Referenced by CodeGenerator::codegenColVar(), Executor::executeSimpleInsert(), get_column_descriptor_maybe(), Executor::getColLazyFetchInfo(), ColumnFetcher::getOneTableColumnFragment(), PlanState::isLazyFetchColumn(), RelAlgExecutor::isRowidLookup(), and Executor::skipFragment().

142  {
143  CHECK_GT(table_id, 0);
144  const auto col_desc = cat.getMetadataForColumn(table_id, col_id);
145  CHECK(col_desc);
146  return col_desc;
147 }
const ColumnDescriptor * getMetadataForColumn(int tableId, const std::string &colName) const
#define CHECK_GT(x, y)
Definition: Logger.h:199
#define CHECK(condition)
Definition: Logger.h:187
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_column_descriptor_maybe()

const ColumnDescriptor* get_column_descriptor_maybe ( const int  col_id,
const int  table_id,
const Catalog_Namespace::Catalog cat 
)
inline

Definition at line 168 of file Execute.h.

References CHECK, and get_column_descriptor().

Referenced by anonymous_namespace{GroupByAndAggregate.cpp}::expr_is_rowid(), OverlapsJoinHashTable::fetchColumnsForDevice(), BaselineJoinHashTable::fetchColumnsForDevice(), Executor::getColumnDescriptor(), ColumnFetcher::getOneColumnFragment(), Executor::getPhysicalColumnDescriptor(), needs_dictionary_translation(), normalize_column_pair(), JoinHashTable::reifyOneToManyForDevice(), JoinHashTable::reifyOneToOneForDevice(), anonymous_namespace{QueryMemoryDescriptor.cpp}::target_expr_proj_indices(), and anonymous_namespace{Execute.cpp}::try_get_column_descriptor().

171  {
172  CHECK(table_id);
173  return table_id > 0 ? get_column_descriptor(col_id, table_id, cat) : nullptr;
174 }
#define CHECK(condition)
Definition: Logger.h:187
const ColumnDescriptor * get_column_descriptor(const int col_id, const int table_id, const Catalog_Namespace::Catalog &cat)
Definition: Execute.h:139
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_column_type()

const SQLTypeInfo get_column_type ( const int  col_id,
const int  table_id,
const ColumnDescriptor cd,
const TemporaryTables temporary_tables 
)
inline

Definition at line 184 of file Execute.h.

References CHECK, CHECK_EQ, ColumnDescriptor::columnId, ColumnDescriptor::columnType, get_temporary_table(), and ColumnDescriptor::tableId.

Referenced by ColumnFetcher::getOneTableColumnFragment(), needs_dictionary_translation(), and normalize_column_pair().

187  {
188  CHECK(cd || temporary_tables);
189  if (cd) {
190  CHECK_EQ(col_id, cd->columnId);
191  CHECK_EQ(table_id, cd->tableId);
192  return cd->columnType;
193  }
194  const auto& temp = get_temporary_table(temporary_tables, table_id);
195  return temp->getColType(col_id);
196 }
#define CHECK_EQ(x, y)
Definition: Logger.h:195
const ResultSetPtr & get_temporary_table(const TemporaryTables *temporary_tables, const int table_id)
Definition: Execute.h:176
#define CHECK(condition)
Definition: Logger.h:187
SQLTypeInfo columnType
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_context_count()

size_t get_context_count ( const ExecutorDeviceType  device_type,
const size_t  cpu_count,
const size_t  gpu_count 
)

Definition at line 946 of file Execute.cpp.

References GPU, and run-benchmark::gpu_count.

Referenced by Executor::executeWorkUnitImpl(), and is_unnest().

948  {
949  return device_type == ExecutorDeviceType::GPU ? gpu_count
950  : static_cast<size_t>(cpu_count);
951 }
+ Here is the caller graph for this function:

◆ get_exprs_not_owned()

std::vector<Analyzer::Expr*> get_exprs_not_owned ( const std::vector< std::shared_ptr< Analyzer::Expr >> &  exprs)
inline

Definition at line 211 of file Execute.h.

Referenced by RelAlgExecutor::createFilterWorkUnit(), RelAlgExecutor::createModifyCompoundWorkUnit(), RelAlgExecutor::createModifyProjectWorkUnit(), RelAlgExecutor::createProjectWorkUnit(), and anonymous_namespace{RelAlgExecutor.cpp}::get_inputs_meta().

212  {
213  std::vector<Analyzer::Expr*> exprs_not_owned;
214  for (const auto expr : exprs) {
215  exprs_not_owned.push_back(expr.get());
216  }
217  return exprs_not_owned;
218 }
+ Here is the caller graph for this function:

◆ get_null_check_suffix()

std::string get_null_check_suffix ( const SQLTypeInfo lhs_ti,
const SQLTypeInfo rhs_ti 
)
inline

Definition at line 1043 of file Execute.h.

References CHECK, and SQLTypeInfoCore< TYPE_FACET_PACK >::get_notnull().

Referenced by CodeGenerator::codegenCmp(), CodeGenerator::codegenDeciDiv(), CodeGenerator::codegenFpArith(), CodeGenerator::codegenIntArith(), and CodeGenerator::codegenStrCmp().

1044  {
1045  if (lhs_ti.get_notnull() && rhs_ti.get_notnull()) {
1046  return "";
1047  }
1048  std::string null_check_suffix{"_nullable"};
1049  if (lhs_ti.get_notnull()) {
1050  CHECK(!rhs_ti.get_notnull());
1051  null_check_suffix += "_rhs";
1052  } else if (rhs_ti.get_notnull()) {
1053  CHECK(!lhs_ti.get_notnull());
1054  null_check_suffix += "_lhs";
1055  }
1056  return null_check_suffix;
1057 }
HOST DEVICE bool get_notnull() const
Definition: sqltypes.h:326
#define CHECK(condition)
Definition: Logger.h:187
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_temporary_table()

const ResultSetPtr& get_temporary_table ( const TemporaryTables temporary_tables,
const int  table_id 
)
inline

Definition at line 176 of file Execute.h.

References CHECK, and CHECK_LT.

Referenced by RelAlgExecutor::executeDeleteViaProject(), RelAlgExecutor::executeProject(), RelAlgExecutor::executeUpdateViaProject(), get_column_type(), ColumnFetcher::getOneColumnFragment(), and ColumnFetcher::getResultSetColumn().

177  {
178  CHECK_LT(table_id, 0);
179  const auto it = temporary_tables->find(table_id);
180  CHECK(it != temporary_tables->end());
181  return it->second;
182 }
#define CHECK_LT(x, y)
Definition: Logger.h:197
#define CHECK(condition)
Definition: Logger.h:187
+ Here is the caller graph for this function:

◆ is_rt_udf_module_present()

bool is_rt_udf_module_present ( bool  cpu_only = false)

Definition at line 1197 of file NativeCodegen.cpp.

References rt_udf_cpu_module, and rt_udf_gpu_module.

Referenced by Executor::compileWorkUnit(), and CodeGenerator::generateNativeGPUCode().

1197  {
1198  return (cpu_only || rt_udf_gpu_module != nullptr) && (rt_udf_cpu_module != nullptr);
1199 }
std::unique_ptr< llvm::Module > rt_udf_cpu_module
std::unique_ptr< llvm::Module > rt_udf_gpu_module
+ Here is the caller graph for this function:

◆ is_trivial_loop_join()

bool is_trivial_loop_join ( const std::vector< InputTableInfo > &  query_infos,
const RelAlgExecutionUnit ra_exe_unit 
)

Definition at line 1054 of file Execute.cpp.

References CHECK_NE, g_trivial_loop_join_threshold, and RelAlgExecutionUnit::input_descs.

Referenced by anonymous_namespace{IRCodegen.cpp}::check_if_loop_join_is_allowed(), and is_unnest().

1055  {
1056  if (ra_exe_unit.input_descs.size() < 2) {
1057  return false;
1058  }
1059 
1060  // We only support loop join at the end of folded joins
1061  // where ra_exe_unit.input_descs.size() > 2 for now.
1062  const auto inner_table_id = ra_exe_unit.input_descs.back().getTableId();
1063 
1064  ssize_t inner_table_idx = -1;
1065  for (size_t i = 0; i < query_infos.size(); ++i) {
1066  if (query_infos[i].table_id == inner_table_id) {
1067  inner_table_idx = i;
1068  break;
1069  }
1070  }
1071  CHECK_NE(ssize_t(-1), inner_table_idx);
1072  return query_infos[inner_table_idx].info.getNumTuples() <=
1074 }
unsigned g_trivial_loop_join_threshold
Definition: Execute.cpp:74
const std::vector< InputDescriptor > input_descs
#define CHECK_NE(x, y)
Definition: Logger.h:196
+ Here is the caller graph for this function:

◆ is_udf_module_present()

bool is_udf_module_present ( bool  cpu_only = false)

Definition at line 1193 of file NativeCodegen.cpp.

References udf_cpu_module, and udf_gpu_module.

Referenced by Executor::compileWorkUnit(), and CodeGenerator::generateNativeGPUCode().

1193  {
1194  return (cpu_only || udf_gpu_module != nullptr) && (udf_cpu_module != nullptr);
1195 }
std::unique_ptr< llvm::Module > udf_cpu_module
std::unique_ptr< llvm::Module > udf_gpu_module
+ Here is the caller graph for this function:

◆ is_unnest()

bool is_unnest ( const Analyzer::Expr expr)
inline

Definition at line 1059 of file Execute.h.

References get_available_gpus(), get_context_count(), Analyzer::UOper::get_optype(), run-benchmark::gpu_count, is_trivial_loop_join(), kUNNEST, register_buffer_with_executor_rsm(), and remove_cast_to_int().

Referenced by CodeGenerator::codegen(), CodeGenerator::codegenCmp(), and anonymous_namespace{CalciteAdapter.cpp}::handle_logical_aggregate().

1059  {
1060  return dynamic_cast<const Analyzer::UOper*>(expr) &&
1061  static_cast<const Analyzer::UOper*>(expr)->get_optype() == kUNNEST;
1062 }
SQLOps get_optype() const
Definition: Analyzer.h:363
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ log2_bytes()

uint32_t log2_bytes ( const uint32_t  bytes)
inline

Definition at line 124 of file Execute.h.

Referenced by CodeGenerator::codegen().

124  {
125  switch (bytes) {
126  case 1:
127  return 0;
128  case 2:
129  return 1;
130  case 4:
131  return 2;
132  case 8:
133  return 3;
134  default:
135  abort();
136  }
137 }
+ Here is the caller graph for this function:

◆ numeric_type_name()

std::string numeric_type_name ( const SQLTypeInfo ti)
inline

Definition at line 157 of file Execute.h.

References CHECK, SQLTypeInfoCore< TYPE_FACET_PACK >::get_compression(), SQLTypeInfoCore< TYPE_FACET_PACK >::get_logical_size(), SQLTypeInfoCore< TYPE_FACET_PACK >::get_type(), SQLTypeInfoCore< TYPE_FACET_PACK >::is_boolean(), SQLTypeInfoCore< TYPE_FACET_PACK >::is_decimal(), SQLTypeInfoCore< TYPE_FACET_PACK >::is_fp(), SQLTypeInfoCore< TYPE_FACET_PACK >::is_integer(), SQLTypeInfoCore< TYPE_FACET_PACK >::is_string(), SQLTypeInfoCore< TYPE_FACET_PACK >::is_time(), SQLTypeInfoCore< TYPE_FACET_PACK >::is_timeinterval(), kDOUBLE, kENCODING_DICT, and to_string().

Referenced by TargetExprCodegen::codegen(), CodeGenerator::codegenCastBetweenIntTypes(), CodeGenerator::codegenCastBetweenIntTypesOverflowChecks(), CodeGenerator::codegenCastFromFp(), CodeGenerator::codegenCastToFp(), CodeGenerator::codegenCmp(), CodeGenerator::codegenDiv(), CodeGenerator::codegenFpArith(), CodeGenerator::codegenQualifierCmp(), CodeGenerator::codegenUMinus(), CodeGenerator::codgenAdjustFixedEncNull(), Executor::groupByColumnCodegen(), and anonymous_namespace{ArithmeticIR.cpp}::numeric_or_time_interval_type_name().

157  {
158  CHECK(ti.is_integer() || ti.is_decimal() || ti.is_boolean() || ti.is_time() ||
159  ti.is_fp() || (ti.is_string() && ti.get_compression() == kENCODING_DICT) ||
160  ti.is_timeinterval());
161  if (ti.is_integer() || ti.is_decimal() || ti.is_boolean() || ti.is_time() ||
162  ti.is_string() || ti.is_timeinterval()) {
163  return "int" + std::to_string(ti.get_logical_size() * 8) + "_t";
164  }
165  return ti.get_type() == kDOUBLE ? "double" : "float";
166 }
bool is_time() const
Definition: sqltypes.h:452
bool is_fp() const
Definition: sqltypes.h:450
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:319
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:327
std::string to_string(char const *&&v)
bool is_timeinterval() const
Definition: sqltypes.h:457
bool is_integer() const
Definition: sqltypes.h:448
bool is_decimal() const
Definition: sqltypes.h:449
bool is_boolean() const
Definition: sqltypes.h:453
int get_logical_size() const
Definition: sqltypes.h:330
#define CHECK(condition)
Definition: Logger.h:187
bool is_string() const
Definition: sqltypes.h:446
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read_rt_udf_cpu_module()

void read_rt_udf_cpu_module ( const std::string &  udf_ir)

Definition at line 1242 of file NativeCodegen.cpp.

References getGlobalLLVMContext(), rt_udf_cpu_module, and throw_parseIR_error().

Referenced by MapDHandler::register_runtime_udf().

1242  {
1243  llvm::SMDiagnostic parse_error;
1244 
1245  auto buf =
1246  std::make_unique<llvm::MemoryBufferRef>(udf_ir_string, "Runtime UDF for CPU");
1247 
1248  rt_udf_cpu_module = llvm::parseIR(*buf, parse_error, getGlobalLLVMContext());
1249  if (!rt_udf_cpu_module) {
1250  throw_parseIR_error(parse_error);
1251  }
1252 }
std::unique_ptr< llvm::Module > rt_udf_cpu_module
llvm::LLVMContext & getGlobalLLVMContext()
void throw_parseIR_error(const llvm::SMDiagnostic &parse_error, std::string src="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read_rt_udf_gpu_module()

void read_rt_udf_gpu_module ( const std::string &  udf_ir)

Definition at line 1230 of file NativeCodegen.cpp.

References getGlobalLLVMContext(), rt_udf_gpu_module, and throw_parseIR_error().

Referenced by MapDHandler::register_runtime_udf().

1230  {
1231  llvm::SMDiagnostic parse_error;
1232 
1233  auto buf =
1234  std::make_unique<llvm::MemoryBufferRef>(udf_ir_string, "Runtime UDF for GPU");
1235 
1236  rt_udf_gpu_module = llvm::parseIR(*buf, parse_error, getGlobalLLVMContext());
1237  if (!rt_udf_gpu_module) {
1238  throw_parseIR_error(parse_error);
1239  }
1240 }
std::unique_ptr< llvm::Module > rt_udf_gpu_module
llvm::LLVMContext & getGlobalLLVMContext()
void throw_parseIR_error(const llvm::SMDiagnostic &parse_error, std::string src="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read_udf_cpu_module()

void read_udf_cpu_module ( const std::string &  udf_ir_filename)

Definition at line 1219 of file NativeCodegen.cpp.

References getGlobalLLVMContext(), throw_parseIR_error(), and udf_cpu_module.

Referenced by UdfCompiler::readCompiledModules().

1219  {
1220  llvm::SMDiagnostic parse_error;
1221 
1222  llvm::StringRef file_name_arg(udf_ir_filename);
1223 
1224  udf_cpu_module = llvm::parseIRFile(file_name_arg, parse_error, getGlobalLLVMContext());
1225  if (!udf_cpu_module) {
1226  throw_parseIR_error(parse_error, udf_ir_filename);
1227  }
1228 }
std::unique_ptr< llvm::Module > udf_cpu_module
llvm::LLVMContext & getGlobalLLVMContext()
void throw_parseIR_error(const llvm::SMDiagnostic &parse_error, std::string src="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read_udf_gpu_module()

void read_udf_gpu_module ( const std::string &  udf_ir_filename)

Definition at line 1208 of file NativeCodegen.cpp.

References getGlobalLLVMContext(), throw_parseIR_error(), and udf_gpu_module.

Referenced by UdfCompiler::readCompiledModules().

1208  {
1209  llvm::SMDiagnostic parse_error;
1210 
1211  llvm::StringRef file_name_arg(udf_ir_filename);
1212 
1213  udf_gpu_module = llvm::parseIRFile(file_name_arg, parse_error, getGlobalLLVMContext());
1214  if (!udf_gpu_module) {
1215  throw_parseIR_error(parse_error, udf_ir_filename);
1216  }
1217 }
std::unique_ptr< llvm::Module > udf_gpu_module
llvm::LLVMContext & getGlobalLLVMContext()
void throw_parseIR_error(const llvm::SMDiagnostic &parse_error, std::string src="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ register_buffer_with_executor_rsm()

void register_buffer_with_executor_rsm ( int64_t  exec,
int8_t *  buffer 
)

Definition at line 98 of file ExtensionsIR.cpp.

Referenced by is_unnest().

98  {
99  Executor* exec_ptr = reinterpret_cast<Executor*>(exec);
100  if (buffer != nullptr) {
101  exec_ptr->getRowSetMemoryOwner()->addVarlenBuffer(buffer);
102  }
103 }
+ Here is the caller graph for this function:

◆ remove_cast_to_int()

const Analyzer::Expr* remove_cast_to_int ( const Analyzer::Expr expr)

Definition at line 527 of file ColumnIR.cpp.

References Analyzer::Expr::get_type_info(), and kCAST.

Referenced by anonymous_namespace{DateTimePlusRewrite.cpp}::get_dt_field(), CodeGenerator::hashJoinLhs(), and is_unnest().

527  {
528  const auto uoper = dynamic_cast<const Analyzer::UOper*>(expr);
529  if (!uoper || uoper->get_optype() != kCAST) {
530  return nullptr;
531  }
532  const auto& target_ti = uoper->get_type_info();
533  if (!target_ti.is_integer()) {
534  return nullptr;
535  }
536  return uoper->get_operand();
537 }
Definition: sqldefs.h:49
const SQLTypeInfo & get_type_info() const
Definition: Analyzer.h:77
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rows_to_columnar_results()

template<typename PtrTy >
const ColumnarResults* rows_to_columnar_results ( std::shared_ptr< RowSetMemoryOwner row_set_mem_owner,
const PtrTy &  result,
const int  number 
)
inline

Definition at line 199 of file Execute.h.

References get_logical_type_info().

Referenced by columnarize_result().

202  {
203  std::vector<SQLTypeInfo> col_types;
204  for (size_t i = 0; i < result->colCount(); ++i) {
205  col_types.push_back(get_logical_type_info(result->getColType(i)));
206  }
207  return new ColumnarResults(row_set_mem_owner, *result, number, col_types);
208 }
SQLTypeInfo get_logical_type_info(const SQLTypeInfo &type_info)
Definition: sqltypes.h:836
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ g_allow_cpu_retry

bool g_allow_cpu_retry

Definition at line 72 of file Execute.cpp.

◆ g_big_group_threshold

size_t g_big_group_threshold

Definition at line 90 of file Execute.cpp.

Referenced by RelAlgExecutor::executeWorkUnit(), and TEST().

◆ g_bigint_count

bool g_bigint_count

Definition at line 50 of file GroupByAndAggregate.cpp.

◆ g_bump_allocator_step_reduction

double g_bump_allocator_step_reduction

Definition at line 97 of file Execute.cpp.

◆ g_constrained_by_in_threshold

size_t g_constrained_by_in_threshold

Definition at line 89 of file Execute.cpp.

Referenced by QueryRewriter::rewriteConstrainedByInImpl(), and TEST().

◆ g_dynamic_watchdog_time_limit

◆ g_enable_columnar_output

bool g_enable_columnar_output

Definition at line 84 of file Execute.cpp.

◆ g_enable_dynamic_watchdog

bool g_enable_dynamic_watchdog

Definition at line 70 of file Execute.cpp.

◆ g_enable_filter_push_down

bool g_enable_filter_push_down

Definition at line 80 of file Execute.cpp.

◆ g_enable_overlaps_hashjoin

bool g_enable_overlaps_hashjoin

Definition at line 85 of file Execute.cpp.

◆ g_enable_watchdog

bool g_enable_watchdog

Definition at line 69 of file Execute.cpp.

◆ g_enable_window_functions

bool g_enable_window_functions

Definition at line 91 of file Execute.cpp.

◆ g_filter_push_down_high_frac

float g_filter_push_down_high_frac

Definition at line 82 of file Execute.cpp.

◆ g_filter_push_down_low_frac

float g_filter_push_down_low_frac

Definition at line 81 of file Execute.cpp.

◆ g_filter_push_down_passing_row_ubound

size_t g_filter_push_down_passing_row_ubound

Definition at line 83 of file Execute.cpp.

◆ g_from_table_reordering

◆ g_inner_join_fragment_skipping

bool g_inner_join_fragment_skipping

Definition at line 76 of file Execute.cpp.

Referenced by Executor::dispatchFragments(), and MapDProgramOptions::fillOptions().

◆ g_max_memory_allocation_size

size_t g_max_memory_allocation_size

Definition at line 92 of file Execute.cpp.

◆ g_null_div_by_zero

bool g_null_div_by_zero

◆ g_overlaps_max_table_size_bytes

size_t g_overlaps_max_table_size_bytes

◆ g_strip_join_covered_quals

bool g_strip_join_covered_quals

◆ g_trivial_loop_join_threshold

unsigned g_trivial_loop_join_threshold

Definition at line 74 of file Execute.cpp.