OmniSciDB  ba1bac9284
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
QueryRunner::QueryRunner Class Reference

#include <QueryRunner.h>

+ Inheritance diagram for QueryRunner::QueryRunner:
+ Collaboration diagram for QueryRunner::QueryRunner:

Public Member 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< CalcitegetCalcite () const
 
std::shared_ptr< ExecutorgetExecutor () const
 
Catalog_Namespace::UserMetadatagetUserMetadata () const
 
bool gpusPresent () const
 
virtual void clearGpuMemory () const
 
virtual void clearCpuMemory () const
 
virtual void runDDLStatement (const std::string &)
 
virtual std::shared_ptr
< ResultSet
runSQL (const std::string &query_str, CompilationOptions co, ExecutionOptions eo)
 
virtual std::shared_ptr
< ExecutionResult
runSelectQuery (const std::string &query_str, CompilationOptions co, ExecutionOptions eo)
 
virtual 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)
 
virtual 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)
 
virtual 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)
 
virtual std::vector
< std::shared_ptr< ResultSet > > 
runMultipleStatements (const std::string &, const ExecutorDeviceType)
 
virtual RegisteredQueryHint getParsedQueryHint (const std::string &)
 
virtual void runImport (Parser::CopyTableStmt *import_stmt)
 
virtual std::unique_ptr
< import_export::Loader
getLoader (const TableDescriptor *td) const
 
const int32_t * getCachedJoinHashTable (size_t idx)
 
const int8_t * getCachedBaselineHashTable (size_t idx)
 
size_t getEntryCntCachedBaselineHashTable (size_t idx)
 
size_t getNumberOfCachedJoinHashTables ()
 
size_t getNumberOfCachedBaselineJoinHashTables ()
 
size_t getNumberOfCachedOverlapsHashTables ()
 
void resizeDispatchQueue (const size_t num_executors)
 
 QueryRunner (std::unique_ptr< Catalog_Namespace::SessionInfo > session)
 
virtual ~QueryRunner ()
 

Static Public Member Functions

static QueryRunnerinit (const char *db_path, const std::string &udf_filename="", const size_t max_gpu_mem=0, const int reserved_gpu_mem=256<< 20)
 
static QueryRunnerinit (const File_Namespace::DiskCacheConfig *disk_cache_config, const char *db_path, const std::vector< LeafHostInfo > &string_servers={}, const std::vector< LeafHostInfo > &leaf_servers={})
 
static QueryRunnerinit (const char *db_path, const std::vector< LeafHostInfo > &string_servers, const std::vector< LeafHostInfo > &leaf_servers)
 
static QueryRunnerinit (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 QueryRunnerinit (std::unique_ptr< Catalog_Namespace::SessionInfo > &session)
 
static QueryRunnerget ()
 
static void reset ()
 
static 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)
 

Static Public Attributes

static query_state::QueryStates query_states_
 

Protected Member 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

std::shared_ptr
< Catalog_Namespace::SessionInfo
session_info_
 
std::unique_ptr
< QueryDispatchQueue
dispatch_queue_
 
std::shared_ptr
< Data_Namespace::DataMgr
data_mgr_
 

Static Protected Attributes

static std::unique_ptr
< QueryRunner
qr_instance_ = nullptr
 

Detailed Description

Definition at line 59 of file QueryRunner.h.

Constructor & Destructor Documentation

QueryRunner::QueryRunner::QueryRunner ( std::unique_ptr< Catalog_Namespace::SessionInfo session)

Referenced by init().

+ Here is the caller graph for this function:

QueryRunner::QueryRunner::~QueryRunner ( )
virtual

Definition at line 244 of file QueryRunner.cpp.

References Executor::nukeCacheOfExecutors().

244  {
246 }
static void nukeCacheOfExecutors()
Definition: Execute.h:381

+ Here is the call graph for this function:

QueryRunner::QueryRunner::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

Definition at line 149 of file QueryRunner.cpp.

References ExtensionFunctionsWhitelist::add(), ExtensionFunctionsWhitelist::addUdfs(), SystemParameters::aggregator, anonymous_namespace{QueryRunner.cpp}::calcite_shutdown_handler(), CALCITEPORT, cat(), CHECK, data_mgr_, Catalog_Namespace::DBMetadata::dbOwner, File_Namespace::fsi, g_base_path, anonymous_namespace{QueryRunner.cpp}::g_calcite, g_serialize_temp_tables, table_functions::TableFunctionsFactory::get_table_funcs(), GPU, SystemParameters::gpu_buffer_mem_bytes, table_functions::TableFunctionsFactory::init(), Catalog_Namespace::SysCatalog::instance(), Catalog_Namespace::UserMetadata::isSuper, OMNISCI_DEFAULT_DB, Catalog_Namespace::UserMetadata::passwd_hash, session_info_, logger::set_once_fatal_func(), anonymous_namespace{QueryRunner.cpp}::setup_signal_handler(), ThriftSerializers::to_thrift(), and Catalog_Namespace::UserMetadata::userId.

