OmniSciDB
c1a53651b2
|
#include <Analyzer.h>
Public Types | |
enum | FrameBoundType { FrameBoundType::NONE, FrameBoundType::ROW, FrameBoundType::RANGE } |
Public Member Functions | |
WindowFunction (const SQLTypeInfo &ti, const SqlWindowFunctionKind kind, const std::vector< std::shared_ptr< Analyzer::Expr >> &args, const std::vector< std::shared_ptr< Analyzer::Expr >> &partition_keys, const std::vector< std::shared_ptr< Analyzer::Expr >> &order_keys, const FrameBoundType frame_bound_type, const std::shared_ptr< Expr > frame_start_bound, const std::shared_ptr< Expr > frame_end_bound, const std::vector< OrderEntry > &collation) | |
std::shared_ptr< Analyzer::Expr > | deep_copy () const override |
bool | operator== (const Expr &rhs) const override |
std::string | toString () const override |
SqlWindowFunctionKind | getKind () const |
const std::vector < std::shared_ptr < Analyzer::Expr > > & | getArgs () const |
const std::vector < std::shared_ptr < Analyzer::Expr > > & | getPartitionKeys () const |
const std::vector < std::shared_ptr < Analyzer::Expr > > & | getOrderKeys () const |
const Analyzer::WindowFrame * | getFrameStartBound () const |
const Analyzer::WindowFrame * | getFrameEndBound () const |
const std::vector< OrderEntry > & | getCollation () const |
Analyzer::WindowFunction::FrameBoundType | getFrameBoundType () const |
bool | hasRowModeFraming () const |
bool | hasRangeModeFraming () const |
bool | hasFraming () const |
bool | hasAggregateTreeRequiredWindowFunc () const |
bool | isFrameNavigateWindowFunction () const |
![]() | |
Expr (SQLTypes t, bool notnull) | |
Expr (SQLTypes t, int d, bool notnull) | |
Expr (SQLTypes t, int d, int s, bool notnull) | |
Expr (const SQLTypeInfo &ti, bool has_agg=false) | |
virtual | ~Expr () |
std::shared_ptr< Analyzer::Expr > | get_shared_ptr () |
const SQLTypeInfo & | get_type_info () const |
void | set_type_info (const SQLTypeInfo &ti) |
bool | get_contains_agg () const |
void | set_contains_agg (bool a) |
virtual std::shared_ptr < Analyzer::Expr > | add_cast (const SQLTypeInfo &new_type_info) |
virtual void | check_group_by (const std::list< std::shared_ptr< Analyzer::Expr >> &groupby) const |
virtual std::shared_ptr < Analyzer::Expr > | normalize_simple_predicate (int &rte_idx) const |
virtual void | group_predicates (std::list< const Expr * > &scan_predicates, std::list< const Expr * > &join_predicates, std::list< const Expr * > &const_predicates) const |
virtual void | collect_rte_idx (std::set< int > &rte_idx_set) const |
virtual void | collect_column_var (std::set< const ColumnVar *, bool(*)(const ColumnVar *, const ColumnVar *)> &colvar_set, bool include_agg) const |
virtual size_t | get_num_column_vars (const bool include_agg) const |
virtual std::shared_ptr < Analyzer::Expr > | rewrite_with_targetlist (const std::vector< std::shared_ptr< TargetEntry >> &tlist) const |
virtual std::shared_ptr < Analyzer::Expr > | rewrite_with_child_targetlist (const std::vector< std::shared_ptr< TargetEntry >> &tlist) const |
virtual std::shared_ptr < Analyzer::Expr > | rewrite_agg_to_var (const std::vector< std::shared_ptr< TargetEntry >> &tlist) const |
virtual void | print () const |
virtual void | add_unique (std::list< const Expr * > &expr_list) const |
virtual void | find_expr (std::function< bool(const Expr *)> f, std::list< const Expr * > &expr_list) const |
std::shared_ptr< Analyzer::Expr > | decompress () |
virtual void | get_domain (DomainSet &domain_set) const |
Static Public Member Functions | |
static bool | isFramingAvailableWindowFunc (SqlWindowFunctionKind kind) |
Static Public Attributes | |
static constexpr std::array < SqlWindowFunctionKind, 11 > | FRAMING_ALLOWED_WINDOW_FUNCS |
static constexpr std::array < SqlWindowFunctionKind, 8 > | AGGREGATION_TREE_REQUIRED_WINDOW_FUNCS_FOR_FRAMING |
static constexpr std::array < SqlWindowFunctionKind, 3 > | REQUIRE_HASH_TABLE_FOR_FRAMING |
Private Attributes | |
const SqlWindowFunctionKind | kind_ |
const std::vector < std::shared_ptr < Analyzer::Expr > > | args_ |
const std::vector < std::shared_ptr < Analyzer::Expr > > | partition_keys_ |
const std::vector < std::shared_ptr < Analyzer::Expr > > | order_keys_ |
const FrameBoundType | frame_bound_type_ {FrameBoundType::NONE} |
const std::shared_ptr < Analyzer::Expr > | frame_start_bound_ |
const std::shared_ptr < Analyzer::Expr > | frame_end_bound_ |
const std::vector< OrderEntry > | collation_ |
Additional Inherited Members | |
![]() | |
SQLTypeInfo | type_info |
bool | contains_agg |
Definition at line 2522 of file Analyzer.h.
|
strong |
|
inline |
Definition at line 2552 of file Analyzer.h.
|
overridevirtual |
Implements Analyzer::Expr.
Definition at line 222 of file Analyzer.cpp.
References args_, collation_, frame_bound_type_, frame_end_bound_, frame_start_bound_, kind_, order_keys_, partition_keys_, and Analyzer::Expr::type_info.
|
inline |
Definition at line 2578 of file Analyzer.h.
References args_.
Referenced by CodeGenerator::codegenFixedLengthColVarInWindow(), WindowFunctionContext::compute(), WindowFunctionContext::computeAggregateTreeCacheKey(), WindowFunctionContext::computePartitionBuffer(), RelAlgExecutor::createWindowFunctionContext(), anonymous_namespace{WindowFunctionIR.cpp}::get_adjusted_window_type_info(), anonymous_namespace{WindowContext.cpp}::get_lag_or_lead_argument(), ScalarExprToSql::visitWindowFunction(), DeepCopyVisitor::visitWindowFunction(), ScalarExprVisitor< std::set< shared::TableKey > >::visitWindowFunction(), and anonymous_namespace{WindowExpressionRewrite.cpp}::window_sum_and_count_match().
|
inline |
Definition at line 2602 of file Analyzer.h.
References collation_.
Referenced by WindowFunctionContext::computeAggregateTreeCacheKey(), WindowFunctionContext::createComparator(), RelAlgExecutor::createWindowFunctionContext(), ScalarExprToSql::visitWindowFunction(), and DeepCopyVisitor::visitWindowFunction().
|
inline |
Definition at line 2604 of file Analyzer.h.
References frame_bound_type_.
Referenced by DeepCopyVisitor::visitWindowFunction().
|
inline |
Definition at line 2595 of file Analyzer.h.
References CHECK, and frame_end_bound_.
Referenced by Executor::codegenFrameBoundRange(), and DeepCopyVisitor::visitWindowFunction().
|
inline |
Definition at line 2588 of file Analyzer.h.
References CHECK, and frame_start_bound_.
Referenced by Executor::codegenFrameBoundRange(), and DeepCopyVisitor::visitWindowFunction().
|
inline |
Definition at line 2576 of file Analyzer.h.
References kind_.
Referenced by WindowFunctionContext::aggregateState(), WindowFunctionContext::aggregateStateCount(), WindowFunctionContext::aggregateStatePendingOutputs(), Executor::codegenAggregateWindowState(), CodeGenerator::codegenFixedLengthColVarInWindow(), GroupByAndAggregate::codegenWindowRowPointer(), WindowFunctionContext::compute(), WindowFunctionContext::computeAggregateTreeCacheKey(), WindowFunctionContext::computePartitionBuffer(), anonymous_namespace{WindowFunctionIR.cpp}::get_adjusted_window_type_info(), anonymous_namespace{WindowContext.cpp}::get_lag_or_lead_argument(), anonymous_namespace{WindowContext.cpp}::get_target_idx_for_first_or_last_value_func(), ScalarExprToSql::visitWindowFunction(), DeepCopyVisitor::visitWindowFunction(), window_function_requires_peer_handling(), and WindowFunctionContext::WindowFunctionContext().
|
inline |
Definition at line 2584 of file Analyzer.h.
References order_keys_.
Referenced by Executor::codegenFrameBoundExpr(), Executor::codegenLoadCurrentValueFromColBuf(), Executor::codegenLoadOrderKeyBufPtr(), WindowFunctionContext::compute(), WindowFunctionContext::computeAggregateTreeCacheKey(), WindowFunctionContext::createComparator(), RelAlgExecutor::createWindowFunctionContext(), Executor::getFirstOrderColTypeInfo(), Executor::getOrderKeyTypeName(), ScalarExprToSql::visitWindowFunction(), DeepCopyVisitor::visitWindowFunction(), ScalarExprVisitor< std::set< shared::TableKey > >::visitWindowFunction(), and window_function_requires_peer_handling().
|
inline |
Definition at line 2580 of file Analyzer.h.
References partition_keys_.
Referenced by WindowFunctionContext::computeAggregateTreeCacheKey(), RelAlgExecutor::computeWindow(), ScalarExprToSql::visitWindowFunction(), DeepCopyVisitor::visitWindowFunction(), and ScalarExprVisitor< std::set< shared::TableKey > >::visitWindowFunction().
|
inline |
Definition at line 2624 of file Analyzer.h.
References AGGREGATION_TREE_REQUIRED_WINDOW_FUNCS_FOR_FRAMING, anonymous_namespace{QueryMemoryDescriptor.cpp}::any_of(), and kind_.
Referenced by WindowFunctionContext::needsToBuildAggregateTree().
|
inline |
Definition at line 2612 of file Analyzer.h.
References frame_bound_type_, isFramingAvailableWindowFunc(), kind_, and NONE.
Referenced by WindowFunctionContext::compute(), WindowFunctionContext::needsToBuildAggregateTree(), toString(), and WindowFunctionContext::WindowFunctionContext().
|
inline |
Definition at line 2610 of file Analyzer.h.
References frame_bound_type_, and RANGE.
Referenced by CodeGenerator::codegenFixedLengthColVar(), and Executor::codegenFrameBoundExpr().
|
inline |
Definition at line 2608 of file Analyzer.h.
References frame_bound_type_, and ROW.
|
inline |
Definition at line 2630 of file Analyzer.h.
References anonymous_namespace{QueryMemoryDescriptor.cpp}::any_of(), kind_, and REQUIRE_HASH_TABLE_FOR_FRAMING.
Referenced by Executor::codegenCurrentPartitionIndex(), Executor::codegenLoadCurrentValueFromColBuf(), and RelAlgExecutor::createWindowFunctionContext().
|
inlinestatic |
Definition at line 2617 of file Analyzer.h.
References anonymous_namespace{QueryMemoryDescriptor.cpp}::any_of(), and FRAMING_ALLOWED_WINDOW_FUNCS.
Referenced by hasFraming(), and RelAlgTranslator::translateWindowFunction().
|
overridevirtual |
Implements Analyzer::Expr.
Definition at line 2548 of file Analyzer.cpp.
References args_, expr_list_match(), frame_bound_type_, frame_end_bound_, frame_start_bound_, kind_, order_keys_, and partition_keys_.
|
overridevirtual |
Implements Analyzer::Expr.
Definition at line 2985 of file Analyzer.cpp.
References args_, frame_bound_type_, frame_end_bound_, frame_start_bound_, hasFraming(), kind_, order_keys_, RANGE, run_benchmark_import::result, ROW, and UNREACHABLE.
|
static |
Definition at line 2538 of file Analyzer.h.
Referenced by hasAggregateTreeRequiredWindowFunc().
|
private |
Definition at line 2639 of file Analyzer.h.
Referenced by deep_copy(), getArgs(), operator==(), and toString().
|
private |
Definition at line 2645 of file Analyzer.h.
Referenced by deep_copy(), and getCollation().
|
private |
Definition at line 2642 of file Analyzer.h.
Referenced by deep_copy(), getFrameBoundType(), hasFraming(), hasRangeModeFraming(), hasRowModeFraming(), operator==(), and toString().
|
private |
Definition at line 2644 of file Analyzer.h.
Referenced by deep_copy(), getFrameEndBound(), operator==(), and toString().
|
private |
Definition at line 2643 of file Analyzer.h.
Referenced by deep_copy(), getFrameStartBound(), operator==(), and toString().
|
static |
Definition at line 2525 of file Analyzer.h.
Referenced by isFramingAvailableWindowFunc().
|
private |
Definition at line 2638 of file Analyzer.h.
Referenced by deep_copy(), getKind(), hasAggregateTreeRequiredWindowFunc(), hasFraming(), isFrameNavigateWindowFunction(), operator==(), and toString().
|
private |
Definition at line 2641 of file Analyzer.h.
Referenced by deep_copy(), getOrderKeys(), operator==(), and toString().
|
private |
Definition at line 2640 of file Analyzer.h.
Referenced by deep_copy(), getPartitionKeys(), and operator==().
|
static |
Definition at line 2547 of file Analyzer.h.
Referenced by isFrameNavigateWindowFunction().