RussellSpitzer commented on issue #6670: URL: https://github.com/apache/iceberg/issues/6670#issuecomment-1406772042
Another high level repo using a String Collision ```java @Test public void testDeleteWithCollision() { Schema schema = new Schema(Types.NestedField.of(0, false, "x", Types.StringType.get())); PartitionSpec spec = PartitionSpec.builderFor(schema).identity("x").build(); Table collisionTable = TestTables.create(tableDir, "hashcollision", schema, spec, formatVersion); PartitionData partitionOne = new PartitionData(spec.partitionType()); partitionOne.set(0, "Aa"); PartitionData partitionTwo = new PartitionData(spec.partitionType()); partitionTwo.set(0, "BB"); Assert.assertEquals( StructLikeWrapper.forType(spec.partitionType()).set(partitionOne).hashCode(), StructLikeWrapper.forType(spec.partitionType()).set(partitionTwo).hashCode()); Metrics metrics = new Metrics(1L, null, null, null, null); DataFile testFileOne = DataFiles.builder(spec) .withPartition(partitionOne) .withPath("/g1.parquet") .withFileSizeInBytes(100) .withMetrics(metrics) .build(); DataFile testFileTwo = DataFiles.builder(spec) .withPartition(partitionTwo) .withMetrics(metrics) .withFileSizeInBytes(100) .withPath("/g2.parquet") .build(); collisionTable.newFastAppend().appendFile(testFileOne).appendFile(testFileTwo).commit(); Assert.assertEquals( "We should have two files", 2, Lists.newArrayList(collisionTable.newScan().planFiles().iterator()).size()); collisionTable.newDelete().deleteFromRowFilter(Expressions.equal("x", "BB")).commit(); Assert.assertEquals( "We should have deleted one of them", 1, Lists.newArrayList(collisionTable.newScan().planFiles().iterator()).size()); } ``` -- 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