I’m trying to fast_forward my iceberg branch but it fails with:
pyspark.errors.exceptions.captured.IllegalArgumentException: Cannot fast-forward: main is not an ancestor of mywap
1.First I’m creating mywap
branch via
ALTER TABLE `test_table` CREATE OR REPLACE BRANCH `mywap` RETAIN 2 DAYS
And then I do fast-forward:
CALL dev.system.fast_forward(table => "test_table", branch => "main", to => "mywap")
And I get the aforementioned error.
2.As a workaround I’ve tried explicitly provide ancestor:
main_id = spark.sql(f'select snapshot_id from test_table.refs where name = "main" and type="BRANCH"').first()['snapshot_id']
spark.sql(f'ALTER TABLE test_table CREATE OR REPLACE BRANCH `mywap` as of VERSION {main_id} RETAIN 2 DAYS')
But the code fails with the same error. Any ideas would be appreciated)
I’m using pyspark with iceberg-spark-runtime-3.5_2.12-1.5.1