OmniSciDB  5ade3759e0
QueryRunner::anonymous_namespace{QueryRunner.cpp} Namespace Reference

Functions

ExecutionResult run_select_query_with_filter_push_down (const std::string &query_str, const std::unique_ptr< Catalog_Namespace::SessionInfo > &session, const ExecutorDeviceType device_type, const bool hoist_literals, const bool allow_loop_joins, const bool just_explain, const bool with_filter_push_down)
 

Function Documentation

◆ run_select_query_with_filter_push_down()

ExecutionResult QueryRunner::anonymous_namespace{QueryRunner.cpp}::run_select_query_with_filter_push_down ( const std::string &  query_str,
const std::unique_ptr< Catalog_Namespace::SessionInfo > &  session,
const ExecutorDeviceType  device_type,
const bool  hoist_literals,
const bool  allow_loop_joins,
const bool  just_explain,
const bool  with_filter_push_down 
)

Definition at line 333 of file QueryRunner.cpp.

References ExecutionOptions::allow_loop_joins, ExecutionOptions::allow_multifrag, ExecutionOptions::dynamic_watchdog_time_limit, g_enable_columnar_output, g_gpu_mem_limit_percent, Executor::getExecutor(), ExecutionOptions::gpu_input_mem_limit_percent, ExecutionOptions::jit_debug, ExecutionOptions::just_explain, ExecutionOptions::just_validate, LoopStrengthReduction, ExecutionOptions::output_columnar_hint, pg_shim(), run-benchmark-import::result, ExecutionOptions::with_dynamic_watchdog, and ExecutionOptions::with_watchdog.

Referenced by QueryRunner::QueryRunner::runSelectQuery().

340  {
341  const auto& cat = session->getCatalog();
342  auto executor = Executor::getExecutor(cat.getCurrentDB().dbId);
343  CompilationOptions co = {
344  device_type, true, ExecutorOptLevel::LoopStrengthReduction, false};
346  true,
347  just_explain,
348  allow_loop_joins,
349  false,
350  false,
351  false,
352  false,
353  10000,
354  with_filter_push_down,
355  false,
357  auto calcite_mgr = cat.getCalciteMgr();
358  const auto query_ra =
359  calcite_mgr->process(*session, pg_shim(query_str), {}, true, false, false)
360  .plan_result;
361  RelAlgExecutor ra_executor(executor.get(), cat);
362 
363  auto result = ra_executor.executeRelAlgQuery(query_ra, co, eo, nullptr);
364  const auto& filter_push_down_requests = result.getPushedDownFilterInfo();
365  if (!filter_push_down_requests.empty()) {
366  std::vector<TFilterPushDownInfo> filter_push_down_info;
367  for (const auto& req : filter_push_down_requests) {
368  TFilterPushDownInfo filter_push_down_info_for_request;
369  filter_push_down_info_for_request.input_prev = req.input_prev;
370  filter_push_down_info_for_request.input_start = req.input_start;
371  filter_push_down_info_for_request.input_next = req.input_next;
372  filter_push_down_info.push_back(filter_push_down_info_for_request);
373  }
374  const auto new_query_ra =
375  calcite_mgr
376  ->process(
377  *session, pg_shim(query_str), filter_push_down_info, true, false, false)
378  .plan_result;
379  const ExecutionOptions eo_modified{eo.output_columnar_hint,
380  eo.allow_multifrag,
381  eo.just_explain,
382  eo.allow_loop_joins,
383  eo.with_watchdog,
384  eo.jit_debug,
385  eo.just_validate,
388  /*find_push_down_candidates=*/false,
389  /*just_calcite_explain=*/false,
391  return ra_executor.executeRelAlgQuery(new_query_ra, co, eo_modified, nullptr);
392  } else {
393  return result;
394  }
395 }
static std::shared_ptr< Executor > getExecutor(const int db_id, const std::string &debug_dir="", const std::string &debug_file="", const MapDParameters mapd_parameters=MapDParameters(), ::QueryRenderer::QueryRenderManager *render_manager=nullptr)
Definition: Execute.cpp:122
bool g_enable_columnar_output
Definition: Execute.cpp:84
const bool allow_multifrag
const bool just_validate
const bool with_dynamic_watchdog
const double gpu_input_mem_limit_percent
double g_gpu_mem_limit_percent
Definition: QueryRunner.cpp:45
const bool output_columnar_hint
const bool allow_loop_joins
const unsigned dynamic_watchdog_time_limit
TSessionId session
std::string pg_shim(const std::string &query)
const bool with_watchdog
+ Here is the call graph for this function:
+ Here is the caller graph for this function: