kasakrisz commented on code in PR #5136: URL: https://github.com/apache/hive/pull/5136#discussion_r1541084031
########## iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java: ########## @@ -1611,7 +1612,68 @@ public SnapshotContext getCurrentSnapshotContext(org.apache.hadoop.hive.ql.metad if (current == null) { return null; } - return new SnapshotContext(current.snapshotId()); + return toSnapshotContext(current); + } + + private SnapshotContext toSnapshotContext(Snapshot snapshot) { + Map<String, String> summaryMap = snapshot.summary(); + long addedRecords = getLongSummary(summaryMap, SnapshotSummary.ADDED_RECORDS_PROP); + long deletedRecords = getLongSummary(summaryMap, SnapshotSummary.DELETED_RECORDS_PROP); + return new SnapshotContext( + snapshot.snapshotId(), toWriteOperationType(snapshot.operation()), addedRecords, deletedRecords); + } + + private SnapshotContext.WriteOperationType toWriteOperationType(String operation) { + if (DataOperations.APPEND.equals(operation)) { Review Comment: changed -- 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: gitbox-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For additional commands, e-mail: gitbox-h...@hive.apache.org