```sql
DROP TABLE IF EXISTS tp;

create table tp (d1 Int32, d2 Int32, eventcnt Int64,
projection p (select sum(eventcnt), d1 group by d1)) 
engine = SummingMergeTree order by (d1, d2);

set allow_experimental_projection_optimization = 1, force_optimize_projection = 1;

select sum(eventcnt) eventcnt, d1
from tp
group by d1;

DB::Exception: No projection is used when allow_experimental_projection_optimization = 1.

```

The exception message is also incorrect, should be "when force_optimize_projection = 1".

if (settings.do_not_merge_across_partitions_select_final &&
            std::distance(parts_to_merge_ranges[range_index], parts_to_merge_ranges[range_index + 1]) == 1 &&
            parts_to_merge_ranges[range_index]->data_part->info.level > 0)
        {
            partition_plans.emplace_back(std::move(plan));
            continue;
        }
        Names sort_columns = metadata_snapshot->getSortingKeyColumns();
        SortDescription sort_description;
        size_t sort_columns_size = sort_columns.size();
        sort_description.reserve(sort_columns_size);
        Names partition_key_columns = metadata_snapshot->getPartitionKey().column_names;
        const auto & header = plan->getCurrentDataStream().header;
        for (size_t i = 0; i < sort_columns_size; ++i)
            sort_description.emplace_back(header.getPositionByName(sort_columns[i]), 1, 1);
        auto final_step = std::make_unique<MergingFinal>(
            plan->getCurrentDataStream(),
            std::min<size_t>(num_streams, settings.max_final_threads),
            sort_description,
            data.merging_params,
            partition_key_columns,
            max_block_size);
        final_step->setStepDescription("Merge rows for FINAL");
        plan->addStep(std::move(final_step));
        partition_plans.emplace_back(std::move(plan));
    }
    if (!lonely_parts.empty())
    {