You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Aman Sinha (JIRA)" <ji...@apache.org> on 2016/03/16 03:05:33 UTC

[jira] [Commented] (CALCITE-777) IS NOT NULL filter is incorrectly dropped for aggregates and window functions

    [ https://issues.apache.org/jira/browse/CALCITE-777?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15196619#comment-15196619 ] 

Aman Sinha commented on CALCITE-777:
------------------------------------

I investigated this more and I believe this is no longer an issue.  It seems to me that some nullability related fixes in Calcite may have resolved a wrong result issue that I was seeing in Drill.  I also realize that my examples above were operating on non-nullable 'sal' column from emp table, so the dropping of IS NOT NULL filter is actually expected for such queries since it would always be TRUE.  To confirm that, I replaced emp.sal with emp.mgr (nullable) column in the above queries and saw that the IS NOT NULL filter was preserved. 

> IS NOT NULL filter is incorrectly dropped for aggregates and window functions
> -----------------------------------------------------------------------------
>
>                 Key: CALCITE-777
>                 URL: https://issues.apache.org/jira/browse/CALCITE-777
>             Project: Calcite
>          Issue Type: Bug
>    Affects Versions: 1.3.0-incubating
>            Reporter: Aman Sinha
>            Assignee: Aman Sinha
>
> The below plans show the IS NOT NULL filter is incorrectly dropped.  
> {code}
> select wsum from (select sum(sal) over (partition by deptno) as wsum from emp) where wsum is not null;
> LogicalProject(WSUM=[$0])
>   LogicalProject(WSUM=[SUM($5) OVER (PARTITION BY $7 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)])
>     LogicalTableScan(table=[[CATALOG, SALES, EMP]])
> {code}
> {code}
> select wsum from (select sum(sal) as wsum from emp group by deptno) where wsum is not null;
> LogicalProject(WSUM=[$0])
>   LogicalProject(WSUM=[$1])
>     LogicalAggregate(group=[{0}], WSUM=[SUM($1)])
>       LogicalProject(DEPTNO=[$7], SAL=[$5])
>         LogicalTableScan(table=[[CATALOG, SALES, EMP]])
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)