JeonDaehong commented on code in PR #18027: URL: https://github.com/apache/iceberg/pull/18027#discussion_r4005683036
########## core/src/test/java/org/apache/iceberg/deletes/TestPositionDeleteIndexForEachInRange.java: ########## @@ -0,0 +1,227 @@ +/* + * 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.deletes; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.List; +import java.util.Random; +import java.util.Set; +import org.apache.iceberg.relocated.com.google.common.collect.Lists; +import org.apache.iceberg.relocated.com.google.common.collect.Sets; +import org.junit.jupiter.api.Test; + +/** + * Verifies that {@link PositionDeleteIndex#forEachInRange(long, int, + * java.util.function.LongConsumer)} returns exactly the positions that {@link + * PositionDeleteIndex#isDeleted(long)} reports as deleted in the same range, in ascending order, + * for every implementation. + */ +public class TestPositionDeleteIndexForEachInRange { Review Comment: Thought about creating a new test class, but on second thought it didn't seem right, so I dropped it and split the tests by what they actually exercise * `TestRoaringPositionBitmap` : container and key boundaries, a range spanning three keys, ranges past the allocated bitmaps, run containers after runLengthEncode, the new precondition, and a randomized comparison against contains. * `TestBitmapPositionDeleteIndex` : the range contract (inclusive start, exclusive end), ascending order, empty index and empty range, and a randomized comparison against isDeleted for both the bitmap-backed index and the interface default. org.apache.iceberg.deletes went from 55 to 63 tests. -- 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]
