CTTY commented on code in PR #3474: URL: https://github.com/apache/iceberg-rust/pull/3474#discussion_r4331521599
########## crates/iceberg/src/transaction/simple_snapshot_producer.rs: ########## @@ -0,0 +1,509 @@ +// 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 append-shaped snapshot actions. + +use std::collections::{HashMap, HashSet}; + +use futures::TryStreamExt; +use futures::stream::FuturesUnordered; +use uuid::Uuid; + +use crate::error::{Result, invalid_data}; +use crate::spec::{ + DataContentType, DataFile, FormatVersion, ManifestContentType, ManifestEntry, ManifestFile, + ManifestStatus, Operation, +}; +use crate::table::Table; +use crate::transaction::ActionCommit; +use crate::transaction::snapshot_helpers::{ + SnapshotCommitInput, current_manifests, generate_snapshot_id, manifest_list_path, + manifest_path, new_manifest_writer, validate_partition_value, write_snapshot_commit, +}; +use crate::{Error, ErrorKind}; + +/// Retry-persistent state for an action that appends data files in a single +/// new manifest. Review Comment: the rolling mechanism can be added later, and I'm more concerned about the spec id grouping. Looks like we just assume all new data files belong to the same partition spec (current default spec): https://github.com/apache/iceberg-rust/blob/219571a4185df2bc6e144dbbcb72cf016714b61b/crates/iceberg/src/transaction/snapshot.rs#L339 I think we can fix it, rather than just blocking them in the validation: https://github.com/apache/iceberg-rust/blame/main/crates/iceberg/src/transaction/snapshot.rs#L155-L164 -- 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]
