sunjincheng121 commented on a change in pull request #8359:
[FLINK-11051][table] Add streaming window FlatAggregate to Table API
URL: https://github.com/apache/flink/pull/8359#discussion_r282789770
##########
File path:
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/plan/TableOperationConverter.java
##########
@@ -151,21 +151,24 @@ public RelNode visitAggregate(AggregateTableOperation
aggregate) {
List<RexNode> groupings =
convertToRexNodes(aggregate.getGroupingExpressions());
GroupKey groupKey = relBuilder.groupKey(groupings);
-
- if (isTableAggregate) {
- return ((FlinkRelBuilder)
relBuilder).tableAggregate(groupKey, aggregations).build();
- } else {
- return relBuilder.aggregate(groupKey,
aggregations).build();
- }
+ return ((FlinkRelBuilder)
relBuilder).aggregate(groupKey, aggregations, isTableAggregate).build();
}
@Override
public RelNode
visitWindowAggregate(WindowAggregateTableOperation windowAggregate) {
+ boolean isTableAggregate =
windowAggregate.getAggregateExpressions().size() == 1 &&
+
AggregateOperationFactory.isTableAggFunctionCall(windowAggregate.getAggregateExpressions().get(0));
+
FlinkRelBuilder flinkRelBuilder = (FlinkRelBuilder)
relBuilder;
List<AggCall> aggregations =
windowAggregate.getAggregateExpressions()
.stream()
- .map(expr -> expr.accept(aggregateVisitor))
- .collect(toList());
+ .map(expr -> {
+ if (isTableAggregate) {
Review comment:
if(isTableAggFunctionCall(expr)){...} ?
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services