OmniSciDB  c0231cc57d
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RelProject Class Reference

#include <RelAlgDag.h>

+ Inheritance diagram for RelProject:
+ Collaboration diagram for RelProject:

Public Types

using ConstRexScalarPtr = std::unique_ptr< const RexScalar >
 
using ConstRexScalarPtrVector = std::vector< ConstRexScalarPtr >
 

Public Member Functions

 RelProject (std::vector< std::unique_ptr< const RexScalar >> &scalar_exprs, const std::vector< std::string > &fields, std::shared_ptr< const RelAlgNode > input)
 
 RelProject (RelProject const &)
 
void setExpressions (std::vector< std::unique_ptr< const RexScalar >> &exprs) const
 
bool isSimple () const
 
bool isIdentity () const
 
bool isRenaming () const
 
size_t size () const override
 
void propagateModifyManipulationTarget (std::shared_ptr< RelProject > new_project_node) const
 
void resetModifyManipulationTarget () const
 
bool hasPushedDownWindowExpr () const
 
void setPushedDownWindowExpr ()
 
const RexScalargetProjectAt (const size_t idx) const
 
const RexScalargetProjectAtAndRelease (const size_t idx) const
 
std::vector< std::unique_ptr
< const RexScalar > > 
getExpressionsAndRelease ()
 
const std::vector< std::string > & getFields () const
 
void setFields (std::vector< std::string > &&fields)
 
const std::string getFieldName (const size_t i) const
 
void replaceInput (std::shared_ptr< const RelAlgNode > old_input, std::shared_ptr< const RelAlgNode > input) override
 
void replaceInput (std::shared_ptr< const RelAlgNode > old_input, std::shared_ptr< const RelAlgNode > input, std::optional< std::unordered_map< unsigned, unsigned >> old_to_new_index_map)
 
void appendInput (std::string new_field_name, std::unique_ptr< const RexScalar > new_input)
 
std::string toString (RelRexToStringConfig config=RelRexToStringConfig::defaults()) const override
 
size_t toHash () const override
 
std::shared_ptr< RelAlgNodedeepCopy () const override
 
bool hasWindowFunctionExpr () const
 
void addHint (const ExplainedQueryHint &hint_explained)
 
const bool hasHintEnabled (QueryHint candidate_hint) const
 
const ExplainedQueryHintgetHintInfo (QueryHint hint) const
 
bool hasDeliveredHint ()
 
HintsgetDeliveredHints ()
 
- Public Member Functions inherited from RelAlgNode
 RelAlgNode (RelAlgInputs inputs={})
 
virtual ~RelAlgNode ()
 
void resetQueryExecutionState ()
 
void setContextData (const RaExecutionDesc *context_data) const
 
void setOutputMetainfo (const std::vector< TargetMetaInfo > &targets_metainfo) const
 
void setQueryPlanDag (const std::string &extracted_query_plan_dag) const
 
std::string getQueryPlanDag () const
 
size_t getQueryPlanDagHash () const
 
const std::vector
< TargetMetaInfo > & 
getOutputMetainfo () const
 
unsigned getId () const
 
void setIdInPlanTree (size_t id) const
 
std::optional< size_t > getIdInPlanTree () const
 
bool hasContextData () const
 
const RaExecutionDescgetContextData () const
 
const size_t inputCount () const
 
const RelAlgNodegetInput (const size_t idx) const
 
std::shared_ptr< const RelAlgNodegetAndOwnInput (const size_t idx) const
 
void addManagedInput (std::shared_ptr< const RelAlgNode > input)
 
bool hasInput (const RelAlgNode *needle) const
 
void setRelNodeDagId (const size_t id) const
 
size_t getRelNodeDagId () const
 
bool isNop () const
 
void markAsNop ()
 
void clearContextData () const
 
- Public Member Functions inherited from ModifyManipulationTarget
 ModifyManipulationTarget (bool const update_via_select=false, bool const delete_via_select=false, bool const varlen_update_required=false, TableDescriptor const *table_descriptor=nullptr, ColumnNameList target_columns=ColumnNameList())
 
void setUpdateViaSelectFlag (bool required) const
 
void setDeleteViaSelectFlag (bool required) const
 
void setVarlenUpdateRequired (bool required) const
 
void forceRowwiseOutput () const
 
TableDescriptor const * getModifiedTableDescriptor () const
 
void setModifiedTableDescriptor (TableDescriptor const *td) const
 
auto const isUpdateViaSelect () const
 
auto const isDeleteViaSelect () const
 
auto const isVarlenUpdateRequired () const
 
auto const isProjectForUpdate () const
 
auto const isRowwiseOutputForced () const
 
void setTargetColumns (ColumnNameList const &target_columns) const
 
ColumnNameList const & getTargetColumns () const
 
void invalidateTargetColumns () const
 
template<typename VALIDATION_FUNCTOR >
bool validateTargetColumns (VALIDATION_FUNCTOR validator) const
 

Private Member Functions

template<typename EXPR_VISITOR_FUNCTOR >
void visitScalarExprs (EXPR_VISITOR_FUNCTOR visitor_functor) const
 
void injectOffsetInFragmentExpr () const
 

Private Attributes

std::vector< std::unique_ptr
< const RexScalar > > 
scalar_exprs_
 
std::vector< std::string > fields_
 
bool hint_applied_
 
std::unique_ptr< Hintshints_
 
bool has_pushed_down_window_expr_
 

Friends

class RelModify
 

Additional Inherited Members

- Static Public Member Functions inherited from RelAlgNode
static void resetRelAlgFirstId () noexcept
 
- Protected Attributes inherited from RelAlgNode
RelAlgInputs inputs_
 
const unsigned id_
 
std::optional< size_t > id_in_plan_tree_
 
std::optional< size_t > hash_
 

Detailed Description

Definition at line 1033 of file RelAlgDag.h.

Member Typedef Documentation

using RelProject::ConstRexScalarPtr = std::unique_ptr<const RexScalar>

Definition at line 1036 of file RelAlgDag.h.

Definition at line 1037 of file RelAlgDag.h.

Constructor & Destructor Documentation

RelProject::RelProject ( std::vector< std::unique_ptr< const RexScalar >> &  scalar_exprs,
const std::vector< std::string > &  fields,
std::shared_ptr< const RelAlgNode input 
)
inline

Definition at line 1040 of file RelAlgDag.h.

References RelAlgNode::inputs_.

Referenced by toHash().

1043  : ModifyManipulationTarget(false, false, false, nullptr)
1044  , scalar_exprs_(std::move(scalar_exprs))
1045  , fields_(fields)
1046  , hint_applied_(false)
1047  , hints_(std::make_unique<Hints>())
1048  , has_pushed_down_window_expr_(false) {
1049  inputs_.push_back(input);
1050  }
std::vector< std::string > fields_
Definition: RelAlgDag.h:1212
bool has_pushed_down_window_expr_
Definition: RelAlgDag.h:1215
std::vector< std::unique_ptr< const RexScalar > > scalar_exprs_
Definition: RelAlgDag.h:1211
std::unique_ptr< Hints > hints_
Definition: RelAlgDag.h:1214
bool hint_applied_
Definition: RelAlgDag.h:1213
ModifyManipulationTarget(bool const update_via_select=false, bool const delete_via_select=false, bool const varlen_update_required=false, TableDescriptor const *table_descriptor=nullptr, ColumnNameList target_columns=ColumnNameList())
Definition: RelAlgDag.h:976
RelAlgInputs inputs_
Definition: RelAlgDag.h:886

+ Here is the caller graph for this function:

RelProject::RelProject ( RelProject const &  rhs)

Definition at line 555 of file RelAlgDag.cpp.

References addHint(), hint_applied_, hints_, scalar_exprs_, and RexVisitorBase< T >::visit().

