OmniSciDB  16c4e035a1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
QueryRunner::anonymous_namespace{QueryRunner.cpp} Namespace Reference

Functions

std::shared_ptr< ExecutionResultrun_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)
 

Function Documentation

std::shared_ptr<ExecutionResult> QueryRunner::anonymous_namespace{QueryRunner.cpp}::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 
)

Definition at line 792 of file QueryRunner.cpp.

References ExecutionOptions::allow_loop_joins, ExecutionOptions::allow_multifrag, ExecutionOptions::allow_runtime_query_interrupt, cat(), CompilationOptions::defaults(), ExecutionOptions::defaults(), ExecutionOptions::dynamic_watchdog_time_limit, CompilationOptions::explain_type, ExecutionOptions::find_push_down_candidates, g_enable_columnar_output, g_enable_watchdog, g_gpu_mem_limit_percent, Executor::getExecutor(), query_state::QueryStateProxy::getQueryState(), ExecutionOptions::gpu_input_mem_limit_percent, ExecutionOptions::jit_debug, ExecutionOptions::just_explain, ExecutionOptions::just_validate, ExecutionOptions::output_columnar_hint, ExecutionOptions::pending_query_interrupt_freq, pg_shim(), run_benchmark_import::result, ExecutionOptions::running_query_interrupt_freq, Executor::UNITARY_EXECUTOR_ID, ExecutionOptions::with_dynamic_watchdog, and ExecutionOptions::with_watchdog.

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

799  {
800  auto const& query_state = query_state_proxy.getQueryState();
801  const auto& cat = query_state.getConstSessionInfo()->getCatalog();
804  co.explain_type = explain_type;
805 
808  eo.just_explain = just_explain;
809  eo.allow_loop_joins = allow_loop_joins;
810  eo.find_push_down_candidates = with_filter_push_down;
812 
813  auto calcite_mgr = cat.getCalciteMgr();
814  const auto calciteQueryParsingOption =
815  calcite_mgr->getCalciteQueryParsingOption(true, false, true);
816  const auto calciteOptimizationOption =
817  calcite_mgr->getCalciteOptimizationOption(false, g_enable_watchdog, {});
818  const auto query_ra = calcite_mgr
819  ->process(query_state_proxy,
820  pg_shim(query_state.getQueryStr()),
821  calciteQueryParsingOption,
822  calciteOptimizationOption)
823  .plan_result;
824  auto ra_executor = RelAlgExecutor(executor.get(), cat, query_ra);
825  auto result = std::make_shared<ExecutionResult>(
826  ra_executor.executeRelAlgQuery(co, eo, false, nullptr));
827  const auto& filter_push_down_requests = result->getPushedDownFilterInfo();
828  if (!filter_push_down_requests.empty()) {
829  std::vector<TFilterPushDownInfo> filter_push_down_info;
830  for (const auto& req : filter_push_down_requests) {
831  TFilterPushDownInfo filter_push_down_info_for_request;
832  filter_push_down_info_for_request.input_prev = req.input_prev;
833  filter_push_down_info_for_request.input_start = req.input_start;
834  filter_push_down_info_for_request.input_next = req.input_next;
835  filter_push_down_info.push_back(filter_push_down_info_for_request);
836  }
837  const auto calciteQueryParsingOption =
838  calcite_mgr->getCalciteQueryParsingOption(true, false, true);
839  const auto calciteOptimizationOption = calcite_mgr->getCalciteOptimizationOption(
840  false, g_enable_watchdog, filter_push_down_info);
841  const auto new_query_ra = calcite_mgr
842  ->process(query_state_proxy,
843  pg_shim(query_state.getQueryStr()),
844  calciteQueryParsingOption,
845  calciteOptimizationOption)
846  .plan_result;
847  const ExecutionOptions eo_modified{eo.output_columnar_hint,
848  eo.allow_multifrag,
849  eo.just_explain,
850  eo.allow_loop_joins,
851  eo.with_watchdog,
852  eo.jit_debug,
853  eo.just_validate,
856  /*find_push_down_candidates=*/false,
857  /*just_calcite_explain=*/false,
862  auto new_ra_executor = RelAlgExecutor(executor.get(), cat, new_query_ra);
863  return std::make_shared<ExecutionResult>(
864  new_ra_executor.executeRelAlgQuery(co, eo_modified, false, nullptr));
865  } else {
866  return result;
867  }
868 }
bool g_enable_watchdog
std::string cat(Ts &&...args)
double running_query_interrupt_freq
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:179
bool g_enable_columnar_output
Definition: Execute.cpp:95
QueryState & getQueryState()
Definition: QueryState.h:181
ExecutorExplainType explain_type
double g_gpu_mem_limit_percent
Definition: QueryRunner.cpp:52
unsigned pending_query_interrupt_freq
static CompilationOptions defaults(const ExecutorDeviceType device_type=ExecutorDeviceType::GPU)
double gpu_input_mem_limit_percent
unsigned dynamic_watchdog_time_limit
static ExecutionOptions defaults()
std::string pg_shim(const std::string &query)
static const ExecutorId UNITARY_EXECUTOR_ID
Definition: Execute.h:377

+ Here is the call graph for this function:

+ Here is the caller graph for this function: