OmniSciDB  04ee39c94c
RelAlgTranslator.cpp File Reference
+ Include dependency graph for RelAlgTranslator.cpp:

Go to the source code of this file.

Namespaces

 anonymous_namespace{RelAlgTranslator.cpp}
 

Functions

SQLTypeInfo anonymous_namespace{RelAlgTranslator.cpp}::build_type_info (const SQLTypes sql_type, const int scale, const int precision)
 
std::pair< std::shared_ptr< Analyzer::Expr >, SQLQualifieranonymous_namespace{RelAlgTranslator.cpp}::get_quantified_rhs (const RexScalar *rex_scalar, const RelAlgTranslator &translator)
 
std::pair< Datum, bool > anonymous_namespace{RelAlgTranslator.cpp}::datum_from_scalar_tv (const ScalarTargetValue *scalar_tv, const SQLTypeInfo &ti) noexcept
 
std::shared_ptr< Analyzer::Expranonymous_namespace{RelAlgTranslator.cpp}::get_in_values_expr (std::shared_ptr< Analyzer::Expr > arg, const ResultSet &val_set)
 
void anonymous_namespace{RelAlgTranslator.cpp}::fill_dictionary_encoded_in_vals (std::vector< int64_t > &in_vals, std::atomic< size_t > &total_in_vals_count, const ResultSet *values_rowset, const std::pair< int64_t, int64_t > values_rowset_slice, const StringDictionaryProxy *source_dict, const StringDictionaryProxy *dest_dict, const int64_t needle_null_val)
 
void anonymous_namespace{RelAlgTranslator.cpp}::fill_integer_in_vals (std::vector< int64_t > &in_vals, std::atomic< size_t > &total_in_vals_count, const ResultSet *values_rowset, const std::pair< int64_t, int64_t > values_rowset_slice)
 
void anonymous_namespace{RelAlgTranslator.cpp}::fill_dictionary_encoded_in_vals (std::vector< int64_t > &in_vals, std::atomic< size_t > &total_in_vals_count, const ResultSet *values_rowset, const std::pair< int64_t, int64_t > values_rowset_slice, const std::vector< LeafHostInfo > &leaf_hosts, const DictRef source_dict_ref, const DictRef dest_dict_ref, const int32_t dest_generation, const int64_t needle_null_val)
 
std::shared_ptr< Analyzer::Constantanonymous_namespace{RelAlgTranslator.cpp}::makeNumericConstant (const SQLTypeInfo &ti, const long val)
 
std::string anonymous_namespace{RelAlgTranslator.cpp}::get_datetimeplus_rewrite_funcname (const SQLOps &op)
 
std::vector< Analyzer::OrderEntryanonymous_namespace{RelAlgTranslator.cpp}::translate_collation (const std::vector< SortField > &sort_fields)
 
bool anonymous_namespace{RelAlgTranslator.cpp}::supported_lower_bound (const RexWindowFunctionOperator::RexWindowBound &window_bound)
 
bool anonymous_namespace{RelAlgTranslator.cpp}::supported_upper_bound (const RexWindowFunctionOperator *rex_window_function)
 
QualsConjunctiveForm qual_to_conjunctive_form (const std::shared_ptr< Analyzer::Expr > qual_expr)
 
std::vector< std::shared_ptr< Analyzer::Expr > > qual_to_disjunctive_form (const std::shared_ptr< Analyzer::Expr > &qual_expr)
 

Variables

bool g_enable_watchdog
 
const size_t anonymous_namespace{RelAlgTranslator.cpp}::g_max_integer_set_size {1 << 25}
 

Function Documentation

◆ qual_to_conjunctive_form()

QualsConjunctiveForm qual_to_conjunctive_form ( const std::shared_ptr< Analyzer::Expr qual_expr)

Definition at line 1612 of file RelAlgTranslator.cpp.

References CHECK, kAND, qual_to_conjunctive_form(), rewrite_expr(), and QualsConjunctiveForm::simple_quals.

