cshuo opened a new pull request #12208: URL: https://github.com/apache/flink/pull/12208
…es wrong plan when there exist distinct agg and simple agg with same filter. ## What is the purpose of the change DecomposeGroupingSetsRule may generates wrong plan when there exist distinct agg and simple agg with same filter, such as the following example: ``` SELECT h, COUNT(1) FILTER(WHERE d > 1), COUNT(DISTINCT e) FILTER(WHERE d > 1) FROM Table5 GROUP BY h ``` ## Brief change log * This PR fix bugs in `DecomposeGroupingSetsRule`. ## Verifying this change This change added tests: * Add integration test in `AggregateITCaseBase` for end-to-end test. * Add unit test in `DistinctAggregateTestBase`. ## Does this pull request potentially affect one of the following parts: - Dependencies (does it add or upgrade a dependency): (no) - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (no) - The serializers: (no) - The runtime per-record code paths (performance sensitive): (no) - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: (no) - The S3 file system connector: (no) ## Documentation - Does this pull request introduce a new feature? (no) ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org