Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-777

IS NOT NULL filter is incorrectly dropped for aggregates and window functions

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 1.3.0-incubating
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      The below plans show the IS NOT NULL filter is incorrectly dropped.

      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]])
      
      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]])
      

        Attachments

          Activity

            People

            • Assignee:
              amansinha100 Aman Sinha
              Reporter:
              amansinha100 Aman Sinha
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: