private RowDataToFieldConverter createTimestampConverter() {
        switch (timestampFormat) {
            case ISO_8601:
                return inputObj -> {
                    TimestampData timestamp = (TimestampData) inputObj;
                    return ISO8601_TIMESTAMP_FORMAT.format(timestamp.toLocalDateTime());
                };
            case SQL:
                return inputObj -> {
                    TimestampData timestamp = (TimestampData) inputObj;
                    return SQL_TIMESTAMP_FORMAT.format(timestamp.toLocalDateTime());
                };
            default:
                throw new TableException("Unsupported timestamp format. Validator should have checked that.");
        }
    }
Creates a runtime converter which assuming input object is not null.
inlong-sort/sort-formats/format-rowdata/format-rowdata-json/src/main/java/org/apache/inlong/sort/formats/json/RowDataToFieldConverters.java