flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggevay <...@git.apache.org>
Subject [GitHub] flink pull request #1517: [FLINK-3477] [runtime] Add hash-based combine stra...
Date Sun, 19 Jun 2016 12:13:53 GMT
Github user ggevay commented on a diff in the pull request:

    https://github.com/apache/flink/pull/1517#discussion_r67615885
  
    --- Diff: flink-scala/src/main/scala/org/apache/flink/api/scala/GroupedDataSet.scala ---
    @@ -282,27 +283,57 @@ class GroupedDataSet[T: ClassTag](
       }
     
       /**
    -   * Creates a new [[DataSet]] by merging the elements of each group (elements with the
same key)
    -   * using an associative reduce function.
    -   */
    +    * Creates a new [[DataSet]] by merging the elements of each group (elements with
the same key)
    +    * using an associative reduce function.
    +    */
       def reduce(fun: (T, T) => T): DataSet[T] = {
    +    reduce(getCallLocationName(), fun, CombineHint.OPTIMIZER_CHOOSES)
    +  }
    +
    +  /**
    +   * Special [[reduce]] operation for explicitly telling the system what strategy to
use for the
    +   * combine phase.
    +   * If null is given as the strategy, then the optimizer will pick the strategy.
    +   */
    +  def reduce(fun: (T, T) => T, strategy: CombineHint): DataSet[T] = {
    --- End diff --
    
    Unfortunately this doesn't seem to work either: japicmp is complaining [1] that the return
type of `DataSet.reduce` has changed (to the newly created `ReduceOperator` scala class),
which breaks binary compatibility [2]. I'm out of any better ideas than to just go back to
adding overloads that take the `CombineHint` as an additional parameter.
    
    [1] http://compalg.inf.elte.hu/~ggevay/japicmp.diff
    [2] https://docs.oracle.com/javase/specs/jls/se7/html/jls-13.html#jls-13.4.15


---
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