556  : RelAlgNode(rhs)
558  , fields_(rhs.fields_)
559  , hint_applied_(false)
560  , hints_(std::make_unique<Hints>()) {
561  RexDeepCopyVisitor copier;
562  for (auto const& expr : rhs.scalar_exprs_) {
563  scalar_exprs_.push_back(copier.visit(expr.get()));
564  }
565  if (rhs.hint_applied_) {
566  for (auto const& kv : *rhs.hints_) {
567  addHint(kv.second);
568  }
569  }
570 }
RelAlgNode(RelAlgInputs inputs={})
Definition: RelAlgDag.h:774
std::vector< std::string > fields_
Definition: RelAlgDag.h:1212
virtual T visit(const RexScalar *rex_scalar) const
Definition: RexVisitor.h:27
std::vector< std::unique_ptr< const RexScalar > > scalar_exprs_
Definition: RelAlgDag.h:1211
void addHint(const ExplainedQueryHint &hint_explained)
Definition: RelAlgDag.h:1169
std::unique_ptr< Hints > hints_
Definition: RelAlgDag.h:1214
bool hint_applied_
Definition: RelAlgDag.h:1213
ModifyManipulationTarget(bool const update_via_select=false, bool const delete_via_select=false, bool const varlen_update_required=false, TableDescriptor const *table_descriptor=nullptr, ColumnNameList target_columns=ColumnNameList())
Definition: RelAlgDag.h:976

+ Here is the call graph for this function:

Member Function Documentation

void RelProject::addHint ( const ExplainedQueryHint hint_explained)
inline

Definition at line 1169 of file RelAlgDag.h.

References ExplainedQueryHint::getHint(), hint_applied_, and hints_.

Referenced by RelProject().

1169  {
1170  if (!hint_applied_) {
1171  hint_applied_ = true;
1172  }
1173  hints_->emplace(hint_explained.getHint(), hint_explained);
1174  }
std::unique_ptr< Hints > hints_
Definition: RelAlgDag.h:1214
bool hint_applied_
Definition: RelAlgDag.h:1213
const QueryHint getHint() const
Definition: QueryHint.h:123

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void RelProject::appendInput ( std::string  new_field_name,
std::unique_ptr< const RexScalar new_input 
)

Definition at line 364 of file RelAlgDag.cpp.

References fields_, and scalar_exprs_.

365  {
366  fields_.emplace_back(std::move(new_field_name));
367  scalar_exprs_.emplace_back(std::move(new_input));
368 }
std::vector< std::string > fields_
Definition: RelAlgDag.h:1212
std::vector< std::unique_ptr< const RexScalar > > scalar_exprs_
Definition: RelAlgDag.h:1211
std::shared_ptr<RelAlgNode> RelProject::deepCopy ( ) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 1156 of file RelAlgDag.h.

References has_pushed_down_window_expr_, ModifyManipulationTarget::isProjectForUpdate(), and propagateModifyManipulationTarget().

1156  {
1157  auto copied_project_node = std::make_shared<RelProject>(*this);
1158  if (isProjectForUpdate()) {
1159  propagateModifyManipulationTarget(copied_project_node);
1160  }
1162  copied_project_node->setPushedDownWindowExpr();
1163  }
1164  return copied_project_node;
1165  }
auto const isProjectForUpdate() const
Definition: RelAlgDag.h:1002
bool has_pushed_down_window_expr_
Definition: RelAlgDag.h:1215
void propagateModifyManipulationTarget(std::shared_ptr< RelProject > new_project_node) const
Definition: RelAlgDag.h:1076

+ Here is the call graph for this function:

Hints* RelProject::getDeliveredHints ( )
inline

Definition at line 1192 of file RelAlgDag.h.

References hints_.

Referenced by anonymous_namespace{RelAlgDag.cpp}::handle_query_hint().

1192 { return hints_.get(); }
std::unique_ptr< Hints > hints_
Definition: RelAlgDag.h:1214

+ Here is the caller graph for this function:

