Glue table Parameters are never pruned: removed table properties persist indefinitely

Open
#3,977 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
databases

Research direction

Start in pyiceberg/catalog/glue.py at _construct_parameters and trace how the existing Glue Parameters and current table metadata properties are combined. Verify the behavior around removing a table property, then add coverage for that scenario. Done means Glue no longer retains keys absent from the table's current properties while preserving the required metadata entries.

Written by the indexing model from the issue text.

Description

bug

_construct_parameters in pyiceberg/catalog/glue.py builds the Glue Parameters map by starting from whatever Glue already holds and layering the current table properties on top:

new_parameters = glue_table.get("Parameters", {}) if glue_table else {}
new_parameters.update({TABLE_TYPE: ICEBERG.upper(), METADATA_LOCATION: metadata_location})
if prev_metadata_location:
    new_parameters[PREVIOUS_METADATA_LOCATION] = prev_metadata_location

if metadata_properties:
    for key, value in metadata_properties.items():
        new_parameters[key] = str(value)

The operation is additive only. A key that exists in Glue but is no longer present in the table's metadata is never deleted, so removing a property from the table and committing leaves the old value in Glue permanently.

Glue Parameters and the table's property map therefore drift apart over time, and the drift is one-directional: Glue accumulates every key the table has ever had. Anything that reads table properties via Glue sees keys the table no longer declares.


Issue investigation generated via claude, reviewed by Sung, Kevin, Fokko.

Dominant language
Python
Stars
1.1k
Forks
589
Avg merge
2d 4h
Merged PRs (30d)
72

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/iceberg-python

All issues in apache/iceberg-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.