-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[fix](http stream) http stream should throw exception if parse sql failed #55863
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes an issue where HTTP stream failed to properly handle SQL parsing errors, resulting in confusing null pointer exceptions instead of meaningful error messages. The fix ensures that parsing failures are properly caught and rethrown with descriptive error messages.
- Improves error handling by properly propagating SQL parsing exceptions in HTTP stream
- Enhances error message clarity by including the original SQL statement in logs
- Adds test coverage for SQL parsing error scenarios
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| regression-test/suites/load_p0/http_stream/test_http_stream.groovy | Adds test case for invalid SQL to verify proper error handling |
| fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java | Improves error logging with original SQL statement context |
| fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java | Fixes control flow to properly propagate parsing exceptions and prevent null pointer errors |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| LOG.warn("Analyze failed. {}", context.getQueryIdentifier(), e); | ||
| throw ((NereidsException) e).getException(); | ||
| } | ||
| throw e; |
Copilot
AI
Sep 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The removal of the specific exception handling for NereidsException breaks the original logic. The code should still throw the nested exception from NereidsException rather than the wrapper exception itself.
| throw e; | |
| if (e instanceof NereidsException && e.getCause() != null) { | |
| // Restore original logic: throw the nested cause of NereidsException | |
| if (e.getCause() instanceof Exception) { | |
| throw (Exception) e.getCause(); | |
| } else if (e.getCause() instanceof Error) { | |
| throw (Error) e.getCause(); | |
| } else { | |
| throw new RuntimeException(e.getCause()); | |
| } | |
| } else { | |
| throw e; | |
| } |
TPC-H: Total hot run time: 34529 ms |
TPC-DS: Total hot run time: 188435 ms |
ClickBench: Total hot run time: 30.2 s |
FE Regression Coverage ReportIncrement line coverage |
dataroaring
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
liaoxin01
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…iled (#55863) Problem Summary: if http stream parse sql failed, the exception is ignored and continue execute, then throw exception: ``` "Message": "[ANALYSIS_ERROR]TStatus: errCode = 2, detailMessage = exec sql error catch unknown result.java.lang.NullPointerException: Cannot invoke \"org.apache.doris.planner.Planner.getFragments()\" because \"planner\" is null" ```
…iled (#55863) Problem Summary: if http stream parse sql failed, the exception is ignored and continue execute, then throw exception: ``` "Message": "[ANALYSIS_ERROR]TStatus: errCode = 2, detailMessage = exec sql error catch unknown result.java.lang.NullPointerException: Cannot invoke \"org.apache.doris.planner.Planner.getFragments()\" because \"planner\" is null" ```
…parse sql failed #55863 (#55890) Cherry-picked from #55863 Co-authored-by: meiyi <[email protected]>
…parse sql failed #55863 (#55891) Cherry-picked from #55863 Co-authored-by: meiyi <[email protected]>
What problem does this PR solve?
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
if http stream parse sql failed, the exception is ignored and continue execute, then throw exception:
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)