OmniSciDB  c07336695a
RexWindowFunctionOperator Class Reference

#include <RelAlgAbstractInterpreter.h>

+ Inheritance diagram for RexWindowFunctionOperator:
+ Collaboration diagram for RexWindowFunctionOperator:

Classes

struct  RexWindowBound
 

Public Member Functions

 RexWindowFunctionOperator (const SqlWindowFunctionKind kind, ConstRexScalarPtrVector &operands, ConstRexScalarPtrVector &partition_keys, ConstRexScalarPtrVector &order_keys, const std::vector< SortField > collation, const RexWindowBound &lower_bound, const RexWindowBound &upper_bound, const bool is_rows, const SQLTypeInfo &ti)
 
SqlWindowFunctionKind getKind () const
 
const ConstRexScalarPtrVectorgetPartitionKeys () const
 
ConstRexScalarPtrVector getPartitionKeysAndRelease () const
 
ConstRexScalarPtrVector getOrderKeysAndRelease () const
 
const ConstRexScalarPtrVectorgetOrderKeys () const
 
const std::vector< SortField > & getCollation () const
 
const RexWindowBoundgetLowerBound () const
 
const RexWindowBoundgetUpperBound () const
 
bool isRows () const
 
std::unique_ptr< const RexOperatordisambiguatedOperands (ConstRexScalarPtrVector &operands, ConstRexScalarPtrVector &partition_keys, ConstRexScalarPtrVector &order_keys, const std::vector< SortField > &collation) const
 
std::string toString () const override
 
- Public Member Functions inherited from RexFunctionOperator
 RexFunctionOperator (const std::string &name, ConstRexScalarPtrVector &operands, const SQLTypeInfo &ti)
 
std::unique_ptr< const RexOperatorgetDisambiguated (std::vector< std::unique_ptr< const RexScalar >> &operands) const override
 
const std::string & getName () const
 
- Public Member Functions inherited from 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 ()
 

Private Attributes

const SqlWindowFunctionKind kind_
 
ConstRexScalarPtrVector partition_keys_
 
ConstRexScalarPtrVector order_keys_
 
const std::vector< SortFieldcollation_
 
const RexWindowBound lower_bound_
 
const RexWindowBound upper_bound_
 
const bool is_rows_
 

Additional Inherited Members

- Public Types inherited from RexFunctionOperator
using ConstRexScalarPtr = std::unique_ptr< const RexScalar >
 
using ConstRexScalarPtrVector = std::vector< ConstRexScalarPtr >
 
- Protected Attributes inherited from RexOperator
const SQLOps op_
 
std::vector< std::unique_ptr< const RexScalar > > operands_
 
const SQLTypeInfo type_
 

Detailed Description

Definition at line 456 of file RelAlgAbstractInterpreter.h.

Constructor & Destructor Documentation

◆ RexWindowFunctionOperator()

RexWindowFunctionOperator::RexWindowFunctionOperator ( const SqlWindowFunctionKind  kind,
ConstRexScalarPtrVector operands,
ConstRexScalarPtrVector partition_keys,
ConstRexScalarPtrVector order_keys,
const std::vector< SortField collation,
const RexWindowBound lower_bound,
const RexWindowBound upper_bound,
const bool  is_rows,
const SQLTypeInfo ti 
)
inline

Definition at line 467 of file RelAlgAbstractInterpreter.h.

476  : RexFunctionOperator(sql_window_function_to_str(kind), operands, ti)
477  , kind_(kind)
478  , partition_keys_(std::move(partition_keys))
479  , order_keys_(std::move(order_keys))
480  , collation_(collation)
481  , lower_bound_(lower_bound)
482  , upper_bound_(upper_bound)
483  , is_rows_(is_rows) {}
const SqlWindowFunctionKind kind_
std::string sql_window_function_to_str(const SqlWindowFunctionKind kind)
const std::vector< SortField > collation_
ConstRexScalarPtrVector order_keys_
RexFunctionOperator(const std::string &name, ConstRexScalarPtrVector &operands, const SQLTypeInfo &ti)
ConstRexScalarPtrVector partition_keys_

Member Function Documentation

◆ disambiguatedOperands()

std::unique_ptr<const RexOperator> RexWindowFunctionOperator::disambiguatedOperands ( ConstRexScalarPtrVector operands,
ConstRexScalarPtrVector partition_keys,
ConstRexScalarPtrVector order_keys,
const std::vector< SortField > &  collation 
) const
inline

Definition at line 507 of file RelAlgAbstractInterpreter.h.

511  {
512  return std::unique_ptr<const RexOperator>(
514  operands,
515  partition_keys,
516  order_keys,
517  collation,
518  getLowerBound(),
519  getUpperBound(),
520  isRows(),
521  getType()));
522  }
const RexWindowBound & getLowerBound() const
const SqlWindowFunctionKind kind_
const RexWindowBound & getUpperBound() const
RexWindowFunctionOperator(const SqlWindowFunctionKind kind, ConstRexScalarPtrVector &operands, ConstRexScalarPtrVector &partition_keys, ConstRexScalarPtrVector &order_keys, const std::vector< SortField > collation, const RexWindowBound &lower_bound, const RexWindowBound &upper_bound, const bool is_rows, const SQLTypeInfo &ti)
const SQLTypeInfo & getType() const

◆ getCollation()

const std::vector<SortField>& RexWindowFunctionOperator::getCollation ( ) const
inline

Definition at line 499 of file RelAlgAbstractInterpreter.h.

