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

#include <RelAlgDag.h>

+ Inheritance diagram for RexFunctionOperator:
+ Collaboration diagram for RexFunctionOperator:

Public Types

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

Public Member Functions

 RexFunctionOperator ()=default
 
 RexFunctionOperator (const std::string &name, ConstRexScalarPtrVector &operands, const SQLTypeInfo &ti)
 
std::unique_ptr< const
RexOperator
getDisambiguated (std::vector< std::unique_ptr< const RexScalar >> &operands) const override
 
virtual void acceptChildren (Visitor &v) const override
 
virtual void accept (Visitor &v, std::string name) const override
 
const std::string & getName () const
 
std::string toString (RelRexToStringConfig config=RelRexToStringConfig::defaults()) const override
 
virtual size_t toHash () const override
 
- Public Member Functions inherited from RexOperator
 RexOperator ()
 
 RexOperator (const SQLOps op, std::vector< std::unique_ptr< const RexScalar >> &operands, const SQLTypeInfo &type)
 
size_t size () const
 
const RexScalargetOperand (const size_t idx) const
 
const RexScalargetOperandAndRelease (const size_t idx) const
 
SQLOps getOperator () const
 
const SQLTypeInfogetType () const
 
- Public Member Functions inherited from Rex
virtual ~Rex ()
 
virtual size_t getStepNumber () const
 
- Public Member Functions inherited from RelAlgDagNode
 RelAlgDagNode ()
 
virtual void setStepNumber (size_t step) const
 
std::optional< size_t > getIdInPlanTree () const
 
void setIdInPlanTree (size_t id) const
 

Private Attributes

std::string name_
 

Friends

struct RelAlgDagSerializer
 
std::size_t hash_value (RexFunctionOperator const &)
 

Additional Inherited Members

- Protected Attributes inherited from RexOperator
SQLOps op_
 
std::vector< std::unique_ptr
< const RexScalar > > 
operands_
 
SQLTypeInfo type_
 
- Protected Attributes inherited from Rex
std::optional< size_t > hash_
 
- Protected Attributes inherited from RelAlgDagNode
size_t step_ {0}
 
std::optional< size_t > id_in_plan_tree_
 

Detailed Description

Definition at line 474 of file RelAlgDag.h.

Member Typedef Documentation

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

Definition at line 476 of file RelAlgDag.h.

Definition at line 477 of file RelAlgDag.h.

Constructor & Destructor Documentation

RexFunctionOperator::RexFunctionOperator ( )
default

Referenced by getDisambiguated().

+ Here is the caller graph for this function:

RexFunctionOperator::RexFunctionOperator ( const std::string &  name,
ConstRexScalarPtrVector operands,
const SQLTypeInfo ti 
)
inline

Definition at line 482 of file RelAlgDag.h.

485  : RexOperator(kFUNCTION, operands, ti), name_(name) {}
std::string name_
Definition: RelAlgDag.h:526
string name
Definition: setup.in.py:72

Member Function Documentation

virtual void RexFunctionOperator::accept ( Visitor v,
std::string  name 
) const
inlineoverridevirtual

Reimplemented from RexOperator.

Reimplemented in RexWindowFunctionOperator.

Definition at line 500 of file RelAlgDag.h.

References acceptChildren(), and RelAlgDagNode::Visitor::visit().

Referenced by TableFunctionsFactory_node.PrintNode::__str__().

500  {
501  if (v.visit(this, std::move(name))) {
502  acceptChildren(v);
503  }
504  }
virtual void acceptChildren(Visitor &v) const override
Definition: RelAlgDag.h:493
string name
Definition: setup.in.py:72

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

virtual void RexFunctionOperator::acceptChildren ( Visitor v) const
inlineoverridevirtual

Reimplemented from RexOperator.

Reimplemented in RexWindowFunctionOperator.

Definition at line 493 of file RelAlgDag.h.

References RelAlgDagNode::accept(), RexOperator::getOperand(), and RexOperator::size().

Referenced by accept().

493  {
494  for (size_t i = 0; i < size(); ++i) {
495  if (getOperand(i)) {
496  getOperand(i)->accept(v, "operand");
497  }
498  }
499  }
size_t size() const
Definition: RelAlgDag.h:364
const RexScalar * getOperand(const size_t idx) const
Definition: RelAlgDag.h:366
virtual void accept(Visitor &v, std::string name) const =0

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::unique_ptr<const RexOperator> RexFunctionOperator::getDisambiguated ( std::vector< std::unique_ptr< const RexScalar >> &  operands) const
inlineoverridevirtual

Reimplemented from RexOperator.

Definition at line 487 of file RelAlgDag.h.

References RexOperator::getType(), name_, and RexFunctionOperator().

488  {
489  return std::unique_ptr<const RexOperator>(
490  new RexFunctionOperator(name_, operands, getType()));
491  }
RexFunctionOperator()=default
const SQLTypeInfo & getType() const
Definition: RelAlgDag.h:378
std::string name_
Definition: RelAlgDag.h:526

+ Here is the call graph for this function:

virtual size_t RexFunctionOperator::toHash ( ) const
inlineoverridevirtual

Reimplemented from RexOperator.

Reimplemented in RexWindowFunctionOperator.

Definition at line 521 of file RelAlgDag.h.

References hash_value.

521 { return hash_value(*this); }
friend std::size_t hash_value(RexFunctionOperator const &)
Definition: RelAlgDag.cpp:3602
std::string RexFunctionOperator::toString ( RelRexToStringConfig  config = RelRexToStringConfig::defaults()) const
inlineoverridevirtual

Reimplemented from RexOperator.

Reimplemented in RexWindowFunctionOperator.

Definition at line 508 of file RelAlgDag.h.

References cat(), name_, RexOperator::operands_, and typeName().

Referenced by RelAlgTranslator::translateGeoProjection().

509  {
510  if (!config.attributes_only) {
511  auto ret = cat(::typeName(this), "(", name_, ", operands=");
512  for (auto& operand : operands_) {
513  ret += operand->toString(config) + " ";
514  }
515  return cat(ret, ")");
516  } else {
517  return cat(::typeName(this), "(", name_, ")");
518  }
519  }
std::string cat(Ts &&...args)
std::vector< std::unique_ptr< const RexScalar > > operands_
Definition: RelAlgDag.h:400
std::string typeName(const T *v)
Definition: toString.h:106
std::string name_
Definition: RelAlgDag.h:526

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Friends And Related Function Documentation

std::size_t hash_value ( RexFunctionOperator const &  rex_op)
friend

Definition at line 3602 of file RelAlgDag.cpp.

Referenced by toHash().

3602  {
3603  if (rex_op.hash_) {
3604  return *rex_op.hash_;
3605  }
3606  rex_op.hash_ = typeid(RexFunctionOperator).hash_code();
3607  boost::hash_combine(*rex_op.hash_, ::toString(rex_op.op_));
3608  boost::hash_combine(*rex_op.hash_, rex_op.getType().get_type_name());
3609  boost::hash_combine(*rex_op.hash_, rex_op.operands_);
3610  boost::hash_combine(*rex_op.hash_, rex_op.name_);
3611  return *rex_op.hash_;
3612 }
RexFunctionOperator()=default
std::string toString(RelRexToStringConfig config=RelRexToStringConfig::defaults()) const override
Definition: RelAlgDag.h:508
friend struct RelAlgDagSerializer
friend

Definition at line 528 of file RelAlgDag.h.

Member Data Documentation

std::string RexFunctionOperator::name_
private

Definition at line 526 of file RelAlgDag.h.

Referenced by getDisambiguated(), getName(), hash_value(), and toString().


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