sdd commented on code in PR #373: URL: https://github.com/apache/iceberg-rust/pull/373#discussion_r1697764804
########## crates/iceberg/src/spec/manifest_list.rs: ########## @@ -79,6 +79,11 @@ impl ManifestList { pub fn entries(&self) -> &[ManifestFile] { &self.entries } + + /// Take ownership of the entries in the manifest list, consuming it + pub fn consume_entries(self) -> Box<dyn Iterator<Item = ManifestFile>> { Review Comment: Done, thanks! ########## crates/iceberg/src/scan.rs: ########## @@ -338,157 +303,463 @@ impl TableScan { arrow_reader_builder.build().read(self.plan_files().await?) } - /// Checks whether the [`ManifestContentType`] is `Data` or not. - fn content_type_is_data(entry: &ManifestFile) -> bool { - if let ManifestContentType::Data = entry.content { - return true; - } - false - } - /// Returns a reference to the column names of the table scan. pub fn column_names(&self) -> &[String] { &self.column_names } + /// Returns a reference to the snapshot of the table scan. + pub fn snapshot(&self) -> &SnapshotRef { + &self.plan_context.snapshot + } + + async fn process_manifest_entry( + manifest_entry_context: ManifestEntryContext, + mut file_scan_task_tx: Sender<Result<FileScanTask>>, + ) -> Result<()> { + // skip processing this manifest entry if it has been marked as deleted + if !manifest_entry_context.manifest_entry.is_alive() { + return Ok(()); + } + + // abort the plan if we encounter a manifest entry whose data file's + // content type is currently unsupported + if manifest_entry_context.manifest_entry.content_type() != DataContentType::Data { + return Err(Error::new( + ErrorKind::FeatureUnsupported, + "Only Data files currently supported", + )); + } + + if let Some(ref snapshot_bound_predicate) = manifest_entry_context.snapshot_bound_predicate + { + let Some(ref partition_bound_predicate) = + manifest_entry_context.partition_bound_predicate + else { + panic!("partition_bound_predicate expected to always be present if snapshot_bound_predicate is present"); Review Comment: Good suggestion - done! -- 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