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

Classes

class  ExprTableIdVisitor
 

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)
 
void check_valid_join_qual (std::shared_ptr< Analyzer::BinOper > &bin_oper)
 

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 230 of file IRCodegen.cpp.

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

Referenced by Executor::buildCurrentLevelHashTable().

231  {
232  const auto qual_cf = qual_to_conjunctive_form(qual);
233  ra_exe_unit.simple_quals.insert(ra_exe_unit.simple_quals.end(),
234  qual_cf.simple_quals.begin(),
235  qual_cf.simple_quals.end());
236  ra_exe_unit.quals.insert(
237  ra_exe_unit.quals.end(), qual_cf.quals.begin(), qual_cf.quals.end());
238 }
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 240 of file IRCodegen.cpp.

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

244  {
245  if (eo.allow_loop_joins) {
246  return;
247  }
248  if (level_idx + 1 != ra_exe_unit.join_quals.size()) {
249  throw std::runtime_error(
250  "Hash join failed, reason(s): " + fail_reason +
251  " | Cannot fall back to loop join for intermediate join quals");
252  }
253  if (!is_trivial_loop_join(query_infos, ra_exe_unit)) {
254  throw std::runtime_error(
255  "Hash join failed, reason(s): " + fail_reason +
256  " | Cannot fall back to loop join for non-trivial inner table size");
257  }
258 }
bool is_trivial_loop_join(const std::vector< InputTableInfo > &query_infos, const RelAlgExecutionUnit &ra_exe_unit)
Definition: Execute.cpp:1152
const JoinQualsPerNestingLevel join_quals

+ Here is the call graph for this function:

void anonymous_namespace{IRCodegen.cpp}::check_valid_join_qual ( std::shared_ptr< Analyzer::BinOper > &  bin_oper)

Definition at line 260 of file IRCodegen.cpp.

References SQLTypeInfo::get_type(), Analyzer::Expr::get_type_info(), and kARRAY.

Referenced by Executor::buildCurrentLevelHashTable().

260  {
261  // check whether a join qual is valid before entering the hashtable build and codegen
262 
263  auto lhs_cv = dynamic_cast<const Analyzer::ColumnVar*>(bin_oper->get_left_operand());
264  auto rhs_cv = dynamic_cast<const Analyzer::ColumnVar*>(bin_oper->get_right_operand());
265  if (lhs_cv && rhs_cv && !bin_oper->is_overlaps_oper()) {
266  auto lhs_type = lhs_cv->get_type_info().get_type();
267  auto rhs_type = rhs_cv->get_type_info().get_type();
268  // check #1. avoid a join btw full array columns
269  if (lhs_type == SQLTypes::kARRAY && rhs_type == SQLTypes::kARRAY) {
270  throw std::runtime_error(
271  "Join operation between full array columns (i.e., R.arr = S.arr) instead of "
272  "indexed array columns (i.e., R.arr[1] = S.arr[2]) is not supported yet.");
273  }
274  }
275 }
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:314
const SQLTypeInfo & get_type_info() const
Definition: Analyzer.h:78

+ Here is the call graph for this function:

+ Here is the caller graph for this function: