nastra commented on code in PR #9728: URL: https://github.com/apache/iceberg/pull/9728#discussion_r1583003922
########## core/src/test/java/org/apache/iceberg/TestFileScanTaskParser.java: ########## @@ -84,20 +127,38 @@ private String expectedFileScanTaskJson() { + "\"residual-filter\":{\"type\":\"eq\",\"term\":\"id\",\"value\":1}}"; } + private String fileScanTaskJson() { + return "{\"task-type\":\"file-scan-task\"," + + "\"schema\":{\"type\":\"struct\",\"schema-id\":0,\"fields\":[" + + "{\"id\":3,\"name\":\"id\",\"required\":true,\"type\":\"int\"}," + + "{\"id\":4,\"name\":\"data\",\"required\":true,\"type\":\"string\"}]}," + + "\"spec\":{\"spec-id\":0,\"fields\":[{\"name\":\"data_bucket\"," + + "\"transform\":\"bucket[16]\",\"source-id\":4,\"field-id\":1000}]}," + + "\"data-file\":{\"spec-id\":0,\"content\":\"DATA\",\"file-path\":\"/path/to/data-a.parquet\"," + + "\"file-format\":\"PARQUET\",\"partition\":{\"1000\":0}," + + "\"file-size-in-bytes\":10,\"record-count\":1,\"sort-order-id\":0}," + + "\"start\":0,\"length\":10," + + "\"delete-files\":[{\"spec-id\":0,\"content\":\"POSITION_DELETES\"," + + "\"file-path\":\"/path/to/data-a-deletes.parquet\",\"file-format\":\"PARQUET\"," + + "\"partition\":{\"1000\":0},\"file-size-in-bytes\":10,\"record-count\":1}," + + "{\"spec-id\":0,\"content\":\"EQUALITY_DELETES\",\"file-path\":\"/path/to/data-a2-deletes.parquet\"," + + "\"file-format\":\"PARQUET\",\"partition\":{\"1000\":0},\"file-size-in-bytes\":10," + + "\"record-count\":1,\"equality-ids\":[1],\"sort-order-id\":0}]," + + "\"residual-filter\":{\"type\":\"eq\",\"term\":\"id\",\"value\":1}}"; + } + private static void assertFileScanTaskEquals( FileScanTask expected, FileScanTask actual, PartitionSpec spec, boolean caseSensitive) { TestContentFileParser.assertContentFileEquals(expected.file(), actual.file(), spec); - Assertions.assertThat(actual.deletes()).hasSameSizeAs(expected.deletes()); + assertThat(actual.deletes()).hasSameSizeAs(expected.deletes()); for (int pos = 0; pos < expected.deletes().size(); ++pos) { TestContentFileParser.assertContentFileEquals( expected.deletes().get(pos), actual.deletes().get(pos), spec); } - Assertions.assertThat(expected.schema().sameSchema(actual.schema())) - .as("Schema should match") - .isTrue(); - Assertions.assertThat(actual.spec()).isEqualTo(expected.spec()); - Assertions.assertThat( + assertThat(expected.schema().sameSchema(actual.schema())).as("Schema should match").isTrue(); Review Comment: ```suggestion assertThat(actual.schema().asStruct()).isEqualTo(expected.schema().asStruct()); ``` if the assertion fails, then this will show where the schema mismatch is -- 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