kinolaev commented on code in PR #19124:
URL: https://github.com/apache/iceberg/pull/19124#discussion_r4711945301
##########
core/src/test/java/org/apache/iceberg/TestFileScanTaskParser.java:
##########
@@ -74,6 +74,34 @@ public void testFileScanTaskParsesFieldIdPartitionMap() {
assertFileScanTaskEquals(expected, deserializedTask, spec, caseSensitive);
}
+ @Test
+ public void testFileScanTaskWithGlobalEqualityDeletesOfAnotherSpec() {
+ PartitionSpec unpartitioned =
PartitionSpec.builderFor(TestBase.SCHEMA).withSpecId(1).build();
+ DeleteFile globalDeletes =
+ FileMetadata.deleteFileBuilder(unpartitioned)
+ .ofEqualityDeletes(1)
+ .withPath("/path/to/global-eq-deletes.parquet")
+ .withFileSizeInBytes(10)
+ .withRecordCount(1)
+ .build();
+ FileScanTask fileScanTask =
+ new BaseFileScanTask(
+ TestBase.FILE_A,
+ new DeleteFile[] {TestBase.FILE_A2_DELETES, globalDeletes},
+ SchemaParser.toJson(TestBase.SCHEMA),
+ PartitionSpecParser.toJson(TestBase.SPEC),
+ ResidualEvaluator.unpartitioned(Expressions.alwaysTrue()));
+
+ FileScanTask deserializedTask =
+ ScanTaskParser.fromJson(ScanTaskParser.toJson(fileScanTask), true);
Review Comment:
Thanks @timothyw553, I updated the test in
c0885fa24ccd3b68870bd65e2f6ba3eedbcc18d0:
- asserted the serialized task against the expected JSON string
- deserialized from that fixed JSON instead of from `toJson` output
- added an `assertFileScanTaskEquals` overload that takes specs by ID and
used it to check the deserialized task
--
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]