Github user arunmahadevan commented on the pull request:

    https://github.com/apache/storm/pull/1061#issuecomment-179827493
  
    Haven't gone through the implementation details yet, but from the api
    
    `public <T> Stream max(String inputFieldName, String outputFieldName, 
Comparator<T> comparator)`
    
    it looks like the comparison is based on a single field and the trident 
tuples itself are not compared.
    
    Since we are dealing with a stream of `TridentTuple`, can we have an api 
that just takes a `Comparator<TridentTuple>`  (similar to the Java8 
[min/max](https://docs.oracle.com/javase/8/docs/api/java/util/stream/Stream.html#max-java.util.Comparator-))
 and passes the entire tuple in the compareTo? The comparison can then be based 
on one or more fields as users wish and the max tuple is finally emitted. 
    
    `Stream max(Comparator<TridentTuple> comparator)`
    
    With this api user need not care about the input or output fields but only 
the values.



---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to