```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".

plan->getCurrentDataStream(),
                    sorting_key_prefix_expr);
            expression_step->setStepDescription("Calculate sorting key prefix");
            plan->addStep(std::move(expression_step));
            auto merging_sorted = std::make_unique<MergingSortedStep>(
                    plan->getCurrentDataStream(),
                    sort_description,
                    max_block_size);
            merging_sorted->setStepDescription("Merge sorting mark ranges");
            plan->addStep(std::move(merging_sorted));
        }
    }
    if (plans.size() == 1)
        return std::move(plans.front());
    DataStreams input_streams;
    for (const auto & plan : plans)
        input_streams.emplace_back(plan->getCurrentDataStream());
    auto union_step = std::make_unique<UnionStep>(std::move(input_streams));
    auto plan = std::make_unique<QueryPlan>();
    plan->unitePlans(std::move(union_step), std::move(plans));
    return plan;
}
QueryPlanPtr MergeTreeDataSelectExecutor::spreadMarkRangesAmongStreamsFinal(
    RangesInDataParts && parts,
    ReadFromMergeTree::IndexStatPtr index_stats,
    size_t num_streams,
    const Names & column_names,
    const StorageMetadataPtr & metadata_snapshot,
    UInt64 max_block_size,
    bool use_uncompressed_cache,