Github user fhueske commented on a diff in the pull request: https://github.com/apache/flink/pull/1553#discussion_r55205361 --- Diff: flink-optimizer/src/main/java/org/apache/flink/optimizer/operators/GroupReduceWithCombineProperties.java --- @@ -126,12 +117,66 @@ public SingleInputPlanNode instantiate(Channel in, SingleInputNode node) { } toReducer.setLocalStrategy(LocalStrategy.COMBININGSORT, in.getLocalStrategyKeys(), in.getLocalStrategySortOrder()); - return new SingleInputPlanNode(node, "Reduce ("+node.getOperator().getName()+")", toReducer, DriverStrategy.SORTED_GROUP_REDUCE, this.keyList); } } + private SingleInputPlanNode injectCombinerBeforPartitioner(Channel in, SingleInputNode node) { + // Inject a combiner before the partition node + Channel channelWithPartitionSrc = new Channel(in.getSource()); + GroupReduceNode combinerNode = ((GroupReduceNode) node).getCombinerUtilityNode(); + combinerNode.setParallelism(in.getSource().getParallelism()); + if(in.getSource().getInputs().iterator().hasNext()) { + Channel oldChannelToPartitioner = channelWithPartitionSrc.getSource().getInputs().iterator().next(); + Channel toCombiner = new Channel(oldChannelToPartitioner.getSource()); + // A combiner plan node is created with the channel as input that has the partitioner as the target + toCombiner.setShipStrategy(ShipStrategyType.FORWARD, DataExchangeMode.PIPELINED); + SingleInputPlanNode combiner = new SingleInputPlanNode(combinerNode, "Combine("+node.getOperator() --- End diff -- Indention is off
--- 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. ---