public GroupReduceWithCombineProperties( FieldSet groupKeys, Ordering additionalOrderKeys, Partitioner<?> customPartitioner) { super(groupKeys); // if we have an additional ordering, construct the ordering to have primarily the grouping // fields if (additionalOrderKeys != null) { this.ordering = new Ordering(); for (Integer key : this.keyList) { this.ordering.appendOrdering(key, null, Order.ANY); } // and next the additional order fields for (int i = 0; i < additionalOrderKeys.getNumberOfFields(); i++) { Integer field = additionalOrderKeys.getFieldNumber(i); Order order = additionalOrderKeys.getOrder(i); this.ordering.appendOrdering(field, additionalOrderKeys.getType(i), order); } } else { this.ordering = null; } this.customPartitioner = customPartitioner; }