OmniSciDB  c1a53651b2
 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 (const TableDescriptor *td, const Catalog_Namespace::Catalog *catalog)
 
 scalar_exprs_ (std::move(scalar_exprs))
 
 fields_ (fields)
 
 hint_applied_ (false)
 
 hints_ (std::make_unique< Hints >())
 
 has_pushed_down_window_expr_ (false)
 
 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 (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(), const Catalog_Namespace::Catalog *catalog=nullptr)
 
void setUpdateViaSelectFlag (bool required) const
 
void setDeleteViaSelectFlag (bool required) const
 
void setVarlenUpdateRequired (bool required) const
 
void forceRowwiseOutput () const
 
TableDescriptor const * getModifiedTableDescriptor () const
 
TableDescriptor const * getTableDescriptor () const
 
void setModifiedTableDescriptor (TableDescriptor const *td) const
 
const Catalog_Namespace::CataloggetModifiedTableCatalog () const
 
void setModifiedTableCatalog (const Catalog_Namespace::Catalog *catalog) 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
 

Public Attributes

 catalog
 
 hint_applied_ {false}
 
 has_pushed_down_window_expr_
 

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
 
struct RelAlgDagSerializer
 

Additional Inherited Members

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

Detailed Description

Definition at line 1125 of file RelAlgDag.h.

Member Typedef Documentation

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

Definition at line 1128 of file RelAlgDag.h.

Definition at line 1129 of file RelAlgDag.h.

Constructor & Destructor Documentation

RelProject::RelProject ( const TableDescriptor td,
const Catalog_Namespace::Catalog catalog 
)
inline

Definition at line 1132 of file RelAlgDag.h.

Referenced by toHash().

1133  : ModifyManipulationTarget(false, false, false, td, {}, catalog)
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(), const Catalog_Namespace::Catalog *catalog=nullptr)
Definition: RelAlgDag.h:1056

+ 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  , has_pushed_down_window_expr_(rhs.has_pushed_down_window_expr_) {
562  RexDeepCopyVisitor copier;
563  for (auto const& expr : rhs.scalar_exprs_) {
564  scalar_exprs_.push_back(copier.visit(expr.get()));
565  }
566  if (rhs.hint_applied_) {
567  for (auto const& kv : *rhs.hints_) {
568  addHint(kv.second);
569  }
570  }
571 }
RelAlgNode(RelAlgInputs inputs={})
Definition: RelAlgDag.h:840
std::vector< std::string > fields_
Definition: RelAlgDag.h:1312
virtual T visit(const RexScalar *rex_scalar) const
Definition: RexVisitor.h:27
std::vector< std::unique_ptr< const RexScalar > > scalar_exprs_
Definition: RelAlgDag.h:1311
void addHint(const ExplainedQueryHint &hint_explained)
Definition: RelAlgDag.h:1269
std::unique_ptr< Hints > hints_
Definition: RelAlgDag.h:1314
has_pushed_down_window_expr_
Definition: RelAlgDag.h:1135
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(), const Catalog_Namespace::Catalog *catalog=nullptr)
Definition: RelAlgDag.h:1056

+ Here is the call graph for this function:

Member Function Documentation

void RelProject::addHint ( const ExplainedQueryHint hint_explained)
inline

Definition at line 1269 of file RelAlgDag.h.

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

Referenced by RelProject().

1269  {
1270  if (!hint_applied_) {
1271  hint_applied_ = true;
1272  }
1273  hints_->emplace(hint_explained.getHint(), hint_explained);
1274  }
std::unique_ptr< Hints > hints_
Definition: RelAlgDag.h:1314
const QueryHint getHint() const
Definition: QueryHint.h:154

+ 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:1312
std::vector< std::unique_ptr< const RexScalar > > scalar_exprs_
Definition: RelAlgDag.h:1311
std::shared_ptr<RelAlgNode> RelProject::deepCopy ( ) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 1256 of file RelAlgDag.h.

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

1256  {
1257  auto copied_project_node = std::make_shared<RelProject>(*this);
1258  if (isProjectForUpdate()) {
1259  propagateModifyManipulationTarget(copied_project_node);
1260  }
1262  copied_project_node->setPushedDownWindowExpr();
1263  }
1264  return copied_project_node;
1265  }
auto const isProjectForUpdate() const
Definition: RelAlgDag.h:1091
void propagateModifyManipulationTarget(std::shared_ptr< RelProject > new_project_node) const
Definition: RelAlgDag.h:1174
has_pushed_down_window_expr_
Definition: RelAlgDag.h:1135

