Improve exception handling in UnifiedQueryPlanner#5465
Conversation
PR Code Analyzer ❗AI-powered 'Code-Diff-Analyzer' found issues on commit 67ffe78.
The table above displays the top 10 most important findings. Pull Requests Author(s): Please update your Pull Request according to the report above. Repository Maintainer(s): You can Thanks. |
PR Code Suggestions ✨Latest suggestions up to 9417b02
Previous suggestionsSuggestions up to commit 67ffe78
|
Tighten exception propagation and logging in UnifiedQueryPlanner.plan() on the new SQL/PPL + Analytics Engine execution path. - Catch Calcite AssertionError (thrown on invalid RelNode by RelBuilder/Validator) and rewrap as SemanticCheckException so these surface as 400 instead of crashing the worker thread. - Rethrow QueryEngineException and IllegalArgumentException as-is; the previous catch (Exception) demoted user-fixable 400s to 500. - Log all catches at ERROR with messages that match the thrown exception. No request-id threading (this is library code; the REST layer adds request-id to its own logs). Add real-query regression tests in UnifiedQueryPlannerTest using the fluent QueryErrorAssert helper (extended with type, message, and cause assertions) covering each exception-routing branch: SyntaxCheckException (invalid term), SemanticCheckException (wildcard-rename mismatch), and AssertionError wrapped as SemanticCheckException (MAX over a timestamp UDT field). Signed-off-by: Chen Dai <daichen@amazon.com>
67ffe78 to
9417b02
Compare
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
UnifiedQueryPlanner.plan()UnifiedQueryPlanner
Description
Tighten exception handling, improve error classification, and add structured logging in
UnifiedQueryPlanner.plan().Related Issues
Part of #5246
Check List
--signoffor-s.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.