OmniSciDB  04ee39c94c
WindowContext.h File Reference
#include "../Analyzer/Analyzer.h"
#include "../Chunk/Chunk.h"
#include "JoinHashTableInterface.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

class  WindowFunctionContext
 
struct  WindowFunctionContext::AggregateState
 
class  WindowProjectNodeContext
 

Functions

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

Function Documentation

◆ window_function_is_aggregate()

bool window_function_is_aggregate ( const SqlWindowFunctionKind  kind)
inline

◆ window_function_is_value()

bool window_function_is_value ( const SqlWindowFunctionKind  kind)
inline

Definition at line 27 of file WindowContext.h.

References FIRST_VALUE, LAG, LAST_VALUE, and LEAD.

Referenced by WindowFunctionContext::compute(), and RelAlgTranslator::translateWindowFunction().

27  {
28  switch (kind) {
33  return true;
34  }
35  default: {
36  return false;
37  }
38  }
39 }
+ Here is the caller graph for this function:

◆ window_function_requires_peer_handling()

bool window_function_requires_peer_handling ( const Analyzer::WindowFunction window_func)

Definition at line 381 of file WindowContext.cpp.

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

Referenced by TargetExprCodegen::codegen(), WindowFunctionContext::compute(), and WindowFunctionContext::computePartition().

381  {
382  if (!window_function_is_aggregate(window_func->getKind())) {
383  return false;
384  }
385  if (window_func->getOrderKeys().empty()) {
386  return true;
387  }
388  switch (window_func->getKind()) {
391  return false;
392  }
393  default: {
394  return true;
395  }
396  }
397 }
const std::vector< std::shared_ptr< Analyzer::Expr > > & getOrderKeys() const
Definition: Analyzer.h:1347
bool window_function_is_aggregate(const SqlWindowFunctionKind kind)
Definition: WindowContext.h:42
SqlWindowFunctionKind getKind() const
Definition: Analyzer.h:1339
+ Here is the call graph for this function:
+ Here is the caller graph for this function: