Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
Add a rule that converts "SUM(CASE WHEN b THEN x END)" to "SUM(x) FILTER (WHERE b)".
Druid added CaseFilteredAggregatorRule in https://github.com/apache/incubator-druid/pull/4360.
Maybe AggregateCaseToFilterRule is a slightly better name. Or maybe this transform could be done in RelBuilder.aggregate, and we wouldn't need a rule.