OmniSciDB  343343d194
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
anonymous_namespace{IRCodegen.cpp} Namespace Reference

Functions

void add_qualifier_to_execution_unit (RelAlgExecutionUnit &ra_exe_unit, const std::shared_ptr< Analyzer::Expr > &qual)
 
void check_if_loop_join_is_allowed (RelAlgExecutionUnit &ra_exe_unit, const ExecutionOptions &eo, const std::vector< InputTableInfo > &query_infos, const size_t level_idx, const std::string &fail_reason)
 

Function Documentation

void anonymous_namespace{IRCodegen.cpp}::add_qualifier_to_execution_unit ( RelAlgExecutionUnit ra_exe_unit,
const std::shared_ptr< Analyzer::Expr > &  qual 
)

Definition at line 178 of file IRCodegen.cpp.

References qual_to_conjunctive_form(), RelAlgExecutionUnit::quals, and RelAlgExecutionUnit::simple_quals.

Referenced by Executor::buildCurrentLevelHashTable().

179  {
180  const auto qual_cf = qual_to_conjunctive_form(qual);
181  ra_exe_unit.simple_quals.insert(ra_exe_unit.simple_quals.end(),
182  qual_cf.simple_quals.begin(),
183  qual_cf.simple_quals.end());
184  ra_exe_unit.quals.insert(
185  ra_exe_unit.quals.end(), qual_cf.quals.begin(), qual_cf.quals.end());
186 }
QualsConjunctiveForm qual_to_conjunctive_form(const std::shared_ptr< Analyzer::Expr > qual_expr)
std::list< std::shared_ptr< Analyzer::Expr > > quals
std::list< std::shared_ptr< Analyzer::Expr > > simple_quals

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void anonymous_namespace{IRCodegen.cpp}::check_if_loop_join_is_allowed ( RelAlgExecutionUnit ra_exe_unit,
const ExecutionOptions eo,
const std::vector< InputTableInfo > &  query_infos,
const size_t  level_idx,
const std::string &  fail_reason 
)

Definition at line 188 of file IRCodegen.cpp.

References ExecutionOptions::allow_loop_joins, is_trivial_loop_join(), and RelAlgExecutionUnit::join_quals.

192  {
193  if (eo.allow_loop_joins) {
194  return;
195  }
196  if (level_idx + 1 != ra_exe_unit.join_quals.size()) {
197  throw std::runtime_error(
198  "Hash join failed, reason(s): " + fail_reason +
199  " | Cannot fall back to loop join for intermediate join quals");
200  }
201  if (!is_trivial_loop_join(query_infos, ra_exe_unit)) {
202  throw std::runtime_error(
203  "Hash join failed, reason(s): " + fail_reason +
204  " | Cannot fall back to loop join for non-trivial inner table size");
205  }
206 }
bool is_trivial_loop_join(const std::vector< InputTableInfo > &query_infos, const RelAlgExecutionUnit &ra_exe_unit)
Definition: Execute.cpp:1062
const JoinQualsPerNestingLevel join_quals
const bool allow_loop_joins

+ Here is the call graph for this function: