timothyw553 commented on code in PR #19124:
URL: https://github.com/apache/iceberg/pull/19124#discussion_r4705633206


##########
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:
   here we're writing and reading with the same implementation, so a matching 
change to both could still pass without catching a format break for flink 
splits. could we assert the expected json string with `"spec-id":1` and 
`"partition":[]` for the global delete and deserialize from that fixed json 
instead? we'd still want to assert each delete separately like below since 
`assertFileScanTaskEquals` assumes one spec.



-- 
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]

Reply via email to