pvary commented on code in PR #18338:
URL: https://github.com/apache/iceberg/pull/18338#discussion_r4513472449


##########
core/src/test/java/org/apache/iceberg/TestDeleteFiles.java:
##########
@@ -470,6 +471,50 @@ public void testDeleteWithCollision() {
     assertThat(afterDeletePartitions).containsExactly(partitionOne);
   }
 
+  @TestTemplate
+  public void 
testDeleteFromRowFilterKeepsEqualityDeleteWithMisleadingNonKeyColumnStats() {
+    assumeThat(formatVersion).isIn(2, 3);
+
+    Table eqDeleteTable =
+        TestTables.create(
+            tableDir, "eq-delete-row-filter", SCHEMA, 
PartitionSpec.unpartitioned(), formatVersion);
+
+    int idFieldId = eqDeleteTable.schema().findField("id").fieldId();
+    int dataFieldId = eqDeleteTable.schema().findField("data").fieldId();
+
+    DeleteFile eqDeletes =
+        FileMetadata.deleteFileBuilder(PartitionSpec.unpartitioned())
+            .ofEqualityDeletes(idFieldId)
+            .withPath("/path/to/eq-delete.parquet")
+            .withFileSizeInBytes(10)
+            .withRecordCount(1)
+            .withMetrics(
+                new Metrics(
+                    1L,
+                    null, // no column sizes
+                    ImmutableMap.of(idFieldId, 1L, dataFieldId, 1L), // value 
counts
+                    ImmutableMap.of(idFieldId, 0L, dataFieldId, 0L), // null 
counts
+                    null, // no nan value counts
+                    ImmutableMap.of(
+                        dataFieldId, 
Conversions.toByteBuffer(Types.StringType.get(), "zzz")),

Review Comment:
   nit: Maybe create a variable for 
`Conversions.toByteBuffer(Types.StringType.get(), "zzz")`?



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