Add lifecycle hooks and configs for custom partial-upsert mergers - #19422
Open
xiangfu0 wants to merge 3 commits into
Open
Add lifecycle hooks and configs for custom partial-upsert mergers#19422xiangfu0 wants to merge 3 commits into
xiangfu0 wants to merge 3 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #19422 +/- ##
============================================
- Coverage 67.67% 67.64% -0.03%
Complexity 1430 1430
============================================
Files 3488 3490 +2
Lines 224395 224430 +35
Branches 35422 35428 +6
============================================
- Hits 151867 151826 -41
- Misses 60488 60577 +89
+ Partials 12040 12027 -13
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
xiangfu0
force-pushed
the
codex/structured-partial-upsert-plumbing
branch
3 times, most recently
from
September 2, 2026 09:23
9f8e968 to
294a20f
Compare
xiangfu0
force-pushed
the
codex/structured-partial-upsert-plumbing
branch
from
September 3, 2026 09:24
294a20f to
7ed3c9d
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.
Motivation
Custom partial-upsert mergers can own row merge behavior, but they currently cannot receive implementation-specific configuration or validate and normalize records that have no previously stored row. Plugins also need an opt-in way to validate schema changes against their table configuration.
Changes
partialUpsertMergerConfigstoUpsertConfig.PartialUpsertMerger.prepare(GenericRow)hook.prepare()for every partial-upsert record before previous-row lookup and update, including the first record for a primary key.TableConfigValidatorand invoke registered validators during schema writes.Compatibility
Existing custom mergers remain compatible because
prepare()defaults to a no-op, and existing table configs need not define merger configs.This intentionally tightens table-update validation: adding, removing, or changing a custom merger class/config on an existing table is rejected. Such handlers are initialized at table startup, so accepting live mutations could give replicas different merge semantics.
Implementations must not change primary-key or comparison-column values from
prepare()becauseRecordInfohas already been constructed.Tests
pinot-spiandpinot-segment-local, includingUpsertConfigTest,TableConfigUtilsTest,PartialUpsertHandlerTest,BasePartitionUpsertMetadataManagerTest,TableConfigValidatorRegistryTest, andSchemaUtilsTableConfigValidatorTest.git diff --checkpassed.