Github user srowen commented on the pull request:

    https://github.com/apache/spark/pull/9655#issuecomment-156159712
  
    It's possible that the differing usages are intentional. Calling `reduce` 
makes sense for a truly commutative operation; calling `reduceLeft` suggests 
that the operation is not commutative and so an order must be specified.
    
    So, I don't think in general you would _always_ call `reduce` _or_ 
`reduceLeft|Right`. There are usages for both. Therefore I don't think most of 
these changes are in the right direction as you're changing things like 
`reduce(_ || _)` to `reduceLeft(_ || _)`. It actually precludes the 
implementation from doing it in an optimal or parallel order (though it won't, 
in practice, in Scala). 
    
    (As an aside I suppose that particular first example is an instance of 
pointlessly verbose Scala -- `f.map(...).reduce(_ || _)` is just 
`f.exists(...)` but don't fix it.)
    
    Can you find examples where `reduceLeft` is called but `reduce` is 
appropriate? _that_ could be a useful standardization.


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

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to