[default values] Spark catalog itest for ReadBridge initial-default overlay - #681
Open
cbb330 wants to merge 2 commits into
Open
[default values] Spark catalog itest for ReadBridge initial-default overlay#681cbb330 wants to merge 2 commits into
cbb330 wants to merge 2 commits into
Conversation
cbb330
force-pushed
the
chbush/read-bridge-spark-itest
branch
from
August 13, 2026 05:59
36e818e to
d799227
Compare
This was referenced Aug 13, 2026
cbb330
force-pushed
the
chbush/read-bridge-spark-itest
branch
from
August 13, 2026 06:48
d799227 to
610d668
Compare
cbb330
force-pushed
the
chbush/read-bridge-spark-itest
branch
from
August 13, 2026 22:28
610d668 to
b1a506a
Compare
cbb330
force-pushed
the
chbush/read-bridge-spark-itest
branch
from
August 13, 2026 22:36
b1a506a to
8c170e5
Compare
cbb330
force-pushed
the
chbush/read-bridge-spark-itest
branch
from
August 13, 2026 23:56
8c170e5 to
d6dbba3
Compare
cbb330
force-pushed
the
chbush/read-bridge-spark-itest
branch
from
August 14, 2026 04:44
d6dbba3 to
a301754
Compare
cbb330
force-pushed
the
chbush/read-bridge-spark-itest
branch
from
August 14, 2026 20:41
a301754 to
2228148
Compare
cbb330
force-pushed
the
chbush/read-bridge-spark-itest
branch
from
August 19, 2026 20:44
2228148 to
601170a
Compare
cbb330
force-pushed
the
chbush/read-bridge-spark-itest
branch
from
August 20, 2026 15:08
601170a to
b0b6bd0
Compare
cbb330
force-pushed
the
chbush/read-bridge-spark-itest
branch
from
August 21, 2026 03:31
b0b6bd0 to
41d1a76
Compare
cbb330
force-pushed
the
chbush/read-bridge-spark-itest
branch
from
August 21, 2026 22:43
41d1a76 to
82a44f2
Compare
cbb330
force-pushed
the
chbush/read-bridge-spark-itest
branch
from
August 21, 2026 23:02
82a44f2 to
3b03a4a
Compare
cbb330
force-pushed
the
chbush/read-bridge-spark-itest
branch
from
August 22, 2026 00:17
3b03a4a to
df6c123
Compare
cbb330
force-pushed
the
chbush/read-bridge-spark-itest
branch
from
August 22, 2026 00:30
df6c123 to
327f974
Compare
| } | ||
|
|
||
| static Map<Integer, JsonNode> defaults(TableDto tableDto) { | ||
| if (tableDto == null || !DATABASE.equals(tableDto.getDatabaseId())) { |
Contributor
There was a problem hiding this comment.
why are we handling nulls in test code?
Collaborator
Author
There was a problem hiding this comment.
Resolver never passes a null TableDto. Dropped the null check.
cbb330
force-pushed
the
chbush/read-bridge-spark-itest
branch
from
August 25, 2026 22:59
327f974 to
000b355
Compare
cbb330
force-pushed
the
chbush/read-bridge-spark-itest
branch
3 times, most recently
from
August 26, 2026 04:39
c047856 to
3b81639
Compare
cbb330
added a commit
that referenced
this pull request
Aug 27, 2026
#678) ## Summary Depends on [#674](#674) (policy), stacked on [#668](#668) → [#645](#645). [#679](#679) (`ReadBridge.apply`) restacks on this PR. Read-bridge overlays must not persist. This PR puts the drop on the **server** *before* apply lands, so there is no deployable cut where overlays are applied but not stripped. Default-aware clients send `initial-default` on stamped field-ids (the handshake). The server gates Type 1 / Type 2, then strips those keys before Iceberg commit. Unstamped ids keep the writer's defaults. Until #679, apply is still a no-op; PUTs only carry `initial-default` if the writer set it. The server is already safe: drop is a no-op when the handshake is absent, and Type 2 fail-closes unaware rewrites on ramped tables. ## How strip protection works | Gate | When | Result | |---|---|---| | Type 1 | Ramped table; a previously stamped field-id is still in the schema but missing from incoming stamps | 400 `COLUMN_DEFAULT_REMOVED` | | Type 2 | Ramped rewrite (`replace` / `overwrite` on main) while previous stamps are nonempty | 400 `COLUMN_DEFAULT_REWRITE` unless each remaining id's `initial-default` JSON equals the stamp | | Unusable | Ramped write; source throw / unreadable schema / unreadable snapshots | 400 `COLUMN_DEFAULT_UNUSABLE` | | Drop | After gates pass | Remove `initial-default` on stamped ids (same `findParents("id")` walk as the client) | Unramped tables are a no-op. GET `resolve()` still fail-opens; only the write path is fail-closed. Awareness is `JsonNode.equals` against the stamped config, not key presence. OSS never parses ASL. `ColumnDefaultsSource` is the seam (`NONE` in OSS); LinkedIn fills it. Type 1 compares stamped field-id sets from the resolver. ## Changes - [x] New Features — `ReadBridgeStripProtection.prepare` on PUT table / snapshots - [x] Internal API Changes — resolver write APIs `stampedColumnDefaults` / `isRampedForCommit` - [x] Tests — unit Type 1/2/unusable, mock bean for `MockTablesApplication`, HTTP e2e that GET `initialDefault()` is null after overlay PUT ## Testing Done - [x] Added new tests for the changes made. - [x] Updated existing tests to reflect the changes made. - Local (Java 17): `./gradlew :services:tables:test --tests '*ReadBridgeStripProtectionTest' --tests '*ReadBridgeConfigResolverTest' --tests '*ReadBridgeColumnDefaultE2ETest'` ## Additional Information - [x] Large PR broken into smaller PRs, and PR plan linked in the description. ### Stack 1. [#645](#645) — substrate (seam + encode + decode hook) 2. [#668](#668) — decode off Iceberg’s retry path 3. [#674](#674) — policy / ramp in OpenHouse 4. **This PR** — handshake on PUT, Type 1/2, drop before persist 5. [#679](#679) — `ReadBridge.apply` (merge after this PR) 6. [#681](#681) — Spark catalog itest (overlay) ### Rollback Plan Revert this PR. After #679, clients send overlays; without the server drop they persist in Iceberg metadata.
cbb330
force-pushed
the
chbush/read-bridge-spark-itest
branch
from
August 27, 2026 00:03
013dc44 to
69fee6d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stacked on #679. Spark catalog itest that runs create → insert →
ADD COLUMNthrough the OpenHouse catalog and asserts ReadBridge stampedinitial-defaulton Spark's Iceberg table.OSS has no deployment
ColumnDefaultsSource; the local-server fixture supplies one ford1_column_defaultso the client overlay is exercised. SQL fill/filter cases are present but@Disableduntil OpenHouse bumps Iceberg past 1.2.0.20 (linkedin/iceberg#267–269): that runtime's Spark parquet/ORC readers do not fillinitial-default.Changes
Adds
ColumnDefaultSparkITestand a local-serverColumnDefaultsSourcestub (SparkItestColumnDefaults) imported bySpringH2TestApplication.Testing Done
./gradlew :integrations:spark:spark-3.1:openhouse-spark-itest:catalogTest --tests com.linkedin.openhouse.spark.catalogtest.ColumnDefaultSparkITest(JDK 11). Overlay test passed; SQL fill test remains disabled.Additional Information
Stack
ReadBridge.applyDepends on #679. Enable
columnDefaultBackfillViaReadBridgeafter the Iceberg bump that includes reader fill.