OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
WindowContext.h File Reference
#include "Analyzer/Analyzer.h"
#include "DataMgr/Chunk/Chunk.h"
#include "QueryEngine/JoinHashTable/HashJoin.h"
#include "QueryEngine/Utils/SegmentTree.h"
#include "Shared/sqltypes.h"
#include <functional>
#include <unordered_map>
+ Include dependency graph for WindowContext.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  AggregateTreeForWindowFraming
 
struct  WindowFrameBoundFuncArgs
 
struct  WindowPartitionBufferPtrs
 
class  WindowFunctionContext
 
struct  WindowFunctionContext::AggregateState
 
class  WindowProjectNodeContext
 

Functions

bool window_function_is_value (const SqlWindowFunctionKind kind)
 
bool window_function_is_value_with_frame (const SqlWindowFunctionKind kind)
 
bool window_function_is_aggregate (const SqlWindowFunctionKind kind)
 
bool window_function_conditional_aggregate (const SqlWindowFunctionKind kind)
 
bool window_function_requires_peer_handling (const Analyzer::WindowFunction *window_func)
 

Function Documentation

bool window_function_conditional_aggregate ( const SqlWindowFunctionKind  kind)
inline

Definition at line 78 of file WindowContext.h.

References COUNT_IF, and SUM_IF.

Referenced by Executor::codegenWindowFunctionAggregateCalls().

78  {
79  switch (kind) {
82  return true;
83  default:
84  return false;
85  }
86 }

+ Here is the caller graph for this function:

bool window_function_is_value_with_frame ( const SqlWindowFunctionKind  kind)
inline

Definition at line 47 of file WindowContext.h.

References FIRST_VALUE_IN_FRAME, LAG_IN_FRAME, LAST_VALUE_IN_FRAME, LEAD_IN_FRAME, and NTH_VALUE_IN_FRAME.

Referenced by RelAlgTranslator::translateWindowFunction().

+ Here is the caller graph for this function:

bool window_function_requires_peer_handling ( const Analyzer::WindowFunction window_func)

Definition at line 531 of file WindowContext.cpp.

References Analyzer::WindowFunction::getKind(), Analyzer::WindowFunction::getOrderKeys(), MAX, MIN, and window_function_is_aggregate().

Referenced by TargetExprCodegen::codegenAggregate(), WindowFunctionContext::compute(), and WindowFunctionContext::computePartitionBuffer().

531  {
532  if (!window_function_is_aggregate(window_func->getKind())) {
533  return false;
534  }
535  if (window_func->getOrderKeys().empty()) {
536  return true;
537  }
538  switch (window_func->getKind()) {
541  return false;
542  }
543  default: {
544  return true;
545  }
546  }
547 }
SqlWindowFunctionKind getKind() const
Definition: Analyzer.h:2925
const std::vector< std::shared_ptr< Analyzer::Expr > > & getOrderKeys() const
Definition: Analyzer.h:2933
bool window_function_is_aggregate(const SqlWindowFunctionKind kind)
Definition: WindowContext.h:61

+ Here is the call graph for this function:

+ Here is the caller graph for this function: