```sql
SELECT toStartOfHour(time) AS timex, id, count()
FROM
(
    SELECT
        concat('id', toString(number % 3)) AS id,
        toDateTime('2020-01-01') + (number * 60) AS time
    FROM numbers(100)
)
GROUP BY
    GROUPING SETS ( (timex, id), (timex))
ORDER BY timex ASC;

Received exception from server (version 22.5.1):
Code: 215. DB::Exception: Received from localhost:9000. 
DB::Exception: Column `time` is not under aggregate function and not in GROUP BY: 
While processing time ASC. (NOT_AN_AGGREGATE)
```
if (settings.enable_positional_arguments)
            {
                const auto & value = group_exprs[i]->as<ASTLiteral>()->value;
                if (value.getType() == Field::Types::UInt64)
                {
                    auto pos = value.get<UInt64>();
                    if (pos > 0 && pos <= select_query->select()->children.size())
                        keep_position = true;
                }
            }
            if (keep_position)
                ++i;
            else
                remove_expr_at_index(i);
        }
        else
        {
            
            ++i;
        }
    }
    if (group_exprs.empty())
        appendUnusedGroupByColumn(select_query);
}
struct GroupByKeysInfo
{
    NameSet key_names; 
    bool has_function = false;
};
GroupByKeysInfo getGroupByKeysInfo(const ASTs & group_by_keys)