162  : dispatch_queue_(std::make_unique<QueryDispatchQueue>(1)) {
164  boost::filesystem::path base_path{db_path};
165  CHECK(boost::filesystem::exists(base_path));
166  auto system_db_file = base_path / "mapd_catalogs" / OMNISCI_DEFAULT_DB;
167  CHECK(boost::filesystem::exists(system_db_file));
168  auto data_dir = base_path / "mapd_data";
169  File_Namespace::DiskCacheConfig disk_cache_config{
170  (base_path / "omnisci_disk_cache").string(), File_Namespace::DiskCacheLevel::fsi};
171  if (cache_config) {
172  disk_cache_config = *cache_config;
173  }
176 
179  g_calcite =
180  std::make_shared<Calcite>(-1, CALCITEPORT, db_path, 1024, 5000, true, udf_filename);
181  ExtensionFunctionsWhitelist::add(g_calcite->getExtensionFunctionWhitelist());
182  if (!udf_filename.empty()) {
183  ExtensionFunctionsWhitelist::addUdfs(g_calcite->getUserDefinedFunctionWhitelist());
184  }
185 
187  auto udtfs = ThriftSerializers::to_thrift(
189  std::vector<TUserDefinedFunction> udfs = {};
190  g_calcite->setRuntimeExtensionFunctions(udfs, udtfs, /*is_runtime=*/false);
191 
192  std::unique_ptr<CudaMgr_Namespace::CudaMgr> cuda_mgr;
193 #ifdef HAVE_CUDA
194  if (uses_gpus) {
195  cuda_mgr = std::make_unique<CudaMgr_Namespace::CudaMgr>(-1, 0);
196  }
197 #else
198  uses_gpus = false;
199 #endif
200  SystemParameters mapd_params;
201  mapd_params.gpu_buffer_mem_bytes = max_gpu_mem;
202  mapd_params.aggregator = !leaf_servers.empty();
203 
204  data_mgr_.reset(new Data_Namespace::DataMgr(data_dir.string(),
205  mapd_params,
206  std::move(cuda_mgr),
207  uses_gpus,
208  reserved_gpu_mem,
209  0,
210  disk_cache_config));
211 
212  auto& sys_cat = Catalog_Namespace::SysCatalog::instance();
213 
214  g_base_path = base_path.string();
215  sys_cat.init(g_base_path,
216  data_mgr_,
217  {},
218  g_calcite,
219  false,
220  mapd_params.aggregator,
221  string_servers);
222 
223  if (create_user) {
224  if (!sys_cat.getMetadataForUser(user_name, user)) {
225  sys_cat.createUser(user_name, passwd, false, "", true);
226  }
227  }
228  CHECK(sys_cat.getMetadataForUser(user_name, user));
229  CHECK(bcrypt_checkpw(passwd.c_str(), user.passwd_hash.c_str()) == 0);
230 
231  if (create_db) {
232  if (!sys_cat.getMetadataForDB(db_name, db)) {
233  sys_cat.createDatabase(db_name, user.userId);
234  }
235  }
236  CHECK(sys_cat.getMetadataForDB(db_name, db));
237  CHECK(user.isSuper || (user.userId == db.dbOwner));
238  auto cat = sys_cat.getCatalog(db, create_db);
239  CHECK(cat);
240  session_info_ = std::make_unique<Catalog_Namespace::SessionInfo>(
241  cat, user, ExecutorDeviceType::GPU, "");
242 }
static void addUdfs(const std::string &json_func_sigs)
#define CALCITEPORT
Definition: QueryRunner.cpp:44
std::string cat(Ts &&...args)
std::unique_ptr< QueryDispatchQueue > dispatch_queue_
Definition: QueryRunner.h:215
static void add(const std::string &json_func_sigs)
void set_once_fatal_func(FatalFunc fatal_func)
Definition: Logger.cpp:307
static SysCatalog & instance()
Definition: SysCatalog.h:292
std::string g_base_path
Definition: SysCatalog.cpp:62
const std::string OMNISCI_DEFAULT_DB
Definition: SysCatalog.h:59
bool g_serialize_temp_tables
Definition: Catalog.cpp:98
TExtArgumentType::type to_thrift(const ExtArgumentType &t)
std::shared_ptr< Catalog_Namespace::SessionInfo > session_info_
Definition: QueryRunner.h:214
std::shared_ptr< Calcite > g_calcite
Definition: QueryRunner.cpp:58
#define CHECK(condition)
Definition: Logger.h:206
static std::vector< TableFunction > get_table_funcs(const std::string &name, const bool is_gpu)
std::shared_ptr< Data_Namespace::DataMgr > data_mgr_
Definition: QueryRunner.h:216
std::atomic< bool > isSuper
Definition: SysCatalog.h:99

+ Here is the call graph for this function:

Member Function Documentation

void QueryRunner::QueryRunner::addSessionId ( const std::string &  session_id,
ExecutorDeviceType  device_type = ExecutorDeviceType::GPU 
)
inline

Definition at line 114 of file QueryRunner.h.

References session_info_.

115  {
116  session_info_ =
117  std::make_unique<Catalog_Namespace::SessionInfo>(session_info_->get_catalog_ptr(),
118  session_info_->get_currentUser(),
119  device_type,
120  session_id);
121  }
std::shared_ptr< Catalog_Namespace::SessionInfo > session_info_
Definition: QueryRunner.h:214
void QueryRunner::QueryRunner::clearCpuMemory ( ) const
virtual

Definition at line 276 of file QueryRunner.cpp.

References CHECK, Executor::clearMemory(), Data_Namespace::CPU_LEVEL, and Catalog_Namespace::SysCatalog::instance().

276  {
279 }
static void clearMemory(const Data_Namespace::MemoryLevel memory_level)
Definition: Execute.cpp:188
static SysCatalog & instance()
Definition: SysCatalog.h:292
#define CHECK(condition)
Definition: Logger.h:206

+ Here is the call graph for this function:

void QueryRunner::QueryRunner::clearGpuMemory ( ) const
virtual

Definition at line 271 of file QueryRunner.cpp.

References CHECK, Executor::clearMemory(), Data_Namespace::GPU_LEVEL, and Catalog_Namespace::SysCatalog::instance().

271  {
274 }
static void clearMemory(const Data_Namespace::MemoryLevel memory_level)
Definition: Execute.cpp:188
static SysCatalog & instance()
Definition: SysCatalog.h:292
#define CHECK(condition)
Definition: Logger.h:206

+ Here is the call graph for this function:

void QueryRunner::QueryRunner::clearSessionId ( )
inline

Definition at line 123 of file QueryRunner.h.

References session_info_.

123 { session_info_ = nullptr; }
std::shared_ptr< Catalog_Namespace::SessionInfo > session_info_
Definition: QueryRunner.h:214
template<typename... Ts>
static std::shared_ptr<query_state::QueryState> QueryRunner::QueryRunner::create_query_state ( Ts &&...  args)
inlinestatic

Definition at line 194 of file QueryRunner.h.

References run_benchmark_import::args, query_state::QueryStates::create(), and query_states_.

Referenced by getExecutor(), getParsedQueryHint(), runDDLStatement(), runSelectQuery(), runSQL(), and runSQLWithAllowingInterrupt().

194  {
195  return query_states_.create(std::forward<Ts>(args)...);
196  }
static query_state::QueryStates query_states_
Definition: QueryRunner.h:191
CircleBuffer::value_type create(ARGS &&...args)
Definition: QueryState.h:189

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ExecutionOptions QueryRunner::QueryRunner::defaultExecutionOptionsForRunSQL ( bool  allow_loop_joins = true,
bool  just_explain = false 
)
static

Definition at line 395 of file QueryRunner.cpp.

References g_enable_columnar_output, and g_gpu_mem_limit_percent.

Referenced by runSelectQuery(), and runSQL().

396  {
397  return {g_enable_columnar_output,
398  true,
399  just_explain,
400  allow_loop_joins,
401  false,
402  false,
403  false,
404  false,
405  10000,
406  false,
407  false,
409  false,
410  1000};
411 }
bool g_enable_columnar_output
Definition: Execute.cpp:93
double g_gpu_mem_limit_percent
Definition: QueryRunner.cpp:49

+ Here is the caller graph for this function:

static QueryRunner* QueryRunner::QueryRunner::get ( )
inlinestatic

Definition at line 101 of file QueryRunner.h.

References qr_instance_.

101  {
102  if (!qr_instance_) {
103  throw std::runtime_error("QueryRunner must be initialized before calling get().");
104  }
105  return qr_instance_.get();
106  }
static std::unique_ptr< QueryRunner > qr_instance_
Definition: QueryRunner.h:212
const int8_t * QueryRunner::QueryRunner::getCachedBaselineHashTable ( size_t  idx)

Definition at line 716 of file QueryRunner.cpp.

References CHECK, and BaselineJoinHashTable::getHashTableCache().

716  {
717  auto hash_table_cache = BaselineJoinHashTable::getHashTableCache();
718  CHECK(hash_table_cache);
719  auto hash_table = hash_table_cache->getCachedHashTable(idx);
720  CHECK(hash_table);
721  return hash_table->getCpuBuffer();
722 };
static auto * getHashTableCache()
#define CHECK(condition)
Definition: Logger.h:206

+ Here is the call graph for this function:

const int32_t * QueryRunner::QueryRunner::getCachedJoinHashTable ( size_t  idx)

Definition at line 708 of file QueryRunner.cpp.

References CHECK, and PerfectJoinHashTable::getHashTableCache().

708  {
709  auto hash_table_cache = PerfectJoinHashTable::getHashTableCache();
710  CHECK(hash_table_cache);
711  auto hash_table = hash_table_cache->getCachedHashTable(idx);
712  CHECK(hash_table);
713  return reinterpret_cast<int32_t*>(hash_table->getCpuBuffer());
714 };
#define CHECK(condition)
Definition: Logger.h:206

+ Here is the call graph for this function:

std::shared_ptr< Calcite > QueryRunner::QueryRunner::getCalcite ( ) const

Definition at line 261 of file QueryRunner.cpp.

References anonymous_namespace{QueryRunner.cpp}::g_calcite.

261  {
262  // TODO: Embed Calcite shared_ptr ownership in QueryRunner
263  return g_calcite;
264 }
std::shared_ptr< Calcite > g_calcite
Definition: QueryRunner.cpp:58
std::shared_ptr< Catalog_Namespace::Catalog > QueryRunner::QueryRunner::getCatalog ( ) const

Definition at line 256 of file QueryRunner.cpp.

References CHECK, and session_info_.

Referenced by getLoader().

256  {
258  return session_info_->get_catalog_ptr();
259 }
std::shared_ptr< Catalog_Namespace::SessionInfo > session_info_
Definition: QueryRunner.h:214
#define CHECK(condition)
Definition: Logger.h:206

+ Here is the caller graph for this function:

size_t QueryRunner::QueryRunner::getEntryCntCachedBaselineHashTable ( size_t  idx)

Definition at line 724 of file QueryRunner.cpp.

References CHECK, and BaselineJoinHashTable::getHashTableCache().

724  {
725  auto hash_table_cache = BaselineJoinHashTable::getHashTableCache();
726  CHECK(hash_table_cache);
727  auto hash_table = hash_table_cache->getCachedHashTable(idx);
728  CHECK(hash_table);
729  return hash_table->getEntryCount();
730 }
static auto * getHashTableCache()
#define CHECK(condition)
Definition: Logger.h:206

+ Here is the call graph for this function:

std::shared_ptr< Executor > QueryRunner::QueryRunner::getExecutor ( ) const

Definition at line 413 of file QueryRunner.cpp.

References CHECK, create_query_state(), Executor::getExecutor(), Catalog_Namespace::SysCatalog::instance(), session_info_, STDLOG, and Executor::UNITARY_EXECUTOR_ID.

413  {
416  auto query_state = create_query_state(session_info_, "");
417  auto stdlog = STDLOG(query_state);
419  return executor;
420 }
static std::shared_ptr< Executor > getExecutor(const ExecutorId id, const std::string &debug_dir="", const std::string &debug_file="", const SystemParameters &system_parameters=SystemParameters())
Definition: Execute.cpp:166
static SysCatalog & instance()
Definition: SysCatalog.h:292
std::shared_ptr< Catalog_Namespace::SessionInfo > session_info_
Definition: QueryRunner.h:214
static std::shared_ptr< query_state::QueryState > create_query_state(Ts &&...args)
Definition: QueryRunner.h:194
#define CHECK(condition)
Definition: Logger.h:206
#define STDLOG(...)
Definition: QueryState.h:229
static const ExecutorId UNITARY_EXECUTOR_ID
Definition: Execute.h:366

+ Here is the call graph for this function:

std::unique_ptr< import_export::Loader > QueryRunner::QueryRunner::getLoader ( const TableDescriptor td) const
virtual

Definition at line 545 of file QueryRunner.cpp.

References cat(), and getCatalog().

546  {
547  auto cat = getCatalog();
548  return std::make_unique<import_export::Loader>(*cat, td);
549 }
std::string cat(Ts &&...args)
std::shared_ptr< Catalog_Namespace::Catalog > getCatalog() const

+ Here is the call graph for this function:

size_t QueryRunner::QueryRunner::getNumberOfCachedBaselineJoinHashTables ( )

Definition at line 738 of file QueryRunner.cpp.

References CHECK, and BaselineJoinHashTable::getHashTableCache().

738  {
739  auto hash_table_cache = BaselineJoinHashTable::getHashTableCache();
740  CHECK(hash_table_cache);
741  return hash_table_cache->getNumberOfCachedHashTables();
742 };
static auto * getHashTableCache()
#define CHECK(condition)
Definition: Logger.h:206

+ Here is the call graph for this function:

size_t QueryRunner::QueryRunner::getNumberOfCachedJoinHashTables ( )

Definition at line 732 of file QueryRunner.cpp.

References CHECK, and PerfectJoinHashTable::getHashTableCache().

732  {
733  auto hash_table_cache = PerfectJoinHashTable::getHashTableCache();
734  CHECK(hash_table_cache);
735  return hash_table_cache->getNumberOfCachedHashTables();
736 };
#define CHECK(condition)
Definition: Logger.h:206

+ Here is the call graph for this function:

size_t QueryRunner::QueryRunner::getNumberOfCachedOverlapsHashTables ( )

Definition at line 744 of file QueryRunner.cpp.

References OverlapsJoinHashTable::getCombinedHashTableCacheSize().

744  {
746 }
static size_t getCombinedHashTableCacheSize()

+ Here is the call graph for this function:

RegisteredQueryHint QueryRunner::QueryRunner::getParsedQueryHint ( const std::string &  query_str)
virtual

Definition at line 294 of file QueryRunner.cpp.

References cat(), CHECK, create_query_state(), Executor::getExecutor(), RelAlgExecutor::getParsedQueryHints(), Catalog_Namespace::SysCatalog::instance(), pg_shim(), session_info_, and Executor::UNITARY_EXECUTOR_ID.

294  {
297  auto query_state = create_query_state(session_info_, query_str);
298  const auto& cat = session_info_->getCatalog();
300  auto calcite_mgr = cat.getCalciteMgr();
301  const auto query_ra = calcite_mgr
302  ->process(query_state->createQueryStateProxy(),
303  pg_shim(query_str),
304  {},
305  true,
306  false,
307  false,
308  true)
309  .plan_result;
310  auto ra_executor = RelAlgExecutor(executor.get(), cat, query_ra, query_state);
311  const auto& query_hints = ra_executor.getParsedQueryHints();
312  return query_hints;
313 }
std::string cat(Ts &&...args)
static std::shared_ptr< Executor > getExecutor(const ExecutorId id, const std::string &debug_dir="", const std::string &debug_file="", const SystemParameters &system_parameters=SystemParameters())
Definition: Execute.cpp:166
static SysCatalog & instance()
Definition: SysCatalog.h:292
RegisteredQueryHint getParsedQueryHints()
std::shared_ptr< Catalog_Namespace::SessionInfo > session_info_
Definition: QueryRunner.h:214
static std::shared_ptr< query_state::QueryState > create_query_state(Ts &&...args)
Definition: QueryRunner.h:194
#define CHECK(condition)
Definition: Logger.h:206
std::string pg_shim(const std::string &query)
static const ExecutorId UNITARY_EXECUTOR_ID
Definition: Execute.h:366

+ Here is the call graph for this function:

std::shared_ptr<Catalog_Namespace::SessionInfo> QueryRunner::QueryRunner::getSession ( ) const
inline

Definition at line 110 of file QueryRunner.h.

References session_info_.

110  {
111  return session_info_;
112  }
std::shared_ptr< Catalog_Namespace::SessionInfo > session_info_
Definition: QueryRunner.h:214
Catalog_Namespace::UserMetadata& QueryRunner::QueryRunner::getUserMetadata ( ) const
bool QueryRunner::QueryRunner::gpusPresent ( ) const

Definition at line 266 of file QueryRunner.cpp.

References CHECK, and session_info_.

266  {
268  return session_info_->getCatalog().getDataMgr().gpusPresent();
269 }
std::shared_ptr< Catalog_Namespace::SessionInfo > session_info_
Definition: QueryRunner.h:214
#define CHECK(condition)
Definition: Logger.h:206
QueryRunner * QueryRunner::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 
)
static

Definition at line 80 of file QueryRunner.cpp.

References logger::init(), OMNISCI_DEFAULT_DB, and OMNISCI_ROOT_USER.

83  {
84  return QueryRunner::init(db_path,
85  std::string{OMNISCI_ROOT_USER},
86  "HyperInteractive",
87  std::string{OMNISCI_DEFAULT_DB},
88  {},
89  {},
90  udf_filename,
91  true,
92  max_gpu_mem,
93  reserved_gpu_mem);
94 }
void init(LogOptions const &log_opts)
Definition: Logger.cpp:280
const std::string OMNISCI_DEFAULT_DB
Definition: SysCatalog.h:59
const std::string OMNISCI_ROOT_USER
Definition: SysCatalog.h:60

+ Here is the call graph for this function:

QueryRunner * QueryRunner::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

Definition at line 96 of file QueryRunner.cpp.

References logger::init(), OMNISCI_DEFAULT_DB, and OMNISCI_ROOT_USER.

99  {
100  return QueryRunner::init(db_path,
101  std::string{OMNISCI_ROOT_USER},
102  "HyperInteractive",
103  std::string{OMNISCI_DEFAULT_DB},
104  string_servers,
105  leaf_servers,
106  "",
107  true,
108  0,
109  256 << 20,
110  false,
111  false,
112  disk_cache_config);
113 }
void init(LogOptions const &log_opts)
Definition: Logger.cpp:280
const std::string OMNISCI_DEFAULT_DB
Definition: SysCatalog.h:59
const std::string OMNISCI_ROOT_USER
Definition: SysCatalog.h:60

