Github user HeartSaVioR commented on a diff in the pull request:

    https://github.com/apache/storm/pull/1706#discussion_r80184767
  
    --- 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 --
    
    One missed spot is that it should do nothing if n is 0. Now if n is 0, it 
will behave same as top 1. n should be greater than 0 anyway but we can do some 
defensive programming.
    Other then that it looks good.


---
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.
---

Reply via email to