Fix chained-transform schema validation error to list conflicting col…#18512
Open
dkranchii wants to merge 1 commit into
Open
Fix chained-transform schema validation error to list conflicting col…#18512dkranchii wants to merge 1 commit into
dkranchii wants to merge 1 commit into
Conversation
…umns The error message previously rendered as "Columns: true ..." because Set#retainAll's boolean return value was passed as the format argument instead of the intersection set. Compute the intersection into a fresh HashSet so operators see the actual conflicting columns (e.g. "Columns: [x] ..."). Adds a regression test that asserts the full expected message.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #18512 +/- ##
=============================================
+ Coverage 35.23% 63.73% +28.49%
- Complexity 1117 1932 +815
=============================================
Files 3292 3292
Lines 201470 201471 +1
Branches 31316 31316
=============================================
+ Hits 70998 128398 +57400
+ Misses 124206 62788 -61418
- Partials 6266 10285 +4019
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
Author
|
@Jackie-Jiang can you please review this PR. thanks |
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
SchemaUtils.validate(...)correctly rejects a schema where a column produced by one transform function is reused as an argument to another transform, but the error message previously rendered as"Columns: true are a result of transformations, and cannot be used as arguments to other transform functions"(orfalse). The cause:Set#retainAllreturns aboolean, and that boolean was passed where the formatted intersection set should have been.The message is surfaced through the controller's schema REST endpoint, so operators currently see
"Invalid schema: <name>. Reason: Columns: true ..."and have no way to tell which columns actually conflict.What this PR changes
HashSetand pass that set toPreconditions.checkState, producing"Columns: [x] are a result of transformations, ...".retainAllwas mutatingtransformedColumnsregardless of validation outcome).import java.util.Collections.Testing
SchemaUtilsTest#testChainedTransformErrorMessageListsConflictingColumns, which asserts the full expected error message so the bug cannot regress silently.testValidateTransformFunctionArgumentscontinues to cover the validation outcome../mvnw -pl pinot-core -Dtest=SchemaUtilsTest test—Tests run: 12, Failures: 0, Errors: 0.Risk
pinot-segment-localplus one new test inpinot-core.