std::vector<std::unique_ptr<const RexScalar> > RelProject::getExpressionsAndRelease ( )
inline

Definition at line 1114 of file RelAlgDag.h.

References scalar_exprs_.

1114  {
1115  return std::move(scalar_exprs_);
1116  }
std::vector< std::unique_ptr< const RexScalar > > scalar_exprs_
Definition: RelAlgDag.h:1211
const std::string RelProject::getFieldName ( const size_t  i) const
inline

Definition at line 1121 of file RelAlgDag.h.

References fields_.

1121 { return fields_[i]; }
std::vector< std::string > fields_
Definition: RelAlgDag.h:1212
const std::vector<std::string>& RelProject::getFields ( ) const
inline

Definition at line 1118 of file RelAlgDag.h.

References fields_.

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

1118 { return fields_; }
std::vector< std::string > fields_
Definition: RelAlgDag.h:1212

+ Here is the caller graph for this function:

const ExplainedQueryHint& RelProject::getHintInfo ( QueryHint  hint) const
inline

Definition at line 1183 of file RelAlgDag.h.

References CHECK, hasHintEnabled(), hint_applied_, and hints_.

1183  {
1185  CHECK(!hints_->empty());
1186  CHECK(hasHintEnabled(hint));
1187  return hints_->at(hint);
1188  }
std::unique_ptr< Hints > hints_
Definition: RelAlgDag.h:1214
bool hint_applied_
Definition: RelAlgDag.h:1213
#define CHECK(condition)
Definition: Logger.h:222
const bool hasHintEnabled(QueryHint candidate_hint) const
Definition: RelAlgDag.h:1176

+ Here is the call graph for this function:

const RexScalar* RelProject::getProjectAt ( const size_t  idx) const
inline

Definition at line 1104 of file RelAlgDag.h.

References CHECK, and scalar_exprs_.

Referenced by anonymous_namespace{RelAlgDag.cpp}::add_window_function_pre_project(), anonymous_namespace{RelAlgExecutor.cpp}::get_used_inputs(), anonymous_namespace{RelAlgOptimizer.cpp}::is_identical_copy(), anonymous_namespace{RelAlgExecutor.cpp}::scalar_at(), RelRexDagVisitor::visit(), and anonymous_namespace{QueryPhysicalInputsCollector.cpp}::RelAlgPhysicalInputsVisitor::visitProject().

1104  {
1105  CHECK(idx < scalar_exprs_.size());
1106  return scalar_exprs_[idx].get();
1107  }
std::vector< std::unique_ptr< const RexScalar > > scalar_exprs_
Definition: RelAlgDag.h:1211
#define CHECK(condition)
Definition: Logger.h:222

+ Here is the caller graph for this function:

const RexScalar* RelProject::getProjectAtAndRelease ( const size_t  idx) const
inline

Definition at line 1109 of file RelAlgDag.h.

References CHECK, and scalar_exprs_.

1109  {
1110  CHECK(idx < scalar_exprs_.size());
1111  return scalar_exprs_[idx].release();
1112  }
std::vector< std::unique_ptr< const RexScalar > > scalar_exprs_
Definition: RelAlgDag.h:1211
#define CHECK(condition)
Definition: Logger.h:222
bool RelProject::hasDeliveredHint ( )
inline

Definition at line 1190 of file RelAlgDag.h.

References hints_.

1190 { return !hints_->empty(); }
std::unique_ptr< Hints > hints_
Definition: RelAlgDag.h:1214
const bool RelProject::hasHintEnabled ( QueryHint  candidate_hint) const
inline

Definition at line 1176 of file RelAlgDag.h.

References hint_applied_, and hints_.

Referenced by getHintInfo().

1176  {
1177  if (hint_applied_ && !hints_->empty()) {
1178  return hints_->find(candidate_hint) != hints_->end();
1179  }
1180  return false;
1181  }
std::unique_ptr< Hints > hints_
Definition: RelAlgDag.h:1214
bool hint_applied_
Definition: RelAlgDag.h:1213

