How do I get only the first 100 records from a SOW query?

AMPS provides a top_n 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, top_n 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

Last updated