flyrain commented on code in PR #8132: URL: https://github.com/apache/iceberg/pull/8132#discussion_r1278139565
########## data/src/test/java/org/apache/iceberg/data/TestDeleteFilter.java: ########## @@ -0,0 +1,223 @@ +/* + * 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.data; + +import java.io.IOException; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.stream.Collectors; +import org.apache.iceberg.DataFile; +import org.apache.iceberg.DataFiles; +import org.apache.iceberg.DeleteFile; +import org.apache.iceberg.Files; +import org.apache.iceberg.MetadataColumns; +import org.apache.iceberg.Schema; +import org.apache.iceberg.TableTestBase; +import org.apache.iceberg.TestHelpers; +import org.apache.iceberg.deletes.DeleteCounter; +import org.apache.iceberg.deletes.Deletes; +import org.apache.iceberg.io.CloseableIterable; +import org.apache.iceberg.io.CloseableIterator; +import org.apache.iceberg.relocated.com.google.common.collect.Lists; +import org.apache.iceberg.types.TypeUtil; +import org.apache.iceberg.util.CharSequenceSet; +import org.apache.iceberg.util.Pair; +import org.junit.Assert; +import org.junit.Test; + +public class TestDeleteFilter extends TableTestBase { Review Comment: I think we can put these tests into class `TestPositionFilter`. What we do here is to check if both data file iterator and delete file iterator are closed, would it be easier to modify test case like `TestPositionFilter::testPositionStreamRowFilter` for that purpose? ########## data/src/main/java/org/apache/iceberg/data/DeleteFilter.java: ########## @@ -82,7 +82,17 @@ protected DeleteFilter( Schema tableSchema, Schema requestedSchema, DeleteCounter counter) { - this.setFilterThreshold = DEFAULT_SET_FILTER_THRESHOLD; + this(filePath, deletes, tableSchema, requestedSchema, counter, DEFAULT_SET_FILTER_THRESHOLD); + } + + protected DeleteFilter( + String filePath, + List<DeleteFile> deletes, + Schema tableSchema, + Schema requestedSchema, + DeleteCounter counter, + long setFilterThreshold) { + this.setFilterThreshold = setFilterThreshold; Review Comment: Minor: is this change needed? I assume this change will make test easier by setting a customized threshold. However, there is no such test case yet. -- 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]