+ Here is the caller graph for this function:

bool RelProject::hasPushedDownWindowExpr ( ) const
inline

Definition at line 1100 of file RelAlgDag.h.

References has_pushed_down_window_expr_.

1100 { return has_pushed_down_window_expr_; }
bool has_pushed_down_window_expr_
Definition: RelAlgDag.h:1215
bool RelProject::hasWindowFunctionExpr ( ) const

Definition at line 2632 of file RelAlgDag.cpp.

References anonymous_namespace{RelAlgDag.cpp}::anonymous_namespace{RelAlgDag.cpp}::is_window_function_operator(), and scalar_exprs_.

Referenced by RelModify::applyUpdateModificationsToInputNode().

2632  {
2633  for (const auto& expr : scalar_exprs_) {
2634  if (is_window_function_operator(expr.get())) {
2635  return true;
2636  }
2637  }
2638  return false;
2639 }
std::vector< std::unique_ptr< const RexScalar > > scalar_exprs_
Definition: RelAlgDag.h:1211

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void RelProject::injectOffsetInFragmentExpr ( ) const
inlineprivate

Definition at line 1202 of file RelAlgDag.h.

References fields_, kBIGINT, and scalar_exprs_.

1202  {
1204  scalar_exprs_.emplace_back(
1205  std::make_unique<RexFunctionOperator const>(std::string("OFFSET_IN_FRAGMENT"),
1206  transient_vector,
1207  SQLTypeInfo(kBIGINT, false)));
1208  fields_.emplace_back("EXPR$DELETE_OFFSET_IN_FRAGMENT");
1209  }
std::vector< std::string > fields_
Definition: RelAlgDag.h:1212
std::vector< std::unique_ptr< const RexScalar > > scalar_exprs_
Definition: RelAlgDag.h:1211
std::vector< ConstRexScalarPtr > ConstRexScalarPtrVector
Definition: RelAlgDag.h:439
bool RelProject::isIdentity ( ) const

Definition at line 439 of file RelAlgDag.cpp.

References CHECK, CHECK_EQ, get_node_output(), RelAlgNode::getInput(), RelAlgNode::inputCount(), isSimple(), and scalar_exprs_.

439  {
440  if (!isSimple()) {
441  return false;
442  }
443  CHECK_EQ(size_t(1), inputCount());
444  const auto source = getInput(0);
445  if (dynamic_cast<const RelJoin*>(source)) {
446  return false;
447  }
448  const auto source_shape = get_node_output(source);
449  if (source_shape.size() != scalar_exprs_.size()) {
450  return false;
451  }
452  for (size_t i = 0; i < scalar_exprs_.size(); ++i) {
453  const auto& scalar_expr = scalar_exprs_[i];
454  const auto input = dynamic_cast<const RexInput*>(scalar_expr.get());
455  CHECK(input);
456  CHECK_EQ(source, input->getSourceNode());
457  // We should add the additional check that input->getIndex() !=
458  // source_shape[i].getIndex(), but Calcite doesn't generate the right
459  // Sort-Project-Sort sequence when joins are involved.
460  if (input->getSourceNode() != source_shape[i].getSourceNode()) {
461  return false;
462  }
463  }
464  return true;
465 }
#define CHECK_EQ(x, y)
Definition: Logger.h:230
std::vector< std::unique_ptr< const RexScalar > > scalar_exprs_
Definition: RelAlgDag.h:1211
const RelAlgNode * getInput(const size_t idx) const
Definition: RelAlgDag.h:826
bool isSimple() const
Definition: RelAlgDag.h:1061
#define CHECK(condition)
Definition: Logger.h:222
const size_t inputCount() const
Definition: RelAlgDag.h:824
RANodeOutput get_node_output(const RelAlgNode *ra_node)
Definition: RelAlgDag.cpp:370

+ Here is the call graph for this function:

bool RelProject::isRenaming ( ) const

Definition at line 512 of file RelAlgDag.cpp.

