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

#include <RelAlgDag.h>

+ Inheritance diagram for RexOperator:
+ Collaboration diagram for RexOperator:

Public Member Functions

 RexOperator ()
 
 RexOperator (const SQLOps op, std::vector< std::unique_ptr< const RexScalar >> &operands, const SQLTypeInfo &type)
 
virtual std::unique_ptr< const
RexOperator
getDisambiguated (std::vector< std::unique_ptr< const RexScalar >> &operands) const
 
size_t size () const
 
const RexScalargetOperand (const size_t idx) const
 
const RexScalargetOperandAndRelease (const size_t idx) const
 
SQLOps getOperator () const
 
const SQLTypeInfogetType () const
 
std::string toString (RelRexToStringConfig config=RelRexToStringConfig::defaults()) const override
 
size_t toHash () const override
 
- Public Member Functions inherited from Rex
virtual ~Rex ()
 

Protected Attributes

SQLOps op_
 
std::vector< std::unique_ptr
< const RexScalar > > 
operands_
 
SQLTypeInfo type_
 
- Protected Attributes inherited from Rex
std::optional< size_t > hash_
 

Friends

struct RelAlgDagSerializer
 

Detailed Description

Definition at line 255 of file RelAlgDag.h.

Constructor & Destructor Documentation

RexOperator::RexOperator ( )
inline

Definition at line 258 of file RelAlgDag.h.

References kINVALID_OP.

Referenced by getDisambiguated(), and toHash().

+ Here is the caller graph for this function:

RexOperator::RexOperator ( const SQLOps  op,
std::vector< std::unique_ptr< const RexScalar >> &  operands,
const SQLTypeInfo type 
)
inline

Definition at line 260 of file RelAlgDag.h.

263  : op_(op), operands_(std::move(operands)), type_(type) {}
SQLTypeInfo type_
Definition: RelAlgDag.h:310
std::vector< std::unique_ptr< const RexScalar > > operands_
Definition: RelAlgDag.h:309
SQLOps op_
Definition: RelAlgDag.h:308

Member Function Documentation

virtual std::unique_ptr<const RexOperator> RexOperator::getDisambiguated ( std::vector< std::unique_ptr< const RexScalar >> &  operands) const
inlinevirtual

Reimplemented in RexFunctionOperator.

Definition at line 265 of file RelAlgDag.h.

References op_, RexOperator(), and type_.

Referenced by RexDeepCopyVisitor::visitOperator().

266  {
267  return std::unique_ptr<const RexOperator>(new RexOperator(op_, operands, type_));
268  }
SQLTypeInfo type_
Definition: RelAlgDag.h:310
SQLOps op_
Definition: RelAlgDag.h:308

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const RexScalar* RexOperator::getOperand ( const size_t  idx) const
inline

Definition at line 272 of file RelAlgDag.h.

References CHECK, and operands_.

Referenced by anonymous_namespace{RelAlgDag.cpp}::anonymous_namespace{RelAlgDag.cpp}::find_generic_expr_in_window_func(), anonymous_namespace{RelAlgDag.cpp}::anonymous_namespace{RelAlgDag.cpp}::is_window_function_avg(), anonymous_namespace{RelAlgDag.cpp}::PushDownGenericExpressionInWindowFunction::pushDownExpressionInWindowFunction(), RelAlgTranslator::translateAbs(), RelAlgTranslator::translateBinaryGeoConstructor(), RelAlgTranslator::translateBinaryGeoFunction(), RelAlgTranslator::translateBinaryGeoPredicate(), RelAlgTranslator::translateCardinality(), RelAlgTranslator::translateDateadd(), RelAlgTranslator::translateDatediff(), RelAlgTranslator::translateDatepart(), RelAlgTranslator::translateDatePlusMinus(), RelAlgTranslator::translateDatetime(), RelAlgTranslator::translateExtract(), RelAlgTranslator::translateFunction(), RelAlgTranslator::translateFunctionArgs(), RelAlgTranslator::translateFunctionWithGeoArg(), RelAlgTranslator::translateGeoComparison(), RelAlgTranslator::translateGeoOverlapsOper(), RelAlgTranslator::translateGeoProjection(), RelAlgTranslator::translateHPTLiteral(), RelAlgTranslator::translateInOper(), RelAlgTranslator::translateItem(), RelAlgTranslator::translateLength(), RelAlgTranslator::translateLike(), RelAlgTranslator::translateLikely(), RelAlgTranslator::translateOper(), RelAlgTranslator::translateOverlapsOper(), RelAlgTranslator::translateRegexp(), RelAlgTranslator::translateSampleRatio(), RelAlgTranslator::translateSign(), RelAlgTranslator::translateTernaryGeoFunction(), RelAlgTranslator::translateUnaryGeoConstructor(), RelAlgTranslator::translateUnaryGeoFunction(), RelAlgTranslator::translateUnaryGeoPredicate(), RelAlgTranslator::translateUnlikely(), RelAlgTranslator::translateUoper(), RelAlgTranslator::translateWidthBucket(), RelAlgTranslator::translateWindowFunction(), RelRexDagVisitor::visit(), QueryPlanDagChecker::visit(), anonymous_namespace{QueryPhysicalInputsCollector.cpp}::RexPhysicalInputsVisitor::visitOperator(), RexVisitor< T >::visitOperator(), RexDeepCopyVisitor::visitOperator(), anonymous_namespace{RelAlgDag.cpp}::PushDownGenericExpressionInWindowFunction::visitOperator(), and RexDeepCopyVisitor::visitWindowFunctionOperator().

272  {
273  CHECK(idx < operands_.size());
274  return operands_[idx].get();
275  }
std::vector< std::unique_ptr< const RexScalar > > operands_
Definition: RelAlgDag.h:309
#define CHECK(condition)
Definition: Logger.h:289

+ Here is the caller graph for this function:

const RexScalar* RexOperator::getOperandAndRelease ( const size_t  idx) const
inline

Definition at line 277 of file RelAlgDag.h.

References CHECK, and operands_.

277  {
278  CHECK(idx < operands_.size());
279  return operands_[idx].release();
280  }
std::vector< std::unique_ptr< const RexScalar > > operands_
Definition: RelAlgDag.h:309
#define CHECK(condition)
Definition: Logger.h:289
size_t RexOperator::size ( ) const
inline

Definition at line 270 of file RelAlgDag.h.

References operands_.

Referenced by anonymous_namespace{RelAlgDag.cpp}::anonymous_namespace{RelAlgDag.cpp}::find_generic_expr_in_window_func(), anonymous_namespace{RelAlgDag.cpp}::anonymous_namespace{RelAlgDag.cpp}::is_window_function_avg(), anonymous_namespace{RelAlgDag.cpp}::PushDownGenericExpressionInWindowFunction::pushDownExpressionInWindowFunction(), RelAlgTranslator::translateAbs(), RelAlgTranslator::translateBinaryGeoFunction(), RelAlgTranslator::translateDateadd(), RelAlgTranslator::translateDatediff(), RelAlgTranslator::translateDatepart(), RelAlgTranslator::translateDatePlusMinus(), RelAlgTranslator::translateDatetime(), RelAlgTranslator::translateExtract(), RelAlgTranslator::translateFunction(), RelAlgTranslator::translateFunctionArgs(), RelAlgTranslator::translateFunctionWithGeoArg(), RelAlgTranslator::translateGeoComparison(), RelAlgTranslator::translateGeoOverlapsOper(), RelAlgTranslator::translateHPTLiteral(), RelAlgTranslator::translateInOper(), RelAlgTranslator::translateItem(), RelAlgTranslator::translateLength(), RelAlgTranslator::translateLike(), RelAlgTranslator::translateLikely(), RelAlgTranslator::translateOper(), RelAlgTranslator::translateRegexp(), RelAlgTranslator::translateSampleRatio(), RelAlgTranslator::translateSign(), RelAlgTranslator::translateTernaryGeoFunction(), RelAlgTranslator::translateUnaryGeoFunction(), RelAlgTranslator::translateUnlikely(), RelAlgTranslator::translateUoper(), RelAlgTranslator::translateWidthBucket(), RelAlgTranslator::translateWindowFunction(), RelRexDagVisitor::visit(), QueryPlanDagChecker::visit(), anonymous_namespace{QueryPhysicalInputsCollector.cpp}::RexPhysicalInputsVisitor::visitOperator(), RexVisitor< T >::visitOperator(), RexDeepCopyVisitor::visitOperator(), anonymous_namespace{RelAlgDag.cpp}::PushDownGenericExpressionInWindowFunction::visitOperator(), and RexDeepCopyVisitor::visitWindowFunctionOperator().

270 { return operands_.size(); }
std::vector< std::unique_ptr< const RexScalar > > operands_
Definition: RelAlgDag.h:309

+ Here is the caller graph for this function:

size_t RexOperator::toHash ( ) const
inlineoverridevirtual

Implements Rex.

Reimplemented in RexWindowFunctionOperator, and RexFunctionOperator.

Definition at line 295 of file RelAlgDag.h.

References getType(), Rex::hash_, op_, operands_, and RexOperator().

295  {
296  if (!hash_) {
297  hash_ = typeid(RexOperator).hash_code();
298  boost::hash_combine(*hash_, op_);
299  for (auto& operand : operands_) {
300  boost::hash_combine(*hash_, operand->toHash());
301  }
302  boost::hash_combine(*hash_, getType().get_type_name());
303  }
304  return *hash_;
305  }
const SQLTypeInfo & getType() const
Definition: RelAlgDag.h:284
std::vector< std::unique_ptr< const RexScalar > > operands_
Definition: RelAlgDag.h:309
std::optional< size_t > hash_
Definition: RelAlgDag.h:62
SQLOps op_
Definition: RelAlgDag.h:308

+ Here is the call graph for this function:

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

Implements Rex.

Reimplemented in RexWindowFunctionOperator, and RexFunctionOperator.

Definition at line 286 of file RelAlgDag.h.

References cat(), op_, operands_, to_string(), SQLTypeInfo::to_string(), type_, and typeName().

287  {
288  auto ret = cat(::typeName(this), "(", std::to_string(op_), ", operands=");
289  for (auto& operand : operands_) {
290  ret += operand->toString(config) + " ";
291  }
292  return cat(ret, ", type=", type_.to_string(), ")");
293  };
std::string cat(Ts &&...args)
std::string to_string(char const *&&v)
std::string to_string() const
Definition: sqltypes.h:544
SQLTypeInfo type_
Definition: RelAlgDag.h:310
std::vector< std::unique_ptr< const RexScalar > > operands_
Definition: RelAlgDag.h:309
std::string typeName(const T *v)
Definition: toString.h:103
SQLOps op_
Definition: RelAlgDag.h:308

+ Here is the call graph for this function:

Friends And Related Function Documentation

friend struct RelAlgDagSerializer
friend

Definition at line 312 of file RelAlgDag.h.

Member Data Documentation

SQLOps RexOperator::op_
protected
SQLTypeInfo RexOperator::type_
protected

Definition at line 310 of file RelAlgDag.h.

Referenced by getDisambiguated(), getType(), and toString().


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