private static List<String> replaceLastField(
            List<String> fields,
            int maxFieldSize,
            String text,
            int lastFieldStartIndex,
            int lastFieldEndIndex) {
        List<String> newField = fields.subList(0, maxFieldSize - 1);
        String last = text.substring(lastFieldStartIndex, lastFieldEndIndex);
        newField.add(last);
        return newField;
    }
if the max field size < the real field size,
remove the extra fields and copy the latest field from lastFieldStartIndex to lastFieldEndIndex

@param fields Target field list
@param maxFieldSize Specified max fieldSize
@param text Origin text
@param lastFieldStartIndex Start index of last field
@param lastFieldEndIndex End index of last field
inlong-sort/sort-formats/format-common/src/main/java/org/apache/inlong/sort/formats/util/StringUtils.java