OmniSciDB
a5dc49c757
|
#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 |
bool | isMissingValueFillingFunction () const |
Public Member Functions inherited from Analyzer::Expr | |
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, 14 > | FRAMING_ALLOWED_WINDOW_FUNCS |
static constexpr std::array < SqlWindowFunctionKind, 9 > | AGGREGATION_TREE_REQUIRED_WINDOW_FUNCS_FOR_FRAMING |
static constexpr std::array < SqlWindowFunctionKind, 2 > | FILLING_FUNCS_USING_WINDOW |
static constexpr std::array < SqlWindowFunctionKind, 7 > | 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 | |
Protected Attributes inherited from Analyzer::Expr | |
SQLTypeInfo | type_info |
bool | contains_agg |
Definition at line 2860 of file Analyzer.h.
|
strong |
|
inline |
Definition at line 2901 of file Analyzer.h.
|
overridevirtual |
Implements Analyzer::Expr.
Definition at line 239 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 2927 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 2951 of file Analyzer.h.
References collation_.
Referenced by WindowFunctionContext::computeAggregateTreeCacheKey(), WindowFunctionContext::createComparator(), RelAlgExecutor::createWindowFunctionContext(), ScalarExprToSql::visitWindowFunction(), and DeepCopyVisitor::visitWindowFunction().
|
inline |
Definition at line 2953 of file Analyzer.h.
References frame_bound_type_.
Referenced by DeepCopyVisitor::visitWindowFunction().
|
inline |
Definition at line 2944 of file Analyzer.h.
References CHECK, and frame_end_bound_.
Referenced by Executor::codegenFrameBoundRange(), and DeepCopyVisitor::visitWindowFunction().
|
inline |
Definition at line 2937 of file Analyzer.h.
References CHECK, and frame_start_bound_.
Referenced by Executor::codegenFrameBoundRange(), and DeepCopyVisitor::visitWindowFunction().
|
inline |
Definition at line 2925 of file Analyzer.h.
References kind_.
Referenced by WindowFunctionContext::aggregateState(), WindowFunctionContext::aggregateStateCount(), WindowFunctionContext::aggregateStatePendingOutputs(), WindowFunctionContext::buildAggregationTreeForPartition(), 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 2933 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 2929 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 2973 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 2961 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 2959 of file Analyzer.h.
References frame_bound_type_, and RANGE.
Referenced by CodeGenerator::codegenFixedLengthColVar(), and Executor::codegenFrameBoundExpr().
|
inline |
Definition at line 2957 of file Analyzer.h.
References frame_bound_type_, and ROW.
|
inline |
Definition at line 2979 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 2966 of file Analyzer.h.
References anonymous_namespace{QueryMemoryDescriptor.cpp}::any_of(), and FRAMING_ALLOWED_WINDOW_FUNCS.
Referenced by hasFraming(), and RelAlgTranslator::translateWindowFunction().
|
inline |
Definition at line 2986 of file Analyzer.h.
References anonymous_namespace{QueryMemoryDescriptor.cpp}::any_of(), FILLING_FUNCS_USING_WINDOW, and kind_.
Referenced by WindowFunctionContext::compute(), and WindowFunctionContext::WindowFunctionContext().
|
overridevirtual |
Implements Analyzer::Expr.
Definition at line 2651 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 3116 of file Analyzer.cpp.
References args_, frame_bound_type_, frame_end_bound_, frame_start_bound_, hasFraming(), kind_, order_keys_, RANGE, ROW, and UNREACHABLE.
|
static |
Definition at line 2879 of file Analyzer.h.
Referenced by hasAggregateTreeRequiredWindowFunc().
|
private |
Definition at line 2995 of file Analyzer.h.
Referenced by deep_copy(), getArgs(), operator==(), and toString().
|
private |
Definition at line 3001 of file Analyzer.h.
Referenced by deep_copy(), and getCollation().
|
static |
Definition at line 2889 of file Analyzer.h.
Referenced by isMissingValueFillingFunction().
|
private |
Definition at line 2998 of file Analyzer.h.
Referenced by deep_copy(), getFrameBoundType(), hasFraming(), hasRangeModeFraming(), hasRowModeFraming(), operator==(), and toString().
|
private |
Definition at line 3000 of file Analyzer.h.
Referenced by deep_copy(), getFrameEndBound(), operator==(), and toString().
|
private |
Definition at line 2999 of file Analyzer.h.
Referenced by deep_copy(), getFrameStartBound(), operator==(), and toString().
|
static |
Definition at line 2863 of file Analyzer.h.
Referenced by isFramingAvailableWindowFunc().
|
private |
Definition at line 2994 of file Analyzer.h.
Referenced by deep_copy(), getKind(), hasAggregateTreeRequiredWindowFunc(), hasFraming(), isFrameNavigateWindowFunction(), isMissingValueFillingFunction(), operator==(), and toString().
|
private |
Definition at line 2997 of file Analyzer.h.
Referenced by deep_copy(), getOrderKeys(), operator==(), and toString().
|
private |
Definition at line 2996 of file Analyzer.h.
Referenced by deep_copy(), getPartitionKeys(), and operator==().
|
static |
Definition at line 2892 of file Analyzer.h.
Referenced by isFrameNavigateWindowFunction().