```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)
```
++i;
                    continue;
                }
            }
            else
            {
                FunctionOverloadResolverPtr function_builder = UserDefinedExecutableFunctionFactory::instance().tryGet(function->name, context);
                if (!function_builder)
                    function_builder = function_factory.get(function->name, context);
                if (!function_builder->isInjective({}))
                {
                    ++i;
                    continue;
                }
            }
            
            auto args_ast = function->arguments;
            /** remove function call and take a step back to ensure
              * next iteration does not skip not yet processed data
              */
            remove_expr_at_index(i);
            
            std::remove_copy_if(
                    std::begin(args_ast->children), std::end(args_ast->children),
                    std::back_inserter(group_exprs), is_literal
            );
        }
        else if (is_literal(group_exprs[i]))
        {
            bool keep_position = false;