41 #include "gen-cpp/CalciteServer.h"
42 #include "include/bcrypt.h"
44 #include <boost/filesystem/operations.hpp>
48 #define CALCITEPORT 3279
59 using namespace Catalog_Namespace;
66 g_calcite->close_calcite_server();
80 std::unique_ptr<QueryRunner> QueryRunner::qr_instance_ =
nullptr;
85 const std::string& udf_filename,
86 const size_t max_gpu_mem,
87 const int reserved_gpu_mem) {
102 const std::vector<LeafHostInfo>& string_servers,
103 const std::vector<LeafHostInfo>& leaf_servers) {
120 const std::string& user,
121 const std::string& pass,
122 const std::string& db_name,
123 const std::vector<LeafHostInfo>& string_servers,
124 const std::vector<LeafHostInfo>& leaf_servers,
125 const std::string& udf_filename,
127 const size_t max_gpu_mem,
128 const int reserved_gpu_mem,
130 const bool create_db,
135 LOG_IF(
FATAL, !leaf_servers.empty()) <<
"Distributed test runner not supported.";
136 CHECK(leaf_servers.empty());
150 return qr_instance_.get();
154 const std::string& user_name,
155 const std::string& passwd,
156 const std::string& db_name,
157 const std::vector<LeafHostInfo>& string_servers,
158 const std::vector<LeafHostInfo>& leaf_servers,
159 const std::string& udf_filename,
161 const size_t max_gpu_mem,
162 const int reserved_gpu_mem,
164 const bool create_db,
168 boost::filesystem::path base_path{db_path};
169 CHECK(boost::filesystem::exists(base_path));
170 auto system_db_file =
172 CHECK(boost::filesystem::exists(system_db_file));
178 disk_cache_config = *cache_config;
185 std::make_shared<Calcite>(-1,
CALCITEPORT, db_path, 1024, 5000,
true, udf_filename);
187 if (!udf_filename.empty()) {
194 std::vector<TUserDefinedFunction> udfs = {};
195 g_calcite->setRuntimeExtensionFunctions(udfs, udtfs,
false);
197 std::unique_ptr<CudaMgr_Namespace::CudaMgr> cuda_mgr;
200 cuda_mgr = std::make_unique<CudaMgr_Namespace::CudaMgr>(-1, 0);
207 mapd_params.
aggregator = !leaf_servers.empty();
231 if (!sys_cat.getMetadataForUser(user_name, user)) {
235 passwd,
false,
"",
true},
239 CHECK(sys_cat.getMetadataForUser(user_name, user));
244 sys_cat.createDatabase(db_name, user.
userId);
251 session_info_ = std::make_unique<Catalog_Namespace::SessionInfo>(
255 void QueryRunner::resizeDispatchQueue(
const size_t num_executors) {
260 : session_info_(std::move(session))
263 std::shared_ptr<Catalog_Namespace::Catalog> QueryRunner::getCatalog()
const {
268 std::shared_ptr<Calcite> QueryRunner::getCalcite()
const {
273 bool QueryRunner::gpusPresent()
const {
275 return session_info_->getCatalog().getDataMgr().gpusPresent();
278 void QueryRunner::clearGpuMemory()
const {
283 void QueryRunner::clearCpuMemory()
const {
288 std::vector<MemoryInfo> QueryRunner::getMemoryInfo(
291 return session_info_->getCatalog().getDataMgr().getMemoryInfo(memory_level);
296 const bool current_db_only)
const {
299 const std::vector<MemoryInfo> memory_infos =
300 session_info_->getCatalog().getDataMgr().getMemoryInfo(memory_level);
302 CHECK_EQ(memory_infos.size(),
static_cast<size_t>(1));
304 std::set<std::vector<int32_t>> chunk_keys;
305 std::set<std::vector<int32_t>> table_keys;
306 std::set<std::vector<int32_t>> column_keys;
307 std::set<std::vector<int32_t>> fragment_keys;
308 size_t total_num_buffers{
310 size_t total_num_bytes{0};
311 for (
auto& pool_memory_info : memory_infos) {
312 const std::vector<MemoryData>& memory_data = pool_memory_info.nodeMemoryData;
313 for (
auto& memory_datum : memory_data) {
315 const auto& chunk_key = memory_datum.chunk_key;
317 chunk_key.size() < 4) {
320 if (current_db_only) {
325 total_num_bytes += (memory_datum.numPages * pool_memory_info.pageSize);
326 table_keys.insert({chunk_key[0], chunk_key[1]});
327 column_keys.insert({chunk_key[0], chunk_key[1], chunk_key[2]});
328 fragment_keys.insert({chunk_key[0], chunk_key[1], chunk_key[3]});
329 chunk_keys.insert(chunk_key);
332 return {total_num_buffers,
336 fragment_keys.size(),
347 auto calcite_mgr =
cat.getCalciteMgr();
348 const auto calciteQueryParsingOption =
349 calcite_mgr->getCalciteQueryParsingOption(
true,
false,
true);
350 const auto calciteOptimizationOption =
352 const auto query_ra = calcite_mgr
353 ->process(query_state->createQueryStateProxy(),
355 calciteQueryParsingOption,
356 calciteOptimizationOption)
364 std::shared_ptr<const RelAlgNode> QueryRunner::getRootNodeFromParsedQuery(
365 const std::string& query_str) {
372 auto calcite_mgr =
cat.getCalciteMgr();
373 const auto calciteQueryParsingOption =
374 calcite_mgr->getCalciteQueryParsingOption(
true,
false,
true);
375 const auto calciteOptimizationOption =
377 const auto query_ra = calcite_mgr
378 ->process(query_state->createQueryStateProxy(),
380 calciteQueryParsingOption,
381 calciteOptimizationOption)
388 std::unordered_map<size_t, std::unordered_map<unsigned, RegisteredQueryHint>>>
389 QueryRunner::getParsedQueryHints(
const std::string& query_str) {
395 auto calcite_mgr =
cat.getCalciteMgr();
396 const auto calciteQueryParsingOption =
397 calcite_mgr->getCalciteQueryParsingOption(
true,
false,
true);
398 const auto calciteOptimizationOption =
400 const auto query_ra = calcite_mgr
401 ->process(query_state->createQueryStateProxy(),
403 calciteQueryParsingOption,
404 calciteOptimizationOption)
410 std::optional<RegisteredQueryHint> QueryRunner::getParsedGlobalQueryHints(
411 const std::string& query_str) {
417 auto calcite_mgr =
cat.getCalciteMgr();
418 const auto calciteQueryParsingOption =
419 calcite_mgr->getCalciteQueryParsingOption(
true,
false,
true);
420 const auto calciteOptimizationOption =
422 const auto query_ra = calcite_mgr
423 ->process(query_state->createQueryStateProxy(),
425 calciteQueryParsingOption,
426 calciteOptimizationOption)
438 auto calcite_mgr =
cat.getCalciteMgr();
439 const auto calciteQueryParsingOption =
440 calcite_mgr->getCalciteQueryParsingOption(
true,
false,
true);
441 const auto calciteOptimizationOption =
443 const auto query_ra = calcite_mgr
444 ->process(query_state->createQueryStateProxy(),
446 calciteQueryParsingOption,
447 calciteOptimizationOption)
455 void QueryRunner::validateDDLStatement(
const std::string& stmt_str_in) {
458 std::string stmt_str = stmt_str_in;
460 boost::algorithm::trim_left_if(stmt_str, boost::algorithm::is_any_of(
"\n"));
462 boost::algorithm::trim_left(stmt_str);
465 auto stdlog =
STDLOG(query_state);
468 auto calcite_mgr =
cat.getCalciteMgr();
469 const auto calciteQueryParsingOption =
470 calcite_mgr->getCalciteQueryParsingOption(
true,
false,
true);
471 const auto calciteOptimizationOption =
473 calcite_mgr->process(query_state->createQueryStateProxy(),
475 calciteQueryParsingOption,
476 calciteOptimizationOption);
479 std::shared_ptr<RelAlgTranslator> QueryRunner::getRelAlgTranslator(
480 const std::string& query_str,
481 Executor* executor) {
486 auto calcite_mgr =
cat.getCalciteMgr();
487 const auto calciteQueryParsingOption =
488 calcite_mgr->getCalciteQueryParsingOption(
true,
false,
true);
489 const auto calciteOptimizationOption =
491 const auto query_ra = calcite_mgr
492 ->process(query_state->createQueryStateProxy(),
494 calciteQueryParsingOption,
495 calciteOptimizationOption)
497 executor->setCatalog(&
cat);
499 auto root_node_shared_ptr = ra_executor.getRootRelAlgNodeShPtr();
500 return ra_executor.getRelAlgTranslator(root_node_shared_ptr.get());
504 const std::string& query_str) {
510 auto calcite_mgr =
cat.getCalciteMgr();
511 const auto calciteQueryParsingOption =
512 calcite_mgr->getCalciteQueryParsingOption(
true,
false,
true);
513 const auto calciteOptimizationOption =
515 const auto query_ra = calcite_mgr
516 ->process(query_state->createQueryStateProxy(),
518 calciteQueryParsingOption,
519 calciteOptimizationOption)
521 executor->setCatalog(&
cat);
527 auto join_info = ra_executor.getJoinInfo(root_node_shared_ptr.get());
528 auto relAlgTranslator = ra_executor.getRelAlgTranslator(root_node_shared_ptr.get());
529 return {root_node_shared_ptr, join_info.first, join_info.second, relAlgTranslator};
532 std::unique_ptr<Parser::Stmt> QueryRunner::createStatement(
533 const std::string& stmt_str_in) {
537 std::string stmt_str = stmt_str_in;
539 boost::algorithm::trim_left_if(stmt_str, boost::algorithm::is_any_of(
"\n"));
541 boost::algorithm::trim_left(stmt_str);
546 auto stdlog =
STDLOG(query_state);
550 auto calcite_mgr =
cat.getCalciteMgr();
551 const auto calciteQueryParsingOption =
552 calcite_mgr->getCalciteQueryParsingOption(
true,
false,
true);
553 const auto calciteOptimizationOption =
555 const auto query_json = calcite_mgr
556 ->process(query_state->createQueryStateProxy(),
558 calciteQueryParsingOption,
559 calciteOptimizationOption)
569 void QueryRunner::runDDLStatement(
const std::string& stmt_str_in) {
573 std::string stmt_str = stmt_str_in;
575 boost::algorithm::trim_left_if(stmt_str, boost::algorithm::is_any_of(
"\n"));
577 boost::algorithm::trim_left(stmt_str);
582 auto stdlog =
STDLOG(query_state);
586 auto calcite_mgr =
cat.getCalciteMgr();
587 const auto calciteQueryParsingOption =
588 calcite_mgr->getCalciteQueryParsingOption(
true,
false,
true);
589 const auto calciteOptimizationOption =
591 const auto query_ra = calcite_mgr
592 ->process(query_state->createQueryStateProxy(),
594 calciteQueryParsingOption,
595 calciteOptimizationOption)
598 rapidjson::Document ddl_query;
599 ddl_query.Parse(query_ra);
600 CHECK(ddl_query.HasMember(
"payload"));
601 CHECK(ddl_query[
"payload"].IsObject());
612 std::shared_ptr<ResultSet> QueryRunner::runSQL(
const std::string& query_str,
619 if (pw.isCalcitePathPermissable()) {
624 const auto execution_result =
runSelectQuery(query_str, std::move(co), std::move(eo));
626 return execution_result->getRows();
633 std::shared_ptr<ResultSet> QueryRunner::runSQL(
const std::string& query_str,
635 const bool hoist_literals,
636 const bool allow_loop_joins) {
638 co.hoist_literals = hoist_literals;
662 std::shared_ptr<Executor> QueryRunner::getExecutor()
const {
666 auto stdlog =
STDLOG(query_state);
671 std::shared_ptr<ResultSet> QueryRunner::runSQLWithAllowingInterrupt(
672 const std::string& query_str,
673 const std::string& session_id,
675 const double running_query_check_freq,
676 const unsigned pending_query_check_freq) {
680 auto session_info = std::make_shared<Catalog_Namespace::SessionInfo>(
681 session_info_->get_catalog_ptr(), current_user, device_type, session_id);
683 auto stdlog =
STDLOG(query_state);
684 const auto&
cat = query_state->getConstSessionInfo()->getCatalog();
685 std::string query_ra{
""};
687 std::shared_ptr<ExecutionResult>
result;
688 auto query_launch_task = std::make_shared<QueryDispatchQueue::Task>(
694 &running_query_check_freq,
695 &pending_query_check_freq](
const size_t worker_id) {
713 running_query_check_freq,
714 pending_query_check_freq};
720 std::lock_guard<std::mutex> calcite_lock_guard(
calcite_lock);
721 auto calcite_mgr = cat.getCalciteMgr();
722 const auto calciteQueryParsingOption =
723 calcite_mgr->getCalciteQueryParsingOption(
true,
false,
true);
724 const auto calciteOptimizationOption =
726 query_ra = calcite_mgr
727 ->process(query_state->createQueryStateProxy(),
728 pg_shim(query_state->getQueryStr()),
729 calciteQueryParsingOption,
730 calciteOptimizationOption)
734 result = std::make_shared<ExecutionResult>(
735 ra_executor.executeRelAlgQuery(co, eo,
false,
nullptr));
738 executor->enrollQuerySession(session_id,
740 query_state->getQuerySubmittedTime(),
742 QuerySessionStatus::QueryStatus::PENDING_QUEUE);
745 auto result_future = query_launch_task->get_future();
748 return result->getRows();
751 std::vector<std::shared_ptr<ResultSet>> QueryRunner::runMultipleStatements(
752 const std::string& sql,
754 std::vector<std::shared_ptr<ResultSet>> results;
756 auto fields =
split(sql,
";");
757 for (
const auto&
field : fields) {
766 results.push_back(
nullptr);
769 results.push_back(
runSQL(text, dt,
true,
true));
780 std::unique_ptr<import_export::Loader> QueryRunner::getLoader(
783 return std::make_unique<import_export::Loader>(*
cat, td);
791 const bool hoist_literals,
792 const bool allow_loop_joins,
793 const bool just_explain,
795 const bool with_filter_push_down) {
797 const auto&
cat = query_state.getConstSessionInfo()->getCatalog();
809 auto calcite_mgr =
cat.getCalciteMgr();
810 const auto calciteQueryParsingOption =
811 calcite_mgr->getCalciteQueryParsingOption(
true,
false,
true);
812 const auto calciteOptimizationOption =
814 const auto query_ra = calcite_mgr
815 ->process(query_state_proxy,
816 pg_shim(query_state.getQueryStr()),
817 calciteQueryParsingOption,
818 calciteOptimizationOption)
821 auto result = std::make_shared<ExecutionResult>(
822 ra_executor.executeRelAlgQuery(co, eo,
false,
nullptr));
823 const auto& filter_push_down_requests = result->getPushedDownFilterInfo();
824 if (!filter_push_down_requests.empty()) {
825 std::vector<TFilterPushDownInfo> filter_push_down_info;
826 for (
const auto& req : filter_push_down_requests) {
827 TFilterPushDownInfo filter_push_down_info_for_request;
828 filter_push_down_info_for_request.input_prev = req.input_prev;
829 filter_push_down_info_for_request.input_start = req.input_start;
830 filter_push_down_info_for_request.input_next = req.input_next;
831 filter_push_down_info.push_back(filter_push_down_info_for_request);
833 const auto calciteQueryParsingOption =
834 calcite_mgr->getCalciteQueryParsingOption(
true,
false,
true);
835 const auto calciteOptimizationOption = calcite_mgr->getCalciteOptimizationOption(
837 const auto new_query_ra = calcite_mgr
838 ->process(query_state_proxy,
839 pg_shim(query_state.getQueryStr()),
840 calciteQueryParsingOption,
841 calciteOptimizationOption)
860 return std::make_shared<ExecutionResult>(
861 new_ra_executor.executeRelAlgQuery(co, eo_modified,
false,
nullptr));
869 std::shared_ptr<ExecutionResult> QueryRunner::runSelectQuery(
const std::string& query_str,
875 auto stdlog =
STDLOG(query_state);
888 std::shared_ptr<ExecutionResult>
result;
889 auto query_launch_task =
890 std::make_shared<QueryDispatchQueue::Task>([&
cat,
896 &
result](
const size_t worker_id) {
902 co.explain_type = explain_type;
903 auto calcite_mgr = cat.getCalciteMgr();
904 const auto calciteQueryParsingOption =
905 calcite_mgr->getCalciteQueryParsingOption(
true,
false,
true);
906 const auto calciteOptimizationOption = calcite_mgr->getCalciteOptimizationOption(
908 const auto query_ra = calcite_mgr
909 ->process(query_state->createQueryStateProxy(),
911 calciteQueryParsingOption,
912 calciteOptimizationOption)
915 result = std::make_shared<ExecutionResult>(
916 ra_executor.executeRelAlgQuery(co, eo,
false,
nullptr));
920 auto result_future = query_launch_task->get_future();
926 std::shared_ptr<ExecutionResult> QueryRunner::runSelectQuery(
927 const std::string& query_str,
929 const bool hoist_literals,
930 const bool allow_loop_joins,
931 const bool just_explain) {
933 co.hoist_literals = hoist_literals;
943 query_dag_info.root_node.get(), executor);
944 return extracted_dag_info;
958 std::shared_ptr<HashTable>,
959 std::optional<HashtableCacheMetaInfo>>
960 QueryRunner::getCachedHashtableWithoutCacheKey(std::set<size_t>& visited,
964 switch (hash_table_type) {
982 CHECK(hash_table_cache);
983 return hash_table_cache->getCachedHashtableWithoutCacheKey(
984 visited, hash_table_type, device_identifier);
987 std::shared_ptr<CacheItemMetric> QueryRunner::getCacheItemMetric(
992 switch (hash_table_type) {
1010 CHECK(hash_table_cache);
1011 return hash_table_cache->getCachedItemMetric(
1012 hash_table_type, device_identifier, cache_key);
1017 bool with_overlaps_tuning_param)
const {
1018 auto get_num_cached_auto_tuner_param = [&item_status]() {
1020 CHECK(auto_tuner_cache);
1021 switch (item_status) {
1023 return auto_tuner_cache->getCurrentNumCachedItems(
1028 return auto_tuner_cache->getCurrentNumCleanCachedItems(
1033 return auto_tuner_cache->getCurrentNumDirtyCachedItems(
1039 return static_cast<size_t>(0);
1044 auto get_num_cached_hashtable =
1047 &with_overlaps_tuning_param,
1049 switch (item_status) {
1051 if (with_overlaps_tuning_param) {
1055 return hash_table_cache->getCurrentNumCachedItems(
1057 get_num_cached_auto_tuner_param();
1059 return hash_table_cache->getCurrentNumCachedItems(
1063 if (with_overlaps_tuning_param) {
1065 return hash_table_cache->getCurrentNumCleanCachedItems(
1067 get_num_cached_auto_tuner_param();
1069 return hash_table_cache->getCurrentNumCleanCachedItems(
1073 if (with_overlaps_tuning_param) {
1075 return hash_table_cache->getCurrentNumDirtyCachedItems(
1077 get_num_cached_auto_tuner_param();
1079 return hash_table_cache->getCurrentNumDirtyCachedItems(
1084 return static_cast<size_t>(0);
1089 switch (hash_table_type) {
1092 CHECK(hash_table_cache);
1093 return get_num_cached_hashtable(hash_table_cache);
1097 CHECK(hash_table_cache);
1098 return get_num_cached_hashtable(hash_table_cache);
1102 CHECK(hash_table_cache);
1103 return get_num_cached_hashtable(hash_table_cache);
1106 return get_num_cached_auto_tuner_param();
1116 void QueryRunner::reset() {
1125 const std::string session_id)
1127 std::make_unique<Catalog_Namespace::
SessionInfo>(cat, user, dt, session_id)) {}
1130 const std::string& table_name,
1131 const bool compression,
1133 const bool explode_collections) {
1134 using namespace import_export;
1136 static constexpr
bool kIsGeoRaster{
false};
1144 copy_params.geo_coords_comp_param = 32;
1147 copy_params.geo_coords_comp_param = 0;
1149 copy_params.geo_assign_render_groups =
true;
1150 copy_params.geo_explode_collections = explode_collections;
1152 std::map<std::string, std::string> colname_to_src;
1154 auto cds = Importer::gdalToColumnDescriptors(
1157 for (
auto& cd : cds) {
1160 colname_to_src.insert(std::make_pair(col_name_sanitized, cd.columnName));
1162 cd.columnName = col_name_sanitized;
1166 const auto td =
cat.getMetadataForTable(table_name);
1167 if (td !=
nullptr) {
1168 throw std::runtime_error(
1169 "Error: Table " + table_name +
1170 " already exists. Possible failure to correctly re-create " +
1174 throw std::runtime_error(
"Invalid characters in table name: " + table_name);
1177 std::string stmt{
"CREATE TABLE " + table_name};
1178 std::vector<std::string> col_stmts;
1180 for (
auto& cd : cds) {
1183 throw std::runtime_error(
1184 "Unsupported type: INTERVAL_DAY_TIME or INTERVAL_YEAR_MONTH for col " +
1185 cd.columnName +
" (table: " + table_name +
")");
1189 if (cd.columnType.get_precision() == 0 && cd.columnType.get_scale() == 0) {
1190 cd.columnType.set_precision(14);
1191 cd.columnType.set_scale(7);
1195 std::string col_stmt;
1196 col_stmt.append(cd.columnName +
" " + cd.columnType.get_type_name() +
" ");
1199 col_stmt.append(
"ENCODING " + cd.columnType.get_compression_name() +
" ");
1201 if (cd.columnType.is_string()) {
1202 col_stmt.append(
"ENCODING NONE");
1203 }
else if (cd.columnType.is_geometry()) {
1204 if (cd.columnType.get_output_srid() == 4326) {
1205 col_stmt.append(
"ENCODING NONE");
1209 col_stmts.push_back(col_stmt);
1215 LOG(
INFO) <<
"Created table: " << table_name;
1217 LOG(
INFO) <<
"Not creating table: " << table_name;
1220 const auto td =
cat.getMetadataForTable(table_name);
1221 if (td ==
nullptr) {
1222 throw std::runtime_error(
"Error: Failed to create table " + table_name);
1228 LOG(
INFO) <<
"Import Time for " << table_name <<
": " << (double)ms / 1000.0 <<
" s";
bool g_enable_calcite_view_optimize
Classes used to wrap parser calls for calcite redirection.
static void addUdfs(const std::string &json_func_sigs)
ImportStatus importGDAL(const std::map< std::string, std::string > &colname_to_src, const Catalog_Namespace::SessionInfo *session_info, const bool is_raster)
const std::string kDataDirectoryName
static std::vector< TableFunction > get_table_funcs()
bool find_push_down_candidates
std::unique_ptr< QueryDispatchQueue > dispatch_queue_
static TimeT::rep execution(F func, Args &&...args)
static void initialize(const std::string &data_dir, const std::string &allowed_import_paths, const std::string &allowed_export_paths)
const std::string kDefaultDiskCacheDirName
bool with_dynamic_watchdog
ImportDriver(std::shared_ptr< Catalog_Namespace::Catalog > cat, const Catalog_Namespace::UserMetadata &user, const ExecutorDeviceType dt=ExecutorDeviceType::GPU, const std::string session_id="")
ExecutorExplainType explain_type_
static void add(const std::string &json_func_sigs)
static HashtableRecycler * getHashTableCache()
std::optional< std::unordered_map< size_t, std::unordered_map< unsigned, RegisteredQueryHint > > > getParsedQueryHints()
std::optional< RegisteredQueryHint > getParsedQueryHint(const RelAlgNode *node)
void set_once_fatal_func(FatalFunc fatal_func)
void execute(const Catalog_Namespace::SessionInfo &session) override
Catalog_Namespace::DBMetadata db_metadata_
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)
const std::string kGeoColumnName
double running_query_interrupt_freq
#define LOG_IF(severity, condition)
static void clearMemory(const Data_Namespace::MemoryLevel memory_level)
void calcite_shutdown_handler() noexcept
static void addShutdownCallback(std::function< void()> shutdown_callback)
std::shared_ptr< const RelAlgNode > getRootRelAlgNodeShPtr() const
static std::shared_ptr< Executor > getExecutor(const ExecutorId id, const std::string &debug_dir="", const std::string &debug_file="", const SystemParameters &system_parameters=SystemParameters())
std::shared_ptr< QueryEngine > query_engine_
This file contains the class specification and related data structures for Catalog.
bool output_columnar_hint
RaExecutionSequence getRaExecutionSequence(const RelAlgNode *root_node, Executor *executor)
const rapidjson::Value & field(const rapidjson::Value &obj, const char field[]) noexcept
bool g_enable_columnar_output
static SysCatalog & instance()
Classes representing a parse tree.
const std::string kDefaultDbName
void init(LogOptions const &log_opts)
QueryState & getQueryState()
std::unique_ptr< Parser::Stmt > create_stmt_for_json(const std::string &query_json)
static HashtableRecycler * getHashTableCache()
A container for relational algebra descriptors defining the execution order for a relational algebra ...
ExecutorExplainType explain_type
static void registerSignalHandler()
virtual void runDDLStatement(const std::string &)
static std::unique_ptr< QueryRunner > qr_instance_
double g_gpu_mem_limit_percent
std::string sanitize_name(const std::string &name)
import_export::SourceType source_type
static OverlapsTuningParamRecycler * getOverlapsTuningParamCache()
unsigned pending_query_interrupt_freq
bool g_serialize_temp_tables
ExecutorDeviceType device_type
std::optional< RegisteredQueryHint > getGlobalQueryHint()
ExecutionResult execute()
void importGeoTable(const std::string &file_path, const std::string &table_name, const bool compression, const bool create_table, const bool explode_collections)
const std::string kRootUsername
static RegisteredQueryHint defaults()
TExtArgumentType::type to_thrift(const ExtArgumentType &t)
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 ExecutorExplainType explain_type, const bool with_filter_push_down)
std::shared_ptr< Catalog_Namespace::SessionInfo > session_info_
virtual std::shared_ptr< ExecutionResult > runSelectQuery(const std::string &query_str, CompilationOptions co, ExecutionOptions eo)
std::shared_ptr< Calcite > g_calcite
const std::string kCatalogDirectoryName
static std::shared_ptr< query_state::QueryState > create_query_state(Ts &&...args)
static CompilationOptions defaults(const ExecutorDeviceType device_type=ExecutorDeviceType::GPU)
bool g_enable_filter_push_down
QueryPlanDagInfo getQueryInfoForDataRecyclerTest(const std::string &)
static HashtableRecycler * getHashTableCache()
size_t gpu_buffer_mem_bytes
double gpu_input_mem_limit_percent
static std::shared_ptr< QueryEngine > getInstance()
Serializers for query engine types to/from thrift.
std::shared_ptr< Catalog_Namespace::Catalog > getCatalog() const
void setup_signal_handler()
unsigned dynamic_watchdog_time_limit
std::shared_ptr< Data_Namespace::DataMgr > data_mgr_
static constexpr DeviceIdentifier CPU_DEVICE_IDENTIFIER
bool allow_runtime_query_interrupt
static ExecutionOptions defaults()
std::string pg_shim(const std::string &query)
static const ExecutorId UNITARY_EXECUTOR_ID