Skip to content

direct: ignore UC-managed schema property defaults#5195

Open
janniklasrose wants to merge 3 commits intomainfrom
janniklasrose/schema-backend-defaults
Open

direct: ignore UC-managed schema property defaults#5195
janniklasrose wants to merge 3 commits intomainfrom
janniklasrose/schema-backend-defaults

Conversation

@janniklasrose
Copy link
Copy Markdown
Contributor

Summary

UC auto-populates system-managed property keys on schema creation (e.g. unity.catalog.managed.delta.defaults.delta.enableRowTracking). Without a backend_defaults rule, the planner sees the remote map as drift, emits an Update, and DoUpdate sends an empty payload that UC rejects with UpdateSchema Nothing to update.

  • Add narrow backend_defaults rules covering the two known managed keys (...delta.enableRowTracking, ...iceberg...feature.catalogManaged) so user-set properties still drive real drift detection.
  • Handle the nil-vs-map case from structdiff where a remote-only map change is emitted at the parent path: only skip the parent if every remote entry matches a configured child rule. Synthesize child paths with structpath.NewBracketString to match what structdiff produces (rather than NewStringKey, which would diverge for identifier-like keys).
  • Mirror UC behavior in the fake testserver to exercise the no-drift invariant locally; add an acceptance test under acceptance/.../schemas/drift/managed_properties that proves plan/redeploy is a no-op despite the auto-populated keys.

Test plan

  • go test ./bundle/direct/... ./libs/testserver/...
  • go test ./acceptance -run 'TestAccept/bundle/resources/schemas'
  • ./task lint-q and ./task checks
  • New unit test fails on NewStringKey and passes on NewBracketString (verified by toggling)

This pull request and its description were written by Isaac.

UC auto-populates system-managed property keys (e.g.
`unity.catalog.managed.delta.defaults.delta.enableRowTracking`) on
schema creation. Without a backend_defaults rule, the planner sees the
remote map as drift, emits Update, and DoUpdate sends an empty payload
which UC rejects with "UpdateSchema Nothing to update".

The rule only applies when both saved and new are nil, so user-set
properties still drive real drift detection.

Also mirror the UC behavior in the fake testserver so the no-drift
invariant is exercised locally; added acceptance/.../schemas/drift/
managed_properties covering the reproducer.

Co-authored-by: Isaac
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

Approval status: pending

/acceptance/bundle/ - needs approval

6 files changed
Suggested: @denik
Also eligible: @andrewnester, @pietern, @shreyas-goenka, @anton-107, @lennartkats-db

/bundle/ - needs approval

Files: bundle/direct/bundle_plan.go, bundle/direct/bundle_plan_test.go, bundle/direct/dresources/resources.yml
Suggested: @denik
Also eligible: @andrewnester, @pietern, @shreyas-goenka, @anton-107, @lennartkats-db

General files (require maintainer)

Files: libs/testserver/schemas.go
Based on git history:

  • @denik -- recent work in bundle/direct/, bundle/direct/dresources/, libs/testserver/

Any maintainer (@andrewnester, @anton-107, @denik, @pietern, @shreyas-goenka, @simonfaltum, @renaudhartert-db) can approve all areas.
See OWNERS for ownership rules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant