pvary commented on code in PR #13329: URL: https://github.com/apache/iceberg/pull/13329#discussion_r2151646748
########## core/src/test/java/org/apache/iceberg/avro/TestAvroPartitionStatsHandler.java: ########## @@ -18,12 +18,44 @@ */ package org.apache.iceberg.avro; +import static org.assertj.core.api.Assertions.assertThatThrownBy; + import org.apache.iceberg.FileFormat; +import org.apache.iceberg.PartitionStats; +import org.apache.iceberg.PartitionStatsHandler; import org.apache.iceberg.PartitionStatsHandlerTestBase; +import org.apache.iceberg.Partitioning; +import org.apache.iceberg.Schema; +import org.apache.iceberg.Table; +import org.apache.iceberg.TestTables; +import org.apache.iceberg.io.CloseableIterable; +import org.apache.iceberg.relocated.com.google.common.collect.Lists; +import org.junit.jupiter.api.Test; public class TestAvroPartitionStatsHandler extends PartitionStatsHandlerTestBase { public FileFormat format() { return FileFormat.AVRO; } + + @Test + public void testReadingStatsWithInvalidSchema() throws Exception { + Table testTable = + TestTables.create(tempDir("old_schema"), "old_schema", SCHEMA, SPEC, 2, fileFormatProperty); + Schema schema = PartitionStatsHandler.schema(Partitioning.partitionType(testTable)); + + String invalidSchema = + getClass() + .getClassLoader() + .getResource("org/apache/iceberg/PartitionStatsInvalidSchema.avro") Review Comment: Could we just generate the file on the fly instead of checking in the binary? -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org