class ParseURIFunction extends Scalar<Object, String> {

    private static final String NAME = "parse_uri";

    public static void register(Functions.Builder module) {
        module.add(
            Signature.scalar(
                NAME,
                DataTypes.STRING.getTypeSignature(),
                DataTypes.UNTYPED_OBJECT.getTypeSignature()
            ).withFeature(Scalar.Feature.NULLABLE),
            ParseURIFunction::new
        );
    }

    public ParseURIFunction(Signature signature, BoundSignature boundSignature) {
        super(signature, boundSignature);
    }

    @Override
    @SafeVarargs
    public final Object evaluate(TransactionContext txnCtx, NodeContext nodeCtx, Input<String>... args) {
        String uri = args[0].value();
        if (uri == null) {
            return null;
        }
        return parseURI(uri);
    }

    private final Object parseURI(String uriText) {<FILL_FUNCTION_BODY>}
}

        final Map<String, Object> uriMap = new HashMap<>();

        URI uri = null;

        try {
            uri = new URI(uriText);
        } catch (URISyntaxException e) {
            throw new IllegalArgumentException(String.format(Locale.ENGLISH,
                                                         "unable to parse uri %s",
                                                         uriText));
        }

        uriMap.put("scheme", uri.getScheme());
        uriMap.put("userinfo", uri.getUserInfo());
        uriMap.put("hostname", uri.getHost());
        uriMap.put("port", uri.getPort() == -1 ? null : uri.getPort());
        uriMap.put("path", uri.getPath());
        uriMap.put("query", uri.getQuery());
        uriMap.put("fragment", uri.getFragment());

        return uriMap;
    
<methods>public BoundSignature boundSignature() ,public Scalar<java.lang.Object,java.lang.String> compile(List<io.crate.expression.symbol.Symbol>, java.lang.String, io.crate.role.Roles) ,public transient abstract java.lang.Object evaluate(io.crate.metadata.TransactionContext, io.crate.metadata.NodeContext, Input<java.lang.String>[]) ,public io.crate.expression.symbol.Symbol normalizeSymbol(io.crate.expression.symbol.Function, io.crate.metadata.TransactionContext, io.crate.metadata.NodeContext) ,public io.crate.metadata.functions.Signature signature() <variables>public static final Set<io.crate.metadata.Scalar.Feature> DETERMINISTIC_AND_COMPARISON_REPLACEMENT,public static final Set<io.crate.metadata.Scalar.Feature> DETERMINISTIC_ONLY,public static final Set<io.crate.metadata.Scalar.Feature> NO_FEATURES,protected final non-sealed BoundSignature boundSignature,protected final non-sealed io.crate.metadata.functions.Signature signature