Skip to content

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

Merged
harshsoni2024 merged 1 commit into
2.0from
cherry-pick/glue-dedup-2.0
Aug 27, 2026
Merged

harshsoni2024 merged 1 commit into
2.0from
cherry-pick/glue-dedup-2.0

Conversation

@mohittilala

@mohittilala mohittilala commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Backport of #31978 to 2.0. 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.

Applied cleanly, so the diff is identical to what merged on main.

Tests

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

Greptile Summary

This backport prevents Glue tables from being rejected when regular columns and partition keys emit the same final column name.

  • Extracts the existing Glue column enumeration into _iter_columns.
  • Deduplicates emitted names while preserving the first column definition.
  • Adds coverage for standard, Iceberg, fallback, truncation-collision, case-sensitive, and logging behavior.

Confidence Score: 5/5

The PR appears safe to merge with no actionable correctness, security, or repository-rule issues identified.

The deduplication preserves existing enumeration and exception handling while preventing duplicate emitted names across all tested Glue paths.

Important Files Changed

Filename Overview
ingestion/src/metadata/ingestion/source/database/glue/metadata.py Wraps existing Glue column enumeration with first-wins name deduplication across standard and Iceberg paths; no actionable defect found.
ingestion/tests/unit/topology/database/test_glue.py Adds focused pytest coverage for duplicate partition keys, Iceberg fallback, truncation collisions, case sensitivity, and warning suppression.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Glue regular columns] --> C[_iter_columns]
  B[Glue partition keys] --> C
  C --> D[get_columns deduplication]
  D -->|First occurrence| E[OpenMetadata columns]
  D -->|Repeated emitted name| F[Skip and debug log]
Loading

Reviews (1): Last reviewed commit: "Fixes #31975: deduplicate Glue columns s..." | Re-trigger Greptile

…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:09
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@github-actions github-actions Bot added Ingestion safe to test Add this label to run secure Github workflows on PRs labels Aug 26, 2026
@mohittilala mohittilala added the skip-pr-checks Bypass PR metadata validation check label 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 Aug 26, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Backports deduplication logic for Glue columns to prevent duplicate column names from dropping entire tables during ingestion. 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

@github-actions

Copy link
Copy Markdown
Contributor

The Java checkstyle failed.

Please run mvn spotless:apply in the root of your repository and commit the changes to this PR.
You can also use pre-commit to automate the Java code formatting.

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

@github-actions

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit 5f6a76728ee9d80aa51ea11d503717e1e831949c in Playwright run 32967062660, attempt 1.

✅ 110 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky

Performance

Blocking targets: ✅ met · Optimization targets: 🟡 in progress

Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting.

🕒 Full workflow signal wall (to summary) 1h 0m 13s

⏱️ Max setup 3m 46s · max shard execution 12m 25s · max shard-job elapsed before upload 17m 40s · reporting 3s

🌐 211.55 requests/attempt · 1.79 app boots/UI scenario · 0.00% common-shard skew

Optimization targets still in progress:

  • Browser traffic was 211.55 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 1.79 per UI scenario (216 boots / 121 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 46 0 0 0 0 0
✅ Shard ingestion-01 38 0 0 0 0 0
✅ Shard ingestion-02 26 0 0 0 0 0

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@mohittilala mohittilala self-assigned this Aug 26, 2026
@harshsoni2024
harshsoni2024 merged commit af62f58 into 2.0 Aug 27, 2026
141 of 163 checks passed
@harshsoni2024
harshsoni2024 deleted the cherry-pick/glue-dedup-2.0 branch August 27, 2026 11:38

This branch was previously deployed

1 inactive deployment
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