[ 
https://issues.apache.org/jira/browse/FLINK-1023?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14078139#comment-14078139
 ] 

ASF GitHub Bot commented on FLINK-1023:
---------------------------------------

Github user StephanEwen commented on the pull request:

    https://github.com/apache/incubator-flink/pull/84#issuecomment-50518588
  
    Throwing an error for a second `iterator()` call would be possible, but 
quite some change.
    
    For example in CoGroup, I use the simply `Collections.emptySet()` as the 
Iterable for empty sides. The `KeyGroupedIterable` for the reduce function also 
simply returns itself as the iterator, which means the original lightweight 
grouping logic can stay the same.
     
    Also, the some of old internal tests (Record-based) make use of the 
possibility to mix the *Iterable* and the *Iterator*. I could change that, if 
needed.
    
    We could make this change, but I would like to hear some opinion on whether 
this is actually more a confusing trap ("Why the heck do I get an empty set the 
second time I iterate over the input"), or whether this is actually understood 
that these inputs are what Scala calls a *TraversableOnce*


> Provide Iterable instead of Iterator to grouped functions
> ---------------------------------------------------------
>
>                 Key: FLINK-1023
>                 URL: https://issues.apache.org/jira/browse/FLINK-1023
>             Project: Flink
>          Issue Type: Wish
>          Components: Java API
>            Reporter: Ufuk Celebi
>            Priority: Trivial
>              Labels: breaking-api
>
> I would like the grouped functions to provide an Iterable instead of an 
> Iterator to the user, e.g. for the {{reduce}} method of 
> {{GroupReduceFunction}}.
> We had a discussion about this previously (I couldn't find the respective 
> issues/list threads right now) and the result was in favor of the change.
> We never got around to really push for it, because of the API break. With the 
> renaming, it should be less of an issue.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to