+ Here is the call graph for this function:

static QueryRunner* QueryRunner::QueryRunner::init ( const char *  db_path,
const std::vector< LeafHostInfo > &  string_servers,
const std::vector< LeafHostInfo > &  leaf_servers 
)
inlinestatic

Definition at line 71 of file QueryRunner.h.

References logger::init(), OMNISCI_DEFAULT_DB, and OMNISCI_ROOT_USER.

73  {
74  return QueryRunner::init(db_path,
75  std::string{OMNISCI_ROOT_USER},
76  "HyperInteractive",
77  std::string{OMNISCI_DEFAULT_DB},
78  string_servers,
79  leaf_servers);
80  }
void init(LogOptions const &log_opts)
Definition: Logger.cpp:280
const std::string OMNISCI_DEFAULT_DB
Definition: SysCatalog.h:59
const std::string OMNISCI_ROOT_USER
Definition: SysCatalog.h:60

+ Here is the call graph for this function:

QueryRunner * QueryRunner::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

Definition at line 115 of file QueryRunner.cpp.

References CHECK, ddl_utils::FilePathWhitelist::clear(), logger::FATAL, ddl_utils::FilePathWhitelist::initialize(), and LOG_IF.

127  {
128  // Whitelist root path for tests by default
130  ddl_utils::FilePathWhitelist::initialize(db_path, "[\"/\"]", "[\"/\"]");
131  LOG_IF(FATAL, !leaf_servers.empty()) << "Distributed test runner not supported.";
132  CHECK(leaf_servers.empty());
133  qr_instance_.reset(new QueryRunner(db_path,
134  user,
135  pass,
136  db_name,
137  string_servers,
138  leaf_servers,
139  udf_filename,
140  uses_gpus,
141  max_gpu_mem,
142  reserved_gpu_mem,
143  create_user,
144  create_db,
145  disk_cache_config));
146  return qr_instance_.get();
147 }
static void initialize(const std::string &data_dir, const std::string &allowed_import_paths, const std::string &allowed_export_paths)
Definition: DdlUtils.cpp:690
#define LOG_IF(severity, condition)
Definition: Logger.h:296
QueryRunner(std::unique_ptr< Catalog_Namespace::SessionInfo > session)
static std::unique_ptr< QueryRunner > qr_instance_
Definition: QueryRunner.h:212
#define CHECK(condition)
Definition: Logger.h:206

