Class QueryRunner::QueryRunner

class QueryRunner

Subclassed by QueryRunner::ImportDriver

Public Functions

std::shared_ptr<Catalog_Namespace::SessionInfo> getSession() const
void addSessionId(const std::string &session_id, ExecutorDeviceType device_type = ExecutorDeviceType::GPU)
void clearSessionId()
std::shared_ptr<Catalog_Namespace::Catalog> getCatalog() const
std::shared_ptr<Calcite> getCalcite() const
std::shared_ptr<Executor> getExecutor() const
Catalog_Namespace::UserMetadata &getUserMetadata() const
bool gpusPresent() const
void clearGpuMemory() const
void clearCpuMemory() const
std::vector<MemoryInfo> getMemoryInfo(const Data_Namespace::MemoryLevel memory_level) const
BufferPoolStats getBufferPoolStats(const Data_Namespace::MemoryLevel memory_level, const bool current_db_only) const
std::unique_ptr<Parser::DDLStmt> createDDLStatement(const std::string &stmt_str_in)
void runDDLStatement(const std::string &stmt_str_in)
void validateDDLStatement(const std::string &stmt_str_in)
std::shared_ptr<ResultSet> runSQL(const std::string &query_str, CompilationOptions co, ExecutionOptions eo)
std::shared_ptr<ExecutionResult> runSelectQuery(const std::string &query_str, CompilationOptions co, ExecutionOptions eo)
std::shared_ptr<ResultSet> runSQL(const std::string &query_str, const ExecutorDeviceType device_type, const bool hoist_literals = true, const bool allow_loop_joins = true)
std::shared_ptr<ExecutionResult> runSelectQuery(const std::string &query_str, const ExecutorDeviceType device_type, const bool hoist_literals, const bool allow_loop_joins, const bool just_explain = false)
std::shared_ptr<ResultSet> runSQLWithAllowingInterrupt(const std::string &query_str, const std::string &session_id, const ExecutorDeviceType device_type, const double running_query_check_freq = 0.9, const unsigned pending_query_check_freq = 1000)
std::vector<std::shared_ptr<ResultSet>> runMultipleStatements(const std::string &sql, const ExecutorDeviceType dt)
void runImport(Parser::CopyTableStmt *import_stmt)
std::unique_ptr<import_export::Loader> getLoader(const TableDescriptor *td) const
RegisteredQueryHint getParsedQueryHint(const std::string &query_str)
std::optional<std::unordered_map<size_t, std::unordered_map<unsigned, RegisteredQueryHint>>> getParsedQueryHints(const std::string &query_str)
std::shared_ptr<const RelAlgNode> getRootNodeFromParsedQuery(const std::string &query_str)
std::optional<RegisteredQueryHint> getParsedGlobalQueryHints(const std::string &query_str)
RaExecutionSequence getRaExecutionSequence(const std::string &query_str)
std::tuple<QueryPlanHash, std::shared_ptr<HashTable>, std::optional<HashtableCacheMetaInfo>> getCachedHashtableWithoutCacheKey(std::set<size_t> &visited, CacheItemType hash_table_type, DeviceIdentifier device_identifier)
std::shared_ptr<CacheItemMetric> getCacheItemMetric(QueryPlanHash cache_key, CacheItemType hash_table_type, DeviceIdentifier device_identifier)
size_t getNumberOfCachedItem(CacheItemStatus item_status, CacheItemType hash_table_type, bool with_overlaps_tuning_param = false) const
void resizeDispatchQueue(const size_t num_executors)
QueryPlanDagInfo getQueryInfoForDataRecyclerTest(const std::string &query_str)
std::shared_ptr<RelAlgTranslator> getRelAlgTranslator(const std::string &query_str, Executor *executor)
ExtractedQueryPlanDag extractQueryPlanDag(const std::string &query_str)
QueryRunner(std::unique_ptr<Catalog_Namespace::SessionInfo> session)
virtual ~QueryRunner()
void setExplainType(const ExecutorExplainType explain_type)

Public Static Functions

QueryRunner *init(const char *db_path, const std::string &udf_filename = "", const size_t max_gpu_mem = 0, const int reserved_gpu_mem = 256 << 20)
QueryRunner *init(const File_Namespace::DiskCacheConfig *disk_cache_config, const char *db_path, const std::vector<LeafHostInfo> &string_servers = {}, const std::vector<LeafHostInfo> &leaf_servers = {})
static QueryRunner *init(const char *db_path, const std::vector<LeafHostInfo> &string_servers, const std::vector<LeafHostInfo> &leaf_servers)
QueryRunner *init(const char *db_path, const std::string &user, const std::string &pass, const std::string &db_name, const std::vector<LeafHostInfo> &string_servers, const std::vector<LeafHostInfo> &leaf_servers, const std::string &udf_filename = "", bool uses_gpus = true, const size_t max_gpu_mem = 0, const int reserved_gpu_mem = 256 << 20, const bool create_user = false, const bool create_db = false, const File_Namespace::DiskCacheConfig *config = nullptr)
static QueryRunner *init(std::unique_ptr<Catalog_Namespace::SessionInfo> &session)
static QueryRunner *get()
void reset()
ExecutionOptions defaultExecutionOptionsForRunSQL(bool allow_loop_joins = true, bool just_explain = false)
template<typename ...Ts>
static std::shared_ptr<query_state::QueryState> create_query_state(Ts&&... args)

Public Static Attributes

query_state::QueryStates query_states_

Protected Functions

QueryRunner(const char *db_path, const std::string &user, const std::string &pass, const std::string &db_name, const std::vector<LeafHostInfo> &string_servers, const std::vector<LeafHostInfo> &leaf_servers, const std::string &udf_filename, bool uses_gpus, const size_t max_gpu_mem, const int reserved_gpu_mem, const bool create_user, const bool create_db, const File_Namespace::DiskCacheConfig *disk_cache_config = nullptr)

Protected Attributes

ExecutorExplainType explain_type_ = ExecutorExplainType::Default
Catalog_Namespace::DBMetadata db_metadata_
std::shared_ptr<Catalog_Namespace::SessionInfo> session_info_
std::unique_ptr<QueryDispatchQueue> dispatch_queue_
std::shared_ptr<Data_Namespace::DataMgr> data_mgr_

Protected Static Attributes

std::unique_ptr<QueryRunner> qr_instance_ = nullptr