private static FieldToRowDataConverter createFieldRowConverter(LogicalType fieldType) {
        switch (fieldType.getTypeRoot()) {
            case NULL:
                return (obj) -> null;
            case BOOLEAN:
                return obj -> Boolean.parseBoolean(obj.toString());
            case TINYINT:
                return obj -> Byte.parseByte(obj.toString());
            case SMALLINT:
                return obj -> Short.parseShort(obj.toString());
            case INTERVAL_YEAR_MONTH:
            case INTEGER:
                return obj -> Integer.parseInt(obj.toString());
            case INTERVAL_DAY_TIME:
            case BIGINT:
                return obj -> Long.parseLong(obj.toString());
            case FLOAT:
                return obj -> Float.parseFloat(obj.toString());
            case DOUBLE:
                return obj -> Double.parseDouble(obj.toString());
            case BINARY:
            case VARBINARY:
                return obj -> obj.toString().getBytes();
            case CHAR:
            case VARCHAR:
                return (obj -> StringData.fromString((String) obj));
            case DATE:
                return (obj -> ((Date) obj).toLocalDate().toEpochDay());
            case TIME_WITHOUT_TIME_ZONE:
                return (obj -> ((Time) obj).toLocalTime().toSecondOfDay() * 1000);
            case TIMESTAMP_WITH_LOCAL_TIME_ZONE:
            case TIMESTAMP_WITHOUT_TIME_ZONE:
            case TIMESTAMP_WITH_TIME_ZONE:
                return obj -> TimestampData.fromTimestamp((Timestamp) obj);
            case DECIMAL:
                return obj -> DecimalData.fromBigDecimal(
                        (BigDecimal) obj,
                        DecimalType.DEFAULT_PRECISION,
                        DecimalType.DEFAULT_SCALE);
            case ARRAY:
                return obj -> {
                    final Object[] array = (Object[]) obj;
                    FieldToRowDataConverter elementConverter =
                            createFieldRowConverter(((ArrayType) fieldType).getElementType());
                    Object[] converted = Arrays.stream(array)
                            .map(elementConverter::convert)
                            .toArray();
                    return new GenericArrayData(converted);
                };
            case MAP:
                return obj -> {
                    FieldToRowDataConverter keyConverter =
                            createFieldRowConverter(((MapType) fieldType).getKeyType());
                    FieldToRowDataConverter valueConverter =
                            createFieldRowConverter(((MapType) fieldType).getValueType());
                    Map map = (Map) obj;
                    Map<Object, Object> internalMap = new HashMap<>();
                    for (Object k : map.keySet()) {
                        internalMap.put(keyConverter.convert(k),
                                valueConverter.convert(map.get(k)));
                    }
                    return new GenericMapData(internalMap);
                };
            case ROW:
            case MULTISET:
            case RAW:
            default:
                throw new UnsupportedOperationException("Unsupported type:" + fieldType);
        }
    }
Base class of Field To RowData Converters.
inlong-sort/sort-formats/format-rowdata/format-rowdata-base/src/main/java/org/apache/inlong/sort/formats/base/FieldToRowDataConverters.java