private ResultNodeVector toBucketList(PredefinedFunction fnc) {
        ResultNodeVector ret = null;
        for (int i = 0, len = fnc.getNumBuckets(); i < len; ++i) {
            BucketResultNode bucket = toBucket(fnc.getBucket(i));
            if (ret == null) {
                if (bucket instanceof FloatBucketResultNode) {
                    ret = new FloatBucketResultNodeVector();
                } else if (bucket instanceof IntegerBucketResultNode) {
                    ret = new IntegerBucketResultNodeVector();
                } else if (bucket instanceof RawBucketResultNode) {
                    ret = new RawBucketResultNodeVector();
                } else {
                    ret = new StringBucketResultNodeVector();
                }
            }
            ret.add(bucket);
        }
        return ret;
    }
Converts the given ast type grouping expression to a corresponding back-end type expression.

@param exp The expression to convert.
@return The corresponding back-end expression.
@throws IllegalInputException Thrown if the given expression could not be converted.
container-search/src/main/java/com/yahoo/search/grouping/vespa/ExpressionConverter.java