chenjunjiedada commented on a change in pull request #2538:
URL: https://github.com/apache/iceberg/pull/2538#discussion_r623547421
##########
File path: flink/src/test/java/org/apache/iceberg/flink/SimpleDataUtil.java
##########
@@ -191,9 +190,19 @@ public static void assertTableRows(Table table,
List<RowData> expected) throws I
public static void assertTableRecords(Table table, List<Record> expected)
throws IOException {
table.refresh();
+
Review comment:
Because the metadata column projection logic produces additional columns
even when the `requiredSchema` doesn't contain them and that is why we use
`StructLikeSet`. The `_pos` column shows up only when positional deletes
exist, the `_deleted` marker shows up when any of the deletes exist.
The failed unit test contains only equality delete which produces only
`_deleted` column, so it failed with `HashMultiSet` comparison. But when the
unit test, for example
`TestIcebergFilesCommitter.TestCommitTwoCheckpointsInSingleTxn`, contains a
positional delete, the unit test fails as well due to it has the additional
column `_pos`. The following patch for the unit test could test it.
```
- DeleteFile deleteFile1 = writeEqDeleteFile(appenderFactory,
"delete-file-1", ImmutableList.of(delete3));
+ DeleteFile deleteFile1 = writePosDeleteFile(appenderFactory,
+ "pos-delete-file-1",
+ ImmutableList.of(Pair.of(dataFile1.path(), 3L)));
```
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]