apache / apache/iceberg

Duplicate file path found in Iceberg metadata snapshot

Open
#13,763 32 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
9.2k
Forks
3.5k
Avg merge
2d 11h
Merged PRs (30d)
132

Description

### Apache Iceberg version

1.9.2

### Query engine

Databricks Spark 3.5.2 for Maintenance (Data Compaction, Manifest Rewrites, Orphan Deletion
Snowflake to load and query the data.

### Please describe the bug 🐞

Hello everyone,

Our Architecture is to stream data via kafka and ingest the data via kafka-connect with the iceberg-sink-connector with iceberg 1.9.2 to our Azure Blob Storage against Polaris Catalog in version 1.0.0-incubating. Maintenance is done via DBX Spark in version 3.5.2 also with iceberg version 3.5.2 with partial-progress.enabled.

When working with Spark there is no issue but when we import the data into Snowflake the error message pops up.

`SQL execution error: Duplicate file path found in the Iceberg metadata snapshot. Please check that your Iceberg metadata generation is producing valid manifest files and refresh to a newer snapshot once fixed. File path: 'created_at_day=2025-08-06/country_code=/entity_number=/00001-xxxxxxxxx*-.parquet`.

When going down from the snapshot to the manifest file we really see a duplicate entry for the file.

`
{"status":0,"snapshot_id":{"long":7127004696002716753},"sequence_number":{"long":59331},"file_sequence_number":{"long":59331},"data_file":{"content":0,"file_path":"abfss:///xxxx/xxx//data/created_at_day=2025-08-05/country_code=/entity_number=/00001-1754381332739-c55fd420-b673-45ec-be45-35408bf4e650-00001.parquet","file_format":"PARQUET","partition":{"created_at_day":{"int":20305},"country_code":{"string":""},"entity_number":{"string":""}},"record_count":307,"file_size_in_bytes":25282,"column_sizes":{"array":[]},"value_counts":{"array":[]},"null_value_counts":{"array":[]},"nan_value_counts":{"array":[]},"lower_bounds":{"array":[]},"upper_bounds":{"array":[]},"key_metadata":null,"split_offsets":{"array":[4]},"equality_ids":null,"sort_order_id":{"int":0},"referenced_data_file":null}}
`

`
{"status":0,"snapshot_id":{"long":1026760103416329420},"sequence_number":{"long":59330},"file_sequence_number":{"long":59330},"data_file":{"content":0,"file_path":"abfss:///xxxx/xxx//data/created_at_day=2025-08-05/country_code=/entity_number=/00001-1754381332739-c55fd420-b673-45ec-be45-35408bf4e650-00001.parquet","file_format":"PARQUET","partition":{"created_at_day":{"int":20305},"country_code":{"string":""},"entity_number":{"string":""}},"record_count":307,"file_size_in_bytes":25282,"column_sizes":{"array":[]},"value_counts":{"array":[]},"null_value_counts":{"array":[]},"nan_value_counts":{"array":[]},"lower_bounds":{"array":[]},"upper_bounds":{"array":[]},"key_metadata":null,"split_offsets":{"array":[4]},"equality_ids":null,"sort_order_id":{"int":0},"referenced_data_file":null}}
`

I masked some parts but relevant is that the path location, record_count and file_size_in_bytes is same.
What differs is the snapshot_id, sequence_number and file_in_sequence_number.

Re-Running our maintenance job again with manifest_rewrite but partial-progress.enabled true and second try with false was not solving the issue.

### Willingness to contribute

- [ ] I can contribute a fix for this bug independently
- [x] I would be willing to contribute a fix for this bug with guidance from the Iceberg community
- [ ] I cannot contribute a fix for this bug at this time

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the duplicate path with Iceberg 1.9.2, Spark 3.5.2, Polaris 1.0.0, and the stated partial-progress settings. Inspect the generated snapshot and manifest entries after maintenance runs. Done means the same data file is no longer duplicated and Snowflake accepts the refreshed snapshot.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, kafka, spark
Domain
data-engineering, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.