+ Here is the call graph for this function:

RelProject::fields_ ( fields  )
Hints* RelProject::getDeliveredHints ( )
inline

Definition at line 1292 of file RelAlgDag.h.

References hints_.

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

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

+ Here is the caller graph for this function:

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

Definition at line 1214 of file RelAlgDag.h.

References scalar_exprs_.

1214  {
1215  return std::move(scalar_exprs_);
1216  }
std::vector< std::unique_ptr< const RexScalar > > scalar_exprs_
Definition: RelAlgDag.h:1311
const std::string RelProject::getFieldName ( const size_t  i) const
inline

Definition at line 1221 of file RelAlgDag.h.

References fields_.

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

Definition at line 1218 of file RelAlgDag.h.

References fields_.

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

1218 { return fields_; }
std::vector< std::string > fields_
Definition: RelAlgDag.h:1312

+ Here is the caller graph for this function:

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

Definition at line 1283 of file RelAlgDag.h.

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

1283  {
1285  CHECK(!hints_->empty());
1286  CHECK(hasHintEnabled(hint));
1287  return hints_->at(hint);
1288  }
std::unique_ptr< Hints > hints_
Definition: RelAlgDag.h:1314
#define CHECK(condition)
Definition: Logger.h:291
const bool hasHintEnabled(QueryHint candidate_hint) const
Definition: RelAlgDag.h:1276

+ Here is the call graph for this function:

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

Definition at line 1204 of file RelAlgDag.h.

References CHECK, and scalar_exprs_.

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

1204  {
1205  CHECK(idx < scalar_exprs_.size());
1206  return scalar_exprs_[idx].get();
1207  }
std::vector< std::unique_ptr< const RexScalar > > scalar_exprs_
Definition: RelAlgDag.h:1311
#define CHECK(condition)
Definition: Logger.h:291

+ Here is the caller graph for this function:

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

Definition at line 1209 of file RelAlgDag.h.

References CHECK, and scalar_exprs_.

1209  {
1210  CHECK(idx < scalar_exprs_.size());
1211  return scalar_exprs_[idx].release();
1212  }
std::vector< std::unique_ptr< const RexScalar > > scalar_exprs_
Definition: RelAlgDag.h:1311
#define CHECK(condition)
Definition: Logger.h:291
RelProject::has_pushed_down_window_expr_ ( false  )
inline

Definition at line 1146 of file RelAlgDag.h.

References RelAlgNode::inputs_.

1146  {
1147  inputs_.push_back(input);
1148  }
RelAlgInputs inputs_
Definition: RelAlgDag.h:952
bool RelProject::hasDeliveredHint ( )
inline

Definition at line 1290 of file RelAlgDag.h.

References hints_.

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

Definition at line 1276 of file RelAlgDag.h.

References hint_applied_, and hints_.

Referenced by getHintInfo().

1276  {
1277  if (hint_applied_ && !hints_->empty()) {
1278  return hints_->find(candidate_hint) != hints_->end();
1279  }
1280  return false;
1281  }
std::unique_ptr< Hints > hints_
Definition: RelAlgDag.h:1314

+ Here is the caller graph for this function:

bool RelProject::hasPushedDownWindowExpr ( ) const
inline

Definition at line 1200 of file RelAlgDag.h.

References has_pushed_down_window_expr_.

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

Definition at line 2761 of file RelAlgDag.cpp.

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

2761  {
2762  for (const auto& expr : scalar_exprs_) {
2763  if (is_window_function_operator(expr.get())) {
2764  return true;
2765  }
2766  }
2767  return false;
2768 }
std::vector< std::unique_ptr< const RexScalar > > scalar_exprs_
Definition: RelAlgDag.h:1311

+ Here is the call graph for this function:

RelProject::hint_applied_ ( false  )
RelProject::hints_ ( std::make_unique< Hints ())
void RelProject::injectOffsetInFragmentExpr ( ) const
inlineprivate

Definition at line 1302 of file RelAlgDag.h.

References fields_, kBIGINT, and scalar_exprs_.

