You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Shuo Cheng (Jira)" <ji...@apache.org> on 2020/01/03 06:23:00 UTC

[jira] [Created] (FLINK-15466) `FlinkAggregateExpandDistinctAggregatesRule` generates wrong plan for cases that have distinct aggs with filter.

Shuo Cheng created FLINK-15466:
----------------------------------

             Summary: `FlinkAggregateExpandDistinctAggregatesRule` generates wrong plan for cases that have distinct aggs with filter.
                 Key: FLINK-15466
                 URL: https://issues.apache.org/jira/browse/FLINK-15466
             Project: Flink
          Issue Type: Bug
          Components: Table SQL / Planner
    Affects Versions: 1.9.1, 1.9.0, 1.8.3
            Reporter: Shuo Cheng
             Fix For: 1.10.0
         Attachments: image-2020-01-03-14-20-54-887.png

For the sql in batch mode,

 
{code:java}
SELECT 
   a, COUNT(a), SUM(DISTINCT b) FILTER (WHERE a > 0)
FROM MyTable 
GROUP BY a{code}
 

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

!image-2020-01-03-14-20-54-887.png!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)