Skip to content

Backport #31978 to 1.13: deduplicate Glue columns so partition keys do not drop the whole table - #32106

Merged
mohittilala merged 4 commits into
1.13from
cherry-pick/glue-dedup-1.13
Sep 1, 2026
Merged

mohittilala merged 4 commits into
1.13from
cherry-pick/glue-dedup-1.13

Conversation

@mohittilala

@mohittilala mohittilala commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Backport of #31978 to 1.13. Original issue: #31975.

GlueSource.get_columns yielded StorageDescriptor.Columns and then PartitionKeys unfiltered. When the two overlap the column is emitted twice, the server rejects the table with 400 Column name <name> is repeated, and the table is never created while the run still reports a high success percentage.

One conflict needed resolving: 1.13 imports get_connection where main uses close_on_failure / create_connection, which do not exist on this branch. Kept the 1.13 import and added only model_str, which the fix needs. Everything else is byte-identical to main so future backports of this area apply cleanly.

Tests

pytest ingestion/tests/unit/topology/database/test_glue.py: 16 passed

Greptile Summary

The backport prevents Glue tables from being rejected when regular columns and partition keys contain the same emitted name.

  • Wraps Glue column iteration with per-table, case-sensitive name deduplication.
  • Applies the behavior to standard, Iceberg, and Iceberg-fallback extraction paths.
  • Adds coverage for repeated partition keys, case-distinct names, truncation collisions, and warning-free handling.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
ingestion/src/metadata/ingestion/source/database/glue/metadata.py Adds a per-table deduplication wrapper around standard and Iceberg column iteration while preserving first-seen ordering.
ingestion/tests/unit/topology/database/test_glue.py Adds focused tests for duplicate partition keys, Iceberg and fallback paths, case sensitivity, truncation collisions, and logging behavior.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    G[Glue table metadata] --> I[Iterate regular columns and partition keys]
    I --> N[Convert to OpenMetadata columns]
    N --> D[Deduplicate emitted names]
    D --> R[CreateTableRequest]
    R --> S[OpenMetadata server]
Loading

Reviews (3): Last reviewed commit: "Merge branch '1.13' into cherry-pick/glu..." | Re-trigger Greptile

Context used:

…the whole table (#31978)

* fix(ingestion): stop a repeated Glue partition key from dropping the whole table

get_columns yielded StorageDescriptor.Columns then PartitionKeys unfiltered, so an
overlapping partition key was emitted twice and the server rejected the table with
400 "Column name <name> is repeated".

Dedupe once in get_columns over a shared _iter_columns, covering the Iceberg,
Iceberg-fallback and standard paths. Keys on the emitted name so truncation
collisions are caught too.

* fix(ingestion): satisfy basedpyright on the dynamic table_data context attribute

* fix(ingestion): report a routine Glue duplicate column at debug, not warning

Source warnings are counted into the workflow summary, so warning on every repeated
partition key reported healthy Iceberg and Spectrum tables as problems on a run that
ingested every table correctly.

Say why a name can arrive twice: Glue lists a partition key in StorageDescriptor.Columns
as well as PartitionKeys, and lower cases column names on write.
@mohittilala
mohittilala requested a review from a team as a code owner August 26, 2026 12:10
@mohittilala mohittilala added the skip-pr-checks Bypass PR metadata validation check label Aug 26, 2026
@github-actions github-actions Bot added Ingestion safe to test Add this label to run secure Github workflows on PRs labels Aug 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

The Python checkstyle failed.

Please run make py_format and py_format_check in the root of your repository and commit the changes to this PR.
You can also use pre-commit to automate the Python code formatting.

You can install the pre-commit hooks with make install_test precommit_install.

@gitar-bot

gitar-bot Bot commented Sep 1, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Backports the Glue column deduplication fix to prevent partition keys from duplicating columns and dropping tables. No issues found.

Options

Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@sonarqubecloud

sonarqubecloud Bot commented Sep 1, 2026

Copy link
Copy Markdown

This branch was previously deployed

1 inactive deployment
test — 8ba87cd3 Deployed Sep 1, 2026 by mohittilala via playwright-ci-postgresql (2, 6) #77141
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ingestion safe to test Add this label to run secure Github workflows on PRs skip-pr-checks Bypass PR metadata validation check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants