public static TypeInformation<?> getType(TypeInfo typeInfo) {
        if (typeInfo instanceof StringTypeInfo) {
            return Types.STRING;
        } else if (typeInfo instanceof BooleanTypeInfo) {
            return Types.BOOLEAN;
        } else if (typeInfo instanceof ByteTypeInfo) {
            return Types.BYTE;
        } else if (typeInfo instanceof ShortTypeInfo) {
            return Types.SHORT;
        } else if (typeInfo instanceof IntTypeInfo) {
            return Types.INT;
        } else if (typeInfo instanceof LongTypeInfo) {
            return Types.LONG;
        } else if (typeInfo instanceof FloatTypeInfo) {
            return Types.FLOAT;
        } else if (typeInfo instanceof DoubleTypeInfo) {
            return Types.DOUBLE;
        } else if (typeInfo instanceof DecimalTypeInfo) {
            return Types.BIG_DEC;
        } else if (typeInfo instanceof DateTypeInfo) {
            return Types.SQL_DATE;
        } else if (typeInfo instanceof TimeTypeInfo) {
            return Types.SQL_TIME;
        } else if (typeInfo instanceof TimestampTypeInfo) {
            return Types.SQL_TIMESTAMP;
        } else if (typeInfo instanceof LocalZonedTimestampTypeInfo) {
            return Types.LOCAL_DATE_TIME;
        } else if (typeInfo instanceof BinaryTypeInfo) {
            return Types.PRIMITIVE_ARRAY(Types.BYTE);
        } else if (typeInfo instanceof ArrayTypeInfo) {
            ArrayTypeInfo arrayTypeInfo = (ArrayTypeInfo) typeInfo;
            TypeInfo elementTypeInfo =
                    arrayTypeInfo.getElementTypeInfo();
            TypeInformation<?> elementType = getType(elementTypeInfo);

            return Types.OBJECT_ARRAY(elementType);
        } else if (typeInfo instanceof MapTypeInfo) {
            MapTypeInfo mapTypeInfo = (MapTypeInfo) typeInfo;
            TypeInfo keyTypeInfo = mapTypeInfo.getKeyTypeInfo();
            TypeInfo valueTypeInfo = mapTypeInfo.getValueTypeInfo();

            TypeInformation<?> keyType = getType(keyTypeInfo);
            TypeInformation<?> valueType = getType(valueTypeInfo);

            return Types.MAP(keyType, valueType);
        } else if (typeInfo instanceof RowTypeInfo) {
            RowTypeInfo rowTypeInfo = (RowTypeInfo) typeInfo;
            String[] fieldNames = rowTypeInfo.getFieldNames();
            TypeInfo[] fieldTypeInfos = rowTypeInfo.getFieldTypeInfos();

            TypeInformation<?>[] fieldTypes =
                    Arrays.stream(fieldTypeInfos)
                            .map(TableFormatUtils::getType)
                            .toArray(TypeInformation<?>[]::new);

            return Types.ROW_NAMED(fieldNames, fieldTypes);
        } else {
            throw new IllegalStateException("Unexpected type info " + typeInfo + ".");
        }
    }
Returns the type represented by the given format.

@param typeInfo The type information.
@return The type represented by the given format.
inlong-sort/sort-formats/format-common/src/main/java/org/apache/inlong/sort/formats/base/TableFormatUtils.java