@Override
    public Object parse(SourceData sourceData, int rowIndex, Context context) {
        Object stringObj = stringParser.parse(sourceData, rowIndex, context);
        if (stringObj == null) {
            return null;
        }
        String str = OperatorTools.parseString(stringObj);
        int len = str.length();
        for (int i = len - 1; i >= 0; i--) {
            if (str.charAt(i) != ' ') {
                return str.substring(0, i + 1);
            }
        }
        return "";
    }
RtrimFunction  ->  rtrim(str)
description:
- Return NULL if 'str' is NULL
- Return the string 'str' with trailing space characters removed
inlong-sdk/transform-sdk/src/main/java/org/apache/inlong/sdk/transform/process/function/string/RtrimFunction.java