Github user arunmahadevan commented on a diff in the pull request: https://github.com/apache/storm/pull/1706#discussion_r80185268 --- Diff: external/sql/storm-sql-runtime/src/test/org/apache/storm/sql/TestUtils.java --- @@ -60,6 +62,25 @@ public static String result(String accumulator) { } + public static class TopN { + public static PriorityQueue<Integer> init() { + return new PriorityQueue<>(); + } + public static PriorityQueue<Integer> add(PriorityQueue<Integer> accumulator, Integer n, Integer val) { + if (accumulator.size() >= n) { --- End diff -- yes, it will throw NPE if n is 0, since it tries to peek from empty queue. will address this.
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---