This aggregator operation computes the maximum of tuples in a stream by using the given comparator with TridentTuples. @param comparator comparator used in for finding maximum of two tuple values. @return the new stream with this operation.
(Comparator<TridentTuple> comparator)
| 583 | * @return the new stream with this operation. |
| 584 | */ |
| 585 | public Stream max(Comparator<TridentTuple> comparator) { |
| 586 | Aggregator<ComparisonAggregator.State> max = new MaxWithComparator<>(comparator); |
| 587 | return comparableAggregateStream(null, max); |
| 588 | } |
| 589 | |
| 590 | private <T> Stream comparableAggregateStream(String inputFieldName, Aggregator<T> aggregator) { |
| 591 | if (inputFieldName != null) { |