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

Classes

class  OrToInVisitor
 
class  RecursiveOrToInVisitor
 
class  ArrayElementStringLiteralEncodingVisitor
 
class  ConstantFoldingVisitor
 

Functions

const Analyzer::Exprstrip_likelihood (const Analyzer::Expr *expr)
 
void update_input_to_nest_lv (std::unordered_map< const RelAlgNode *, int > &input_to_nest_level, shared::ColumnKey const &column_key, int target_nest_lv)
 
int update_input_desc (std::vector< InputDescriptor > &input_descs, shared::ColumnKey const &column_key, int target_nest_lv)
 
auto update_input_col_desc (std::list< std::shared_ptr< const InputColDescriptor >> &input_col_desc, shared::ColumnKey const &column_key, int target_nest_lv)
 

Function Documentation

const Analyzer::Expr* anonymous_namespace{ExpressionRewrite.cpp}::strip_likelihood ( const Analyzer::Expr expr)

Definition at line 765 of file ExpressionRewrite.cpp.

Referenced by fold_expr(), and rewrite_expr().

765  {
766  const auto with_likelihood = dynamic_cast<const Analyzer::LikelihoodExpr*>(expr);
767  if (!with_likelihood) {
768  return expr;
769  }
770  return with_likelihood->get_arg();
771 }

+ Here is the caller graph for this function:

auto anonymous_namespace{ExpressionRewrite.cpp}::update_input_col_desc ( std::list< std::shared_ptr< const InputColDescriptor >> &  input_col_desc,
shared::ColumnKey const &  column_key,
int  target_nest_lv 
)

Definition at line 839 of file ExpressionRewrite.cpp.

References shared::ColumnKey::db_id, and shared::ColumnKey::table_id.

Referenced by translate_bounding_box_intersect_with_reordering().

842  {
843  for (auto it = input_col_desc.begin(); it != input_col_desc.end(); it++) {
844  auto const tbl_key = (*it)->getScanDesc().getTableKey();
845  if (tbl_key.db_id == column_key.db_id && tbl_key.table_id == column_key.table_id) {
846  (*it) = std::make_shared<InputColDescriptor>(
847  (*it)->getColId(), tbl_key.table_id, tbl_key.db_id, target_nest_lv);
848  return it;
849  }
850  }
851  return input_col_desc.end();
852 }

+ Here is the caller graph for this function:

int anonymous_namespace{ExpressionRewrite.cpp}::update_input_desc ( std::vector< InputDescriptor > &  input_descs,
shared::ColumnKey const &  column_key,
int  target_nest_lv 
)

Definition at line 825 of file ExpressionRewrite.cpp.

References shared::ColumnKey::db_id, and shared::ColumnKey::table_id.

Referenced by translate_bounding_box_intersect_with_reordering().

827  {
828  int num_input_descs = static_cast<int>(input_descs.size());
829  for (int i = 0; i < num_input_descs; i++) {
830  auto const tbl_key = input_descs[i].getTableKey();
831  if (tbl_key.db_id == column_key.db_id && tbl_key.table_id == column_key.table_id) {
832  input_descs[i] = InputDescriptor(tbl_key.db_id, tbl_key.table_id, target_nest_lv);
833  return i;
834  }
835  }
836  return -1;
837 }

+ Here is the caller graph for this function:

void anonymous_namespace{ExpressionRewrite.cpp}::update_input_to_nest_lv ( std::unordered_map< const RelAlgNode *, int > &  input_to_nest_level,
shared::ColumnKey const &  column_key,
int  target_nest_lv 
)

Definition at line 806 of file ExpressionRewrite.cpp.

References anonymous_namespace{QueryMemoryDescriptor.cpp}::any_of(), shared::ColumnKey::db_id, get_physical_table_inputs(), and shared::ColumnKey::table_id.

Referenced by translate_bounding_box_intersect_with_reordering().

809  {
810  for (auto& kv : input_to_nest_level) {
811  auto ra = kv.first;
812  auto table_keys = get_physical_table_inputs(ra);
813  if (std::any_of(table_keys.begin(),
814  table_keys.end(),
815  [column_key](shared::TableKey const& key) {
816  return key.table_id == column_key.table_id &&
817  key.db_id == column_key.db_id;
818  })) {
819  input_to_nest_level[ra] = target_nest_lv;
820  return;
821  }
822  }
823 }
std::unordered_set< shared::TableKey > get_physical_table_inputs(const RelAlgNode *ra)
bool any_of(std::vector< Analyzer::Expr * > const &target_exprs)

+ Here is the call graph for this function:

+ Here is the caller graph for this function: