Repository navigation
Fixes #32625, #33429: [Tables] PATCH keeps schemaDefinition and stores tablePartition - #34053
Conversation
…s tablePartition schemaDefinition was missing from TableRepository.PATCH_FIELDS, so every table PATCH stored the table without its DDL and a remove /schemaDefinition was rejected. tablePartition was loaded but never compared in TableUpdater, so a PATCH that only changed it was never stored. Load schemaDefinition into the patch base and record tablePartition changes. Covered by three TableResourceIT cases that fail without the change.
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
One or more issues must be addressed before approval.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
What changed in this PR
Fixes table PATCH persistence gaps for schemaDefinition and tablePartition.
Changes:
- Loads
schemaDefinitionduring PATCH operations. - Records
tablePartitionchanges inTableUpdater. - Adds three integration regression tests.
| File | Description |
|---|---|
| openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TableRepository.java | Updated as part of this pull request. |
| openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/TableResourceIT.java | Updated as part of this pull request. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
✅ Playwright Results — workflow succeededValidated commit ✅ 4598 passed · ❌ 0 failed · 🟡 7 flaky · ⏭️ 1 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) 52m 22s ⏱️ Max setup 5m 25s · max shard execution 21m 40s · max shard-job elapsed before upload 25m 11s · reporting 36s 🌐 127.98 requests/attempt · 2.23 app boots/UI scenario · 42.92% common-shard skew Optimization targets still in progress:
🟡 7 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
Code Review ✅ Approved 1 closed / 1 findings🔴 High risk · PATCH changes stored-table metadata integrity by preserving DDL and persisting partitions. Fixes PATCH handling for tables by including ✅ 1 closed✅ Edge Case: PATCHed tablePartition is saved without column validation
OptionsDisplay: compact → Counting what did not apply, without listing it. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
🚦 Removed from the merge queue —
|
🚦 Removed from the merge queue —
|

Describe your changes:
Fixes #32625
Fixes #33429
Two gaps in how
TableRepositoryhandles a PATCH:schemaDefinitionwas missing fromPATCH_FIELDS, so the patch base was loaded without it. Any table PATCH (a description edit, or a lineage, usage or lifecycle write) stored the table without its DDL, andremove /schemaDefinitionwas rejected because the key was absent. It is now loaded with the other stored fields. Aremovethen leaves the stored DDL in place, the same way the PUT path already treats a null DDL.tablePartitionwas loaded but never compared inTableUpdater, so a PATCH that only changed it returned 200 without storing anything. It is now recorded like the other fields, and its columns are validated against the table the same way create and PUT already do.Type of change:
Tests:
Four ITs in
TableResourceIT, each on a table created by ingestion-bot and patched by admin (a same-user patch inside the session window is consolidated and stored anyway, which would hide the partition no-op). All four fail without the change.patch_unrelatedField_keepsSchemaDefinitionpatch_removeSchemaDefinition_keepsStoredDdlpatch_tablePartition_isPersistedpatch_tablePartition_unknownColumn_400The full
TableResourceITpasses with the change.Checklist:
Fixes <issue-number>: <short explanation>