OmniSciDB  f632821e96
anonymous_namespace{WindowFunctionIR.cpp} Namespace Reference

Functions

std::string get_window_agg_name (const SqlWindowFunctionKind kind, const SQLTypeInfo &window_func_ti)
 
SQLTypeInfo get_adjusted_window_type_info (const Analyzer::WindowFunction *window_func)
 

Function Documentation

◆ get_adjusted_window_type_info()

SQLTypeInfo anonymous_namespace{WindowFunctionIR.cpp}::get_adjusted_window_type_info ( const Analyzer::WindowFunction window_func)

Definition at line 114 of file WindowFunctionIR.cpp.

References run_benchmark_import::args, AVG, COUNT, Analyzer::Expr::get_type_info(), Analyzer::WindowFunction::getArgs(), and Analyzer::WindowFunction::getKind().

Referenced by Executor::aggregateWindowStatePtr(), Executor::codegenAggregateWindowState(), Executor::codegenWindowAvgEpilogue(), Executor::codegenWindowFunctionAggregateCalls(), and Executor::codegenWindowFunctionStateInit().

114  {
115  const auto& args = window_func->getArgs();
116  return ((window_func->getKind() == SqlWindowFunctionKind::COUNT && !args.empty()) ||
117  window_func->getKind() == SqlWindowFunctionKind::AVG)
118  ? args.front()->get_type_info()
119  : window_func->get_type_info();
120 }
const std::vector< std::shared_ptr< Analyzer::Expr > > & getArgs() const
Definition: Analyzer.h:1449
const SQLTypeInfo & get_type_info() const
Definition: Analyzer.h:78
SqlWindowFunctionKind getKind() const
Definition: Analyzer.h:1447
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_window_agg_name()

std::string anonymous_namespace{WindowFunctionIR.cpp}::get_window_agg_name ( const SqlWindowFunctionKind  kind,
const SQLTypeInfo window_func_ti 
)

Definition at line 73 of file WindowFunctionIR.cpp.

References AVG, COUNT, logger::FATAL, SQLTypeInfo::get_type(), kDOUBLE, kFLOAT, LOG, MAX, MIN, and SUM.

Referenced by Executor::codegenWindowFunctionAggregateCalls().

74  {
75  std::string agg_name;
76  switch (kind) {
78  agg_name = "agg_min";
79  break;
80  }
82  agg_name = "agg_max";
83  break;
84  }
87  agg_name = "agg_sum";
88  break;
89  }
91  agg_name = "agg_count";
92  break;
93  }
94  default: {
95  LOG(FATAL) << "Invalid window function kind";
96  }
97  }
98  switch (window_func_ti.get_type()) {
99  case kFLOAT: {
100  agg_name += "_float";
101  break;
102  }
103  case kDOUBLE: {
104  agg_name += "_double";
105  break;
106  }
107  default: {
108  break;
109  }
110  }
111  return agg_name;
112 }
#define LOG(tag)
Definition: Logger.h:188
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:259
+ Here is the call graph for this function:
+ Here is the caller graph for this function: