Github user fhueske commented on a diff in the pull request:
https://github.com/apache/flink/pull/1746#discussion_r54544027
--- Diff:
flink-libraries/flink-table/src/main/scala/org/apache/flink/api/table/plan/rules/dataset/DataSetAggregateRule.scala
---
@@ -44,17 +45,24 @@ class DataSetAggregateRule
val inputType = agg.getInput.getRowType()
// add grouping fields, position keys in the input, and input type
- val aggregateFunction =
AggregateFactory.createAggregateInstance(agg.getAggCallList,
- inputType, grouping)
+ val aggregateResult =
AggregateUtil.createOperatorFunctionsForAggregates(agg,
+ inputType, rel.getRowType, grouping)
+
+ val mapNode = new DataSetMap(rel.getCluster,
+ traitSet,
+ convInput,
+ aggregateResult.intermediateDataType,
+ agg.toString,
+ aggregateResult.mapFunc)
new DataSetGroupReduce(
rel.getCluster,
traitSet,
- convInput,
+ mapNode,
rel.getRowType,
agg.toString,
- grouping,
- aggregateFunction)
+ (0 until grouping.length).toArray,
+ aggregateResult.reduceGroupFunc)
--- End diff --
Can we also update the `DataSetGroupReduce` to accept a function that
generates the `GroupReduceFunction` instead of the `GroupReduceFunction` itself?
---
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 [email protected] or file a JIRA ticket
with INFRA.
---