private static OptionalLong longProperty(Query q, CompoundName name) {
        Long val = q.properties().getLong(name);
        return val != null ? OptionalLong.of(val) : OptionalLong.empty();
    }
Creates a new grouping request and adds it to the query.getSelect().getGrouping() list

@param query the query to attach the request to.
@return The created request.
container-search/src/main/java/com/yahoo/search/grouping/GroupingRequest.java