anoopj commented on code in PR #2952:
URL: https://github.com/apache/iceberg-rust/pull/2952#discussion_r3713670191
##########
crates/iceberg/src/scan/mod.rs:
##########
@@ -1862,6 +1940,60 @@ pub mod tests {
);
}
+ #[tokio::test]
+ async fn test_plan_files_carries_row_lineage_into_file_scan_task() {
+ let mut fixture = TableTestFixture::new();
+ fixture.setup_manifest_files().await;
+
+ let mut tasks: Vec<_> = fixture
+ .table
+ .scan()
+ .build()
+ .unwrap()
+ .plan_files()
+ .await
+ .unwrap()
+ .try_collect()
+ .await
+ .unwrap();
+
+ tasks.sort_by_key(|task| task.data_file_path.to_string());
+ assert_eq!(tasks.len(), 2);
+
+ // The added file inherits the current snapshot's data sequence number,
+ // the existing file keeps the one it was written with.
+ assert_eq!(tasks[0].data_sequence_number, Some(1));
+ assert_eq!(tasks[1].data_sequence_number, Some(0));
+
+ // first_row_id is a v3 concept; a v2 manifest carries none.
+ assert!(tasks.iter().all(|task| task.first_row_id.is_none()));
+ }
+
+ #[tokio::test]
+ async fn test_plan_files_carries_inherited_first_row_id() {
+ let mut fixture = TableTestFixture::new();
+ fixture.setup_v3_manifest_files().await;
+
+ let task = fixture
+ .table
+ .scan()
+ .build()
+ .unwrap()
+ .plan_files()
+ .await
+ .unwrap()
+ .try_collect::<Vec<_>>()
+ .await
+ .unwrap()
+ .into_iter()
+ .next()
+ .expect("expected one FileScanTask");
+
+ // The manifest-level first_row_id (0) is inherited onto the entry on
+ // read, then carried onto the task.
+ assert_eq!(task.first_row_id, Some(0));
Review Comment:
Added an asertion. Renamed the test to
`test_plan_files_carries_row_lineage_from_v3_manifest`
--
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]