OmniSciDB  cde582ebc3
 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 783 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::keep_result, 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().

790  {
791  auto const& query_state = query_state_proxy.getQueryState();
792  auto& cat = query_state.getConstSessionInfo()->getCatalog();
795  co.explain_type = explain_type;
796 
799  eo.just_explain = just_explain;
800  eo.allow_loop_joins = allow_loop_joins;
801  eo.find_push_down_candidates = with_filter_push_down;
803 
804  auto calcite_mgr = cat.getCalciteMgr();
805  const auto calciteQueryParsingOption =
806  calcite_mgr->getCalciteQueryParsingOption(true, false, true);
807  const auto calciteOptimizationOption =
808  calcite_mgr->getCalciteOptimizationOption(false, g_enable_watchdog, {});
809  const auto query_ra = calcite_mgr
810  ->process(query_state_proxy,
811  pg_shim(query_state.getQueryStr()),
812  calciteQueryParsingOption,
813  calciteOptimizationOption)
814  .plan_result;
815  auto ra_executor = RelAlgExecutor(executor.get(), cat, query_ra);
816  auto result = std::make_shared<ExecutionResult>(
817  ra_executor.executeRelAlgQuery(co, eo, false, nullptr));
818  const auto& filter_push_down_requests = result->getPushedDownFilterInfo();
819  if (!filter_push_down_requests.empty()) {
820  std::vector<TFilterPushDownInfo> filter_push_down_info;
821  for (const auto& req : filter_push_down_requests) {
822  TFilterPushDownInfo filter_push_down_info_for_request;
823  filter_push_down_info_for_request.input_prev = req.input_prev;
824  filter_push_down_info_for_request.input_start = req.input_start;
825  filter_push_down_info_for_request.input_next = req.input_next;
826  filter_push_down_info.push_back(filter_push_down_info_for_request);
827  }
828  const auto calciteQueryParsingOption =
829  calcite_mgr->getCalciteQueryParsingOption(true, false, true);
830  const auto calciteOptimizationOption = calcite_mgr->getCalciteOptimizationOption(
831  false, g_enable_watchdog, filter_push_down_info);
832  const auto new_query_ra = calcite_mgr
833  ->process(query_state_proxy,
834  pg_shim(query_state.getQueryStr()),
835  calciteQueryParsingOption,
836  calciteOptimizationOption)
837  .plan_result;
838  const ExecutionOptions eo_modified{eo.output_columnar_hint,
839  eo.keep_result,
840  eo.allow_multifrag,
841  eo.just_explain,
842  eo.allow_loop_joins,
843  eo.with_watchdog,
844  eo.jit_debug,
845  eo.just_validate,
848  /*find_push_down_candidates=*/false,
849  /*just_calcite_explain=*/false,
854  auto new_ra_executor = RelAlgExecutor(executor.get(), cat, new_query_ra);
855  return std::make_shared<ExecutionResult>(
856  new_ra_executor.executeRelAlgQuery(co, eo_modified, false, nullptr));
857  } else {
858  return result;
859  }
860 }
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:468
bool g_enable_columnar_output
Definition: Execute.cpp:99
QueryState & getQueryState()
Definition: QueryState.h:181
ExecutorExplainType explain_type
bool g_enable_watchdog
double g_gpu_mem_limit_percent
Definition: QueryRunner.cpp:53
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:376

+ Here is the call graph for this function:

+ Here is the caller graph for this function: