private static ArrayElementConverter createArrayElementConverter(LogicalType fieldType) {
        switch (fieldType.getTypeRoot()) {
            case NULL:
                return (array, pos) -> null;
            case BOOLEAN:
                return ArrayData::getBoolean;
            case TINYINT:
                return ArrayData::getByte;
            case SMALLINT:
                return ArrayData::getShort;
            case INTEGER:
            case INTERVAL_YEAR_MONTH:
                return ArrayData::getInt;
            case BIGINT:
            case INTERVAL_DAY_TIME:
                return ArrayData::getLong;
            case FLOAT:
                return ArrayData::getFloat;
            case DOUBLE:
                return ArrayData::getDouble;
            case CHAR:
            case VARCHAR:
                return (array, pos) -> array.getString(pos).toString();
            case BINARY:
            case VARBINARY:
                return ArrayData::getBinary;
            case DATE:
                return (array, pos) -> convertDate(array.getLong(pos));
            case TIME_WITHOUT_TIME_ZONE:
                return (array, pos) -> convertTime(array.getInt(pos));
            case TIMESTAMP_WITHOUT_TIME_ZONE:
                final int timestampPrecision = ((TimestampType) fieldType).getPrecision();
                return (array, pos) -> convertTimestamp(
                        array.getTimestamp(pos, timestampPrecision));
            case TIMESTAMP_WITH_LOCAL_TIME_ZONE:
                final int localZonedTimestampPrecision =
                        ((LocalZonedTimestampType) fieldType).getPrecision();
                return (array, pos) -> convertTimestamp(
                        array.getTimestamp(pos, localZonedTimestampPrecision));
            case DECIMAL:
                return createDecimalArrayElementConverter((DecimalType) fieldType);
            // we don't support ARRAY and ROW in an ARRAY, see
            // CsvRowSchemaConverter#validateNestedField
            case ARRAY:
            case ROW:
            case MAP:
            case MULTISET:
            case RAW:
            default:
                throw new UnsupportedOperationException("Unsupported type: " + fieldType);
        }
    }
Runtime converter that converts objects of Flink Table & SQL internal data structures to
corresponding {@link Object}s.
inlong-sort/sort-formats/format-rowdata/format-rowdata-base/src/main/java/org/apache/inlong/sort/formats/base/RowDataToFieldConverters.java