[
https://issues.apache.org/jira/browse/CALCITE-5425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17726309#comment-17726309
]
Julian Hyde commented on CALCITE-5425:
--------------------------------------
Recently I have been trying not to put significant functionality in {{create}}
methods, because it is not easy to share logic with sub-classes (e.g.
{{Values}}, {{LogicalValues}}, {{EnumerableValues}}). It's more reusable to put
the logic in {{RelBuilder}}, then have {{RelBuilder}} call the factory for the
particular kind of {{RelNode}}.
Obviously this logic can also go in planner rules. But if the logic is "no
brainer" (i.e. beneficial under all conceivable cost models) and/or simplifying
(reduces the number of {{RelNode}} and {{RexNode}} objects created) then I
would tend to add it to {{RelBuilder}} so that we get benefits across the board.
> Should not pushdown filter through aggregate with an empty groupset
> -------------------------------------------------------------------
>
> Key: CALCITE-5425
> URL: https://issues.apache.org/jira/browse/CALCITE-5425
> Project: Calcite
> Issue Type: Bug
> Components: core
> Reporter: Steve Carlin
> Assignee: Dan Zou
> Priority: Major
>
> If we are given a query
> SELECT count(x) FROM tbl HAVING false;
> This query should produce an empty set.
> We should not allow a filter to pass through this aggregate. When the
> aggregate has no group by, there is always one implied group (for the whole
> dataset). So if we apply the filter before the aggregate, the implied group
> will still be created. This is not what we want, since the filter should
> produce an empty set.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)