[
https://issues.apache.org/jira/browse/TAJO-774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14034823#comment-14034823
]
ASF GitHub Bot commented on TAJO-774:
-------------------------------------
Github user jihoonson commented on a diff in the pull request:
https://github.com/apache/tajo/pull/13#discussion_r13899528
--- 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);
}
@Override
- boolean equalsTo(Expr expr) {
- WindowSpecExpr another = (WindowSpecExpr) expr;
- return TUtil.checkEquals(windowName, another.windowName) &&
- TUtil.checkEquals(partitionKeys, another.partitionKeys) &&
- TUtil.checkEquals(sortSpecs, another.sortSpecs);
+ public boolean equals(Object obj) {
+ if (obj == this) {
+ return true;
+ }
+
+ if (obj instanceof WindowSpec) {
+ WindowSpec another = (WindowSpec) obj;
+ return TUtil.checkEquals(windowName, another.windowName) &&
+ TUtil.checkEquals(partitionKeys, another.partitionKeys) &&
+ TUtil.checkEquals(sortSpecs, another.sortSpecs);
--- End diff --
windowFrame also should be compared.
> Implement logical plan part and physical executor for window function.
> ----------------------------------------------------------------------
>
> Key: TAJO-774
> URL: https://issues.apache.org/jira/browse/TAJO-774
> Project: Tajo
> Issue Type: Sub-task
> Components: planner/optimizer
> Reporter: Hyunsik Choi
> Assignee: Hyunsik Choi
> Fix For: 0.9.0
>
>
> See the title. The main objective of this issue is to implement the logical
> planning part for window function support.
--
This message was sent by Atlassian JIRA
(v6.2#6252)