anoopj commented on code in PR #3230: URL: https://github.com/apache/iceberg-rust/pull/3230#discussion_r4031307909
########## crates/iceberg/src/writer/base_writer/position_delete_input.rs: ########## @@ -0,0 +1,378 @@ +// 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. + +//! This module provides [`PositionDeleteInputBuilder`], a small helper that assembles a +//! spec-conforming position delete [`RecordBatch`] from `(path, pos)` rows. +//! +//! A [`PositionDeleteFileWriter`](super::position_delete_writer::PositionDeleteFileWriter) +//! accepts batches shaped as exactly the two required position delete columns: `file_path` +//! (`Utf8`, field id [`crate::metadata_columns::RESERVED_FIELD_ID_DELETE_FILE_PATH`]) and +//! `pos` (`Int64`, field id [`crate::metadata_columns::RESERVED_FIELD_ID_DELETE_FILE_POS`]), +//! both required. Hand-wiring that Arrow schema is error-prone, so this builder reuses the +//! writer's own Arrow projection of +//! [`position_delete_schema`](super::position_delete_writer::position_delete_schema), keeping +//! a single source of truth, and produces a batch the writer's validation accepts. +//! +//! The builder does not sort or deduplicate rows; position delete files must be sorted by +//! `file_path` then `pos`, so callers are responsible for pushing rows in that order for +//! direct-to-writer use (see +//! [`PositionDeleteFileWriter::write`](crate::writer::IcebergWriter::write), which +//! [`PositionDeleteFileWriter`](super::position_delete_writer::PositionDeleteFileWriter) +//! implements). +//! A future sorting writer will consume unsorted input and lift this requirement. Review Comment: These comments usually go stale. The preceding sentence already captures the contract -- 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]