+ Here is the call graph for this function:

static QueryRunner* QueryRunner::QueryRunner::init ( std::unique_ptr< Catalog_Namespace::SessionInfo > &  session)
inlinestatic

Definition at line 96 of file QueryRunner.h.

References qr_instance_, and QueryRunner().

96  {
97  qr_instance_.reset(new QueryRunner(std::move(session)));
98  return qr_instance_.get();
99  }
QueryRunner(std::unique_ptr< Catalog_Namespace::SessionInfo > session)
static std::unique_ptr< QueryRunner > qr_instance_
Definition: QueryRunner.h:212

+ Here is the call graph for this function:

void QueryRunner::QueryRunner::reset ( )
static

Definition at line 748 of file QueryRunner.cpp.

References anonymous_namespace{QueryRunner.cpp}::calcite_shutdown_handler(), and qr_instance_.

748  {
749  qr_instance_.reset(nullptr);
751 }
static std::unique_ptr< QueryRunner > qr_instance_
Definition: QueryRunner.h:212

+ Here is the call graph for this function:

void QueryRunner::QueryRunner::resizeDispatchQueue ( const size_t  num_executors)

Definition at line 248 of file QueryRunner.cpp.

References dispatch_queue_.

248  {
249  dispatch_queue_ = std::make_unique<QueryDispatchQueue>(num_executors);
250 }
std::unique_ptr< QueryDispatchQueue > dispatch_queue_
Definition: QueryRunner.h:215
void QueryRunner::QueryRunner::runDDLStatement ( const std::string &  stmt_str_in)
virtual

Definition at line 315 of file QueryRunner.cpp.

References QueryRunner::apply_copy_to_shim(), CHECK, CHECK_EQ, create_query_state(), Catalog_Namespace::SysCatalog::instance(), run_benchmark_import::parser, session_info_, and STDLOG.

Referenced by QueryRunner::ImportDriver::importGeoTable(), and runMultipleStatements().

315  {
318 
319  std::string stmt_str = stmt_str_in;
320  // First remove special chars
321  boost::algorithm::trim_left_if(stmt_str, boost::algorithm::is_any_of("\n"));
322  // Then remove spaces
323  boost::algorithm::trim_left(stmt_str);
324 
325  ParserWrapper pw{stmt_str};
326  if (pw.is_copy_to) {
327  stmt_str = apply_copy_to_shim(stmt_str_in);
328  }
329 
330  auto query_state = create_query_state(session_info_, stmt_str);
331  auto stdlog = STDLOG(query_state);
332 
333  SQLParser parser;
334  std::list<std::unique_ptr<Parser::Stmt>> parse_trees;
335  std::string last_parsed;
336  CHECK_EQ(parser.parse(stmt_str, parse_trees, last_parsed), 0) << stmt_str_in;
337  CHECK_EQ(parse_trees.size(), size_t(1));
338  auto stmt = parse_trees.front().get();
339  auto ddl = dynamic_cast<Parser::DDLStmt*>(stmt);
340  CHECK(ddl);
341  ddl->execute(*session_info_);
342 }
#define CHECK_EQ(x, y)
Definition: Logger.h:214
static SysCatalog & instance()
Definition: SysCatalog.h:292
std::shared_ptr< Catalog_Namespace::SessionInfo > session_info_
Definition: QueryRunner.h:214
static std::shared_ptr< query_state::QueryState > create_query_state(Ts &&...args)
Definition: QueryRunner.h:194
#define CHECK(condition)
Definition: Logger.h:206
#define STDLOG(...)
Definition: QueryState.h:229
std::string apply_copy_to_shim(const std::string &query_str)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void QueryRunner::QueryRunner::runImport ( Parser::CopyTableStmt import_stmt)
virtual

