This window function does not work
```
select 
      sum(a)*100/sum(sum(a)) over
          (partition by b) as r
from 
(
  SELECT 1 as a, 2 as b
  UNION ALL
  SELECT 3 as a, 4 as b
  UNION ALL
  SELECT 5 as a, 2 as b

) as t
group by 
b
```

```
Received exception from server (version 22.7.1):
Code: 10. DB::Exception: Received from localhost:9000. DB::Exception: Not found column multiply(sum(a), 100) in block. Stack trace:

0. DB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, bool) @ 0xb8f1c3a in /usr/bin/clickhouse
1. DB::Exception::Exception<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>(int, fmt::v8::basic_format_string<char, fmt::v8::type_identity<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&>::type>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) @ 0xb95e638 in /usr/bin/clickhouse
2. DB::ActionsDAG::updateHeader(DB::Block) const @ 0x15a85d21 in /usr/bin/clickhouse
3. DB::ExpressionTransform::transformHeader(DB::Block, DB::ActionsDAG const&) @ 0x17401fc4 in /usr/bin/clickhouse
4. DB::ExpressionStep::ExpressionStep(DB::DataStream const&, std::__1::shared_ptr<DB::ActionsDAG>) @ 0x17507dc0 in /usr/bin/clickhouse
5. DB::InterpreterSelectQuery::executeExpression(DB::QueryPlan&, std::__1::shared_ptr<DB::ActionsDAG> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) @ 0x162e1152 in /usr/bin/clickhouse
6. DB::InterpreterSelectQuery::executeImpl(DB::QueryPlan&, std::__1::optional<DB::Pipe>) @ 0x162d5d31 in /usr/bin/clickhouse
7. DB::InterpreterSelectQuery::buildQueryPlan(DB::QueryPlan&) @ 0x162d2f75 in /usr/bin/clickhouse
8. DB::InterpreterSelectWithUnionQuery::buildQueryPlan(DB::QueryPlan&) @ 0x16317614 in /usr/bin/clickhouse
9. DB::InterpreterSelectWithUnionQuery::execute() @ 0x1631894d in /usr/bin/clickhouse
10. DB::executeQueryImpl(char const*, char const*, std::__1::shared_ptr<DB::Context>, bool, DB::QueryProcessingStage::Enum, DB::ReadBuffer*) @ 0x165ecab2 in /usr/bin/clickhouse
11. DB::executeQuery(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<DB::Context>, bool, DB::QueryProcessingStage::Enum) @ 0x165e9f75 in /usr/bin/clickhouse
12. DB::TCPHandler::runImpl() @ 0x171d3c5a in /usr/bin/clickhouse
13. DB::TCPHandler::run() @ 0x171e62d9 in /usr/bin/clickhouse
14. Poco::Net::TCPServerConnection::start() @ 0x19e85433 in /usr/bin/clickhouse
15. Poco::Net::TCPServerDispatcher::run() @ 0x19e867b1 in /usr/bin/clickhouse
16. Poco::PooledThread::run() @ 0x1a037b5b in /usr/bin/clickhouse
17. Poco::ThreadImpl::runnableEntry(void*) @ 0x1a035260 in /usr/bin/clickhouse
18. ? @ 0x7f5406b79609 in ?
19. clone @ 0x7f5406a9e163 in ?
. (NOT_FOUND_COLUMN_IN_BLOCK)

```



This works:
```
select 
      sum(a)/sum(sum(a)) over
          (partition by b) as r
from 
(
  SELECT 1 as a, 2 as b
  UNION ALL
  SELECT 3 as a, 4 as b
  UNION ALL
  SELECT 5 as a, 2 as b

) as t
group by 
b
```
{
    ExpressionActionsChain::Step & step = chain.lastStep(columns_after_array_join);
    getRootActions(analyzedJoin().leftKeysList(), only_types, step.actions());
    return true;
}
JoinPtr SelectQueryExpressionAnalyzer::appendJoin(
    ExpressionActionsChain & chain,
    ActionsDAGPtr & converting_join_columns)
{
    const ColumnsWithTypeAndName & left_sample_columns = chain.getLastStep().getResultColumns();
    JoinPtr join = makeJoin(*syntax->ast_join, left_sample_columns, converting_join_columns);
    if (converting_join_columns)
    {
        chain.steps.push_back(std::make_unique<ExpressionActionsChain::ExpressionActionsStep>(converting_join_columns));
        chain.addStep();
    }
    ExpressionActionsChain::Step & step = chain.lastStep(columns_after_array_join);
    chain.steps.push_back(std::make_unique<ExpressionActionsChain::JoinStep>(
        syntax->analyzed_join, join, step.getResultColumns()));
    chain.addStep();
    return join;
}
static ActionsDAGPtr createJoinedBlockActions(ContextPtr context, const TableJoin & analyzed_join)
{
    ASTPtr expression_list = analyzed_join.rightKeysList();
    auto syntax_result = TreeRewriter(context).analyze(expression_list, analyzed_join.columnsFromJoinedTable());
    return ExpressionAnalyzer(expression_list, syntax_result, context).getActionsDAG(true, false);
}
static std::shared_ptr<IJoin> chooseJoinAlgorithm(std::shared_ptr<TableJoin> analyzed_join, const Block & right_sample_block, ContextPtr context)