Xuanwo commented on code in PR #1682:
URL: https://github.com/apache/iceberg-rust/pull/1682#discussion_r2470234503


##########
crates/iceberg/src/transaction/snapshot.rs:
##########
@@ -420,8 +434,16 @@ impl<'a> SnapshotProducer<'a> {
             .with_sequence_number(next_seq_num)
             .with_summary(summary)
             .with_schema_id(self.table.metadata().current_schema_id())
-            .with_timestamp_ms(commit_ts)
-            .build();
+            .with_timestamp_ms(commit_ts);
+
+        let new_snapshot = if let Some(writer_next_row_id) = 
writer_next_row_id {
+            let assigned_rows = writer_next_row_id - 
self.table.metadata().next_row_id();
+            new_snapshot
+                .with_row_range(first_row_id, assigned_rows)
+                .build()
+        } else {
+            new_snapshot.build()
+        };

Review Comment:
   Hi, this seems wrong if we have a table upgraded from v2 to v3. 
`writer_next_row_id` includes all existing rows; maybe we should find another 
way to calculate the correct assigned_rows?



-- 
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