Definition at line 540 of file QueryRunner.cpp.

References CHECK, Parser::CopyTableStmt::execute(), and session_info_.

540  {
541  CHECK(import_stmt);
542  import_stmt->execute(*session_info_);
543 }
void execute(const Catalog_Namespace::SessionInfo &session) override
std::shared_ptr< Catalog_Namespace::SessionInfo > session_info_
Definition: QueryRunner.h:214
#define CHECK(condition)
Definition: Logger.h:206

+ Here is the call graph for this function:

std::vector< std::shared_ptr< ResultSet > > QueryRunner::QueryRunner::runMultipleStatements ( const std::string &  sql,
const ExecutorDeviceType  dt 
)
virtual

Definition at line 508 of file QueryRunner.cpp.

References CHECK_EQ, field(), run_benchmark_import::parser, runDDLStatement(), runSQL(), split(), and strip().

510  {
511  std::vector<std::shared_ptr<ResultSet>> results;
512  // TODO: Need to properly handle escaped semicolons instead of doing a naive split().
513  auto fields = split(sql, ";");
514  for (const auto& field : fields) {
515  auto text = strip(field) + ";";
516  if (text == ";") {
517  continue;
518  }
519  // TODO: Maybe remove this redundant parsing after enhancing Parser::Stmt?
520  SQLParser parser;
521  std::list<std::unique_ptr<Parser::Stmt>> parse_trees;
522  std::string last_parsed;
523  CHECK_EQ(parser.parse(text, parse_trees, last_parsed), 0);
524  CHECK_EQ(parse_trees.size(), size_t(1));
525  auto stmt = parse_trees.front().get();
526  Parser::DDLStmt* ddl = dynamic_cast<Parser::DDLStmt*>(stmt);
527  Parser::DMLStmt* dml = dynamic_cast<Parser::DMLStmt*>(stmt);
528  if (ddl != nullptr && dml == nullptr) {
529  runDDLStatement(text);
530  results.push_back(nullptr);
531  } else if (ddl == nullptr && dml != nullptr) {
532  results.push_back(runSQL(text, dt, true, true));
533  } else {
534  throw std::runtime_error("Unexpected SQL statement type: " + text);
535  }
536  }
537  return results;
538 }
#define CHECK_EQ(x, y)
Definition: Logger.h:214
std::string strip(std::string_view str)
trim any whitespace from the left and right ends of a string
virtual std::shared_ptr< ResultSet > runSQL(const std::string &query_str, CompilationOptions co, ExecutionOptions eo)
std::vector< std::string > split(std::string_view str, std::string_view delim, std::optional< size_t > maxsplit)
split apart a string into a vector of substrings
const rapidjson::Value & field(const rapidjson::Value &obj, const char field[]) noexcept
Definition: JsonAccessors.h:31
virtual void runDDLStatement(const std::string &)

+ Here is the call graph for this function:

std::shared_ptr< ExecutionResult > QueryRunner::QueryRunner::runSelectQuery ( const std::string &  query_str,
CompilationOptions  co,
ExecutionOptions  eo 
)
virtual

Definition at line 641 of file QueryRunner.cpp.

References ExecutionOptions::allow_loop_joins, cat(), CHECK, CPU, create_query_state(), CompilationOptions::defaults(), CompilationOptions::device_type, dispatch_queue_, g_enable_calcite_view_optimize, g_enable_filter_push_down, Executor::getExecutor(), RelAlgExecutor::getParsedQueryHints(), CompilationOptions::hoist_literals, Catalog_Namespace::SysCatalog::instance(), ExecutionOptions::just_explain, kCpuMode, LoopStrengthReduction, pg_shim(), run_benchmark_import::result, QueryRunner::anonymous_namespace{QueryRunner.cpp}::run_select_query_with_filter_push_down(), session_info_, and STDLOG.

Referenced by runSelectQuery(), and runSQL().

643  {
646  auto query_state = create_query_state(session_info_, query_str);
647  auto stdlog = STDLOG(query_state);
649  return run_select_query_with_filter_push_down(query_state->createQueryStateProxy(),
650  co.device_type,
651  co.hoist_literals,
652  eo.allow_loop_joins,
653  eo.just_explain,
655  }
656 
657  const auto& cat = session_info_->getCatalog();
658 
659  std::shared_ptr<ExecutionResult> result;
660  auto query_launch_task = std::make_shared<QueryDispatchQueue::Task>(
661  [&cat, &query_str, &co, &eo, &query_state, &result](const size_t worker_id) {
662  auto executor = Executor::getExecutor(worker_id);
663  // TODO The next line should be deleted since it overwrites co, but then
664  // NycTaxiTest.RunSelectsEncodingDictWhereGreater fails due to co not getting
665  // reset to its default values.
666  co = CompilationOptions::defaults(co.device_type);
668  auto calcite_mgr = cat.getCalciteMgr();
669  const auto query_ra = calcite_mgr
670  ->process(query_state->createQueryStateProxy(),
671  pg_shim(query_str),
672  {},
673  true,
674  false,
676  true)
677  .plan_result;
678  auto ra_executor = RelAlgExecutor(executor.get(), cat, query_ra);
679  const auto& query_hints = ra_executor.getParsedQueryHints();
680  const bool cpu_mode_enabled = query_hints.isHintRegistered(QueryHint::kCpuMode);
681  if (cpu_mode_enabled) {
682  co.device_type = ExecutorDeviceType::CPU;
683  }
684  result = std::make_shared<ExecutionResult>(
685  ra_executor.executeRelAlgQuery(co, eo, false, nullptr));
686  });
688  dispatch_queue_->submit(query_launch_task, /*is_update_delete=*/false);
689  auto result_future = query_launch_task->get_future();
690  result_future.get();
691  CHECK(result);
692  return result;
693 }
bool g_enable_calcite_view_optimize
Definition: QueryRunner.cpp:52
std::string cat(Ts &&...args)
std::unique_ptr< QueryDispatchQueue > dispatch_queue_
Definition: QueryRunner.h:215
static std::shared_ptr< Executor > getExecutor(const ExecutorId id, const std::string &debug_dir="", const std::string &debug_file="", const SystemParameters &system_parameters=SystemParameters())
Definition: Execute.cpp:166
static SysCatalog & instance()
Definition: SysCatalog.h:292
ExecutorDeviceType device_type
RegisteredQueryHint getParsedQueryHints()
std::shared_ptr< Catalog_Namespace::SessionInfo > session_info_
Definition: QueryRunner.h:214
static std::shared_ptr< query_state::QueryState > create_query_state(Ts &&...args)
Definition: QueryRunner.h:194
static CompilationOptions defaults(const ExecutorDeviceType device_type=ExecutorDeviceType::GPU)
bool g_enable_filter_push_down
Definition: Execute.cpp:89
#define CHECK(condition)
Definition: Logger.h:206
std::shared_ptr< ExecutionResult > run_select_query_with_filter_push_down(QueryStateProxy query_state_proxy, const ExecutorDeviceType device_type, const bool hoist_literals, const bool allow_loop_joins, const bool just_explain, const bool with_filter_push_down)
std::string pg_shim(const std::string &query)
#define STDLOG(...)
Definition: QueryState.h:229

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::shared_ptr< ExecutionResult > QueryRunner::QueryRunner::runSelectQuery ( const std::string &  query_str,
const ExecutorDeviceType  device_type,
const bool  hoist_literals,
const bool  allow_loop_joins,
const bool  just_explain = false 
)
virtual