References CHECK, CHECK_EQ, fields_, anonymous_namespace{RelAlgDag.cpp}::isRenamedInput(), isSimple(), and scalar_exprs_.

512  {
513  if (!isSimple()) {
514  return false;
515  }
516  CHECK_EQ(scalar_exprs_.size(), fields_.size());
517  for (size_t i = 0; i < fields_.size(); ++i) {
518  auto rex_in = dynamic_cast<const RexInput*>(scalar_exprs_[i].get());
519  CHECK(rex_in);
520  if (isRenamedInput(rex_in->getSourceNode(), rex_in->getIndex(), fields_[i])) {
521  return true;
522  }
523  }
524  return false;
525 }
#define CHECK_EQ(x, y)
Definition: Logger.h:230
std::vector< std::string > fields_
Definition: RelAlgDag.h:1212
bool isRenamedInput(const RelAlgNode *node, const size_t index, const std::string &new_name)
Definition: RelAlgDag.cpp:469
std::vector< std::unique_ptr< const RexScalar > > scalar_exprs_
Definition: RelAlgDag.h:1211
bool isSimple() const
Definition: RelAlgDag.h:1061
#define CHECK(condition)
Definition: Logger.h:222

+ Here is the call graph for this function:

bool RelProject::isSimple ( ) const
inline

Definition at line 1061 of file RelAlgDag.h.

References scalar_exprs_.

Referenced by RelAlgExecutor::executeProject(), isIdentity(), isRenaming(), and anonymous_namespace{RelAlgOptimizer.cpp}::safe_to_redirect().

1061  {
1062  for (const auto& expr : scalar_exprs_) {
1063  if (!dynamic_cast<const RexInput*>(expr.get())) {
1064  return false;
1065  }
1066  }
1067  return true;
1068  }
std::vector< std::unique_ptr< const RexScalar > > scalar_exprs_
Definition: RelAlgDag.h:1211

+ Here is the caller graph for this function:

void RelProject::propagateModifyManipulationTarget ( std::shared_ptr< RelProject new_project_node) const
inline

Definition at line 1076 of file RelAlgDag.h.

References ModifyManipulationTarget::getModifiedTableDescriptor(), ModifyManipulationTarget::getTargetColumns(), ModifyManipulationTarget::isDeleteViaSelect(), ModifyManipulationTarget::isUpdateViaSelect(), ModifyManipulationTarget::isVarlenUpdateRequired(), and resetModifyManipulationTarget().

Referenced by deepCopy().

1077  {
1078  if (isUpdateViaSelect()) {
1079  new_project_node->setUpdateViaSelectFlag(true);
1080  }
1081  if (isDeleteViaSelect()) {
1082  new_project_node->setDeleteViaSelectFlag(true);
1083  }
1084  if (isVarlenUpdateRequired()) {
1085  new_project_node->setVarlenUpdateRequired(true);
1086  }
1087  new_project_node->setModifiedTableDescriptor(getModifiedTableDescriptor());
1088  new_project_node->setTargetColumns(getTargetColumns());
1090  }
ColumnNameList const & getTargetColumns() const
Definition: RelAlgDag.h:1010
void resetModifyManipulationTarget() const
Definition: RelAlgDag.h:1092
auto const isDeleteViaSelect() const
Definition: RelAlgDag.h:1000
auto const isUpdateViaSelect() const
Definition: RelAlgDag.h:999
auto const isVarlenUpdateRequired() const
Definition: RelAlgDag.h:1001
TableDescriptor const * getModifiedTableDescriptor() const
Definition: RelAlgDag.h:994

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void RelProject::replaceInput ( std::shared_ptr< const RelAlgNode old_input,
std::shared_ptr< const RelAlgNode input 
)
inlineoverridevirtual

Reimplemented from RelAlgNode.

Definition at line 1123 of file RelAlgDag.h.

1124  {
1125  replaceInput(old_input, input, std::nullopt);
1126  }
void replaceInput(std::shared_ptr< const RelAlgNode > old_input, std::shared_ptr< const RelAlgNode > input) override
Definition: RelAlgDag.h:1123
void RelProject::replaceInput ( std::shared_ptr< const RelAlgNode old_input,
std::shared_ptr< const RelAlgNode input,
std::optional< std::unordered_map< unsigned, unsigned >>  old_to_new_index_map 
)

Definition at line 345 of file RelAlgDag.cpp.

References CHECK, RelAlgNode::replaceInput(), and scalar_exprs_.

348  {
349  RelAlgNode::replaceInput(old_input, input);
350  std::unique_ptr<RexRebindInputsVisitor> rebind_inputs;
351  if (old_to_new_index_map) {
352  rebind_inputs = std::make_unique<RexRebindReindexInputsVisitor>(
353  old_input.get(), input.get(), *old_to_new_index_map);
354  } else {
355  rebind_inputs =
356  std::make_unique<RexRebindInputsVisitor>(old_input.get(), input.get());
357  }
358  CHECK(rebind_inputs);
359  for (const auto& scalar_expr : scalar_exprs_) {
360  rebind_inputs->visit(scalar_expr.get());
361  }
362 }
std::vector< std::unique_ptr< const RexScalar > > scalar_exprs_
Definition: RelAlgDag.h:1211
virtual void replaceInput(std::shared_ptr< const RelAlgNode > old_input, std::shared_ptr< const RelAlgNode > input)
Definition: RelAlgDag.h:849
#define CHECK(condition)
Definition: Logger.h:222

+ Here is the call graph for this function:

void RelProject::resetModifyManipulationTarget ( ) const
inline

Definition at line 1092 of file RelAlgDag.h.

References ModifyManipulationTarget::invalidateTargetColumns(), ModifyManipulationTarget::setDeleteViaSelectFlag(), ModifyManipulationTarget::setModifiedTableDescriptor(), ModifyManipulationTarget::setUpdateViaSelectFlag(), and ModifyManipulationTarget::setVarlenUpdateRequired().

Referenced by propagateModifyManipulationTarget().

1092  {
1093  setModifiedTableDescriptor(nullptr);
1094  setUpdateViaSelectFlag(false);
1095  setDeleteViaSelectFlag(false);
1096  setVarlenUpdateRequired(false);
1098  }
void setVarlenUpdateRequired(bool required) const
Definition: RelAlgDag.h:989
void invalidateTargetColumns() const
Definition: RelAlgDag.h:1012
void setDeleteViaSelectFlag(bool required) const
Definition: RelAlgDag.h:988
void setUpdateViaSelectFlag(bool required) const
Definition: RelAlgDag.h:987
void setModifiedTableDescriptor(TableDescriptor const *td) const
Definition: RelAlgDag.h:995

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void RelProject::setExpressions ( std::vector< std::unique_ptr< const RexScalar >> &  exprs) const
inline

Definition at line 1054 of file RelAlgDag.h.

References scalar_exprs_.

1054  {
1055  scalar_exprs_ = std::move(exprs);
1056  }
std::vector< std::unique_ptr< const RexScalar > > scalar_exprs_
Definition: RelAlgDag.h:1211
void RelProject::setFields ( std::vector< std::string > &&  fields)
inline

Definition at line 1119 of file RelAlgDag.h.

References fields_.

1119 { fields_ = std::move(fields); }
std::vector< std::string > fields_
Definition: RelAlgDag.h:1212
void RelProject::setPushedDownWindowExpr ( )
inline

Definition at line 1102 of file RelAlgDag.h.

References has_pushed_down_window_expr_.

1102 { has_pushed_down_window_expr_ = true; }
bool has_pushed_down_window_expr_
Definition: RelAlgDag.h:1215
size_t RelProject::size ( ) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 1074 of file RelAlgDag.h.

References scalar_exprs_.

