This code is now present, right before sending window function results out:
a + b, win_func(a+b) over () ...
fails without that last if statement. This should be investigated further to understand the exact reason why this works, and if it covers all use cases.
The "if" approach is inefficient. We should try to make it such that we have the "compiled" list at setup time and then just iterate over them directly. Check