input: max_prices=[MAX($0) OVER (PARTITION BY $2 ORDER BY $0, $1)] output: max_prices=[MAX($0)]
| 701 | // input: max_prices=[MAX($0) OVER (PARTITION BY $2 ORDER BY $0, $1)] |
| 702 | // output: max_prices=[MAX($0)] |
| 703 | std::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 |