OmniSciDB  04ee39c94c
anonymous_namespace{RelAlgAbstractInterpreter.cpp}::anonymous_namespace{RelAlgAbstractInterpreter.cpp} Namespace Reference

Classes

class  CoalesceSecondaryProjectVisitor
 
class  RexInputReplacementVisitor
 

Functions

std::vector< const Rex * > reproject_targets (const RelProject *simple_project, const std::vector< const Rex *> &target_exprs) noexcept
 
bool input_can_be_coalesced (const RelAlgNode *parent_node, const size_t index, const bool first_rex_is_input)
 
bool project_has_window_function_input (const RelProject *ra_project)
 

Function Documentation

◆ input_can_be_coalesced()

bool anonymous_namespace{RelAlgAbstractInterpreter.cpp}::anonymous_namespace{RelAlgAbstractInterpreter.cpp}::input_can_be_coalesced ( const RelAlgNode parent_node,
const size_t  index,
const bool  first_rex_is_input 
)

Definition at line 1186 of file RelAlgAbstractInterpreter.cpp.

Referenced by anonymous_namespace{RelAlgAbstractInterpreter.cpp}::coalesce_nodes(), and anonymous_namespace{RelAlgAbstractInterpreter.cpp}::anonymous_namespace{RelAlgAbstractInterpreter.cpp}::CoalesceSecondaryProjectVisitor::visitInput().

1188  {
1189  if (auto agg_node = dynamic_cast<const RelAggregate*>(parent_node)) {
1190  if (index == 0 && agg_node->getGroupByCount() > 0) {
1191  return true;
1192  } else {
1193  // Is an aggregated target, only allow the project to be elided if the aggregate
1194  // target is simply passed through (i.e. if the top level expression attached to
1195  // the project node is a RexInput expression)
1196  return first_rex_is_input;
1197  }
1198  }
1199  return first_rex_is_input;
1200 }
+ Here is the caller graph for this function:

◆ project_has_window_function_input()

bool anonymous_namespace{RelAlgAbstractInterpreter.cpp}::anonymous_namespace{RelAlgAbstractInterpreter.cpp}::project_has_window_function_input ( const RelProject ra_project)
inline

Definition at line 1230 of file RelAlgAbstractInterpreter.cpp.

References RelProject::getProjectAt(), and RelProject::size().

Referenced by anonymous_namespace{RelAlgAbstractInterpreter.cpp}::coalesce_nodes().

1230  {
1231  for (size_t i = 0; i < ra_project->size(); i++) {
1232  if (dynamic_cast<const RexWindowFunctionOperator*>(ra_project->getProjectAt(i))) {
1233  return true;
1234  }
1235  }
1236  return false;
1237 }
size_t size() const override
const RexScalar * getProjectAt(const size_t idx) const
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reproject_targets()

std::vector<const Rex*> anonymous_namespace{RelAlgAbstractInterpreter.cpp}::anonymous_namespace{RelAlgAbstractInterpreter.cpp}::reproject_targets ( const RelProject simple_project,
const std::vector< const Rex *> &  target_exprs 
)
noexcept

Definition at line 937 of file RelAlgAbstractInterpreter.cpp.

References CHECK, CHECK_LT, and run-benchmark-import::result.

Referenced by anonymous_namespace{RelAlgAbstractInterpreter.cpp}::create_compound().

939  {
940  std::vector<const Rex*> result;
941  for (size_t i = 0; i < simple_project->size(); ++i) {
942  const auto input_rex = dynamic_cast<const RexInput*>(simple_project->getProjectAt(i));
943  CHECK(input_rex);
944  CHECK_LT(static_cast<size_t>(input_rex->getIndex()), target_exprs.size());
945  result.push_back(target_exprs[input_rex->getIndex()]);
946  }
947  return result;
948 }
size_t size() const override
const RexScalar * getProjectAt(const size_t idx) const
#define CHECK_LT(x, y)
Definition: Logger.h:197
#define CHECK(condition)
Definition: Logger.h:187
+ Here is the caller graph for this function: