alexandre-normand commented on code in PR #721: URL: https://github.com/apache/iceberg-go/pull/721#discussion_r2835811686
########## table/pos_delete_partitioned_fanout_writer.go: ########## @@ -0,0 +1,116 @@ +// 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. + +package table + +import ( + "context" + "iter" + "path" + + "github.com/apache/arrow-go/v18/arrow" + "github.com/apache/arrow-go/v18/arrow/array" + "github.com/apache/iceberg-go" + "golang.org/x/sync/errgroup" +) + +// positionDeletePartitionedFanoutWriter distributes Arrow position delete records across multiple partitions based on +// a partition specification, writing data to separate delete files for each partition using +// a fanout pattern with configurable parallelism. +type positionDeletePartitionedFanoutWriter struct { Review Comment: I did most of this in df4cef7e2cc850bf000b7bc8b14f9dcdc9ba3684: * Extracted the processing of one record batch in processBatch so that defer record.Release() could be scoped to the processing of a single batch. * Note that this is a common pattern in many places and I did not expand the scope beyond the new fanout writer. It might be nice to follow-up at some point to take the same approach on other defer released executed in loops. * I added tests for processBatch that include the missing partitionDataByFilePath entry, empty batch, context cancellation, simple success as well as mixed file_path values. * Note that for the mixed file_path case, I didn't want to pre-process the batch to validate that all paths were the same since the calling code already guarantees that. So I left the test case to illustrate the "limitation" as one that's intentional (at least for now). -- 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]
