OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Execute.cpp File Reference
#include "QueryEngine/Execute.h"
#include <llvm/Transforms/Utils/BasicBlockUtils.h>
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/path.hpp>
#include <chrono>
#include <ctime>
#include <future>
#include <memory>
#include <mutex>
#include <numeric>
#include <set>
#include <thread>
#include <type_traits>
#include "Catalog/Catalog.h"
#include "CudaMgr/CudaMgr.h"
#include "DataMgr/BufferMgr/BufferMgr.h"
#include "DataMgr/ForeignStorage/FsiChunkUtils.h"
#include "OSDependent/heavyai_path.h"
#include "Parser/ParserNode.h"
#include "QueryEngine/AggregateUtils.h"
#include "QueryEngine/AggregatedColRange.h"
#include "QueryEngine/CodeGenerator.h"
#include "QueryEngine/ColumnFetcher.h"
#include "QueryEngine/Descriptors/QueryCompilationDescriptor.h"
#include "QueryEngine/Descriptors/QueryFragmentDescriptor.h"
#include "QueryEngine/DynamicWatchdog.h"
#include "QueryEngine/EquiJoinCondition.h"
#include "QueryEngine/ErrorHandling.h"
#include "QueryEngine/ExecutorResourceMgr/ExecutorResourceMgr.h"
#include "QueryEngine/ExpressionRewrite.h"
#include "QueryEngine/ExternalCacheInvalidators.h"
#include "QueryEngine/GpuMemUtils.h"
#include "QueryEngine/InPlaceSort.h"
#include "QueryEngine/JoinHashTable/BaselineJoinHashTable.h"
#include "QueryEngine/JoinHashTable/BoundingBoxIntersectJoinHashTable.h"
#include "QueryEngine/JsonAccessors.h"
#include "QueryEngine/OutputBufferInitialization.h"
#include "QueryEngine/QueryDispatchQueue.h"
#include "QueryEngine/QueryEngine.h"
#include "QueryEngine/QueryRewrite.h"
#include "QueryEngine/QueryTemplateGenerator.h"
#include "QueryEngine/ResultSetReductionJIT.h"
#include "QueryEngine/RuntimeFunctions.h"
#include "QueryEngine/SpeculativeTopN.h"
#include "QueryEngine/StringDictionaryGenerations.h"
#include "QueryEngine/TableFunctions/TableFunctionCompilationContext.h"
#include "QueryEngine/TableFunctions/TableFunctionExecutionContext.h"
#include "QueryEngine/Visitors/TransientStringLiteralsVisitor.h"
#include "Shared/SystemParameters.h"
#include "Shared/TypedDataAccessors.h"
#include "Shared/checked_alloc.h"
#include "Shared/measure.h"
#include "Shared/misc.h"
#include "Shared/scope.h"
#include "Shared/shard_key.h"
#include "Shared/threading.h"
#include "ArrayOps.cpp"
#include "DateAdd.cpp"
#include "GeoOps.cpp"
#include "RowFunctionOps.cpp"
#include "StringFunctions.cpp"
#include "TableFunctions/TableFunctionOps.cpp"

Go to the source code of this file.

Classes

struct  anonymous_namespace{Execute.cpp}::GetTargetInfo
 
class  anonymous_namespace{Execute.cpp}::OutVecOwner
 

Namespaces

 anonymous_namespace{Execute.cpp}
 
 foreign_storage
 

Macros

#define EXECUTE_INCLUDE
 

Functions

std::unique_ptr< llvm::Module > read_llvm_module_from_bc_file (const std::string &udf_ir_filename, llvm::LLVMContext &ctx)
 
std::unique_ptr< llvm::Module > read_llvm_module_from_ir_file (const std::string &udf_ir_filename, llvm::LLVMContext &ctx, bool is_gpu=false)
 
std::unique_ptr< llvm::Module > read_llvm_module_from_ir_string (const std::string &udf_ir_string, llvm::LLVMContext &ctx, bool is_gpu=false)
 
void anonymous_namespace{Execute.cpp}::prepare_string_dictionaries (const std::unordered_set< PhysicalInput > &phys_inputs)
 
bool anonymous_namespace{Execute.cpp}::is_empty_table (Fragmenter_Namespace::AbstractFragmenter *fragmenter)
 
void foreign_storage::populate_string_dictionary (int32_t table_id, int32_t col_id, int32_t db_id)
 
 block_size_x_ (block_size_x)
 
 grid_size_x_ (grid_size_x)
 
 max_gpu_slab_size_ (max_gpu_slab_size)
 
 debug_dir_ (debug_dir)
 
 debug_file_ (debug_file)
 
 data_mgr_ (data_mgr)
 
 temporary_tables_ (nullptr)
 
 input_table_info_cache_ (this)
 
void anonymous_namespace{Execute.cpp}::log_system_memory_info_impl (std::string const &mem_log, size_t executor_id, size_t log_time_ms, std::string const &log_tag, size_t const thread_idx)
 
size_t anonymous_namespace{Execute.cpp}::get_col_byte_width (const shared::ColumnKey &column_key)
 
ResultSetPtr anonymous_namespace{Execute.cpp}::get_merged_result (std::vector< std::pair< ResultSetPtr, std::vector< size_t >>> &results_per_device, std::vector< TargetInfo > const &targets)
 
ReductionCode anonymous_namespace{Execute.cpp}::get_reduction_code (const size_t executor_id, std::vector< std::pair< ResultSetPtr, std::vector< size_t >>> &results_per_device, int64_t *compilation_queue_time)
 
std::unordered_set< int > get_available_gpus (const Data_Namespace::DataMgr *data_mgr)
 
size_t get_context_count (const ExecutorDeviceType device_type, const size_t cpu_count, const size_t gpu_count)
 
size_t anonymous_namespace{Execute.cpp}::compute_buffer_entry_guess (const std::vector< InputTableInfo > &query_infos, const RelAlgExecutionUnit &ra_exe_unit)
 
std::string anonymous_namespace{Execute.cpp}::get_table_name (const InputDescriptor &input_desc)
 
size_t anonymous_namespace{Execute.cpp}::getDeviceBasedWatchdogScanLimit (size_t watchdog_max_projected_rows_per_device, const ExecutorDeviceType device_type, const int device_count)
 
void anonymous_namespace{Execute.cpp}::checkWorkUnitWatchdog (const RelAlgExecutionUnit &ra_exe_unit, const std::vector< InputTableInfo > &table_infos, const ExecutorDeviceType device_type, const int device_count)
 
size_t get_loop_join_size (const std::vector< InputTableInfo > &query_infos, const RelAlgExecutionUnit &ra_exe_unit)
 
template<typename T >
std::vector< std::string > anonymous_namespace{Execute.cpp}::expr_container_to_string (const T &expr_container)
 
template<>
std::vector< std::string > anonymous_namespace{Execute.cpp}::expr_container_to_string (const std::list< Analyzer::OrderEntry > &expr_container)
 
std::string anonymous_namespace{Execute.cpp}::sort_algorithm_to_string (const SortAlgorithm algorithm)
 
std::ostream & operator<< (std::ostream &os, const RelAlgExecutionUnit &ra_exe_unit)
 
RelAlgExecutionUnit anonymous_namespace{Execute.cpp}::replace_scan_limit (const RelAlgExecutionUnit &ra_exe_unit_in, const size_t new_scan_limit)
 
int64_t anonymous_namespace{Execute.cpp}::inline_null_val (const SQLTypeInfo &ti, const bool float_argument_input)
 
void anonymous_namespace{Execute.cpp}::fill_entries_for_empty_input (std::vector< TargetInfo > &target_infos, std::vector< int64_t > &entry, const std::vector< Analyzer::Expr * > &target_exprs, const QueryMemoryDescriptor &query_mem_desc)
 
ResultSetPtr anonymous_namespace{Execute.cpp}::build_row_for_empty_input (const std::vector< Analyzer::Expr * > &target_exprs_in, const QueryMemoryDescriptor &query_mem_desc, const ExecutorDeviceType device_type)
 
size_t anonymous_namespace{Execute.cpp}::permute_storage_columnar (const ResultSetStorage *input_storage, const QueryMemoryDescriptor &input_query_mem_desc, const ResultSetStorage *output_storage, size_t output_row_index, const QueryMemoryDescriptor &output_query_mem_desc, const std::vector< uint32_t > &top_permutation)
 
size_t anonymous_namespace{Execute.cpp}::permute_storage_row_wise (const ResultSetStorage *input_storage, const ResultSetStorage *output_storage, size_t output_row_index, const QueryMemoryDescriptor &output_query_mem_desc, const std::vector< uint32_t > &top_permutation)
 
bool anonymous_namespace{Execute.cpp}::has_lazy_fetched_columns (const std::vector< ColumnLazyFetchInfo > &fetched_cols)
 
const ColumnDescriptoranonymous_namespace{Execute.cpp}::try_get_column_descriptor (const InputColDescriptor *col_desc)
 
std::map< shared::TableKey,
std::vector< uint64_t > > 
get_table_id_to_frag_offsets (const std::vector< InputDescriptor > &input_descs, const std::map< shared::TableKey, const TableFragments * > &all_tables_fragments)
 
std::ostream & operator<< (std::ostream &os, FetchResult const &fetch_result)
 
size_t anonymous_namespace{Execute.cpp}::get_selected_input_descs_index (const shared::TableKey &table_key, std::vector< InputDescriptor > const &input_descs)
 
size_t anonymous_namespace{Execute.cpp}::get_selected_input_col_descs_index (const shared::TableKey &table_key, std::list< std::shared_ptr< InputColDescriptor const >> const &input_col_descs)
 
std::list< std::shared_ptr
< const InputColDescriptor > > 
anonymous_namespace{Execute.cpp}::get_selected_input_col_descs (const shared::TableKey &table_key, std::list< std::shared_ptr< InputColDescriptor const >> const &input_col_descs)
 
void anonymous_namespace{Execute.cpp}::set_mod_range (std::vector< int8_t const * > &frag_col_buffers, int8_t const *const ptr, size_t const local_col_id, size_t const N)
 
bool anonymous_namespace{Execute.cpp}::check_rows_less_than_needed (const ResultSetPtr &results, const size_t scan_limit)
 
void anonymous_namespace{Execute.cpp}::add_deleted_col_to_map (PlanState::DeletedColumnsMap &deleted_cols_map, const ColumnDescriptor *deleted_cd, const shared::TableKey &table_key)
 
std::tuple< bool, int64_t,
int64_t > 
anonymous_namespace{Execute.cpp}::get_hpt_overflow_underflow_safe_scaled_values (const int64_t chunk_min, const int64_t chunk_max, const SQLTypeInfo &lhs_type, const SQLTypeInfo &rhs_type)
 

Variables

bool g_enable_watchdog false
 
bool g_enable_dynamic_watchdog {false}
 
size_t g_watchdog_none_encoded_string_translation_limit {1000000UL}
 
size_t g_watchdog_max_projected_rows_per_device {128000000}
 
size_t g_preflight_count_query_threshold {1000000}
 
size_t g_watchdog_in_clause_max_num_elem_non_bitmap {10000}
 
size_t g_watchdog_in_clause_max_num_elem_bitmap {1 << 25}
 
size_t g_watchdog_in_clause_max_num_input_rows {5000000}
 
size_t g_in_clause_num_elem_skip_bitmap {100}
 
bool g_enable_cpu_sub_tasks {false}
 
size_t g_cpu_sub_task_size {500'000}
 
bool g_enable_filter_function {true}
 
unsigned g_dynamic_watchdog_time_limit {10000}
 
bool g_allow_cpu_retry {true}
 
bool g_allow_query_step_cpu_retry {true}
 
bool g_null_div_by_zero {false}
 
unsigned g_trivial_loop_join_threshold {1000}
 
bool g_from_table_reordering {true}
 
bool g_inner_join_fragment_skipping {true}
 
bool g_enable_smem_group_by
 
std::unique_ptr< llvm::Module > udf_gpu_module
 
std::unique_ptr< llvm::Module > udf_cpu_module
 
bool g_enable_filter_push_down {false}
 
float g_filter_push_down_low_frac {-1.0f}
 
float g_filter_push_down_high_frac {-1.0f}
 
size_t g_filter_push_down_passing_row_ubound {0}
 
bool g_enable_columnar_output {false}
 
bool g_enable_left_join_filter_hoisting {true}
 
bool g_optimize_row_initialization {true}
 
bool g_enable_bbox_intersect_hashjoin {true}
 
size_t g_num_tuple_threshold_switch_to_baseline {100000}
 
size_t g_ratio_num_hash_entry_to_num_tuple_switch_to_baseline {100}
 
bool g_enable_distance_rangejoin {true}
 
bool g_enable_hashjoin_many_to_many {true}
 
size_t g_bbox_intersect_max_table_size_bytes {1024 * 1024 * 1024}
 
double g_bbox_intersect_target_entries_per_bin {1.3}
 
bool g_strip_join_covered_quals {false}
 
size_t g_constrained_by_in_threshold {10}
 
size_t g_default_max_groups_buffer_entry_guess {16384}
 
size_t g_big_group_threshold {g_default_max_groups_buffer_entry_guess}
 
bool g_enable_window_functions {true}
 
bool g_enable_table_functions {true}
 
bool g_enable_ml_functions {true}
 
bool g_restrict_ml_model_metadata_to_superusers {false}
 
bool g_enable_dev_table_functions {false}
 
bool g_enable_geo_ops_on_uncompressed_coords {true}
 
bool g_enable_rf_prop_table_functions {true}
 
bool g_allow_memory_status_log {true}
 
size_t g_max_memory_allocation_size {2000000000}
 
size_t g_min_memory_allocation_size
 
bool g_enable_bump_allocator {false}
 
double g_bump_allocator_step_reduction {0.75}
 
bool g_enable_direct_columnarization {true}
 
bool g_enable_string_functions
 
bool g_enable_lazy_fetch {true}
 
bool g_enable_runtime_query_interrupt {true}
 
bool g_enable_non_kernel_time_query_interrupt {true}
 
bool g_use_estimator_result_cache {true}
 
unsigned g_pending_query_interrupt_freq {1000}
 
double g_running_query_interrupt_freq {0.1}
 
size_t g_gpu_smem_threshold
 
bool g_enable_smem_grouped_non_count_agg
 
bool g_enable_smem_non_grouped_agg
 
bool g_is_test_env {false}
 
size_t g_enable_parallel_linearization
 
bool g_enable_data_recycler {true}
 
bool g_use_hashtable_cache {true}
 
bool g_use_query_resultset_cache {true}
 
bool g_use_chunk_metadata_cache {true}
 
bool g_allow_auto_resultset_caching {false}
 
bool g_allow_query_step_skipping {true}
 
size_t g_hashtable_cache_total_bytes {size_t(1) << 32}
 
size_t g_max_cacheable_hashtable_size_bytes {size_t(1) << 31}
 
size_t g_query_resultset_cache_total_bytes {size_t(1) << 32}
 
size_t g_max_cacheable_query_resultset_size_bytes {size_t(1) << 31}
 
size_t g_auto_resultset_caching_threshold {size_t(1) << 20}
 
bool g_optimize_cuda_block_and_grid_sizes {false}
 
size_t g_approx_quantile_buffer {1000}
 
size_t g_approx_quantile_centroids {300}
 
bool g_enable_automatic_ir_metadata {true}
 
size_t g_max_log_length {500}
 
bool g_enable_executor_resource_mgr {true}
 
double g_executor_resource_mgr_cpu_result_mem_ratio {0.8}
 
size_t g_executor_resource_mgr_cpu_result_mem_bytes {Executor::auto_cpu_mem_bytes}
 
double g_executor_resource_mgr_per_query_max_cpu_slots_ratio {0.9}
 
double g_executor_resource_mgr_per_query_max_cpu_result_mem_ratio {0.8}
 
bool g_executor_resource_mgr_allow_cpu_kernel_concurrency {true}
 
bool g_executor_resource_mgr_allow_cpu_gpu_kernel_concurrency {true}
 
bool g_executor_resource_mgr_allow_cpu_slot_oversubscription_concurrency {false}
 
bool g_executor_resource_mgr_allow_cpu_result_mem_oversubscription_concurrency {false}
 
double g_executor_resource_mgr_max_available_resource_use_ratio {0.8}
 
bool g_use_cpu_mem_pool_for_output_buffers {false}
 
bool g_cache_string_hash
 
 this
 

Macro Definition Documentation

#define EXECUTE_INCLUDE

Definition at line 4453 of file Execute.cpp.

Function Documentation

block_size_x_ ( block_size_x  )
debug_dir_ ( debug_dir  )
debug_file_ ( debug_file  )
std::unordered_set<int> get_available_gpus ( const Data_Namespace::DataMgr data_mgr)

Definition at line 1752 of file Execute.cpp.

References CHECK, CHECK_GT, Data_Namespace::DataMgr::getCudaMgr(), CudaMgr_Namespace::CudaMgr::getDeviceCount(), and Data_Namespace::DataMgr::gpusPresent().

Referenced by Executor::executeWorkUnitImpl().

1752  {
1753  CHECK(data_mgr);
1754  std::unordered_set<int> available_gpus;
1755  if (data_mgr->gpusPresent()) {
1756  CHECK(data_mgr->getCudaMgr());
1757  const int gpu_count = data_mgr->getCudaMgr()->getDeviceCount();
1758  CHECK_GT(gpu_count, 0);
1759  for (int gpu_id = 0; gpu_id < gpu_count; ++gpu_id) {
1760  available_gpus.insert(gpu_id);
1761  }
1762  }
1763  return available_gpus;
1764 }
CudaMgr_Namespace::CudaMgr * getCudaMgr() const
Definition: DataMgr.h:177
#define CHECK_GT(x, y)
Definition: Logger.h:305
int getDeviceCount() const
Definition: CudaMgr.h:90
#define CHECK(condition)
Definition: Logger.h:291
bool gpusPresent() const
Definition: DataMgr.h:170

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 1766 of file Execute.cpp.

References GPU.

Referenced by Executor::executeWorkUnitImpl().

1768  {
1769  return device_type == ExecutorDeviceType::GPU ? gpu_count
1770  : static_cast<size_t>(cpu_count);
1771 }

+ Here is the caller graph for this function:

size_t get_loop_join_size ( const std::vector< InputTableInfo > &  query_infos,
const RelAlgExecutionUnit ra_exe_unit 
)

Definition at line 1905 of file Execute.cpp.

References CHECK, and RelAlgExecutionUnit::input_descs.

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

1906  {
1907  const auto inner_table_key = ra_exe_unit.input_descs.back().getTableKey();
1908 
1909  std::optional<size_t> inner_table_idx;
1910  for (size_t i = 0; i < query_infos.size(); ++i) {
1911  if (query_infos[i].table_key == inner_table_key) {
1912  inner_table_idx = i;
1913  break;
1914  }
1915  }
1916  CHECK(inner_table_idx);
1917  return query_infos[*inner_table_idx].info.getNumTuples();
1918 }
std::vector< InputDescriptor > input_descs
#define CHECK(condition)
Definition: Logger.h:291

+ Here is the caller graph for this function:

std::map<shared::TableKey, std::vector<uint64_t> > get_table_id_to_frag_offsets ( const std::vector< InputDescriptor > &  input_descs,
const std::map< shared::TableKey, const TableFragments * > &  all_tables_fragments 
)

Definition at line 3348 of file Execute.cpp.

References CHECK.

Referenced by Executor::getRowCountAndOffsetForAllFrags().

3350  {
3351  std::map<shared::TableKey, std::vector<uint64_t>> tab_id_to_frag_offsets;
3352  for (auto& desc : input_descs) {
3353  const auto fragments_it = all_tables_fragments.find(desc.getTableKey());
3354  CHECK(fragments_it != all_tables_fragments.end());
3355  const auto& fragments = *fragments_it->second;
3356  std::vector<uint64_t> frag_offsets(fragments.size(), 0);
3357  for (size_t i = 0, off = 0; i < fragments.size(); ++i) {
3358  frag_offsets[i] = off;
3359  off += fragments[i].getNumTuples();
3360  }
3361  tab_id_to_frag_offsets.insert(std::make_pair(desc.getTableKey(), frag_offsets));
3362  }
3363  return tab_id_to_frag_offsets;
3364 }
#define CHECK(condition)
Definition: Logger.h:291

+ Here is the caller graph for this function:

grid_size_x_ ( grid_size_x  )
input_table_info_cache_ ( this  )

Definition at line 293 of file Execute.cpp.

References Executor::initialize_extension_module_sources().

293  {
295  update_extension_modules();
296 }
static void initialize_extension_module_sources()
Definition: Execute.cpp:298

+ Here is the call graph for this function:

max_gpu_slab_size_ ( max_gpu_slab_size  )
std::ostream& operator<< ( std::ostream &  os,
const RelAlgExecutionUnit ra_exe_unit 
)

Definition at line 2024 of file Execute.cpp.

References RelAlgExecutionUnit::estimator, anonymous_namespace{Execute.cpp}::expr_container_to_string(), RelAlgExecutionUnit::groupby_exprs, RelAlgExecutionUnit::input_col_descs, join(), RelAlgExecutionUnit::join_quals, RelAlgExecutionUnit::quals, RelAlgExecutionUnit::query_plan_dag_hash, RelAlgExecutionUnit::scan_limit, RelAlgExecutionUnit::simple_quals, anonymous_namespace{Execute.cpp}::sort_algorithm_to_string(), RelAlgExecutionUnit::sort_info, RelAlgExecutionUnit::target_exprs, to_string(), toString(), RelAlgExecutionUnit::union_all, and RelAlgExecutionUnit::use_bump_allocator.

2024  {
2025  os << "\n\tExtracted Query Plan Dag Hash: " << ra_exe_unit.query_plan_dag_hash;
2026  os << "\n\tTable/Col/Levels: ";
2027  for (const auto& input_col_desc : ra_exe_unit.input_col_descs) {
2028  const auto& scan_desc = input_col_desc->getScanDesc();
2029  os << "(" << scan_desc.getTableKey() << ", " << input_col_desc->getColId() << ", "
2030  << scan_desc.getNestLevel() << ") ";
2031  }
2032  if (!ra_exe_unit.simple_quals.empty()) {
2033  os << "\n\tSimple Quals: "
2035  ", ");
2036  }
2037  if (!ra_exe_unit.quals.empty()) {
2038  os << "\n\tQuals: "
2039  << boost::algorithm::join(expr_container_to_string(ra_exe_unit.quals), ", ");
2040  }
2041  if (!ra_exe_unit.join_quals.empty()) {
2042  os << "\n\tJoin Quals: ";
2043  for (size_t i = 0; i < ra_exe_unit.join_quals.size(); i++) {
2044  const auto& join_condition = ra_exe_unit.join_quals[i];
2045  os << "\t\t" << std::to_string(i) << " " << ::toString(join_condition.type);
2046  os << boost::algorithm::join(expr_container_to_string(join_condition.quals), ", ");
2047  }
2048  }
2049  if (!ra_exe_unit.groupby_exprs.empty()) {
2050  os << "\n\tGroup By: "
2052  ", ");
2053  }
2054  os << "\n\tProjected targets: "
2056  os << "\n\tHas Estimator: " << ::toString(ra_exe_unit.estimator == nullptr);
2057  os << "\n\tSort Info: ";
2058  const auto& sort_info = ra_exe_unit.sort_info;
2059  os << "\n\t Order Entries: "
2060  << boost::algorithm::join(expr_container_to_string(sort_info.order_entries), ", ");
2061  os << "\n\t Algorithm: " << sort_algorithm_to_string(sort_info.algorithm);
2062  std::string limit_str = sort_info.limit ? std::to_string(*sort_info.limit) : "N/A";
2063  os << "\n\t Limit: " << limit_str;
2064  os << "\n\t Offset: " << std::to_string(sort_info.offset);
2065  os << "\n\tScan Limit: " << std::to_string(ra_exe_unit.scan_limit);
2066  os << "\n\tBump Allocator: " << ::toString(ra_exe_unit.use_bump_allocator);
2067  if (ra_exe_unit.union_all) {
2068  os << "\n\tUnion: " << std::string(*ra_exe_unit.union_all ? "UNION ALL" : "UNION");
2069  }
2070  return os;
2071 }
std::vector< Analyzer::Expr * > target_exprs
QueryPlanHash query_plan_dag_hash
const std::optional< bool > union_all
std::string join(T const &container, std::string const &delim)
const std::list< std::shared_ptr< Analyzer::Expr > > groupby_exprs
std::string to_string(char const *&&v)
const JoinQualsPerNestingLevel join_quals
std::vector< std::string > expr_container_to_string(const T &expr_container)
Definition: Execute.cpp:1923
const std::shared_ptr< Analyzer::Estimator > estimator
std::string toString(const Executor::ExtModuleKinds &kind)
Definition: Execute.h:1703
std::string sort_algorithm_to_string(const SortAlgorithm algorithm)
Definition: Execute.cpp:1945
std::list< std::shared_ptr< Analyzer::Expr > > quals
std::list< std::shared_ptr< const InputColDescriptor > > input_col_descs
std::list< std::shared_ptr< Analyzer::Expr > > simple_quals

+ Here is the call graph for this function:

std::ostream& operator<< ( std::ostream &  os,
FetchResult const &  fetch_result 
)

Definition at line 3452 of file Execute.cpp.

References FetchResult::col_buffers, FetchResult::frag_offsets, FetchResult::num_rows, and shared::printContainer().

3452  {
3453  return os << "col_buffers" << shared::printContainer(fetch_result.col_buffers)
3454  << " num_rows" << shared::printContainer(fetch_result.num_rows)
3455  << " frag_offsets" << shared::printContainer(fetch_result.frag_offsets);
3456 }
PrintContainer< CONTAINER > printContainer(CONTAINER &container)
Definition: misc.h:108

+ Here is the call graph for this function:

std::unique_ptr<llvm::Module> read_llvm_module_from_bc_file ( const std::string &  udf_ir_filename,
llvm::LLVMContext &  ctx 
)

Definition at line 1583 of file NativeCodegen.cpp.

Referenced by Executor::update_extension_modules().

1585  {
1586  llvm::SMDiagnostic err;
1587 
1588  auto buffer_or_error = llvm::MemoryBuffer::getFile(bc_filename);
1589  CHECK(!buffer_or_error.getError()) << "bc_filename=" << bc_filename;
1590  llvm::MemoryBuffer* buffer = buffer_or_error.get().get();
1591 
1592  auto owner = llvm::parseBitcodeFile(buffer->getMemBufferRef(), context);
1593  CHECK(!owner.takeError());
1594  CHECK(owner->get());
1595  return std::move(owner.get());
1596 }
#define CHECK(condition)
Definition: Logger.h:291

+ Here is the caller graph for this function:

std::unique_ptr<llvm::Module> read_llvm_module_from_ir_file ( const std::string &  udf_ir_filename,
llvm::LLVMContext &  ctx,
bool  is_gpu = false 
)

Definition at line 1598 of file NativeCodegen.cpp.

Referenced by Executor::update_extension_modules().

1601  {
1602  llvm::SMDiagnostic parse_error;
1603 
1604  llvm::StringRef file_name_arg(udf_ir_filename);
1605 
1606  auto owner = llvm::parseIRFile(file_name_arg, parse_error, ctx);
1607  if (!owner) {
1608  throw_parseIR_error(parse_error, udf_ir_filename, is_gpu);
1609  }
1610 
1611  if (is_gpu) {
1612  llvm::Triple gpu_triple(owner->getTargetTriple());
1613  if (!gpu_triple.isNVPTX()) {
1614  LOG(WARNING)
1615  << "Expected triple nvptx64-nvidia-cuda for NVVM IR of loadtime UDFs but got "
1616  << gpu_triple.str() << ". Disabling the NVVM IR module.";
1617  return std::unique_ptr<llvm::Module>();
1618  }
1619  }
1620  return owner;
1621 }
#define LOG(tag)
Definition: Logger.h:285
void throw_parseIR_error(const llvm::SMDiagnostic &parse_error, std::string src="", const bool is_gpu=false)

+ Here is the caller graph for this function:

std::unique_ptr<llvm::Module> read_llvm_module_from_ir_string ( const std::string &  udf_ir_string,
llvm::LLVMContext &  ctx,
bool  is_gpu = false 
)

Definition at line 1623 of file NativeCodegen.cpp.

Referenced by Executor::update_extension_modules().

1626  {
1627  llvm::SMDiagnostic parse_error;
1628 
1629  auto buf = std::make_unique<llvm::MemoryBufferRef>(udf_ir_string,
1630  "Runtime UDF/UDTF LLVM/NVVM IR");
1631 
1632  auto owner = llvm::parseIR(*buf, parse_error, ctx);
1633  if (!owner) {
1634  LOG(IR) << "read_llvm_module_from_ir_string:\n"
1635  << udf_ir_string << "\nEnd of LLVM/NVVM IR";
1636  throw_parseIR_error(parse_error, "", /* is_gpu= */ is_gpu);
1637  }
1638 
1639  if (is_gpu) {
1640  llvm::Triple gpu_triple(owner->getTargetTriple());
1641  if (!gpu_triple.isNVPTX()) {
1642  LOG(IR) << "read_llvm_module_from_ir_string:\n"
1643  << udf_ir_string << "\nEnd of NNVM IR";
1644  LOG(WARNING) << "Expected triple nvptx64-nvidia-cuda for NVVM IR but got "
1645  << gpu_triple.str()
1646  << ". Executing runtime UDF/UDTFs on GPU will be disabled.";
1647  return std::unique_ptr<llvm::Module>();
1648  ;
1649  }
1650  }
1651  return owner;
1652 }
#define LOG(tag)
Definition: Logger.h:285
void throw_parseIR_error(const llvm::SMDiagnostic &parse_error, std::string src="", const bool is_gpu=false)

+ Here is the caller graph for this function:

temporary_tables_ ( nullptr  )

Variable Documentation

false

Definition at line 80 of file Execute.cpp.

bool g_allow_query_step_cpu_retry {true}
size_t g_approx_quantile_buffer {1000}
size_t g_approx_quantile_centroids {300}
size_t g_auto_resultset_caching_threshold {size_t(1) << 20}
size_t g_bbox_intersect_max_table_size_bytes {1024 * 1024 * 1024}
double g_bbox_intersect_target_entries_per_bin {1.3}
size_t g_big_group_threshold {g_default_max_groups_buffer_entry_guess}

Definition at line 119 of file Execute.cpp.

Referenced by RelAlgExecutor::executeWorkUnit().

double g_bump_allocator_step_reduction {0.75}

Definition at line 133 of file Execute.cpp.

Referenced by create_dev_group_by_buffers().

bool g_cache_string_hash

Definition at line 55 of file StringDictionary.cpp.

size_t g_constrained_by_in_threshold {10}

Definition at line 117 of file Execute.cpp.

Referenced by QueryRewriter::rewriteConstrainedByInImpl().

size_t g_cpu_sub_task_size {500'000}
unsigned g_dynamic_watchdog_time_limit {10000}
bool g_enable_automatic_ir_metadata {true}
bool g_enable_bump_allocator {false}
bool g_enable_cpu_sub_tasks {false}
bool g_enable_dev_table_functions {false}
bool g_enable_direct_columnarization {true}
bool g_enable_distance_rangejoin {true}

Definition at line 112 of file Execute.cpp.

Referenced by convert_bbox_intersect_join(), and CommandLineOptions::fillOptions().

bool g_enable_filter_function {true}

Definition at line 91 of file Execute.cpp.

Referenced by CommandLineOptions::fillDeveloperOptions().

bool g_enable_geo_ops_on_uncompressed_coords {true}
bool g_enable_hashjoin_many_to_many {true}
bool g_enable_left_join_filter_hoisting {true}
size_t g_enable_parallel_linearization
Initial value:
{
10000}

Definition at line 156 of file Execute.cpp.

Referenced by ColumnFetcher::linearizeVarLenArrayColFrags().

bool g_enable_rf_prop_table_functions {true}

Definition at line 126 of file Execute.cpp.

bool g_enable_smem_group_by
bool g_enable_smem_grouped_non_count_agg
Initial value:
{
true}

Definition at line 147 of file Execute.cpp.

Referenced by CommandLineOptions::fillDeveloperOptions().

bool g_enable_smem_non_grouped_agg
Initial value:
{
true}

Definition at line 150 of file Execute.cpp.

Referenced by CommandLineOptions::fillDeveloperOptions().

bool g_enable_string_functions

Definition at line 43 of file RelAlgTranslator.cpp.

bool g_enable_window_functions {true}
bool g_executor_resource_mgr_allow_cpu_gpu_kernel_concurrency {true}
bool g_executor_resource_mgr_allow_cpu_kernel_concurrency {true}
bool g_executor_resource_mgr_allow_cpu_result_mem_oversubscription_concurrency {false}
bool g_executor_resource_mgr_allow_cpu_slot_oversubscription_concurrency {false}
size_t g_executor_resource_mgr_cpu_result_mem_bytes {Executor::auto_cpu_mem_bytes}
double g_executor_resource_mgr_cpu_result_mem_ratio {0.8}
double g_executor_resource_mgr_max_available_resource_use_ratio {0.8}
double g_executor_resource_mgr_per_query_max_cpu_result_mem_ratio {0.8}
double g_executor_resource_mgr_per_query_max_cpu_slots_ratio {0.9}
float g_filter_push_down_high_frac {-1.0f}
float g_filter_push_down_low_frac {-1.0f}
size_t g_filter_push_down_passing_row_ubound {0}
bool g_from_table_reordering {true}
size_t g_gpu_smem_threshold
Initial value:
{
4096}

Definition at line 142 of file Execute.cpp.

Referenced by CommandLineOptions::fillDeveloperOptions().

size_t g_hashtable_cache_total_bytes {size_t(1) << 32}

Definition at line 164 of file Execute.cpp.

Referenced by CommandLineOptions::parse_command_line().

size_t g_in_clause_num_elem_skip_bitmap {100}
bool g_inner_join_fragment_skipping {true}

Definition at line 98 of file Execute.cpp.

Referenced by Executor::createKernels(), and CommandLineOptions::fillOptions().

size_t g_max_cacheable_hashtable_size_bytes {size_t(1) << 31}

Definition at line 165 of file Execute.cpp.

Referenced by CommandLineOptions::parse_command_line().

size_t g_max_cacheable_query_resultset_size_bytes {size_t(1) << 31}
size_t g_max_memory_allocation_size {2000000000}
size_t g_min_memory_allocation_size
Initial value:
{
256}

Definition at line 129 of file Execute.cpp.

Referenced by create_dev_group_by_buffers(), and CommandLineOptions::fillDeveloperOptions().

bool g_null_div_by_zero {false}
size_t g_num_tuple_threshold_switch_to_baseline {100000}
bool g_optimize_cuda_block_and_grid_sizes {false}
bool g_optimize_row_initialization {true}
unsigned g_pending_query_interrupt_freq {1000}
size_t g_preflight_count_query_threshold {1000000}
size_t g_query_resultset_cache_total_bytes {size_t(1) << 32}
size_t g_ratio_num_hash_entry_to_num_tuple_switch_to_baseline {100}
double g_running_query_interrupt_freq {0.1}
bool g_strip_join_covered_quals {false}
size_t g_watchdog_in_clause_max_num_elem_non_bitmap {10000}
size_t g_watchdog_in_clause_max_num_input_rows {5000000}
size_t g_watchdog_max_projected_rows_per_device {128000000}
size_t g_watchdog_none_encoded_string_translation_limit {1000000UL}
std::unique_ptr<llvm::Module> udf_cpu_module
std::unique_ptr<llvm::Module> udf_gpu_module