Fix SchemaUtils to surface actual validation failure reason#18896
Fix SchemaUtils to surface actual validation failure reason#18896Akanksha-kedia wants to merge 1 commit into
Conversation
The updateSchema endpoint in PinotSchemaRestletResource was catching
SchemaBackwardIncompatibleException but only returning a generic message
("Only allow adding new columns") without including the actual reason
from the exception. This made it difficult for users to understand why
their schema update was rejected.
Now the error response includes e.getMessage() which contains detailed
incompatibility information (missing columns, incompatible field types,
primary key changes, and fix suggestions).
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #18896 +/- ##
============================================
+ Coverage 63.68% 64.81% +1.12%
+ Complexity 1684 1347 -337
============================================
Files 3262 3393 +131
Lines 199826 211664 +11838
Branches 31031 33305 +2274
============================================
+ Hits 127264 137193 +9929
- Misses 62414 63390 +976
- Partials 10148 11081 +933
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:
|
|
cc @Jackie-Jiang @siddharthteotia @npawar — requesting your review. What this PR doesFixes a UX paper-cut in schema validation: when
The exception already carries the full reason (which column was removed, which type changed, etc.) but it was being silently discarded in the catch block. This one-line fix threads
Why it matters: operators debugging failed schema updates had no way to know from the API response what was actually wrong — they had to dig into controller logs. This surfaces the detail directly in the REST response where it belongs. Change scope: one catch block in |
Code Review — PR #18896 (
|
Description
The
updateSchemaendpoint inPinotSchemaRestletResourcewas catchingSchemaBackwardIncompatibleExceptionbut discarding the actual error details, returning only a generic message:"Backward incompatible schema <name>. Only allow adding new columns".This made it very difficult for users to understand why their schema update was rejected. The exception itself already contains detailed information about incompatible field specifications, missing columns, primary key changes, and suggestions for fixing the issue — but this information was never surfaced to the user.
After this fix, the error response includes the actual reason from
e.getMessage(), giving users actionable information about what is incompatible and how to fix it.Related Issue
Fixes #14787
Changes Made
PinotSchemaRestletResource.updateSchema()to includee.getMessage()in the error response forSchemaBackwardIncompatibleException, replacing the generic "Only allow adding new columns" message.PinotSchemaRestletResourceTestto verify that backward-incompatible schema update errors include the actual incompatibility details.Testing Done
Upgrade Notes
None. This is a user-facing error message improvement only — no API or configuration changes.