Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-15466

`FlinkAggregateExpandDistinctAggregatesRule` generates wrong plan for cases that have distinct aggs with filter.

    XMLWordPrintableJSON

Details

    Description

      For the sql in batch mode,

       

      SELECT 
         a, COUNT(a), SUM(DISTINCT b) FILTER (WHERE a > 0)
      FROM MyTable 
      GROUP BY a

       

      plan generated after logical stage is as following, which is not correct. The `Filter $4` should be `$f2 and $g_0`.

      Attachments

        Issue Links

          Activity

            People

              icshuo Shuo Cheng
              icshuo Shuo Cheng
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m