public static FormatInfo convertFieldFormat(String type, String format) {
        FormatInfo formatInfo;
        FieldType fieldType = FieldType.forName(StringUtils.substringBefore(type, LEFT_BRACKET));
        switch (fieldType) {
            case BOOLEAN:
                formatInfo = new BooleanFormatInfo();
                break;
            case INT8:
            case TINYINT:
            case BYTE:
                formatInfo = new ByteFormatInfo();
                break;
            case INT16:
            case SMALLINT:
            case SHORT:
                formatInfo = new ShortFormatInfo();
                break;
            case INT32:
            case INT:
            case INTEGER:
                formatInfo = new IntFormatInfo();
                break;
            case INT64:
            case BIGINT:
            case LONG:
                formatInfo = new LongFormatInfo();
                break;
            case FLOAT32:
            case FLOAT:
                formatInfo = new FloatFormatInfo();
                break;
            case FLOAT64:
            case DOUBLE:
                formatInfo = new DoubleFormatInfo();
                break;
            case DECIMAL:
                if (StringUtils.isNotBlank(format)) {
                    DecimalFormat decimalFormat = FieldFormatUtils.parseDecimalFormat(format);
                    formatInfo = new DecimalFormatInfo(decimalFormat.getPrecision(), decimalFormat.getScale());
                } else {
                    formatInfo = new DecimalFormatInfo();
                }
                break;
            case DATE:
                if (StringUtils.isNotBlank(format)) {
                    formatInfo = new DateFormatInfo(convertTimestampOrDataFormat(format));
                } else {
                    formatInfo = new DateFormatInfo();
                }
                break;
            case TIME:
                if (StringUtils.isNotBlank(format)) {
                    formatInfo = new TimeFormatInfo(convertTimestampOrDataFormat(format));
                } else {
                    formatInfo = new TimeFormatInfo();
                }
                break;
            case TIMESTAMP:
            case DATETIME:
                if (StringUtils.isNotBlank(format)) {
                    formatInfo = new TimestampFormatInfo(convertTimestampOrDataFormat(format));
                } else {
                    formatInfo = new TimestampFormatInfo();
                }
                break;
            case TIMESTAMPTZ:
            case LOCAL_ZONE_TIMESTAMP:
                if (StringUtils.isNotBlank(format)) {
                    formatInfo = new LocalZonedTimestampFormatInfo(convertTimestampOrDataFormat(format), 2);
                } else {
                    formatInfo = new LocalZonedTimestampFormatInfo();
                }
                break;
            case BINARY:
            case FIXED:
                if (StringUtils.isNotBlank(format)) {
                    BinaryFormat binaryFormat = FieldFormatUtils.parseBinaryFormat(format);
                    formatInfo = new BinaryFormatInfo(binaryFormat.getLength());
                } else {
                    formatInfo = new BinaryFormatInfo();
                }
                break;
            case VARBINARY:
                if (StringUtils.isNotBlank(format)) {
                    VarBinaryFormat varBinaryFormat = FieldFormatUtils.parseVarBinaryFormat(format);
                    formatInfo = new VarBinaryFormatInfo(varBinaryFormat.getLength());
                } else {
                    formatInfo = new VarBinaryFormatInfo();
                }
                break;
            case ARRAY:
                formatInfo = createArrayFormatInfo(format);
                break;
            case MAP:
                formatInfo = createMapFormatInfo(format);
                break;
            case STRUCT:
                formatInfo = createRowFormatInfo(format);
                break;
            case VARCHAR:
            case TEXT:
            default: // default is string
                formatInfo = new StringFormatInfo();
        }
        return formatInfo;
    }
Get the FieldFormat of Sort according to type string

@param type type string
@return Sort field format instance
inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/sort/util/FieldInfoUtils.java