1302  {
1304  scalar_exprs_.emplace_back(
1305  std::make_unique<RexFunctionOperator const>(std::string("OFFSET_IN_FRAGMENT"),
1306  transient_vector,
1307  SQLTypeInfo(kBIGINT, false)));
1308  fields_.emplace_back("EXPR$DELETE_OFFSET_IN_FRAGMENT");
1309  }
std::vector< std::string > fields_
Definition: RelAlgDag.h:1312
std::vector< std::unique_ptr< const RexScalar > > scalar_exprs_
Definition: RelAlgDag.h:1311
std::vector< ConstRexScalarPtr > ConstRexScalarPtrVector
Definition: RelAlgDag.h:484
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:301
std::vector< std::unique_ptr< const RexScalar > > scalar_exprs_
Definition: RelAlgDag.h:1311
const RelAlgNode * getInput(const size_t idx) const
Definition: RelAlgDag.h:892
bool isSimple() const
Definition: RelAlgDag.h:1159
#define CHECK(condition)
Definition: Logger.h:291
const size_t inputCount() const
Definition: RelAlgDag.h:890
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:301
std::vector< std::string > fields_
Definition: RelAlgDag.h:1312
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:1311
bool isSimple() const
Definition: RelAlgDag.h:1159
#define CHECK(condition)
Definition: Logger.h:291

+ Here is the call graph for this function:

bool RelProject::isSimple ( ) const
inline

Definition at line 1159 of file RelAlgDag.h.

References scalar_exprs_.

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

1159  {
1160  for (const auto& expr : scalar_exprs_) {
1161  if (!dynamic_cast<const RexInput*>(expr.get())) {
1162  return false;
1163  }
1164  }
1165  return true;
1166  }
std::vector< std::unique_ptr< const RexScalar > > scalar_exprs_
Definition: RelAlgDag.h:1311

+ Here is the caller graph for this function:

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

Definition at line 1174 of file RelAlgDag.h.

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

Referenced by deepCopy().

1175  {
1176  if (isUpdateViaSelect()) {
1177  new_project_node->setUpdateViaSelectFlag(true);
1178  }
1179  if (isDeleteViaSelect()) {
1180  new_project_node->setDeleteViaSelectFlag(true);
1181  }
1182  if (isVarlenUpdateRequired()) {
1183  new_project_node->setVarlenUpdateRequired(true);
1184  }
1185  new_project_node->setModifiedTableDescriptor(getModifiedTableDescriptor());
1186  new_project_node->setTargetColumns(getTargetColumns());
1187  new_project_node->setModifiedTableCatalog(getModifiedTableCatalog());
1189  }
ColumnNameList const & getTargetColumns() const
Definition: RelAlgDag.h:1099
void resetModifyManipulationTarget() const
Definition: RelAlgDag.h:1191
auto const isDeleteViaSelect() const
Definition: RelAlgDag.h:1089
auto const isUpdateViaSelect() const
Definition: RelAlgDag.h:1088
auto const isVarlenUpdateRequired() const
Definition: RelAlgDag.h:1090
TableDescriptor const * getModifiedTableDescriptor() const
Definition: RelAlgDag.h:1076
const Catalog_Namespace::Catalog * getModifiedTableCatalog() const
Definition: RelAlgDag.h:1082

+ 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 1223 of file RelAlgDag.h.

1224  {
1225  replaceInput(old_input, input, std::nullopt);
1226  }
void replaceInput(std::shared_ptr< const RelAlgNode > old_input, std::shared_ptr< const RelAlgNode > input) override
Definition: RelAlgDag.h:1223
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:1311
virtual void replaceInput(std::shared_ptr< const RelAlgNode > old_input, std::shared_ptr< const RelAlgNode > input)
Definition: RelAlgDag.h:915
#define CHECK(condition)
Definition: Logger.h:291

+ Here is the call graph for this function:

void RelProject::resetModifyManipulationTarget ( ) const
inline

Definition at line 1191 of file RelAlgDag.h.

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

Referenced by propagateModifyManipulationTarget().

1191  {
1192  setModifiedTableDescriptor(nullptr);
1193  setModifiedTableCatalog(nullptr);
1194  setUpdateViaSelectFlag(false);
1195  setDeleteViaSelectFlag(false);
1196  setVarlenUpdateRequired(false);
1198  }
void setVarlenUpdateRequired(bool required) const
Definition: RelAlgDag.h:1071
void invalidateTargetColumns() const
Definition: RelAlgDag.h:1101
void setDeleteViaSelectFlag(bool required) const
Definition: RelAlgDag.h:1070
void setUpdateViaSelectFlag(bool required) const
Definition: RelAlgDag.h:1069
void setModifiedTableDescriptor(TableDescriptor const *td) const
Definition: RelAlgDag.h:1078
void setModifiedTableCatalog(const Catalog_Namespace::Catalog *catalog) const
Definition: RelAlgDag.h:1084

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 1152 of file RelAlgDag.h.

