-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
MV_CONTAINS function throwing NullPointerException #17440
Comments
The issue persists in the latest version, |
Oops, just noticed this issue, sorry for the delayed response. fwiw a better way to write this query is
since Also a side-note, the Anyway, the reason the query is failing in this form is because of an optimization for This can be fixed by modifying https://github.com/apache/druid/blob/master/processing/src/main/java/org/apache/druid/math/expr/Function.java#L3977 to instead be something like
where it fixes the issue because it bails out of the optimization path early and so falls back to the per row checking of type information to decide how to processing the function. @vivek807 if you'd like to make a PR with that change and add a test for this to https://github.com/apache/druid/blob/master/processing/src/test/java/org/apache/druid/query/expression/NestedDataExpressionsTest.java#L394 I would be happy to approve it, else I can make a PR with a fix later this week. We also need to do |
Thanks, @clintropolis, for the detailed explanation. I’ve implemented the fix and updated the unit tests as well. Please review. |
Please provide a detailed title (e.g. "Broker crashes when using TopN query with Bound filter" instead of just "Broker crashes").
Affected Version
Druid 30.0.0
Description
There is a task wherein we need to upgrade Druid from 29.0.0 to 30.0.0 and some SQL queries started to break.
Before the upgrade, the following SQL query worked. However, in Druid 30.0.0, this throws an NullPointerException.
To verify this, we tested using the sample data from Druid docs and used the function and error still persisted.
v29.0.0 - the query/function still works
v30.0.0 - query fails (throws NullPointerException)
Source data used:
curl -O https://static.imply.io/example-data/kttm-nested-v2/kttm-nested-v2-2019-08-25.json.gz
Query used:
The text was updated successfully, but these errors were encountered: