**Describe the unexpected behaviour**
Not found column number in block error when specifying ORDER BY that uses a column not mentioned in the SELECT.

**How to reproduce**
```
:) select count() over (order by number + 1) from numbers(10) order by number

Code: 10. DB::Exception: Received from localhost:9000. DB::Exception: Not found column number in block. There are only columns: count() OVER (ORDER BY number + 1 ASC), plus(number, 1)
```

**Expected behavior**
It should work.

before_where,
                        ExpressionActionsSettings::fromSettings(context->getSettingsRef())).execute(before_where_sample);
                    auto & column_elem = before_where_sample.getByName(query.where()->getColumnName());
                    
                    if (column_elem.column)
                        where_constant_filter_description = ConstantFilterDescription(*column_elem.column);
                }
            }
            chain.addStep();
        }
        if (need_aggregate)
        {
            
            optimize_aggregation_in_order =
                    context->getSettingsRef().optimize_aggregation_in_order
                    && storage && query.groupBy();
            query_analyzer.appendGroupBy(chain, only_types || !first_stage, optimize_aggregation_in_order, group_by_elements_actions);
            query_analyzer.appendAggregateFunctionsArguments(chain, only_types || !first_stage);
            before_aggregation = chain.getLastActions();
            if (settings.group_by_use_nulls)
                query_analyzer.appendGroupByModifiers(before_aggregation, chain, only_types);
            finalize_chain(chain);
            if (query_analyzer.appendHaving(chain, only_types || !second_stage))
            {
                having_step_num = chain.steps.size() - 1;
                before_having = chain.getLastActions();
                chain.addStep();
            }
        }
        bool join_allow_read_in_order = true;