Repository navigation
Fixes #31975: deduplicate Glue columns so partition keys do not drop the whole table - #31978
Conversation
…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.
There was a problem hiding this comment.
Pull request overview
Fixes Glue ingestion failures caused by duplicate partition columns by deduplicating emitted column names across all ingestion paths.
Changes:
- Added centralized, case-sensitive deduplication, including truncation collisions.
- Added warning logs for dropped duplicates.
- Added six unit tests covering standard, Iceberg, fallback, and edge-case paths.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Summary |
|---|---|
ingestion/tests/unit/topology/database/test_glue.py |
Adds deduplication coverage and edge-case tests. |
ingestion/src/metadata/ingestion/source/database/glue/metadata.py |
Deduplicates emitted Glue columns across ingestion paths. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
✅ Playwright Results — workflow succeededValidated commit ✅ 110 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky PerformanceBlocking 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) 53m 49s ⏱️ Max setup 7m 47s · max shard execution 11m 45s · max shard-job elapsed before upload 17m 49s · reporting 3s 🌐 217.24 requests/attempt · 1.79 app boots/UI scenario · 0.00% common-shard skew Optimization targets still in progress:
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
…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.
Code Review ✅ ApprovedDeduplicates Glue column and partition key iteration to prevent tables from being rejected by the server on duplicate column names. No issues found. OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
ingestion/src/metadata/ingestion/source/database/glue/metadata.py:371
get_columnsis a generator (it always yields) and never returnsNone, but the return annotation isOptional[Iterable[Column]]. This mismatched type can mislead callers/static analysis and also suggestslist(columns)might be unsafe even though it always is here. Consider making the signature non-optional to reflect actual behavior.
def get_columns(self, column_data: StorageDetails) -> Optional[Iterable[Column]]: # noqa: UP045
|
|
Failed to cherry-pick changes to the 2.0 branch. |
|
Failed to cherry-pick changes to the 1.13 branch. |
…the whole table (#31978) (#32105) * 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.
…the whole table (#31978) (#32106) * 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.



Describe your changes:
Fixes #31975
GlueSource.get_columnsyieldedStorageDescriptor.Columnsand thenPartitionKeyswithout deduplicating. AWS Glue does not guarantee that partition keys are absent fromStorageDescriptor.Columns, so whenever the two overlap the same column was emitted twice and the server rejected the entire table with HTTP 400Column name <name> is repeated. The table was silently never ingested while the run still reported a high success percentage.The column iteration is now split into
_iter_columns, which keeps the existing behaviour of yielding regular columns before partition keys, andget_columns, which wraps it in a single deduplication guard. Putting the guard at the wrapper means every path is covered at once: the Iceberg path, the fallback taken whenGetTablefails, and the standard path. The first definition of a name wins, and each dropped duplicate is logged at debug level: source warnings are counted into the workflow summary, so warning here would report every partitioned Iceberg or Spectrum table as a problem on a run that ingested them correctly.Deduplication keys on the emitted
Column.namerather than the raw Glue name._get_column_objecttruncates names to 256 characters, so two longer Glue names can collide after truncation and hit the same server-side validation. Keying on the emitted name covers that case too.Comparison stays case sensitive so the guard cannot silently merge two distinct columns. In practice Glue lowercases column names on write, so a table declaring
DTwith partition keydtarrives asdttwice and is one of the shapes this fixes rather than a case the connector has to keep apart.Type of change:
High-level design:
N/A, small change.
Tests:
Use cases covered
StorageDescriptor.Columnsis ingested with that column once, instead of being rejected by the serverColumnsand inPartitionKeys, is ingestedGetTablecall fails still dedupes on the fallback pathDTwith partition keydt, which Glue stores asdttwice, is ingestedUnit tests
ingestion/tests/unit/topology/database/test_glue.py(newTestGlueColumnDeduplication, 6 cases)mainand pass with this change. The 2 cases that guard against over-deduplication (partition_key_only,case_distinct_kept) pass both before and after.Backend integration tests
Ingestion integration tests
Playwright (UI) tests
Manual testing performed
End to end against a real AWS Glue catalog and a local server on the same commit as this branch. 11 fixture tables covering all three overlap routes, the two parser failure shapes, clean partitioned controls, and clean tables sorted either side of the failing ones. The same ingestion was run twice, once with this change stashed and once with it applied.
Column name ... is repeated400sAll three duplicate-column tables now ingest with each column once. Both clean partitioned controls kept every column, so the guard does not over-delete. No table in the server carries a duplicated column name afterwards.
The 11th table is unrelated: a column of Glue type
struct<array>breaksColumnTypeParserand drops the whole table on both runs. It is filed separately and untouched here.Also run:
python -m pytest ingestion/tests/unit/topology/database/test_glue.pygives 15 passed.python -m pytest ingestion/tests/unit/topology/database/gives 1221 passed, against a 1215 baseline onmainplus the 6 new tests.make py_format_checkclean, andmake static-checksreports no findings in either changed file.UI screen recording / screenshots:
Not applicable.
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.Bug fix
Greptile Summary
The PR deduplicates AWS Glue columns after conversion to OpenMetadata column names, preventing repeated partition keys and truncated-name collisions from rejecting an entire table.
_iter_columnswhile preserving regular-column-before-partition-key ordering.Confidence Score: 5/5
The PR appears safe to merge.
No blocking failure remains.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart LR G[Glue table metadata] --> I[_iter_columns] I --> R[Regular columns first] I --> P[Partition keys second] R --> D[Deduplicate emitted Column.name] P --> D D --> C[CreateTableRequest columns] C --> S[OpenMetadata sink]Reviews (4): Last reviewed commit: "fix(ingestion): report a routine Glue du..." | Re-trigger Greptile