rdblue commented on code in PR #12298: URL: https://github.com/apache/iceberg/pull/12298#discussion_r2718002414
########## core/src/main/java/org/apache/iceberg/formats/EqualityDeleteWriteBuilder.java: ########## @@ -0,0 +1,74 @@ +/* + * 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 org.apache.iceberg.formats; + +import java.io.IOException; +import java.util.List; +import org.apache.iceberg.DeleteFile; +import org.apache.iceberg.Schema; +import org.apache.iceberg.deletes.EqualityDeleteWriter; +import org.apache.iceberg.util.ArrayUtil; + +/** + * A specialized builder for creating equality-based delete file writers. + * + * <p>This builder extends the generic {@link CommonWriteBuilder} interface with functionality + * specific to creating {@link EqualityDeleteWriter} instances. + * + * <p>The builder provides methods to configure which fields should be used for equality comparison + * through {@link #equalityFieldIds(List)} or {@link #equalityFieldIds(int...)}, along with schema + * configuration for the delete records. + * + * @param <D> the type of data records the writer will accept + * @param <S> the type of the schema for the input data + */ +public interface EqualityDeleteWriteBuilder<D, S> + extends CommonWriteBuilder<EqualityDeleteWriteBuilder<D, S>> { + + /** + * Sets the input schema accepted by the writer. If not provided derived from the {@link + * #rowSchema(Schema)}. + */ + EqualityDeleteWriteBuilder<D, S> inputSchema(S schema); + + /** Sets the row schema for the delete writers. */ + EqualityDeleteWriteBuilder<D, S> rowSchema(Schema rowSchema); Review Comment: For equality deletes, we _can_ have a different method name, but there isn't much difference in the functionality between this and the data write builder because in both, this schema is the one used to write the file. I would rather combine this with `schema` so that we don't have as many differences between this and the data write builder. -- 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]
