Skip to content

Fixes #32625, #33429: [Tables] PATCH keeps schemaDefinition and stores tablePartition - #34053

Merged
mohittilala merged 4 commits into
mainfrom
fix/table-patch-schema-definition-partition
Sep 26, 2026
Merged

mohittilala merged 4 commits into
mainfrom
fix/table-patch-schema-definition-partition

Conversation

@mohittilala

@mohittilala mohittilala commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #32625
Fixes #33429

Two gaps in how TableRepository handles a PATCH:

  • schemaDefinition was missing from PATCH_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, and remove /schemaDefinition was rejected because the key was absent. It is now loaded with the other stored fields. A remove then leaves the stored DDL in place, the same way the PUT path already treats a null DDL.
  • tablePartition was loaded but never compared in TableUpdater, 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:

  • Bug fix

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_keepsSchemaDefinition
  • patch_removeSchemaDefinition_keepsStoredDdl
  • patch_tablePartition_isPersisted
  • patch_tablePartition_unknownColumn_400

The full TableResourceIT passes with the change.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • I have added a test that covers the exact scenario we are fixing.

…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.
@mohittilala
mohittilala requested a review from a team as a code owner September 25, 2026 14:16
Copilot AI lite review requested due to automatic review settings September 25, 2026 14:16
@mohittilala mohittilala self-assigned this Sep 25, 2026
@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR checks passed

The linked issue has a description and all required Shipping project fields set. Thanks!

@github-actions github-actions Bot added Ingestion safe to test Add this label to run secure Github workflows on PRs labels Sep 25, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 High severity

Open (1)
What changed in this PR

Fixes table PATCH persistence gaps for schemaDefinition and tablePartition.

Changes:

  • Loads schemaDefinition during PATCH operations.
  • Records tablePartition changes in TableUpdater.
  • 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.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit e071ac07a3dd3717ea89c4fbdb3a53fe46b83aee in Playwright run 36194760529, attempt 1.

✅ 4598 passed · ❌ 0 failed · 🟡 7 flaky · ⏭️ 1 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) 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:

  • Common shard skew was 42.92% (convergence target: at most 15%).
  • Application boot ratio was 2.23 per UI scenario (10946 boots / 4907 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
🟡 Shard advanced-search-01 129 0 1 0 0 0
✅ Shard chromium-01 134 0 0 0 0 0
🟡 Shard chromium-02 165 0 1 0 0 0
🟡 Shard chromium-03 155 0 2 0 0 0
✅ Shard chromium-04 164 0 0 0 0 0
🟡 Shard chromium-05 148 0 1 0 0 0
✅ Shard chromium-06 169 0 0 0 0 0
✅ Shard chromium-07 152 0 0 0 0 0
✅ Shard chromium-08 171 0 0 0 0 0
✅ Shard chromium-09 137 0 0 0 0 0
✅ Shard chromium-10 143 0 0 0 0 0
✅ Shard chromium-11 157 0 0 0 0 0
✅ Shard chromium-12 149 0 0 0 0 0
✅ Shard chromium-13 164 0 0 0 0 0
✅ Shard chromium-14 151 0 0 0 0 0
✅ Shard chromium-15 175 0 0 0 0 0
✅ Shard chromium-16 188 0 0 0 0 0
🟡 Shard chromium-17 154 0 1 0 0 0
🟡 Shard chromium-18 212 0 1 0 0 0
✅ Shard chromium-19 152 0 0 1 0 0
✅ Shard chromium-20 152 0 0 0 0 0
✅ Shard chromium-21 153 0 0 0 0 0
✅ Shard chromium-22 155 0 0 0 0 0
✅ Shard chromium-23 145 0 0 0 0 0
✅ Shard chromium-24 155 0 0 0 0 0
✅ Shard chromium-25 221 0 0 0 0 0
✅ Shard data-asset-rules-01 65 0 0 0 0 0
✅ Shard domain-isolation-01 16 0 0 0 0 0
✅ Shard global-state-01 34 0 0 0 0 0
✅ Shard import-export-01 76 0 0 0 0 0
✅ Shard import-export-02 74 0 0 0 0 0
✅ Shard ingestion-01 49 0 0 0 0 0
✅ Shard ingestion-02 52 0 0 0 0 0
✅ Shard reindex-01 41 0 0 0 0 0
✅ Shard search-01 12 0 0 0 0 0
✅ Shard search-rbac-01 29 0 0 0 0 0
🟡 7 flaky test(s) (passed on retry)
  • Features/AdvancedSearch.spec.ts › Verify Rule functionality for field Response Schema Field with AND operator (shard advanced-search-01, 1 retry)
  • Pages/Entity.spec.ts › Tag Add, Update and Remove (shard chromium-02, 1 retry)
  • Features/ContextCenterArticlesFilters.spec.ts › sort options route to the correct data path (shard chromium-03, 1 retry)
  • Features/Glossary/GlossaryStatusFilterNestedTerms.spec.ts › expanding grandparent shows parent with any status (shard chromium-03, 1 retry)
  • Features/ContextCenterArticles.spec.ts › Text formatting (shard chromium-05, 1 retry)
  • Features/ContextCenterArticles.spec.ts › multiple articles hold independent drafts simultaneously (shard chromium-17, 1 retry)
  • Pages/InputOutputPorts.spec.ts › Input ports list displays entity cards (shard chromium-18, 1 retry)

📦 Download artifacts

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

@gitar-bot

gitar-bot Bot commented Sep 26, 2026

Copy link
Copy Markdown
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 schemaDefinition in the patch base (so DDL is preserved and removals are accepted) and tracking tablePartition changes in the updater. PATCHed tablePartition columns are now validated on save.

✅ 1 closed
✅ Edge Case: PATCHed tablePartition is saved without column validation

📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TableRepository.java:2262-2268
Now that TableUpdater records tablePartition, a PATCH can store a partition whose columnName is not a column of the table. Create and PUT both go through TableMapper.validateNewTable, which calls DatabaseUtil.validateTablePartition. PATCH skips that mapper, so a value like {"columnName": "no_such_col"} returns 200 and is saved, when create/PUT would reject it with "Invalid column name found in table partition". The fix is to run the same validation inside the new compareAndUpdate block, the same way the columns block already calls DatabaseUtil.validateColumns.

Review coverage

📋 Rules No rules evaluated

🧪 Functional validation Not enabled · Set up

🤖 Auto-approval Not enabled · Set up

Options

Display: compact → Counting what did not apply, without listing it.

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

One or more issues must be addressed before approval.

Review effort: Lite
Findings: None

@github-actions

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-09-26T16:13:57Z)

Blocked the queue: playwright-summary

@github-actions

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-09-26T18:09:17Z)

Blocked the queue: integration-tests-mysql-elasticsearch

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

Projects

None yet

3 participants