Referenced by anonymous_namespace{RelAlgExecutor.cpp}::get_scalar_sources_size(), anonymous_namespace{RelAlgExecutor.cpp}::get_used_inputs(), anonymous_namespace{RelAlgOptimizer.cpp}::is_identical_copy(), RelRexDagVisitor::visit(), and anonymous_namespace{QueryPhysicalInputsCollector.cpp}::RelAlgPhysicalInputsVisitor::visitProject().

1074 { return scalar_exprs_.size(); }
std::vector< std::unique_ptr< const RexScalar > > scalar_exprs_
Definition: RelAlgDag.h:1211

+ Here is the caller graph for this function:

size_t RelProject::toHash ( ) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 1145 of file RelAlgDag.h.

References fields_, RelAlgNode::hash_, RelProject(), scalar_exprs_, and toString().

1145  {
1146  if (!hash_) {
1147  hash_ = typeid(RelProject).hash_code();
1148  for (auto& target_expr : scalar_exprs_) {
1149  boost::hash_combine(*hash_, target_expr->toHash());
1150  }
1151  boost::hash_combine(*hash_, ::toString(fields_));
1152  }
1153  return *hash_;
1154  }
std::vector< std::string > fields_
Definition: RelAlgDag.h:1212
std::vector< std::unique_ptr< const RexScalar > > scalar_exprs_
Definition: RelAlgDag.h:1211
std::optional< size_t > hash_
Definition: RelAlgDag.h:889
std::string toString(RelRexToStringConfig config=RelRexToStringConfig::defaults()) const override
Definition: RelAlgDag.h:1136
RelProject(std::vector< std::unique_ptr< const RexScalar >> &scalar_exprs, const std::vector< std::string > &fields, std::shared_ptr< const RelAlgNode > input)
Definition: RelAlgDag.h:1040

+ Here is the call graph for this function:

std::string RelProject::toString ( RelRexToStringConfig  config = RelRexToStringConfig::defaults()) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 1136 of file RelAlgDag.h.

References cat(), fields_, scalar_exprs_, and typeName().

Referenced by toHash().

1137  {
1138  auto ret = cat(::typeName(this), "(");
1139  for (auto& expr : scalar_exprs_) {
1140  ret += expr->toString(config) + " ";
1141  }
1142  return cat(ret, ", ", ::toString(fields_), ")");
1143  }
std::string cat(Ts &&...args)
std::vector< std::string > fields_
Definition: RelAlgDag.h:1212
std::vector< std::unique_ptr< const RexScalar > > scalar_exprs_
Definition: RelAlgDag.h:1211
std::string typeName(const T *v)
Definition: toString.h:103
std::string toString(RelRexToStringConfig config=RelRexToStringConfig::defaults()) const override
Definition: RelAlgDag.h:1136

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename EXPR_VISITOR_FUNCTOR >
void RelProject::visitScalarExprs ( EXPR_VISITOR_FUNCTOR  visitor_functor) const
inlineprivate

Definition at line 1196 of file RelAlgDag.h.

References scalar_exprs_.

Referenced by RelModify::applyUpdateModificationsToInputNode().

1196  {
1197  for (int i = 0; i < static_cast<int>(scalar_exprs_.size()); i++) {
1198  visitor_functor(i);
1199  }
1200  }
std::vector< std::unique_ptr< const RexScalar > > scalar_exprs_
Definition: RelAlgDag.h:1211

+ Here is the caller graph for this function:

Friends And Related Function Documentation

friend class RelModify
friend

Definition at line 1035 of file RelAlgDag.h.

Member Data Documentation

std::vector<std::string> RelProject::fields_
mutableprivate
bool RelProject::has_pushed_down_window_expr_
private

Definition at line 1215 of file RelAlgDag.h.

Referenced by deepCopy(), hasPushedDownWindowExpr(), and setPushedDownWindowExpr().

bool RelProject::hint_applied_
private

Definition at line 1213 of file RelAlgDag.h.

Referenced by addHint(), getHintInfo(), hasHintEnabled(), and RelProject().

std::unique_ptr<Hints> RelProject::hints_
private

The documentation for this class was generated from the following files: