[
https://issues.apache.org/jira/browse/CALCITE-3144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16876495#comment-16876495
]
Gian Merlino commented on CALCITE-3144:
---------------------------------------
> Gian Merlino, Do you recall the reason for this line? I don't think it's
> necessary, because I think the rewrite is valid even if there are GROUPING
> SETS etc.
I don't recall, but, Druid doesn't currently support GROUPING SETS so the
thought process may have been "well, let's not worry about whether or not this
is valid for GROUPING SETS or not".
> Add rule, CaseFilteredAggregatorRule, that converts "SUM(CASE WHEN b THEN x
> END)" to "SUM(x) FILTER (WHERE b)"
> --------------------------------------------------------------------------------------------------------------
>
> Key: CALCITE-3144
> URL: https://issues.apache.org/jira/browse/CALCITE-3144
> Project: Calcite
> Issue Type: Bug
> Reporter: Julian Hyde
> Assignee: Julian Hyde
> Priority: Major
>
> 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.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)