jihoonson opened a new pull request #11900:
URL: https://github.com/apache/druid/pull/11900
### Description
NPE can be thrown when there is a query parameter missing in the mid. Here
is a stack trace.
```
Caused by: java.lang.NullPointerException
at
org.apache.druid.sql.calcite.planner.SqlParameterizerShuttle.visit(SqlParameterizerShuttle.java:54)
at
org.apache.druid.sql.calcite.planner.SqlParameterizerShuttle.visit(SqlParameterizerShuttle.java:39)
at
org.apache.calcite.sql.SqlDynamicParam.accept(SqlDynamicParam.java:76)
```
This PR adds a null check for parameters and returns a more user-friendly
error message.
<hr>
<!-- Check the items by putting "x" in the brackets for the done things. Not
all of these items apply to every PR. Remove the items which are not done or
not relevant to the PR. None of the items from the checklist below are strictly
necessary, but it would be very helpful if you at least self-review the PR. -->
This PR has:
- [x] been self-reviewed.
- [x] added comments explaining the "why" and the intent of the code
wherever would not be obvious for an unfamiliar reader.
- [x] added unit tests or modified existing tests to cover new code paths,
ensuring the threshold for [code
coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md)
is met.
- [x] added integration tests.
--
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]