szehon-ho commented on code in PR #5382: URL: https://github.com/apache/iceberg/pull/5382#discussion_r936119427
########## core/src/test/java/org/apache/iceberg/TestBaseIncrementalChangelogScan.java: ########## @@ -0,0 +1,292 @@ +/* + * 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; + +import static org.apache.iceberg.TableProperties.MANIFEST_MERGE_ENABLED; +import static org.apache.iceberg.TableProperties.MANIFEST_MIN_MERGE_COUNT; + +import java.io.IOException; +import java.util.List; +import org.apache.iceberg.expressions.Expressions; +import org.apache.iceberg.io.CloseableIterable; +import org.apache.iceberg.relocated.com.google.common.collect.ImmutableList; +import org.apache.iceberg.relocated.com.google.common.collect.ImmutableSet; +import org.apache.iceberg.relocated.com.google.common.collect.Iterables; +import org.apache.iceberg.relocated.com.google.common.collect.Lists; +import org.junit.Assert; +import org.junit.Assume; +import org.junit.Test; + +public class TestBaseIncrementalChangelogScan + extends ScanTestBase< + IncrementalChangelogScan, ChangelogScanTask, ScanTaskGroup<ChangelogScanTask>> { + + public TestBaseIncrementalChangelogScan(int formatVersion) { + super(formatVersion); + } + + @Override + protected IncrementalChangelogScan newScan() { + return table.newIncrementalChangelogScan(); + } + + @Test + public void testDataFilters() { + table.newFastAppend().appendFile(FILE_A).commit(); + + Snapshot snap1 = table.currentSnapshot(); + ManifestFile snap1DataManifest = Iterables.getOnlyElement(snap1.dataManifests(table.io())); + + table.newFastAppend().appendFile(FILE_B).commit(); + + Snapshot snap2 = table.currentSnapshot(); + + Assert.assertEquals("Must be 2 data manifests", 2, snap2.dataManifests(table.io()).size()); + + withUnavailableLocations( Review Comment: Question, while this is interesting, is it overkill for testing a data filter? What are we trying to test, that even if the table is corrupt that CDC scan is working fine? Not sure if we really need this test (I imagine a corrupt table breaks many things), but if we do we could probably clarify the name? -- 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]