References scalar_exprs_.

1152  {
1153  scalar_exprs_ = std::move(exprs);
1154  }
std::vector< std::unique_ptr< const RexScalar > > scalar_exprs_
Definition: RelAlgDag.h:1311
void RelProject::setFields ( std::vector< std::string > &&  fields)
inline

Definition at line 1219 of file RelAlgDag.h.

References fields_.

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

Definition at line 1202 of file RelAlgDag.h.

References has_pushed_down_window_expr_.

1202 { has_pushed_down_window_expr_ = true; }
has_pushed_down_window_expr_
Definition: RelAlgDag.h:1135
size_t RelProject::size ( ) const
inlineoverridevirtual
size_t RelProject::toHash ( ) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 1245 of file RelAlgDag.h.

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

1245  {
1246  if (!hash_) {
1247  hash_ = typeid(RelProject).hash_code();
1248  for (auto& target_expr : scalar_exprs_) {
1249  boost::hash_combine(*hash_, target_expr->toHash());
1250  }
1251  boost::hash_combine(*hash_, ::toString(fields_));
1252  }
1253  return *hash_;
1254  }
RelProject(const TableDescriptor *td, const Catalog_Namespace::Catalog *catalog)
Definition: RelAlgDag.h:1132
std::vector< std::string > fields_
Definition: RelAlgDag.h:1312
std::vector< std::unique_ptr< const RexScalar > > scalar_exprs_
Definition: RelAlgDag.h:1311
std::optional< size_t > hash_
Definition: RelAlgDag.h:955
std::string toString(RelRexToStringConfig config=RelRexToStringConfig::defaults()) const override
Definition: RelAlgDag.h:1236

+ Here is the call graph for this function:

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

Implements RelAlgNode.

Definition at line 1236 of file RelAlgDag.h.

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

Referenced by toHash().

1237  {
1238  auto ret = cat(::typeName(this), "(");
1239  for (auto& expr : scalar_exprs_) {
1240  ret += expr->toString(config) + " ";
1241  }
1242  return cat(ret, ", ", ::toString(fields_), ")");
1243  }
std::string cat(Ts &&...args)
std::vector< std::string > fields_
Definition: RelAlgDag.h:1312
std::vector< std::unique_ptr< const RexScalar > > scalar_exprs_
Definition: RelAlgDag.h:1311
std::string typeName(const T *v)
Definition: toString.h:103
std::string toString(RelRexToStringConfig config=RelRexToStringConfig::defaults()) const override
Definition: RelAlgDag.h:1236

+ 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 1296 of file RelAlgDag.h.

References scalar_exprs_.

1296  {
1297  for (int i = 0; i < static_cast<int>(scalar_exprs_.size()); i++) {
1298  visitor_functor(i);
1299  }
1300  }
std::vector< std::unique_ptr< const RexScalar > > scalar_exprs_
Definition: RelAlgDag.h:1311

Friends And Related Function Documentation

friend struct RelAlgDagSerializer
friend

Definition at line 1317 of file RelAlgDag.h.

friend class RelModify
friend

Definition at line 1127 of file RelAlgDag.h.

Member Data Documentation

RelProject::catalog

Definition at line 1133 of file RelAlgDag.h.

std::vector<std::string> RelProject::fields_
mutableprivate
RelProject::has_pushed_down_window_expr_
Initial value:
{false} {}
RelProject(std::vector<std::unique_ptr<const RexScalar>>& scalar_exprs,
const std::vector<std::string>& fields,
std::shared_ptr<const RelAlgNode> input)

Definition at line 1135 of file RelAlgDag.h.

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

bool RelProject::has_pushed_down_window_expr_
private

Definition at line 1315 of file RelAlgDag.h.

RelProject::hint_applied_ {false}

Definition at line 1134 of file RelAlgDag.h.

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

bool RelProject::hint_applied_
private

Definition at line 1313 of file RelAlgDag.h.

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

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