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

Function remove_over_expr

engine/src/parser/expression_utils.cpp:703–710  ·  view source on GitHub ↗

input: max_prices=[MAX($0) OVER (PARTITION BY $2 ORDER BY $0, $1)] output: max_prices=[MAX($0)]

Source from the content-addressed store, hash-verified

701// input: max_prices=[MAX($0) OVER (PARTITION BY $2 ORDER BY $0, $1)]
702// output: max_prices=[MAX($0)]
703std::string remove_over_expr(std::string expression) {
704
705 std::string over_expression = get_over_expression(expression);
706 std::string expression_to_remove = " OVER (" + over_expression + ")";
707 std::string removed_expression = StringUtil::replace(expression, expression_to_remove, "");
708
709 return removed_expression;
710}
711
712// Will replace the `COUNT($X)` expression with the right window col index
713// useful when exists an `avg` or `sum` window expression

Callers 2

TEST_FFunction · 0.85

Calls 1

get_over_expressionFunction · 0.85

Tested by 1

TEST_FFunction · 0.68