julianhyde edited a comment on issue #7953: Exact distinct-COUNT with complex expression (CASE, IN) throws NullPointerException URL: https://github.com/apache/incubator-druid/issues/7953#issuecomment-507523316 I tried to fix this in Calcite. I needed to modify the "A1" case in the rule to exclude the `GROUPING` and `GROUP_ID` aggregate functions: ``` } else if ((RexLiteral.isNullLiteral(arg2) /* Case A1 */ && aggregateCall.getAggregation().getKind() != SqlKind.GROUPING && aggregateCall.getAggregation().getKind() != SqlKind.GROUP_ID) || (aggregateCall.getAggregation().getKind() == SqlKind.SUM && isIntLiteral(arg2) && RexLiteral.intValue(arg2) == 0) /* Case A2 */) { ``` These are generated by `AggregateExpandDistinctAggregatesRule`.
---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
