yashmayya opened a new pull request, #17386:
URL: https://github.com/apache/pinot/pull/17386
```
java.lang.NullPointerException: Cannot invoke "java.lang.Integer.intValue()"
because "java.util.List.get(int)[filterArgId]" is null
at
org.apache.pinot.query.runtime.operator.AggregateOperator.getMatchedBitmap(AggregateOperator.java:352)
at
org.apache.pinot.query.runtime.operator.MultistageGroupByExecutor.processAggregateWithFilter(MultistageGroupByExecutor.java:347)
at
org.apache.pinot.query.runtime.operator.MultistageGroupByExecutor.processAggregate(MultistageGroupByExecutor.java:316)
at
org.apache.pinot.query.runtime.operator.MultistageGroupByExecutor.processBlock(MultistageGroupByExecutor.java:186)
at
org.apache.pinot.query.runtime.operator.AggregateOperator.consumeGroupBy(AggregateOperator.java:270)
at
org.apache.pinot.query.runtime.operator.AggregateOperator.getNextBlock(AggregateOperator.java:205)
at
org.apache.pinot.query.runtime.operator.MultiStageOperator.nextBlock(MultiStageOperator.java:121)
at
org.apache.pinot.query.runtime.operator.MailboxSendOperator.getNextBlock(MailboxSendOperator.java:209)
at
org.apache.pinot.query.runtime.operator.MultiStageOperator.nextBlock(MultiStageOperator.java:121)
at
org.apache.pinot.query.runtime.executor.OpChainSchedulerService$1.runJob(OpChainSchedulerService.java:131)
```
- This is an edge case issue because Calcite usually inserts an `IS_TRUE`
filter on top of the filtered aggregate here -
https://github.com/apache/calcite/blob/f19e854c39e5a43aea2323e455229bd8dfc6dcdb/core/src/main/java/org/apache/calcite/tools/RelBuilder.java#L4533-L4535.
`IS_TRUE` returns `false` for `null` values.
- However, if a column has actual null values and query time null handling
is enabled using `enableNullHandling`, but the column is not marked as nullable
in the schema (see
https://docs.pinot.apache.org/developers/advanced/null-value-support#column-based-null-storing),
then the Calcite type is inferred as non-nullable and the `IS_TRUE` filter
isn't inserted on top. So the filter in the filtered aggregate can generate
actual null values which would then trigger the above NPE.
- This patch adds an additional guardrail to protect against such NPEs. The
serialized block path doesn't need any changes because it will only ever return
null value placeholders (`false` / `0` for boolean) and not actual nulls.
--
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]