Github user fhueske commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3266#discussion_r101014879
  
    --- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/plan/nodes/dataset/DataSetWindowAggregate.scala
 ---
    @@ -294,18 +319,29 @@ class DataSetWindowAggregate(
               namedProperties)
     
             mappedInput.groupBy(groupingKeys: _*)
    -        .sortGroup(rowTimeFieldPos, Order.ASCENDING)
    -        .reduceGroup(groupReduceFunction)
    -        .returns(rowTypeInfo)
    -        .name(aggregateOperatorName)
    -        .asInstanceOf[DataSet[Any]]
    +          .sortGroup(rowTimeFieldPos, Order.ASCENDING)
    +          .reduceGroup(groupReduceFunction)
    +          .returns(rowTypeInfo)
    +          .name(aggregateOperatorName)
    +          .asInstanceOf[DataSet[Any]]
    +
    +      } else {
    +        // non-grouping window
    +        val mapPartitionFunction = 
createDataSetWindowAggregationMapPartitionFunction(
    +          window,
    +          namedAggregates,
    +          inputType,
    +          rowRelDataType,
    +          namedProperties,
    +          isPreMapPartition = false)
    +
    +        mappedInput.sortPartition(rowTimeFieldPos, 
Order.ASCENDING).setParallelism(1)
    +          .mapPartition(mapPartitionFunction).setParallelism(1)
    --- End diff --
    
    I think we can also use `.reduceGroup()` and a `GroupReduceFunction` here. 
Without `groupBy`, the `GroupReduceFunction` will be executed with parallelism 
1.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to