MCPcopy Create free account
hub / github.com/BlazingDB/blazingsql / is_sum_window_function

Function is_sum_window_function

engine/src/parser/expression_utils.cpp:684–689  ·  view source on GitHub ↗

Due to `sum` window aggregation the OVER clause is repeated two times from Calcite something like: CASE(>(COUNT($0) OVER (PARTITION BY $1), 0), $SUM0($0) OVER (PARTITION BY $1), null:INTEGER)

Source from the content-addressed store, hash-verified

682// something like:
683// CASE(>(COUNT($0) OVER (PARTITION BY $1), 0), $SUM0($0) OVER (PARTITION BY $1), null:INTEGER)
684bool is_sum_window_function(std::string expression) {
685 size_t num_over_clauses = StringUtil::findAndCountAllMatches(expression, "OVER");
686 if (num_over_clauses == 2) return true;
687
688 return false;
689}
690
691// Due to `avg` window aggregation the OVER clause is repeated three times from Calcite
692// something like:

Calls

no outgoing calls

Tested by

no test coverage detected