OmniSciDB
a5dc49c757
|
#include <algorithm>
#include <atomic>
#include <condition_variable>
#include <cstddef>
#include <cstdlib>
#include <deque>
#include <functional>
#include <limits>
#include <map>
#include <mutex>
#include <queue>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#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 "QueryEngine/AggregatedColRange.h"
#include "QueryEngine/BufferCompaction.h"
#include "QueryEngine/CartesianProduct.h"
#include "QueryEngine/CgenState.h"
#include "QueryEngine/CodeCache.h"
#include "QueryEngine/CodeCacheAccessor.h"
#include "QueryEngine/CompilationOptions.h"
#include "QueryEngine/DateTimeUtils.h"
#include "QueryEngine/Descriptors/QueryCompilationDescriptor.h"
#include "QueryEngine/Descriptors/QueryFragmentDescriptor.h"
#include "QueryEngine/ExecutionKernel.h"
#include "QueryEngine/ExecutorResourceMgr/ExecutorResourceMgr.h"
#include "QueryEngine/ExternalCacheInvalidators.h"
#include "QueryEngine/GpuSharedMemoryContext.h"
#include "QueryEngine/GroupByAndAggregate.h"
#include "QueryEngine/JoinHashTable/HashJoin.h"
#include "QueryEngine/LoopControlFlow/JoinLoop.h"
#include "QueryEngine/NvidiaKernel.h"
#include "QueryEngine/PlanState.h"
#include "QueryEngine/QueryPlanDagCache.h"
#include "QueryEngine/RelAlgExecutionUnit.h"
#include "QueryEngine/RelAlgTranslator.h"
#include "QueryEngine/ResultSetRecyclerHolder.h"
#include "QueryEngine/StringDictionaryGenerations.h"
#include "QueryEngine/TableGenerations.h"
#include "QueryEngine/TargetMetaInfo.h"
#include "QueryEngine/WindowContext.h"
#include "DataMgr/Chunk/Chunk.h"
#include "Logger/Logger.h"
#include "Shared/DbObjectKeys.h"
#include "Shared/LruCache.h"
#include "Shared/SystemParameters.h"
#include "Shared/funcannotations.h"
#include "Shared/heavyai_shared_mutex.h"
#include "Shared/measure.h"
#include "Shared/thread_count.h"
#include "Shared/toString.h"
#include "StringDictionary/StringDictionary.h"
#include "StringDictionary/StringDictionaryProxy.h"
#include "ThriftHandler/CommandLineOptions.h"
Go to the source code of this file.
Classes | |
class | QuerySessionStatus |
class | WatchdogException |
class | CompilationRetryNoLazyFetch |
class | CompilationRetryNewScanLimit |
class | TooManyLiterals |
class | CompilationRetryNoCompaction |
class | QueryMustRunOnCpu |
class | ParseIRError |
class | StringConstInResultSet |
struct | TableUpdateMetadata |
class | UpdateLogForFragment |
struct | CardinalityCacheKey |
struct | std::hash< CardinalityCacheKey > |
class | Executor |
struct | Executor::JoinHashTableOrError |
struct | Executor::GroupColLLVMValue |
class | Executor::CgenStateManager |
class | Executor::FetchCacheAnchor |
struct | Executor::ExecutorMutexHolder |
Namespaces | |
ExecutorResourceMgr_Namespace | |
std | |
foreign_storage | |
Typedefs | |
using | QueryCompilationDescriptorOwned = std::unique_ptr< QueryCompilationDescriptor > |
using | QueryMemoryDescriptorOwned = std::unique_ptr< QueryMemoryDescriptor > |
using | QuerySessionId = std::string |
using | CurrentQueryStatus = std::pair< QuerySessionId, std::string > |
using | InterruptFlagMap = std::map< QuerySessionId, bool > |
using | QuerySessionMap = std::map< const QuerySessionId, std::map< std::string, QuerySessionStatus >> |
using | RowDataProvider = Fragmenter_Namespace::RowDataProvider |
using | ColumnToFragmentsMap = std::map< const ColumnDescriptor *, std::set< int32_t >> |
using | TableToFragmentIds = std::map< int32_t, std::set< int32_t >> |
using | LLVMValueVector = std::vector< llvm::Value * > |
Enumerations | |
enum | FragmentSkipStatus { SKIPPABLE, NOT_SKIPPABLE, INVALID } |
Functions | |
llvm::Value * | get_arg_by_name (llvm::Function *func, const std::string &name) |
llvm::Value * | get_arg_by_index (llvm::Function *func, unsigned const index) |
unsigned | get_index_by_name (llvm::Function *func, const std::string &name) |
uint32_t | log2_bytes (const uint32_t bytes) |
const ColumnDescriptor * | get_column_descriptor (const shared::ColumnKey &column_key) |
const Analyzer::Expr * | extract_cast_arg (const Analyzer::Expr *expr) |
std::string | numeric_type_name (const SQLTypeInfo &ti) |
const ColumnDescriptor * | get_column_descriptor_maybe (const shared::ColumnKey &column_key) |
const ResultSetPtr & | get_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) |
std::ostream & | operator<< (std::ostream &, FetchResult const &) |
std::string | get_null_check_suffix (const SQLTypeInfo &lhs_ti, const SQLTypeInfo &rhs_ti) |
bool | is_unnest (const Analyzer::Expr *expr) |
bool | is_constructed_point (const Analyzer::Expr *expr) |
size_t | get_loop_join_size (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) |
RUNTIME_EXPORT void | register_buffer_with_executor_rsm (int64_t exec, int8_t *buffer) |
const Analyzer::Expr * | remove_cast_to_int (const Analyzer::Expr *expr) |
std::string | toString (const Executor::ExtModuleKinds &kind) |
void | foreign_storage::populate_string_dictionary (int32_t table_id, int32_t col_id, int32_t db_id) |
using ColumnToFragmentsMap = std::map<const ColumnDescriptor*, std::set<int32_t>> |
using CurrentQueryStatus = std::pair<QuerySessionId, std::string> |
using InterruptFlagMap = std::map<QuerySessionId, bool> |
using LLVMValueVector = std::vector<llvm::Value*> |
using QueryCompilationDescriptorOwned = std::unique_ptr<QueryCompilationDescriptor> |
using QueryMemoryDescriptorOwned = std::unique_ptr<QueryMemoryDescriptor> |
using QuerySessionId = std::string |
using QuerySessionMap = std::map<const QuerySessionId, std::map<std::string, QuerySessionStatus>> |
using TableToFragmentIds = std::map<int32_t, std::set<int32_t>> |
enum FragmentSkipStatus |
Enumerator | |
---|---|
SKIPPABLE | |
NOT_SKIPPABLE | |
INVALID |
|
inline |
Definition at line 222 of file Execute.h.
References kCAST.
Referenced by CodeGenerator::codegen(), CodeGenerator::createInValuesBitmap(), and anonymous_namespace{ExpressionRewrite.cpp}::OrToInVisitor::visitBinOper().
|
inline |
|
inline |
Definition at line 168 of file Execute.h.
References CHECK, and setup::name.
Referenced by GroupByAndAggregate::codegen(), TargetExprCodegen::codegenAggregate(), CodeGenerator::codegenFunctionOper(), HashJoin::codegenHashTableLoad(), PerfectJoinHashTable::codegenHashTableLoad(), CodeGenerator::codegenHoistedConstantsLoads(), GroupByAndAggregate::codegenOutputSlot(), CodeGenerator::codegenRowId(), GroupByAndAggregate::getAdditionalLiteral(), Executor::preloadFragOffsets(), query_group_by_template(), and query_template().
std::unordered_set<int> get_available_gpus | ( | const Catalog_Namespace::Catalog & | cat | ) |
|
inline |
Definition at line 213 of file Execute.h.
References CHECK, CHECK_GT, shared::ColumnKey::db_id, Catalog_Namespace::get_metadata_for_column(), and shared::ColumnKey::table_id.
Referenced by CodeGenerator::codegenColVar(), CodeGenerator::codegenGeoColumnVar(), spatial_type::NPoints::codegenLoads(), RelAlgExecutor::executeSimpleInsert(), get_column_descriptor_maybe(), Executor::getColLazyFetchInfo(), ColumnFetcher::getOneTableColumnFragment(), spatial_type::NRings::getOperand(), spatial_type::NPoints::getOperand(), spatial_type::NumGeometries::getOperand(), PlanState::isLazyFetchColumn(), RelAlgExecutor::isRowidLookup(), ColumnFetcher::linearizeColumnFragments(), and Executor::skipFragment().
|
inline |
Definition at line 241 of file Execute.h.
References get_column_descriptor(), and shared::ColumnKey::table_id.
Referenced by anonymous_namespace{GroupByAndAggregate.cpp}::expr_is_rowid(), BoundingBoxIntersectJoinHashTable::fetchColumnsForDevice(), PerfectJoinHashTable::fetchColumnsForDevice(), BaselineJoinHashTable::fetchColumnsForDevice(), Executor::getColLazyFetchInfo(), Executor::getColumnDescriptor(), ColumnFetcher::getOneColumnFragment(), Executor::getPhysicalColumnDescriptor(), needs_dictionary_translation(), HashJoin::normalizeColumnPair(), anonymous_namespace{QueryMemoryDescriptor.cpp}::target_expr_proj_indices(), and anonymous_namespace{Execute.cpp}::try_get_column_descriptor().
|
inline |
Definition at line 254 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 HashJoin::normalizeColumnPair().
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().
|
inline |
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().
|
inline |
Definition at line 1661 of file Execute.h.
References CHECK, and SQLTypeInfo::get_notnull().
Referenced by CodeGenerator::codegenCmp(), CodeGenerator::codegenDeciDiv(), CodeGenerator::codegenFpArith(), CodeGenerator::codegenIntArith(), and CodeGenerator::codegenStrCmp().
|
inline |
Definition at line 246 of file Execute.h.
References CHECK, and CHECK_LT.
Referenced by anonymous_namespace{ExternalExecutor.cpp}::create_table_schema(), RelAlgExecutor::executeDelete(), RelAlgExecutor::executeProject(), RelAlgExecutor::executeUpdate(), get_column_type(), get_table_cardinality(), ColumnFetcher::getOneColumnFragment(), and ColumnFetcher::getResultSetColumn().
|
inline |
Definition at line 1682 of file Execute.h.
References Analyzer::UOper::get_operand(), and kCAST.
Referenced by anonymous_namespace{FromTableReordering.cpp}::get_join_qual_cost(), CodeGenerator::hashJoinLhs(), CodeGenerator::needCastForHashJoinLhs(), HashJoin::normalizeColumnPair(), and translate_bounding_box_intersect_with_reordering().
|
inline |
Definition at line 1677 of file Execute.h.
References Analyzer::UOper::get_optype(), and kUNNEST.
Referenced by CodeGenerator::codegen(), and CodeGenerator::codegenCmp().
|
inline |
Definition at line 198 of file Execute.h.
Referenced by CodeGenerator::codegen(), GroupByAndAggregate::codegenAggArg(), CodeGenerator::codegenFunctionOperCastArgs(), CodeGenerator::codegenGeoArgs(), spatial_type::PointN::codegenGeoSize(), spatial_type::Centroid::codegenLoads(), spatial_type::Distance::codegenLoads(), spatial_type::AreaPerimeter::codegenLoads(), spatial_type::StartEndPoint::codegenLoads(), spatial_type::NPoints::codegenLoads(), spatial_type::NRings::codegenLoads(), spatial_type::NumGeometries::codegenLoads(), and Executor::groupByColumnCodegen().
|
inline |
Definition at line 230 of file Execute.h.
References CHECK, SQLTypeInfo::get_compression(), SQLTypeInfo::get_logical_size(), SQLTypeInfo::get_type(), SQLTypeInfo::is_boolean(), SQLTypeInfo::is_decimal(), SQLTypeInfo::is_fp(), SQLTypeInfo::is_integer(), SQLTypeInfo::is_string(), SQLTypeInfo::is_time(), SQLTypeInfo::is_timeinterval(), kDOUBLE, kENCODING_DICT, and to_string().
Referenced by TargetExprCodegen::codegenAggregate(), 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().
std::ostream& operator<< | ( | std::ostream & | , |
FetchResult const & | |||
) |
Definition at line 3452 of file Execute.cpp.
References FetchResult::col_buffers, FetchResult::frag_offsets, FetchResult::num_rows, and shared::printContainer().
RUNTIME_EXPORT void register_buffer_with_executor_rsm | ( | int64_t | exec, |
int8_t * | buffer | ||
) |
Definition at line 232 of file ExtensionsIR.cpp.
const Analyzer::Expr* remove_cast_to_int | ( | const Analyzer::Expr * | expr | ) |
Definition at line 618 of file ColumnIR.cpp.
References Analyzer::Expr::get_type_info(), and kCAST.
Referenced by anonymous_namespace{DateTimePlusRewrite.cpp}::get_dt_field(), CodeGenerator::hashJoinLhs(), and CodeGenerator::needCastForHashJoinLhs().
|
inline |
Definition at line 1703 of file Execute.h.
References logger::FATAL, LOG, Executor::rt_geos_module, Executor::rt_libdevice_module, Executor::rt_udf_cpu_module, Executor::rt_udf_gpu_module, Executor::template_module, Executor::udf_cpu_module, and Executor::udf_gpu_module.
Referenced by anonymous_namespace{SerializeToSql.cpp}::agg_to_string(), WindowFunctionContext::buildAggregationTreeForPartition(), CardinalityCacheKey::CardinalityCacheKey(), org.apache.calcite.sql.validate.SqlValidatorImpl::checkRollUp(), DBHandler::clear_gpu_memory(), DBHandler::clearRenderMemory(), DBHandler::clone_session(), StringDictionaryTranslationMgr::codegen(), CodeGenerator::codegenCastNonStringToString(), CodeGenerator::codegenFunctionOperCastArgs(), CodeGenerator::codegenHoistedConstantsLoads(), CodeGenerator::codegenPerRowStringOper(), WindowFunctionContext::compute(), WindowFunctionContext::computeAggregateTreeCacheKey(), DBHandler::connect(), DBHandler::connect_impl(), DBHandler::create_custom_expression(), DBHandler::create_dashboard(), DBHandler::create_link(), DBHandler::create_table(), ct_make_multipolygon__cpu_(), ct_make_polygon3__cpu_(), ct_to_multilinestring__cpu_(), ct_to_polygon__cpu_(), dateTimeParse(), DBHandler::delete_custom_expressions(), DBHandler::delete_dashboards(), DBHandler::detect_column_types(), DBHandler::disconnect(), anonymous_namespace{ResultSetReductionJIT.cpp}::emit_aggregate_one_nullable_value(), Parser::CopyTableStmt::execute(), Executor::executeWorkUnitImpl(), QueryPlanDagExtractor::extractQueryPlanDagImpl(), DBHandler::get_all_files_in_archive(), DBHandler::get_custom_expressions(), DBHandler::get_dashboard(), DBHandler::get_dashboard_grantees(), DBHandler::get_dashboards(), DBHandler::get_databases(), DBHandler::get_device_parameters(), DBHandler::get_first_geo_file_in_archive(), DBHandler::get_hardware_info(), Geo::get_input_srid(), DBHandler::get_internal_table_details(), DBHandler::get_internal_table_details_for_database(), Geo::get_is_geoint(), DBHandler::get_layers_in_geo_file(), DBHandler::get_link_view(), anonymous_namespace{TableFunctionCompilationContext.cpp}::get_llvm_type_from_sql_column_type(), DBHandler::get_memory(), get_node_output(), Geo::get_output_srid(), DBHandler::get_physical_tables(), DBHandler::get_result_row_for_pixel(), DBHandler::get_server_status(), DBHandler::get_session_info(), DBHandler::get_status(), DBHandler::get_table_details(), DBHandler::get_table_details_for_database(), DBHandler::get_table_epoch(), DBHandler::get_table_epoch_by_name(), DBHandler::get_table_epochs(), DBHandler::get_tables(), DBHandler::get_tables_for_database(), DBHandler::get_tables_meta(), DBHandler::get_users(), DBHandler::get_views(), Column< GeoPoint >::getItem(), DBHandler::getQueries(), QueryPlanDagExtractor::handleLeftDeepJoinTree(), hash_value(), DBHandler::import_table(), DBHandler::import_table_status(), import_export::Importer::importGDALGeo(), import_export::Importer::importGDALRaster(), DBHandler::importGeoTableSingle(), DBHandler::interrupt(), DBHandler::invalidate_cur_session(), Column< GeoPoint >::isNull(), DBHandler::load_table(), DBHandler::load_table_binary(), DBHandler::load_table_binary_columnar(), org.apache.calcite.rel.rules.OuterJoinOptViaNullRejectionRule::onMatch(), operator<<(), anonymous_namespace{Datum.cpp}::parseInteger(), DBHandler::pause_executor_queue(), com.mapd.parser.server.CalciteServerHandler::process(), ResultSetStorage::reduceOneSlot(), DBHandler::register_runtime_extension_functions(), org.apache.calcite.sql.validate.SqlValidatorImpl::registerFrom(), QueryPlanDagExtractor::registerNodeToDagCache(), DBHandler::render_vega(), DBHandler::replace_dashboard(), DBHandler::resume_executor_queue(), DBHandler::set_cur_session(), DBHandler::set_execution_mode(), DBHandler::set_table_epoch(), DBHandler::set_table_epoch_by_name(), DBHandler::set_table_epochs(), Column< GeoPoint >::setItem(), Column< GeoPoint >::setNull(), DBHandler::shareOrUnshareDashboards(), DBHandler::sql_execute(), DBHandler::sql_validate(), spatial_type::suffix(), DBHandler::switch_database(), com.mapd.calcite.parser.HeavyDBParser::tableAliasFinder(), GDALTableFunctions::tf_raster_contour_impl(), toString(), Column< TextEncodingDict >::toString(), ColumnList< T >::toString(), ColumnList< Array< T > >::toString(), ColumnList< TextEncodingDict >::toString(), toStringImpl(), RelAlgTranslator::translateAggregateRex(), RelAlgTranslator::translateInOper(), RelAlgTranslator::translateWindowFunction(), tree_string(), DBHandler::update_custom_expression(), Executor::update_extension_modules(), org.apache.calcite.sql.validate.SqlValidatorImpl::validateAccess(), and ScalarExprToSql::visitWindowFunction().