```sql

create table A ( A date) Engine=MergeTree order by A TTL A+interval 1 year;

alter table A reset SETTING TTL;

show create table A;

CREATE TABLE default.A
(
    `A` Date
)
ENGINE = MergeTree
ORDER BY A
TTL A + toIntervalYear(1)
SETTINGS index_granularity = 8192
```
}
std::optional<ProjectionCandidate> MergeTreeData::getQueryProcessingStageWithAggregateProjection(
    ContextPtr query_context, const StorageSnapshotPtr & storage_snapshot, SelectQueryInfo & query_info) const
{
    const auto & metadata_snapshot = storage_snapshot->metadata;
    const auto & settings = query_context->getSettingsRef();
    if (!settings.allow_experimental_projection_optimization || query_info.ignore_projections || query_info.is_projection_query)
        return std::nullopt;
    /
    if (settings.parallel_replicas_count > 1 || settings.max_parallel_replicas > 1)
        return std::nullopt;
    auto query_ptr = query_info.original_query;
    auto * select_query = query_ptr->as<ASTSelectQuery>();
    if (!select_query)
        return std::nullopt;
    /
    if (select_query->final())
        return std::nullopt;
    /
    if (select_query->sampleSize())
        return std::nullopt;
    /
    if (settings.allow_experimental_query_deduplication)
        return std::nullopt;
    /
    if (select_query->arrayJoinExpressionList().first)
        return std::nullopt;
    /
    /
    /