You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (JIRA)" <ji...@apache.org> on 2019/06/24 18:41:00 UTC

[jira] [Created] (CALCITE-3144) Add rule, CaseFilteredAggregatorRule, that converts "SUM(CASE WHEN b THEN x END)" to "SUM(x) FILTER (WHERE b)"

Julian Hyde created CALCITE-3144:
------------------------------------

             Summary: 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


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)