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

    https://github.com/apache/tajo/pull/454#discussion_r28210054
  
    --- Diff: 
tajo-algebra/src/main/java/org/apache/tajo/algebra/WindowSpec.java ---
    @@ -128,12 +128,14 @@ public boolean equals(Object obj) {
       public static enum WindowFrameStartBoundType {
         UNBOUNDED_PRECEDING,
         CURRENT_ROW,
    -    PRECEDING
    +    PRECEDING,
    +    FOLLOWING
       }
    --- End diff --
    
    I don't think only one rule is enough because start bound type and end 
bound type can be the same. 
    For example, we can use ```rows between current row and current row``` as 
followings
    ```
    mydb=# select id, max(value) over (partition by id rows between current row 
and current row) from test3;
     id | max 
    ----+-----
      1 |   1
      1 |   2
      2 |   5
      2 |   6
      2 |   7
    (5 rows)
    ```
    So, actually there are two rules.
    1) end bound cannot precede the start bound, but can be the same as the 
start bound
    2) UNBOUNDED PRECEDING cannot be an end bound and UNBOUNDED FOLLOWING 
cannot be a start bound
    
    However, I totally agree with you that the code becomes much simpler if we 
use the unified bound type. So, I'll try to unify the bound type.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to