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

#include <RelAlgDagBuilder.h>

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

Public Member Functions

 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 () const override
 
size_t toHash () const override
 
- Public Member Functions inherited from Rex
virtual ~Rex ()
 

Protected Attributes

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

Detailed Description

Definition at line 223 of file RelAlgDagBuilder.h.

Constructor & Destructor Documentation

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

Definition at line 225 of file RelAlgDagBuilder.h.

Referenced by getDisambiguated(), and toHash().

228  : op_(op), operands_(std::move(operands)), type_(type) {}
const SQLOps op_
const SQLTypeInfo type_
std::vector< std::unique_ptr< const RexScalar > > operands_

+ Here is the caller graph for this function:

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 230 of file RelAlgDagBuilder.h.

References op_, RexOperator(), and type_.

Referenced by RexDeepCopyVisitor::visitOperator().

231  {
232  return std::unique_ptr<const RexOperator>(new RexOperator(op_, operands, type_));
233  }
RexOperator(const SQLOps op, std::vector< std::unique_ptr< const RexScalar >> &operands, const SQLTypeInfo &type)
const SQLOps op_
const SQLTypeInfo type_

+ 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 237 of file RelAlgDagBuilder.h.

References CHECK, and operands_.

Referenced by anonymous_namespace{RelAlgDagBuilder.cpp}::anonymous_namespace{RelAlgDagBuilder.cpp}::is_window_function_operator(), 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::translateHPTLiteral(), RelAlgTranslator::translateInOper(), RelAlgTranslator::translateItem(), RelAlgTranslator::translateLength(), RelAlgTranslator::translateLike(), RelAlgTranslator::translateLikely(), RelAlgTranslator::translateOper(), RelAlgTranslator::translateOverlapsOper(), RelAlgTranslator::translateRegexp(), RelAlgTranslator::translateSampleRatio(), RelAlgTranslator::translateSign(), RelAlgTranslator::translateTernaryGeoFunction(), RelAlgTranslator::translateUnaryGeoFunction(), RelAlgTranslator::translateUnaryGeoPredicate(), RelAlgTranslator::translateUnlikely(), RelAlgTranslator::translateUoper(), RelAlgTranslator::translateWidthBucket(), RelAlgTranslator::translateWindowFunction(), RelRexDagVisitor::visit(), QueryPlanDagChecker::visit(), anonymous_namespace{QueryPhysicalInputsCollector.cpp}::RexPhysicalInputsVisitor::visitOperator(), RexVisitor< std::unordered_set< const RexInput * > >::visitOperator(), RexDeepCopyVisitor::visitOperator(), and RexDeepCopyVisitor::visitWindowFunctionOperator().

237  {
238  CHECK(idx < operands_.size());
239  return operands_[idx].get();
240  }
std::vector< std::unique_ptr< const RexScalar > > operands_
#define CHECK(condition)
Definition: Logger.h:211

+ Here is the caller graph for this function:

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

Definition at line 242 of file RelAlgDagBuilder.h.

References CHECK, and operands_.

242  {
243  CHECK(idx < operands_.size());
244  return operands_[idx].release();
245  }
std::vector< std::unique_ptr< const RexScalar > > operands_
#define CHECK(condition)
Definition: Logger.h:211
SQLOps RexOperator::getOperator ( ) const
inline
size_t RexOperator::size ( ) const
inline

Definition at line 235 of file RelAlgDagBuilder.h.

References operands_.

Referenced by anonymous_namespace{RelAlgDagBuilder.cpp}::anonymous_namespace{RelAlgDagBuilder.cpp}::is_window_function_operator(), 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< std::unordered_set< const RexInput * > >::visitOperator(), RexDeepCopyVisitor::visitOperator(), and RexDeepCopyVisitor::visitWindowFunctionOperator().

235 { return operands_.size(); }
std::vector< std::unique_ptr< const RexScalar > > operands_

+ Here is the caller graph for this function:

size_t RexOperator::toHash ( ) const
inlineoverridevirtual

Implements Rex.

Reimplemented in RexWindowFunctionOperator, and RexFunctionOperator.

Definition at line 262 of file RelAlgDagBuilder.h.

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

262  {
263  if (!hash_) {
264  hash_ = typeid(RexOperator).hash_code();
265  boost::hash_combine(*hash_, op_);
266  for (auto& operand : operands_) {
267  boost::hash_combine(*hash_, operand->toHash());
268  }
269  boost::hash_combine(*hash_, getType().get_type_name());
270  }
271  return *hash_;
272  }
RexOperator(const SQLOps op, std::vector< std::unique_ptr< const RexScalar >> &operands, const SQLTypeInfo &type)
const SQLTypeInfo & getType() const
const SQLOps op_
std::vector< std::unique_ptr< const RexScalar > > operands_
std::optional< size_t > hash_

+ Here is the call graph for this function:

std::string RexOperator::toString ( ) const
inlineoverridevirtual

Implements Rex.

Reimplemented in RexWindowFunctionOperator, and RexFunctionOperator.

Definition at line 251 of file RelAlgDagBuilder.h.

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

251  {
252  return cat(::typeName(this),
253  "(",
255  ", operands=",
256  ::toString(operands_),
257  ", type=",
258  type_.to_string(),
259  ")");
260  };
std::string cat(Ts &&...args)
const SQLOps op_
std::string to_string(char const *&&v)
std::string to_string() const
Definition: sqltypes.h:482
const SQLTypeInfo type_
std::vector< std::unique_ptr< const RexScalar > > operands_
std::string typeName(const T *v)
Definition: toString.h:93
std::string toString() const override

+ Here is the call graph for this function:

Member Data Documentation

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

Definition at line 277 of file RelAlgDagBuilder.h.

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


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