https://s3.amazonaws.com/clickhouse-test-reports/42033/ebdfbf43db5e5eacaff81b4a3dd55c5a285ee025/fuzzer_astfuzzerasan//report.html
How to reproduce:
```
:) create table data_02295 (b Int64, a Int64, grp_aggreg AggregateFunction(groupArrayArray, Array(UInt64))) engine = MergeTree() order by a;
:) set allow_experimental_analyzer=1;
:) SELECT grp_aggreg FROM data_02295 WHERE JSONLength(grp_aggreg, 100, NULL) SETTINGS optimize_aggregation_in_order = 1;
```

CC: @kitaisreal 
pipeline.setSinks([&](const Block & cur_header, QueryPipelineBuilder::StreamType) -> ProcessorPtr
        {
            return std::make_shared<EmptySink>(cur_header);
        });
        if (!allow_materialized)
        {
            for (const auto & column : metadata_snapshot->getColumns())
                if (column.default_desc.kind == ColumnDefaultKind::Materialized && header.has(column.name))
                    throw Exception("Cannot insert column " + column.name + ", because it is MATERIALIZED column.", ErrorCodes::ILLEGAL_COLUMN);
        }
        res.pipeline = QueryPipelineBuilder::getPipeline(std::move(pipeline));
    }
    else
    {
        res.pipeline = QueryPipeline(std::move(out_chains.at(0)));
        res.pipeline.setNumThreads(std::min<size_t>(res.pipeline.getNumThreads(), settings.max_threads));
        if (query.hasInlinedData() && !async_insert)
        {
            
            auto pipe = getSourceFromASTInsertQuery(query_ptr, true, query_sample_block, getContext(), nullptr);
            res.pipeline.complete(std::move(pipe));
        }
    }
    res.pipeline.addResources(std::move(resources));
    res.pipeline.addStorageHolder(table);
    if (inner_table)
        res.pipeline.addStorageHolder(inner_table);
    return res;
}
StorageID InterpreterInsertQuery::getDatabaseTable() const