Referenced by anonymous_namespace{IRCodegen.cpp}::add_qualifier_to_execution_unit(), RelAlgExecutor::makeJoinQuals(), qual_to_conjunctive_form(), anonymous_namespace{RelAlgExecutor.cpp}::reverse_logical_distribution(), Executor::skipFragmentInnerJoins(), and anonymous_namespace{RelAlgExecutor.cpp}::translate_quals().

1613  {
1614  CHECK(qual_expr);
1615  auto bin_oper = std::dynamic_pointer_cast<const Analyzer::BinOper>(qual_expr);
1616  if (!bin_oper) {
1617  const auto rewritten_qual_expr = rewrite_expr(qual_expr.get());
1618  return {{}, {rewritten_qual_expr ? rewritten_qual_expr : qual_expr}};
1619  }
1620 
1621  if (bin_oper->get_optype() == kAND) {
1622  const auto lhs_cf = qual_to_conjunctive_form(bin_oper->get_own_left_operand());
1623  const auto rhs_cf = qual_to_conjunctive_form(bin_oper->get_own_right_operand());
1624  auto simple_quals = lhs_cf.simple_quals;
1625  simple_quals.insert(
1626  simple_quals.end(), rhs_cf.simple_quals.begin(), rhs_cf.simple_quals.end());
1627  auto quals = lhs_cf.quals;
1628  quals.insert(quals.end(), rhs_cf.quals.begin(), rhs_cf.quals.end());
1629  return {simple_quals, quals};
1630  }
1631  int rte_idx{0};
1632  const auto simple_qual = bin_oper->normalize_simple_predicate(rte_idx);
1633  return simple_qual ? QualsConjunctiveForm{{simple_qual}, {}}
1634  : QualsConjunctiveForm{{}, {qual_expr}};
1635 }
Analyzer::ExpressionPtr rewrite_expr(const Analyzer::Expr *expr)
QualsConjunctiveForm qual_to_conjunctive_form(const std::shared_ptr< Analyzer::Expr > qual_expr)
Definition: sqldefs.h:37
#define CHECK(condition)
Definition: Logger.h:187
const 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:

◆ qual_to_disjunctive_form()

std::vector<std::shared_ptr<Analyzer::Expr> > qual_to_disjunctive_form ( const std::shared_ptr< Analyzer::Expr > &  qual_expr)

Definition at line 1637 of file RelAlgTranslator.cpp.

References CHECK, kOR, qual_to_disjunctive_form(), and rewrite_expr().

Referenced by qual_to_disjunctive_form(), and anonymous_namespace{RelAlgExecutor.cpp}::reverse_logical_distribution().

1638  {
1639  CHECK(qual_expr);
1640  const auto bin_oper = std::dynamic_pointer_cast<const Analyzer::BinOper>(qual_expr);
1641  if (!bin_oper) {
1642  const auto rewritten_qual_expr = rewrite_expr(qual_expr.get());
1643  return {rewritten_qual_expr ? rewritten_qual_expr : qual_expr};
1644  }
1645  if (bin_oper->get_optype() == kOR) {
1646  const auto lhs_df = qual_to_disjunctive_form(bin_oper->get_own_left_operand());
1647  const auto rhs_df = qual_to_disjunctive_form(bin_oper->get_own_right_operand());
1648  auto quals = lhs_df;
1649  quals.insert(quals.end(), rhs_df.begin(), rhs_df.end());
1650  return quals;
1651  }
1652  return {qual_expr};
1653 }
Definition: sqldefs.h:38
Analyzer::ExpressionPtr rewrite_expr(const Analyzer::Expr *expr)
#define CHECK(condition)
Definition: Logger.h:187
std::vector< std::shared_ptr< Analyzer::Expr > > qual_to_disjunctive_form(const std::shared_ptr< Analyzer::Expr > &qual_expr)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ g_enable_watchdog