' returns 0 rows, making any subsequent cherrypick_snapshot call impossible.
Steps to Reproduce
Using any Spark + Iceberg catalog (Hadoop, Hive, REST). Verified with Spark 3.5.x + Iceberg 1.10.1.
Failure mode (WAP DELETE):
_-- Step 1: Create format-version 3 table with MOR DELETE
CREATE TABLE test_wap_dv (id INT, name STRING, dept STRING)
USING iceberg
TBLPROPERTIES (
'format-version' = '3',
'write.delete.mode' = 'merge-on-read'
);
-- Step 2: Insert rows
INSERT INTO test_wap_dv
VALUES (1, 'Alice', 'Eng'), (2, 'Bob', 'HR'), (3, 'Carol', 'Eng');
-- Step 3: Enable WAP
ALTER TABLE test_wap_dv
SET TBLPROPERTIES ('write.wap.enabled' = 'true');
-- Step 4: Stage a DELETE under WAP
SET spark.wap.id = 'wap_stage_001';
DELETE FROM test_wap_dv WHERE dept = 'HR';
-- Succeeds with no exception
-- Step 5: Find staged snapshot (BUG: returns 0 rows)
SELECT snapshot_id, summary
FROM test_wap_dv.snapshots
WHERE summary['wap.id'] = 'wap_stage_001'
ORDER BY committed_at DESC LIMIT 1;
-- Expected: 1 row containing the staged snapshot ID
-- Actual: 0 rows
-- Step 6: Cherry-pick fails (no snapshot ID to use)
-- CALL .system.cherrypick_snapshot(
-- table => '.test_wap_dv',
-- snapshot_id => <id from step 5>);
-- Fails with IndexError / NullPointerException because step 5 returned nothing_
Willingness to contribute
- [ ] I can contribute a fix for this bug independently
- [ ] I would be willing to contribute a fix for this bug with guidance from the Iceberg community
- [x] I cannot contribute a fix for this bug at this time
@abjain123 can i take this bug to work on?
3. Sure @akashrn5 !
Thank you, i will raise a PR in couple of days
Hey @akashrn5 , are you still working on the issue? If not then I can pick it up. Thanks!
@neel429 i was working on it, i was bit delayed due to some issues though