[ https://issues.apache.org/jira/browse/FLINK-12174?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dawid Wysakowicz closed FLINK-12174. ------------------------------------ Resolution: Fixed Fix Version/s: 1.9.0 Implemented in 9d0951ecf2466e7b27e41b2fa894a0979527f07a > Introduce FlinkAggregateExtractProjectRule and remove extractFieldReferences > ---------------------------------------------------------------------------- > > Key: FLINK-12174 > URL: https://issues.apache.org/jira/browse/FLINK-12174 > Project: Flink > Issue Type: Improvement > Components: Table SQL / API > Reporter: Hequn Cheng > Assignee: Hequn Cheng > Priority: Major > Labels: pull-request-available > Fix For: 1.9.0 > > Time Spent: 20m > Remaining Estimate: 0h > > Currently, when parsing Table API expression, an inner project will be added > to projects fields for {{Aggregate}}s. As the code show below: > {code:java} > if (!extracted.getAggregations.isEmpty) { > val projectFields = extractFieldReferences(expressionsWithResolvedCalls) > wrap( > operationTreeBuilder.project(extracted.getProjections, > operationTreeBuilder.aggregate(emptyList[Expression], > extracted.getAggregations, > operationTreeBuilder.project(projectFields, operationTree) > ) > ) > ) > } > {code} > This optimization is not very suited to added here, instead, we can use a > rule to achieve this. The `extractFieldReferences` method can also be removed > if we use a rule which also makes the Expression parsing logic more clear. -- This message was sent by Atlassian JIRA (v7.6.3#76005)