[
https://issues.apache.org/jira/browse/CALCITE-3764?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Julian Hyde resolved CALCITE-3764.
----------------------------------
Resolution: Fixed
Fixed in
[13728c03|https://github.com/apache/calcite/commit/13728c0320dcd2e042e775dcc19b615df5c4a614].
> AggregateCaseToFilterRule handles NULL values correctly
> -------------------------------------------------------
>
> Key: CALCITE-3764
> URL: https://issues.apache.org/jira/browse/CALCITE-3764
> Project: Calcite
> Issue Type: Bug
> Reporter: Julian Hyde
> Assignee: Julian Hyde
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.22.0
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> {{AggregateCaseToFilterRule}} handles NULL values correctly. It converts
> {code:sql}
> SELECT COUNT(CASE WHEN b THEN NULL ELSE 1 END) FROM t
> {code}
> to
> {code:sql}
> SELECT COUNT(*) FILTER (WHERE b IS FALSE) FROM t
> {code}
> which fails to count rows where {{b}} is UNKNOWN, so it should convert to
> {code:sql}
> SELECT COUNT(*) FILTER (WHERE b IS NOT TRUE) FROM t
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)