RussellSpitzer commented on code in PR #12855: URL: https://github.com/apache/iceberg/pull/12855#discussion_r2075725427
########## data/src/test/java/org/apache/iceberg/data/DeleteReadTests.java: ########## @@ -586,6 +595,94 @@ public void testEqualityDeleteByNull() throws IOException { checkDeleteCount(1L); } + @TestTemplate + public void testEqualityDeleteBinaryColumn() throws IOException { + List<Record> allRecords = appendOptionalColumnRecords(); + + Record binaryDataDelete = GenericRecord.create(table.schema().select("binaryData")); + List<Record> equalityDeletes = + Lists.newArrayList( + binaryDataDelete.copy("binaryData", ByteBuffer.wrap(("binaryData_0").getBytes())), + binaryDataDelete.copy("binaryData", ByteBuffer.wrap(("binaryData_1").getBytes())), + binaryDataDelete.copy("binaryData", ByteBuffer.wrap(("binaryData_2").getBytes()))); + StructLikeSet expected = rowSetWithoutIds(table, allRecords, 200, 201, 202); + testEqualityDeletes(equalityDeletes, expected); + } + + @TestTemplate + public void testEqualityDeleteStructColumn() throws IOException { + List<Record> allRecords = appendOptionalColumnRecords(); + + Record structDataDelete = GenericRecord.create(table.schema().select("structData")); + Record structRecord0 = + GenericRecord.create(table.schema().findType("structData").asStructType()); + Record structRecord1 = + GenericRecord.create(table.schema().findType("structData").asStructType()); + Record structRecord2 = + GenericRecord.create(table.schema().findType("structData").asStructType()); + structRecord0.setField("structInnerData", "structInnerData_0"); + structRecord1.setField("structInnerData", "structInnerData_1"); + structRecord2.setField("structInnerData", "structInnerData_2"); + List<Record> equalityDeletes = + Lists.newArrayList( + structDataDelete.copy("structData", structRecord0), + structDataDelete.copy("structData", structRecord1), + structDataDelete.copy("structData", structRecord2)); + StructLikeSet expected = rowSetWithoutIds(table, allRecords, 200, 201, 202); + testEqualityDeletes(equalityDeletes, expected); + } + + private void testEqualityDeletes(List<Record> equalityDeletes, StructLikeSet expected) + throws IOException { + if (equalityDeletes.isEmpty()) { Review Comment: We use Preconditions for things like this, Example ```java Preconditions.checkArgument(null != fileFormat, "Invalid file format: null"); ``` -- 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