See how First works for an idea. I keep forgetting to create a TopN like Aggregator, I'll push it up the list..
ckw
> --
> You received this message because you are subscribed to the Google Groups "cascading-user" group.
> To post to this group, send email to cascadi...@googlegroups.com.
> To unsubscribe from this group, send email to cascading-use...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/cascading-user?hl=en.
>
--
Chris K Wensel
ch...@concurrentinc.com
http://concurrentinc.com
public class TopN extends BaseOperation implements Buffer {
private long maxResults;
public TopN(long maxResults) {
super(Fields.ARGS);
this.maxResults = maxResults;
}
public void operate(FlowProcess flowProcess, BufferCall bufferCall) {
long count = 0;
Iterator<TupleEntry> arguments = bufferCall.getArgumentsIterator();
while (arguments.hasNext() && count < maxResults) {
bufferCall.getOutputCollector().add(arguments.next());
count++;
Thank you for your info. However, it does not seem to work for me.
Or just making a test and running it through a debugger in your IDE to see both the debug output locally and step through your custom aggregator.
ckw
> For more options, visit this group at http://groups.google.com/group/cascading-user?hl=en.
Hi, Ken,
The input and output are mentioned in my first message. My input is
the a pipe and the output is a sub-pipe of top N in term of sum_1 for
each group (ID_1 and ID_2).