**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.

if (hasJoin())
        {
            
            join_has_delayed_stream = query_analyzer.analyzedJoin().needStreamWithNonJoinedRows();
            join_allow_read_in_order = typeid_cast<HashJoin *>(join.get()) && !join_has_delayed_stream;
        }
        optimize_read_in_order =
            settings.optimize_read_in_order
            && storage
            && query.orderBy()
            && !query_analyzer.hasAggregation()
            && !query_analyzer.hasWindow()
            && !query.final()
            && join_allow_read_in_order;
        if (storage && optimize_read_in_order)
        {
            Names columns_for_sorting_key = metadata_snapshot->getColumnsRequiredForSortingKey();
            additional_required_columns_after_prewhere.insert(additional_required_columns_after_prewhere.end(),
                columns_for_sorting_key.begin(), columns_for_sorting_key.end());
        }
        
        query_analyzer.appendSelect(chain, only_types || (need_aggregate ? !second_stage : !first_stage));
        
        
        if (has_window)
        {
            query_analyzer.makeWindowDescriptions(chain.getLastActions());
            query_analyzer.appendWindowFunctionsArguments(chain, only_types || !first_stage);