laskoviymishka commented on code in PR #512: URL: https://github.com/apache/iceberg-go/pull/512#discussion_r2233881843
########## table/replace_partitions.go: ########## @@ -0,0 +1,330 @@ +// 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" + "errors" + "fmt" + + "github.com/apache/iceberg-go" + "github.com/apache/iceberg-go/io" + "github.com/google/uuid" +) + +// ReplacePartitions is used to replace data in a table, partition by partition. +// +// This interface is similar to OverwriteFiles but only replaces specific partitions +// rather than files. Only data files that belong to partitions that match added files +// will be replaced. +// +// As an example, if you have a table partitioned by columns "year" and "month" and this +// action adds two data files with partition data (2021, 1) and (2021, 2), then all existing +// data files that contain records where year=2021 and month=1 OR year=2021 and month=2 +// will be replaced. +type ReplacePartitions interface { Review Comment: this and all other PR-s looks like a 1-1 adaptation for java [iceberg interfaces](https://github.com/apache/iceberg/blob/dc88aad3daf0a04e0b674ef2aa394ecf95e19068/api/src/main/java/org/apache/iceberg/ReplacePartitions.java#L42) this approach is not really work with golang, it's not ideomatic. Better to stick with what we have with for example [snapshot](https://github.com/apache/iceberg-go/blob/main/table/snapshots.go#L248) No need to define interface just for the sake of interface. -- 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]