Definition at line 695 of file QueryRunner.cpp.

References defaultExecutionOptionsForRunSQL(), CompilationOptions::defaults(), and runSelectQuery().

700  {
701  auto co = CompilationOptions::defaults(device_type);
702  co.hoist_literals = hoist_literals;
703  return runSelectQuery(query_str,
704  std::move(co),
705  defaultExecutionOptionsForRunSQL(allow_loop_joins, just_explain));
706 }
static ExecutionOptions defaultExecutionOptionsForRunSQL(bool allow_loop_joins=true, bool just_explain=false)
virtual std::shared_ptr< ExecutionResult > runSelectQuery(const std::string &query_str, CompilationOptions co, ExecutionOptions eo)
static CompilationOptions defaults(const ExecutorDeviceType device_type=ExecutorDeviceType::GPU)

+ Here is the call graph for this function:

std::shared_ptr< ResultSet > QueryRunner::QueryRunner::runSQL ( const std::string &  query_str,
CompilationOptions  co,
ExecutionOptions  eo 
)
virtual

Definition at line 344 of file QueryRunner.cpp.

References CHECK, CHECK_EQ, create_query_state(), Parser::InsertIntoTableAsSelectStmt::execute(), Parser::CreateTableAsSelectStmt::execute(), Parser::InsertValuesStmt::execute(), Catalog_Namespace::SysCatalog::instance(), run_benchmark_import::parser, runSelectQuery(), session_info_, STDLOG, UNREACHABLE, and VLOG.

Referenced by runMultipleStatements(), and runSQL().

346  {
349 
350  ParserWrapper pw{query_str};
351  if (pw.isCalcitePathPermissable()) {
352  const auto execution_result = runSelectQuery(query_str, std::move(co), std::move(eo));
353  VLOG(1) << session_info_->getCatalog().getDataMgr().getSystemMemoryUsage();
354  return execution_result->getRows();
355  }
356 
357  auto query_state = create_query_state(session_info_, query_str);
358  auto stdlog = STDLOG(query_state);
359 
360  SQLParser parser;
361  std::list<std::unique_ptr<Parser::Stmt>> parse_trees;
362  std::string last_parsed;
363  CHECK_EQ(parser.parse(query_str, parse_trees, last_parsed), 0) << query_str;
364  CHECK_EQ(parse_trees.size(), size_t(1));
365  auto stmt = parse_trees.front().get();
366  auto insert_values_stmt = dynamic_cast<Parser::InsertValuesStmt*>(stmt);
367  if (insert_values_stmt) {
368  insert_values_stmt->execute(*session_info_);
369  return nullptr;
370  }
371  auto ctas_stmt = dynamic_cast<Parser::CreateTableAsSelectStmt*>(stmt);
372  if (ctas_stmt) {
373  ctas_stmt->execute(*session_info_);
374  return nullptr;
375  }
376  auto itas_stmt = dynamic_cast<Parser::InsertIntoTableAsSelectStmt*>(stmt);
377  if (itas_stmt) {
378  itas_stmt->execute(*session_info_);
379  return nullptr;
380  }
381  UNREACHABLE();
382  return nullptr;
383 }
#define CHECK_EQ(x, y)
Definition: Logger.h:214
#define UNREACHABLE()
Definition: Logger.h:250
static SysCatalog & instance()
Definition: SysCatalog.h:292
void execute(const Catalog_Namespace::SessionInfo &session) override
void execute(const Catalog_Namespace::SessionInfo &session) override
std::shared_ptr< Catalog_Namespace::SessionInfo > session_info_
Definition: QueryRunner.h:214
virtual std::shared_ptr< ExecutionResult > runSelectQuery(const std::string &query_str, CompilationOptions co, ExecutionOptions eo)
static std::shared_ptr< query_state::QueryState > create_query_state(Ts &&...args)
Definition: QueryRunner.h:194
#define CHECK(condition)
Definition: Logger.h:206
void execute(const Catalog_Namespace::SessionInfo &session)
#define STDLOG(...)
Definition: QueryState.h:229
#define VLOG(n)
Definition: Logger.h:300

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::shared_ptr< ResultSet > QueryRunner::QueryRunner::runSQL ( const std::string &  query_str,
const ExecutorDeviceType  device_type,
const bool  hoist_literals = true,
const bool  allow_loop_joins = true 
)
virtual

Definition at line 385 of file QueryRunner.cpp.

References defaultExecutionOptionsForRunSQL(), CompilationOptions::defaults(), and runSQL().

