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 
if (table_sample_physical.has(current_name))
            {
                if (!allow_materialized)
                    throw Exception("Cannot insert column " + current_name + ", because it is MATERIALIZED column.",
                        ErrorCodes::ILLEGAL_COLUMN);
                res.insert(ColumnWithTypeAndName(table_sample_physical.getByName(current_name).type, current_name));
            }
            else 
                throw Exception("No such column " + current_name + " in table " + table->getStorageID().getNameForLogs(),
                    ErrorCodes::NO_SUCH_COLUMN_IN_TABLE);
        }
        else
            res.insert(ColumnWithTypeAndName(table_sample_insertable.getByName(current_name).type, current_name));
    }
    return res;
}
static bool hasAggregateFunctions(const IAST * ast)
{
    if (const auto * func = typeid_cast<const ASTFunction *>(ast))
        if (AggregateUtils::isAggregateFunction(*func))
            return true;
    for (const auto & child : ast->children)
        if (hasAggregateFunctions(child.get()))
            return true;
    return false;
}
/** A query that just reads all data without any complex computations or filetering.
  * If we just pipe the result to INSERT, we don't have to use too many threads for read.
  */
static bool isTrivialSelect(const ASTPtr & select)