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

    https://github.com/apache/tajo/pull/13#discussion_r14167723
  
    --- Diff: 
tajo-algebra/src/main/java/org/apache/tajo/algebra/WindowSpec.java ---
    @@ -79,17 +76,47 @@ public WindowFrame getWindowFrame() {
         return windowFrame;
       }
     
    +  public Object clone() throws CloneNotSupportedException {
    +    WindowSpec windowSpec = (WindowSpec) super.clone();
    +    windowSpec.windowName = windowName;
    +    if (hasPartitionBy()) {
    +      windowSpec.partitionKeys = new Expr[windowSpec.partitionKeys.length];
    +      for (int i = 0; i < partitionKeys.length; i++) {
    +        windowSpec.partitionKeys[i] = (Expr) partitionKeys[i].clone();
    +      }
    +    }
    +    if (hasOrderBy()) {
    +      windowSpec.sortSpecs = new Sort.SortSpec[sortSpecs.length];
    +      for (int i = 0; i < sortSpecs.length; i++) {
    +        windowSpec.sortSpecs[i] = (Sort.SortSpec) sortSpecs[i].clone();
    +      }
    +    }
    +    if (hasWindowFrame()) {
    +      windowSpec.windowFrame = (WindowFrame) windowFrame.clone();
    +    }
    +    return windowSpec;
    +  }
    +
       @Override
       public int hashCode() {
         return Objects.hashCode(windowName, partitionKeys, sortSpecs);
    --- End diff --
    
    hasWindowFrame() checks whether windowFrame is null or not.


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