Apache Iceberg version
1.10.1 (latest release)
Query engine
None
Please describe the bug 🐞
Executing the following statements in Spark (on Iceberg) leads to a mismatch between the actual and expected query results:
CREATE TABLE test_table (id bigint NOT NULL, data binary) USING iceberg PARTITIONED BY (data);
INSERT INTO TABLE test_table VALUES(1, X'e3bcd1'), (2, X'bcd1');
DELETE FROM test_table WHERE data = X'bcd1';
SELECT * FROM test_table where data = X'e3bcd1';
The expected result is the remaining data row, but the query returns empty. Upon investigation, this is because the partition bounds for the binary column in the newly generated manifest file are computed incorrectly, causing the corresponding data file to be pruned during the planning phase.
PrestoDB encounters the same issue when using DeleteFiles.deleteFromRowFilter to support file-level deletion.
To dig deeper, the root cause is that, when calling DeleteFiles.deleteFromRowFilter, the PartitionFieldStats's min/max fields directly reference a reusable byte array. Specifically, this array can be (and is) reused by the ManifestReader when processing multiple files.
Willingness to contribute
Apache Iceberg version
1.10.1 (latest release)
Query engine
None
Please describe the bug 🐞
Executing the following statements in Spark (on Iceberg) leads to a mismatch between the actual and expected query results:
The expected result is the remaining data row, but the query returns empty. Upon investigation, this is because the partition bounds for the binary column in the newly generated manifest file are computed incorrectly, causing the corresponding data file to be pruned during the planning phase.
PrestoDB encounters the same issue when using
DeleteFiles.deleteFromRowFilterto support file-level deletion.To dig deeper, the root cause is that, when calling
DeleteFiles.deleteFromRowFilter, thePartitionFieldStats's min/max fields directly reference a reusable byte array. Specifically, this array can be (and is) reused by theManifestReaderwhen processing multiple files.Willingness to contribute