OmniSciDB  0fdbebe030
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RexWindowFunctionOperator Class Reference

#include <RelAlgDagBuilder.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
RexOperator
disambiguatedOperands (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
RexOperator
getDisambiguated (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 453 of file RelAlgDagBuilder.h.

Constructor & Destructor Documentation

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

Referenced by disambiguatedOperands().

473  : RexFunctionOperator(sql_window_function_to_str(kind), operands, ti)
474  , kind_(kind)
475  , partition_keys_(std::move(partition_keys))
476  , order_keys_(std::move(order_keys))
477  , collation_(collation)
478  , lower_bound_(lower_bound)
479  , upper_bound_(upper_bound)
480  , is_rows_(is_rows) {}
const RexWindowBound upper_bound_
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_
const RexWindowBound lower_bound_

+ Here is the caller graph for this function:

Member Function Documentation

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

References getLowerBound(), RexOperator::getType(), getUpperBound(), isRows(), kind_, and RexWindowFunctionOperator().

Referenced by RexDeepCopyVisitor::visitWindowFunctionOperator().

508  {
509  return std::unique_ptr<const RexOperator>(
511  operands,
512  partition_keys,
513  order_keys,
514  collation,
515  getLowerBound(),
516  getUpperBound(),
517  isRows(),
518  getType()));
519  }
const SQLTypeInfo & getType() const
const SqlWindowFunctionKind kind_
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 RexWindowBound & getLowerBound() const
const RexWindowBound & getUpperBound() const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 496 of file RelAlgDagBuilder.h.

References collation_.

Referenced by RelAlgTranslator::translateWindowFunction(), and RexDeepCopyVisitor::visitWindowFunctionOperator().

496 { return collation_; }
const std::vector< SortField > collation_

+ Here is the caller graph for this function:

SqlWindowFunctionKind RexWindowFunctionOperator::getKind ( ) const
inline

Definition at line 482 of file RelAlgDagBuilder.h.

References kind_.

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

482 { return kind_; }
const SqlWindowFunctionKind kind_

+ Here is the caller graph for this function:

const RexWindowBound& RexWindowFunctionOperator::getLowerBound ( ) const
inline

Definition at line 498 of file RelAlgDagBuilder.h.

References lower_bound_.

Referenced by disambiguatedOperands(), and RelAlgTranslator::translateWindowFunction().

498 { return lower_bound_; }
const RexWindowBound lower_bound_

+ Here is the caller graph for this function:

const ConstRexScalarPtrVector& RexWindowFunctionOperator::getOrderKeys ( ) const
inline

Definition at line 494 of file RelAlgDagBuilder.h.

References order_keys_.

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

494 { return order_keys_; }
ConstRexScalarPtrVector order_keys_

+ Here is the caller graph for this function:

ConstRexScalarPtrVector RexWindowFunctionOperator::getOrderKeysAndRelease ( ) const
inline

Definition at line 490 of file RelAlgDagBuilder.h.

References order_keys_.

490  {
491  return std::move(order_keys_);
492  }
ConstRexScalarPtrVector order_keys_
const ConstRexScalarPtrVector& RexWindowFunctionOperator::getPartitionKeys ( ) const
inline

Definition at line 484 of file RelAlgDagBuilder.h.

References partition_keys_.

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

484 { return partition_keys_; }
ConstRexScalarPtrVector partition_keys_

+ Here is the caller graph for this function:

ConstRexScalarPtrVector RexWindowFunctionOperator::getPartitionKeysAndRelease ( ) const
inline

Definition at line 486 of file RelAlgDagBuilder.h.

References partition_keys_.

486  {
487  return std::move(partition_keys_);
488  }
ConstRexScalarPtrVector partition_keys_
const RexWindowBound& RexWindowFunctionOperator::getUpperBound ( ) const
inline

Definition at line 500 of file RelAlgDagBuilder.h.

References upper_bound_.

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

500 { return upper_bound_; }
const RexWindowBound upper_bound_

+ Here is the caller graph for this function:

bool RexWindowFunctionOperator::isRows ( ) const
inline

Definition at line 502 of file RelAlgDagBuilder.h.

References is_rows_.

Referenced by disambiguatedOperands(), and RelAlgTranslator::translateWindowFunction().

502 { return is_rows_; }

+ Here is the caller graph for this function:

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

Reimplemented from RexFunctionOperator.

Definition at line 521 of file RelAlgDagBuilder.h.

References RexFunctionOperator::getName(), RexOperator::operands_, order_keys_, partition_keys_, and run_benchmark_import::result.

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

+ Here is the call graph for this function:

Member Data Documentation

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

Definition at line 543 of file RelAlgDagBuilder.h.

Referenced by getCollation().

const bool RexWindowFunctionOperator::is_rows_
private

Definition at line 546 of file RelAlgDagBuilder.h.

Referenced by isRows().

const SqlWindowFunctionKind RexWindowFunctionOperator::kind_
private

Definition at line 540 of file RelAlgDagBuilder.h.

Referenced by disambiguatedOperands(), and getKind().

const RexWindowBound RexWindowFunctionOperator::lower_bound_
private

Definition at line 544 of file RelAlgDagBuilder.h.

Referenced by getLowerBound().

ConstRexScalarPtrVector RexWindowFunctionOperator::order_keys_
mutableprivate

Definition at line 542 of file RelAlgDagBuilder.h.

Referenced by getOrderKeys(), getOrderKeysAndRelease(), and toString().

ConstRexScalarPtrVector RexWindowFunctionOperator::partition_keys_
mutableprivate

Definition at line 541 of file RelAlgDagBuilder.h.

Referenced by getPartitionKeys(), getPartitionKeysAndRelease(), and toString().

const RexWindowBound RexWindowFunctionOperator::upper_bound_
private

Definition at line 545 of file RelAlgDagBuilder.h.

Referenced by getUpperBound().


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