Abnormal memory requirements for a query with string filter


Appeared fresh after upgrade to 21.3.2.5 

The table is not big - 480 mb compressed

Getting an error
```
SQL Error [241]: ClickHouse exception, code: 241, host: localhost, port: 8123; Code: 241, e.displayText() = DB::Exception: Memory limit (for query) exceeded: would use 1.00 EiB (attempt to allocate chunk of 1152921504606554384 bytes), maximum: 101.47 GiB: While executing ConvertingAggregatedToChunksTransform (version 21.3.2.5 (official build))

The query is quite plain
SELECT 
       FirstScreen,
       "SessionResult" AS "SessionResult",
       count(*) AS count
FROM
  (SELECT FirstScreen,
          SessionResult,
          LastResponse,
          toDate(LastResponseDateTime),
          WasEligible,
          WasSessionSuccessfull,
          COUNT (*)
   FROM MPTUSSDSESSIONS
   GROUP by FirstScreen,
            SessionResult,
            LastResponse,
            toDate(LastResponseDateTime),
            WasEligible,
            WasSessionSuccessfull) AS expr_qry
WHERE  "SessionResult" NOT IN ('unknown result')
  AND "WasSessionSuccessfull" ='Y'
GROUP BY FirstScreen,  "SessionResult"
ORDER BY count DESC
LIMIT 10000;
```

Most interesting - when line  `AND "WasSessionSuccessfull" ='Y' ` is removed from the query it completes ok.
"Filter column {} was removed from ActionsDAG but it is needed in result. DAG:\n{}",
                        filter_column_name, expression->dumpDAG());
    
    const bool filter_is_constant = found_filter_column && (*it)->column && isColumnConst(*(*it)->column);
    if (!found_filter_column || filter_is_constant)
        
        
        parent = std::make_unique<ExpressionStep>(child->getOutputStream(), expression);
    
    
    auto & node = nodes.emplace_back();
    node.children.swap(child_node->children);
    child_node->children.emplace_back(&node);
    
    
    auto split_filter_column_name = (*split_filter->getIndex().rbegin())->result_name;
    node.step = std::make_unique<FilterStep>(
            node.children.at(0)->step->getOutputStream(),
            std::move(split_filter), std::move(split_filter_column_name), true);
    return 3;
}
static Names getAggregatinKeys(const Aggregator::Params & params)
{
    Names keys;
    keys.reserve(params.keys.size());
    for (auto pos : params.keys)
        keys.push_back(params.src_header.getByPosition(pos).name);
    return keys;
}
size_t tryPushDownFilter(QueryPlan::Node * parent_node, QueryPlan::Nodes & nodes)