OmniSciDB
a5dc49c757
|
#include <RelAlgDag.h>
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 &) | |
virtual void | acceptChildren (Visitor &v) const override |
virtual void | accept (Visitor &v, std::string name) const override |
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 RexScalar * | getProjectAt (const size_t idx) const |
const RexScalar * | getProjectAtAndRelease (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 idx) 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 |
std::shared_ptr< RelAlgNode > | deepCopy () const override |
bool | hasWindowFunctionExpr () const |
void | addHint (const ExplainedQueryHint &hint_explained) |
const bool | hasHintEnabled (QueryHint candidate_hint) const |
const ExplainedQueryHint & | getHintInfo (QueryHint hint) const |
bool | hasDeliveredHint () |
Hints * | getDeliveredHints () |
virtual size_t | toHash () const override |
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 |
bool | hasContextData () const |
const RaExecutionDesc * | getContextData () const |
const size_t | inputCount () const |
const RelAlgNode * | getInput (const size_t idx) const |
const std::vector< RelAlgNode const * > | getInputs () const |
std::shared_ptr< const RelAlgNode > | getAndOwnInput (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 RelAlgDagNode | |
RelAlgDagNode () | |
virtual size_t | getStepNumber () const |
virtual void | setStepNumber (size_t step) const |
std::optional< size_t > | getIdInPlanTree () const |
void | setIdInPlanTree (size_t id) 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::Catalog * | getModifiedTableCatalog () 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< Hints > | hints_ |
bool | has_pushed_down_window_expr_ |
Friends | |
class | RelModify |
struct | RelAlgDagSerializer |
std::size_t | hash_value (RelProject const &) |
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 > | hash_ |
Protected Attributes inherited from RelAlgDagNode | |
size_t | step_ {0} |
std::optional< size_t > | id_in_plan_tree_ |
Definition at line 1254 of file RelAlgDag.h.
using RelProject::ConstRexScalarPtr = std::unique_ptr<const RexScalar> |
Definition at line 1257 of file RelAlgDag.h.
using RelProject::ConstRexScalarPtrVector = std::vector<ConstRexScalarPtr> |
Definition at line 1258 of file RelAlgDag.h.
|
inline |
Definition at line 1261 of file RelAlgDag.h.
RelProject::RelProject | ( | RelProject const & | rhs | ) |
Definition at line 556 of file RelAlgDag.cpp.
References addHint(), hint_applied_, hints_, scalar_exprs_, and RexVisitorBase< T >::visit().
|
inlineoverridevirtual |
Implements RelAlgDagNode.
Definition at line 1294 of file RelAlgDag.h.
References acceptChildren(), and RelAlgDagNode::Visitor::visit().
Referenced by TableFunctionsFactory_node.PrintNode::__str__().
|
inlineoverridevirtual |
Implements RelAlgDagNode.
Definition at line 1282 of file RelAlgDag.h.
References RelAlgDagNode::accept(), getFieldName(), RelAlgNode::getInputs(), getProjectAt(), anonymous_namespace{Utm.h}::n, and size().
Referenced by accept().
|
inline |
Definition at line 1413 of file RelAlgDag.h.
References ExplainedQueryHint::getHint(), hint_applied_, and hints_.
Referenced by RelProject().
void RelProject::appendInput | ( | std::string | new_field_name, |
std::unique_ptr< const RexScalar > | new_input | ||
) |
Definition at line 365 of file RelAlgDag.cpp.
References fields_, and scalar_exprs_.
|
inlineoverridevirtual |
Implements RelAlgNode.
Definition at line 1400 of file RelAlgDag.h.
References has_pushed_down_window_expr_, ModifyManipulationTarget::isProjectForUpdate(), and propagateModifyManipulationTarget().
RelProject::fields_ | ( | fields | ) |
|
inline |
Definition at line 1436 of file RelAlgDag.h.
References hints_.
Referenced by anonymous_namespace{RelAlgDag.cpp}::handle_query_hint().
|
inline |
Definition at line 1362 of file RelAlgDag.h.
References scalar_exprs_.
|
inline |
Definition at line 1369 of file RelAlgDag.h.
References CHECK, and fields_.
Referenced by acceptChildren().
|
inline |
Definition at line 1366 of file RelAlgDag.h.
References fields_.
Referenced by anonymous_namespace{RelAlgDag.cpp}::create_compound().
|
inline |
Definition at line 1427 of file RelAlgDag.h.
References CHECK, hasHintEnabled(), hint_applied_, and hints_.
|
inline |
Definition at line 1352 of file RelAlgDag.h.
References CHECK, and scalar_exprs_.
Referenced by acceptChildren(), 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().
|
inline |
Definition at line 1357 of file RelAlgDag.h.
References CHECK, and scalar_exprs_.
|
inline |
Definition at line 1275 of file RelAlgDag.h.
References CHECK_EQ, fields_, RelAlgNode::inputs_, and scalar_exprs_.
|
inline |
|
inline |
Definition at line 1420 of file RelAlgDag.h.
References hint_applied_, and hints_.
Referenced by getHintInfo().
|
inline |
bool RelProject::hasWindowFunctionExpr | ( | ) | const |
Definition at line 2880 of file RelAlgDag.cpp.
References anonymous_namespace{RelAlgDag.cpp}::anonymous_namespace{RelAlgDag.cpp}::is_window_function_operator(), and scalar_exprs_.
RelProject::hint_applied_ | ( | false | ) |
RelProject::hints_ | ( | std::make_unique< Hints > | () | ) |
|
inlineprivate |
Definition at line 1450 of file RelAlgDag.h.
References fields_, kBIGINT, and scalar_exprs_.
bool RelProject::isIdentity | ( | ) | const |
Definition at line 440 of file RelAlgDag.cpp.
References CHECK, CHECK_EQ, get_node_output(), RelAlgNode::getInput(), RelAlgNode::inputCount(), isSimple(), and scalar_exprs_.
bool RelProject::isRenaming | ( | ) | const |
Definition at line 513 of file RelAlgDag.cpp.
References CHECK, CHECK_EQ, fields_, anonymous_namespace{RelAlgDag.cpp}::isRenamedInput(), isSimple(), and scalar_exprs_.
|
inline |
Definition at line 1307 of file RelAlgDag.h.
References scalar_exprs_.
Referenced by RelAlgExecutor::executeProject(), isIdentity(), isRenaming(), and anonymous_namespace{RelAlgOptimizer.cpp}::safe_to_redirect().
|
inline |
Definition at line 1322 of file RelAlgDag.h.
References ModifyManipulationTarget::getModifiedTableCatalog(), ModifyManipulationTarget::getModifiedTableDescriptor(), ModifyManipulationTarget::getTargetColumns(), ModifyManipulationTarget::isDeleteViaSelect(), ModifyManipulationTarget::isUpdateViaSelect(), ModifyManipulationTarget::isVarlenUpdateRequired(), and resetModifyManipulationTarget().
Referenced by deepCopy().
|
inlineoverridevirtual |
Reimplemented from RelAlgNode.
Definition at line 1374 of file RelAlgDag.h.
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 346 of file RelAlgDag.cpp.
References CHECK, RelAlgNode::replaceInput(), and scalar_exprs_.
|
inline |
Definition at line 1339 of file RelAlgDag.h.
References ModifyManipulationTarget::invalidateTargetColumns(), ModifyManipulationTarget::setDeleteViaSelectFlag(), ModifyManipulationTarget::setModifiedTableCatalog(), ModifyManipulationTarget::setModifiedTableDescriptor(), ModifyManipulationTarget::setUpdateViaSelectFlag(), and ModifyManipulationTarget::setVarlenUpdateRequired().
Referenced by propagateModifyManipulationTarget().
RelProject::scalar_exprs_ | ( | std:: | movescalar_exprs | ) |
|
inline |
Definition at line 1300 of file RelAlgDag.h.
References scalar_exprs_.
|
inline |
|
inline |
|
inlineoverridevirtual |
Implements RelAlgNode.
Definition at line 1320 of file RelAlgDag.h.
References scalar_exprs_.
Referenced by acceptChildren(), anonymous_namespace{RelAlgExecutor.cpp}::get_scalar_sources_size(), 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(), RelRexDagVisitor::visit(), and anonymous_namespace{QueryPhysicalInputsCollector.cpp}::RelAlgPhysicalInputsVisitor::visitProject().
|
inlineoverridevirtual |
Implements RelAlgNode.
Definition at line 1438 of file RelAlgDag.h.
References hash_value.
|
inlineoverridevirtual |
Implements RelAlgNode.
Definition at line 1387 of file RelAlgDag.h.
References cat(), fields_, scalar_exprs_, and typeName().
|
inlineprivate |
Definition at line 1444 of file RelAlgDag.h.
References scalar_exprs_.
|
friend |
Definition at line 3702 of file RelAlgDag.cpp.
Referenced by toHash().
|
friend |
Definition at line 1465 of file RelAlgDag.h.
|
friend |
Definition at line 1256 of file RelAlgDag.h.
RelProject::catalog |
Definition at line 1262 of file RelAlgDag.h.
|
mutableprivate |
Definition at line 1460 of file RelAlgDag.h.
Referenced by appendInput(), getFieldName(), getFields(), has_pushed_down_window_expr_(), hash_value(), injectOffsetInFragmentExpr(), isRenaming(), setFields(), and toString().
RelProject::has_pushed_down_window_expr_ |
Definition at line 1264 of file RelAlgDag.h.
Referenced by deepCopy(), hasPushedDownWindowExpr(), and setPushedDownWindowExpr().
|
private |
Definition at line 1463 of file RelAlgDag.h.
RelProject::hint_applied_ {false} |
Definition at line 1263 of file RelAlgDag.h.
Referenced by addHint(), getHintInfo(), hasHintEnabled(), and RelProject().
|
private |
Definition at line 1461 of file RelAlgDag.h.
|
private |
Definition at line 1462 of file RelAlgDag.h.
Referenced by addHint(), getDeliveredHints(), getHintInfo(), hasDeliveredHint(), hasHintEnabled(), and RelProject().
|
mutableprivate |
Definition at line 1459 of file RelAlgDag.h.
Referenced by appendInput(), getExpressionsAndRelease(), getProjectAt(), getProjectAtAndRelease(), has_pushed_down_window_expr_(), hash_value(), hasWindowFunctionExpr(), injectOffsetInFragmentExpr(), isIdentity(), isRenaming(), isSimple(), RelProject(), replaceInput(), setExpressions(), size(), toString(), and visitScalarExprs().