388  {
389  auto co = CompilationOptions::defaults(device_type);
390  co.hoist_literals = hoist_literals;
391  return runSQL(
392  query_str, std::move(co), defaultExecutionOptionsForRunSQL(allow_loop_joins));
393 }
static ExecutionOptions defaultExecutionOptionsForRunSQL(bool allow_loop_joins=true, bool just_explain=false)
virtual std::shared_ptr< ResultSet > runSQL(const std::string &query_str, CompilationOptions co, ExecutionOptions eo)
static CompilationOptions defaults(const ExecutorDeviceType device_type=ExecutorDeviceType::GPU)

+ Here is the call graph for this function:

std::shared_ptr< ResultSet > QueryRunner::QueryRunner::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 
)
virtual

Definition at line 422 of file QueryRunner.cpp.

References calcite_lock, cat(), CHECK, CPU, create_query_state(), CompilationOptions::defaults(), CompilationOptions::device_type, dispatch_queue_, g_enable_columnar_output, g_gpu_mem_limit_percent, Executor::getExecutor(), RelAlgExecutor::getParsedQueryHints(), Catalog_Namespace::SysCatalog::instance(), kCpuMode, LoopStrengthReduction, CompilationOptions::opt_level, pg_shim(), run_benchmark_import::result, session_info_, STDLOG, and Executor::UNITARY_EXECUTOR_ID.

427  {
430  auto session_info =
431  std::make_shared<Catalog_Namespace::SessionInfo>(session_info_->get_catalog_ptr(),
432  session_info_->get_currentUser(),
433  device_type,
434  session_id);
435  auto query_state = create_query_state(session_info, query_str);
436  auto stdlog = STDLOG(query_state);
437  const auto& cat = query_state->getConstSessionInfo()->getCatalog();
438  std::string query_ra{""};
439 
440  std::shared_ptr<ExecutionResult> result;
441  auto query_launch_task = std::make_shared<QueryDispatchQueue::Task>(
442  [&cat,
443  &query_ra,
444  &device_type,
445  &query_state,
446  &result,
447  &running_query_check_freq,
448  &pending_query_check_freq](const size_t worker_id) {
449  auto executor = Executor::getExecutor(worker_id);
452 
454  true,
455  false,
456  true,
457  false,
458  false,
459  false,
460  false,
461  10000,
462  false,
463  false,
465  true,
466  running_query_check_freq,
467  pending_query_check_freq};
468  {
469  // async query initiation for interrupt test
470  // incurs data race warning in TSAN since
471  // calcite_mgr is shared across multiple query threads
472  // so here we lock the manager during query parsing
473  std::lock_guard<std::mutex> calcite_lock_guard(calcite_lock);
474  auto calcite_mgr = cat.getCalciteMgr();
475  query_ra = calcite_mgr
476  ->process(query_state->createQueryStateProxy(),
477  pg_shim(query_state->getQueryStr()),
478  {},
479  true,
480  false,
481  false,
482  true)
483  .plan_result;
484  }
485  auto ra_executor = RelAlgExecutor(executor.get(), cat, query_ra, query_state);
486  const auto& query_hints = ra_executor.getParsedQueryHints();
487  const bool cpu_mode_enabled = query_hints.isHintRegistered(QueryHint::kCpuMode);
488  if (cpu_mode_enabled) {
490  }
491  result = std::make_shared<ExecutionResult>(
492  ra_executor.executeRelAlgQuery(co, eo, false, nullptr));
493  });
495  executor->enrollQuerySession(session_id,
496  query_str,
497  query_state->getQuerySubmittedTime(),
499  QuerySessionStatus::QueryStatus::PENDING_QUEUE);
501  dispatch_queue_->submit(query_launch_task, /*is_update_delete=*/false);
502  auto result_future = query_launch_task->get_future();
503  result_future.get();
504  CHECK(result);
505  return result->getRows();
506 }
std::string cat(Ts &&...args)
std::unique_ptr< QueryDispatchQueue > dispatch_queue_
Definition: QueryRunner.h:215
std::mutex calcite_lock
Definition: QueryRunner.cpp:53
ExecutorOptLevel opt_level
static std::shared_ptr< Executor > getExecutor(const ExecutorId id, const std::string &debug_dir="", const std::string &debug_file="", const SystemParameters &system_parameters=SystemParameters())
Definition: Execute.cpp:166
bool g_enable_columnar_output
Definition: Execute.cpp:93
static SysCatalog & instance()
Definition: SysCatalog.h:292
double g_gpu_mem_limit_percent
Definition: QueryRunner.cpp:49
ExecutorDeviceType device_type
RegisteredQueryHint getParsedQueryHints()
std::shared_ptr< Catalog_Namespace::SessionInfo > session_info_
Definition: QueryRunner.h:214
static std::shared_ptr< query_state::QueryState > create_query_state(Ts &&...args)
Definition: QueryRunner.h:194
static CompilationOptions defaults(const ExecutorDeviceType device_type=ExecutorDeviceType::GPU)
#define CHECK(condition)
Definition: Logger.h:206
std::string pg_shim(const std::string &query)
#define STDLOG(...)
Definition: QueryState.h:229
static const ExecutorId UNITARY_EXECUTOR_ID
Definition: Execute.h:366

+ Here is the call graph for this function:

Member Data Documentation

std::shared_ptr<Data_Namespace::DataMgr> QueryRunner::QueryRunner::data_mgr_
protected

Definition at line 216 of file QueryRunner.h.

Referenced by QueryRunner().

std::unique_ptr<QueryDispatchQueue> QueryRunner::QueryRunner::dispatch_queue_
protected

Definition at line 215 of file QueryRunner.h.

Referenced by resizeDispatchQueue(), runSelectQuery(), and runSQLWithAllowingInterrupt().

std::unique_ptr< QueryRunner > QueryRunner::QueryRunner::qr_instance_ = nullptr
staticprotected

Definition at line 212 of file QueryRunner.h.

Referenced by get(), init(), and reset().

query_state::QueryStates QueryRunner::QueryRunner::query_states_
static

Definition at line 191 of file QueryRunner.h.

Referenced by create_query_state().


The documentation for this class was generated from the following files: