As of 4.0, AMPS provides a TopN option on SOW queries that returns only a specific number of results. Because SOW queries don't return records in any specific order by default, TopN is often most useful with the OrderBy option to return records in a specific order.
To use these options, you provide them with the command that runs the SOW query. For example, the command line below shows a SOW query using
spark that requests the top 100 records, in ascending order by the
/agent field of record.
./spark sow -proto amps -server localhost:9007 \
-topic sow-test -orderby /agent -topn 100