jackye1995 commented on code in PR #4517:
URL: https://github.com/apache/iceberg/pull/4517#discussion_r858230855


##########
spark/v3.2/spark/src/main/java/org/apache/iceberg/spark/source/SparkMicroBatchStream.java:
##########
@@ -111,7 +112,10 @@ public Offset latestOffset() {
     }
 
     Snapshot latestSnapshot = table.currentSnapshot();
-    return new StreamingOffset(latestSnapshot.snapshotId(), 
Iterables.size(latestSnapshot.addedFiles()), false);
+    return new StreamingOffset(latestSnapshot.snapshotId(),
+        
Long.parseLong(latestSnapshot.summary().getOrDefault(SnapshotSummary.ADDED_FILES_PROP,

Review Comment:
   can use `PropertyUtil.propertyAsLong`. Also this is too long to squeeze in a 
single line call. Can we have 1 line getting the added files, another line to 
call `return new StreamingOffset(latestSnapshot.snapshotId(), addedFilesCount, 
false);`



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to