xiangfu0 opened a new pull request, #19422: URL: https://github.com/apache/pinot/pull/19422
## 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 - Add optional `partialUpsertMergerConfigs` to `UpsertConfig`. - Add a backward-compatible `PartialUpsertMerger.prepare(GenericRow)` hook. - Invoke `prepare()` for every partial-upsert record before previous-row lookup and update, including the first record for a primary key. - Reject merger configs without a custom merger class and continue rejecting combinations of custom mergers with built-in per-column strategies. - Treat a custom merger class and its configs as immutable on existing tables, preventing replicas from using mixed semantics while handlers remain initialized with old configuration. - Add an opt-in schema-validation phase to `TableConfigValidator` and 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()` because `RecordInfo` has already been constructed. ## Tests - 107 focused tests passed across `pinot-spi` and `pinot-segment-local`, including `UpsertConfigTest`, `TableConfigUtilsTest`, `PartialUpsertHandlerTest`, `BasePartitionUpsertMetadataManagerTest`, `TableConfigValidatorRegistryTest`, and `SchemaUtilsTableConfigValidatorTest`. - Affected-module formatting, Checkstyle, license checks, and `git diff --check` passed. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
