flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fhueske <...@git.apache.org>
Subject [GitHub] incubator-flink pull request: [FLINK-1112] Add KeySelector group s...
Date Mon, 01 Dec 2014 15:27:46 GMT
Github user fhueske commented on a diff in the pull request:

    https://github.com/apache/incubator-flink/pull/209#discussion_r21094766
  
    --- Diff: flink-java/src/main/java/org/apache/flink/api/java/operators/SortedGrouping.java
---
    @@ -83,6 +84,30 @@ public SortedGrouping(DataSet<T> set, Keys<T> keys, String
field, Order order) {
     		this.groupSortOrders = new Order[groupSortKeyPositions.length];
     		Arrays.fill(this.groupSortOrders, order); // if field == "*"
     	}
    +
    +	/*
    +	 * KeySelector sorting for Pojos and tuples
    +	 */
    +	public <K> SortedGrouping(DataSet<T> set, Keys<T> keys, Keys.SelectorFunctionKeys<T,
K> keySelector, Order order) {
    +		super(set, keys);
    +
    +		if (!(this.keys instanceof Keys.SelectorFunctionKeys)) {
    +			throw new InvalidProgramException("Sorting on KeySelector only works for KeySelector
grouping.");
    +		}
    +
    +		if (!(dataSet.getType() instanceof CompositeType)) {
    --- End diff --
    
    I don't think we need this restriction.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message