RussellSpitzer commented on code in PR #12672: URL: https://github.com/apache/iceberg/pull/12672#discussion_r2047303162
########## core/src/main/java/org/apache/iceberg/ManifestFileParser.java: ########## @@ -125,41 +113,13 @@ static ManifestFile fromJson(JsonNode jsonNode) { long sequenceNumber = JsonUtil.getLong(SEQUENCE_NUMBER, jsonNode); long minSequenceNumber = JsonUtil.getLong(MIN_SEQUENCE_NUMBER, jsonNode); - - Long addedSnapshotId = null; - if (jsonNode.has(ADDED_SNAPSHOT_ID)) { - addedSnapshotId = JsonUtil.getLong(ADDED_SNAPSHOT_ID, jsonNode); - } - - Integer addedFilesCount = null; - if (jsonNode.has(ADDED_FILES_COUNT)) { - addedFilesCount = JsonUtil.getInt(ADDED_FILES_COUNT, jsonNode); - } - - Integer existingFilesCount = null; - if (jsonNode.has(EXISTING_FILES_COUNT)) { - existingFilesCount = JsonUtil.getInt(EXISTING_FILES_COUNT, jsonNode); - } - - Integer deletedFilesCount = null; - if (jsonNode.has(DELETED_FILES_COUNT)) { - deletedFilesCount = JsonUtil.getInt(DELETED_FILES_COUNT, jsonNode); - } - - Long addedRowsCount = null; - if (jsonNode.has(ADDED_ROWS_COUNT)) { - addedRowsCount = JsonUtil.getLong(ADDED_ROWS_COUNT, jsonNode); - } - - Long existingRowsCount = null; - if (jsonNode.has(EXISTING_ROWS_COUNT)) { - existingRowsCount = JsonUtil.getLong(EXISTING_ROWS_COUNT, jsonNode); - } - - Long deletedRowsCount = null; - if (jsonNode.has(DELETED_ROWS_COUNT)) { - deletedRowsCount = JsonUtil.getLong(DELETED_ROWS_COUNT, jsonNode); - } + Long addedSnapshotId = JsonUtil.getLongOrNull(ADDED_SNAPSHOT_ID, jsonNode); + Integer addedFilesCount = JsonUtil.getIntOrNull(ADDED_FILES_COUNT, jsonNode); + Integer existingFilesCount = JsonUtil.getIntOrNull(EXISTING_FILES_COUNT, jsonNode); + Integer deletedFilesCount = JsonUtil.getIntOrNull(DELETED_FILES_COUNT, jsonNode); + Long addedRowsCount = JsonUtil.getLongOrNull(ADDED_ROWS_COUNT, jsonNode); + Long existingRowsCount = JsonUtil.getLongOrNull(EXISTING_ROWS_COUNT, jsonNode); + Long deletedRowsCount = JsonUtil.getLongOrNull(DELETED_ROWS_COUNT, jsonNode); Review Comment: I think it's a good set of changes, probably could live in another refactor PR but I don't have a problem including it now -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org