Referenced by RelAlgTranslator::translateWindowFunction().

499 { return collation_; }
const std::vector< SortField > collation_
+ Here is the caller graph for this function:

◆ getKind()

SqlWindowFunctionKind RexWindowFunctionOperator::getKind ( ) const
inline

Definition at line 485 of file RelAlgAbstractInterpreter.h.

Referenced by anonymous_namespace{RelAlgTranslator.cpp}::supported_upper_bound(), and RelAlgTranslator::translateWindowFunction().

485 { return kind_; }
const SqlWindowFunctionKind kind_
+ Here is the caller graph for this function:

◆ getLowerBound()

const RexWindowBound& RexWindowFunctionOperator::getLowerBound ( ) const
inline

Definition at line 501 of file RelAlgAbstractInterpreter.h.

Referenced by RelAlgTranslator::translateWindowFunction().

501 { return lower_bound_; }
+ Here is the caller graph for this function:

◆ getOrderKeys()

const ConstRexScalarPtrVector& RexWindowFunctionOperator::getOrderKeys ( ) const
inline

Definition at line 497 of file RelAlgAbstractInterpreter.h.

Referenced by anonymous_namespace{RelAlgTranslator.cpp}::supported_upper_bound(), RelAlgTranslator::translateWindowFunction(), and RexVisitor< std::unordered_set< RexInput > >::visitWindowFunctionOperator().

497 { return order_keys_; }
ConstRexScalarPtrVector order_keys_
+ Here is the caller graph for this function:

◆ getOrderKeysAndRelease()

ConstRexScalarPtrVector RexWindowFunctionOperator::getOrderKeysAndRelease ( ) const
inline

Definition at line 493 of file RelAlgAbstractInterpreter.h.

493  {
494  return std::move(order_keys_);
495  }
ConstRexScalarPtrVector order_keys_

◆ getPartitionKeys()

const ConstRexScalarPtrVector& RexWindowFunctionOperator::getPartitionKeys ( ) const
inline

Definition at line 487 of file RelAlgAbstractInterpreter.h.

Referenced by anonymous_namespace{RelAlgAbstractInterpreter.cpp}::disambiguate_operator(), RelAlgTranslator::translateWindowFunction(), RexDeepCopyVisitor::visitOperator(), and RexVisitor< std::unordered_set< RexInput > >::visitWindowFunctionOperator().

487 { return partition_keys_; }
ConstRexScalarPtrVector partition_keys_
+ Here is the caller graph for this function:

◆ getPartitionKeysAndRelease()

ConstRexScalarPtrVector RexWindowFunctionOperator::getPartitionKeysAndRelease ( ) const
inline

Definition at line 489 of file RelAlgAbstractInterpreter.h.

489  {
490  return std::move(partition_keys_);
491  }
ConstRexScalarPtrVector partition_keys_

◆ getUpperBound()

const RexWindowBound& RexWindowFunctionOperator::getUpperBound ( ) const
inline

Definition at line 503 of file RelAlgAbstractInterpreter.h.

Referenced by anonymous_namespace{RelAlgTranslator.cpp}::supported_upper_bound().

503 { return upper_bound_; }
+ Here is the caller graph for this function:

◆ isRows()

bool RexWindowFunctionOperator::isRows ( ) const
inline

Definition at line 505 of file RelAlgAbstractInterpreter.h.

Referenced by RelAlgTranslator::translateWindowFunction().

505 { return is_rows_; }
+ Here is the caller graph for this function:

◆ toString()

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

Reimplemented from RexFunctionOperator.

Definition at line 524 of file RelAlgAbstractInterpreter.h.

References run-benchmark-import::result.

524  {
525  auto result = "(RexWindowFunctionOperator " + getName();
526  for (const auto& operand : operands_) {
527  result += (" " + operand->toString());
528  }
529  result += " partition[";
530  for (const auto& partition_key : partition_keys_) {
531  result += (" " + partition_key->toString());
532  }
533  result += "]";
534  result += " order[";
535  for (const auto& order_key : order_keys_) {
536  result += (" " + order_key->toString());
537  }
538  result += "]";
539  return result + ")";
540  }
std::vector< std::unique_ptr< const RexScalar > > operands_
ConstRexScalarPtrVector order_keys_
ConstRexScalarPtrVector partition_keys_
const std::string & getName() const

Member Data Documentation

◆ collation_

const std::vector<SortField> RexWindowFunctionOperator::collation_
private

Definition at line 546 of file RelAlgAbstractInterpreter.h.

◆ is_rows_

const bool RexWindowFunctionOperator::is_rows_
private

Definition at line 549 of file RelAlgAbstractInterpreter.h.

◆ kind_

const SqlWindowFunctionKind RexWindowFunctionOperator::kind_
private

Definition at line 543 of file RelAlgAbstractInterpreter.h.

◆ lower_bound_

const RexWindowBound RexWindowFunctionOperator::lower_bound_
private

Definition at line 547 of file RelAlgAbstractInterpreter.h.

◆ order_keys_

ConstRexScalarPtrVector RexWindowFunctionOperator::order_keys_
mutableprivate

Definition at line 545 of file RelAlgAbstractInterpreter.h.

◆ partition_keys_

ConstRexScalarPtrVector RexWindowFunctionOperator::partition_keys_
mutableprivate

Definition at line 544 of file RelAlgAbstractInterpreter.h.

◆ upper_bound_

const RexWindowBound RexWindowFunctionOperator::upper_bound_
private

Definition at line 548 of file RelAlgAbstractInterpreter.h.


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