CTTY commented on code in PR #3564:
URL: https://github.com/apache/iceberg-rust/pull/3564#discussion_r4765827922


##########
crates/iceberg/src/transaction/snapshot/mod.rs:
##########
@@ -173,6 +180,61 @@ pub(crate) async fn current_manifests(table: &Table) -> 
Result<Vec<ManifestFile>
         .collect())
 }
 
+/// The manifests a producer wrote for one execution's added files.
+///
+/// Reusable while the table's format version is unchanged. Per spec, sequence
+/// number inheritance does not apply to v1 manifests, so one written before a
+/// concurrent upgrade cannot carry the v2 sequence number a retry assigns and
+/// must be rewritten. The schema is not a guard: the manifest's embedded 
schema
+/// describes the files it was written for, which do not change. Nor is the
+/// default partition spec: the files name their own spec, which stays valid.
+pub(crate) struct AddedManifests {
+    /// One per content type today. Several once added files are grouped by
+    /// partition spec (#3500) or rolled over at a target size (#3499).
+    pub manifests: Vec<ManifestFile>,

Review Comment:
   Makes sense, will fix this



##########
crates/iceberg/src/transaction/snapshot/manifest_filter.rs:
##########
@@ -0,0 +1,316 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+//! Rewrites existing manifests to mark files as deleted.
+
+use std::collections::{HashMap, HashSet};
+
+use uuid::Uuid;
+
+use super::{manifest_path, new_manifest_writer};
+use crate::error::{Result, invalid_data};
+use crate::io::object_cache::ManifestKey;
+use crate::spec::{DataFile, DataFileFormat, FormatVersion, 
ManifestContentType, ManifestFile};
+use crate::table::Table;
+
+/// Identifies one entry to mark as `Deleted`, a data file or a delete file.
+///
+/// A path alone is not enough: a Puffin file may hold several deletion
+/// vectors, each its own entry at a distinct blob offset. Data files and
+/// non-DV delete files have no offset, so for them this is the path.
+#[derive(Clone, Debug, PartialEq, Eq, Hash)]
+struct RemovedFileIdentity {

Review Comment:
   Good idea, will update



##########
crates/iceberg/src/transaction/snapshot/merging.rs:
##########
@@ -0,0 +1,1329 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+//! Persistent producer for snapshot actions that add and remove data and
+//! delete files.
+
+use std::collections::{HashMap, HashSet};
+
+use uuid::Uuid;
+
+use super::manifest_filter::ManifestFilterManager;
+use super::{
+    AddedManifests, SnapshotCommitInput, current_manifests, 
generate_snapshot_id,
+    manifest_list_path, manifest_path, validate_partition_value, 
write_added_manifest,
+    write_snapshot_commit,
+};
+use crate::error::{Result, invalid_data};
+use crate::spec::{
+    DataContentType, DataFile, DataFileFormat, FormatVersion, 
ManifestContentType, ManifestFile,
+    Operation,
+};
+use crate::table::Table;
+use crate::transaction::ActionCommit;
+
+/// What a merging action asks the producer to do.
+///
+/// Fixed for one logical execution; the producer derives everything else from
+/// it and the table of the current attempt. The action validates the
+/// table-independent parts, such as content types, before each attempt. A path
+/// may be both removed and added: the producer marks the old entry `Deleted`
+/// and writes a new `Added` one, so whether to allow it is the action's call.
+pub(crate) struct MergingIntent {

Review Comment:
   Will fix this



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