You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/07/14 15:17:21 UTC

[GitHub] [doris] jackwener opened a new pull request, #10870: [feature](Nereids): hashCode(), equals() and UT.

jackwener opened a new pull request, #10870:
URL: https://github.com/apache/doris/pull/10870

   # Proposed changes
   
   Issue Number: close #xxx
   
   ## Problem Summary:
   
   Add hashCode(), equals() for operator.
   
   Add basic UT for them(need more detail test).
   
   ## Checklist(Required)
   
   1. Does it affect the original behavior: no
   2. Has unit tests been added: no need
   3. Has document been added or modified: no need
   4. Does it need to update dependencies: no
   5. Are there any changes that cannot be rolled back: no
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] github-actions[bot] commented on pull request #10870: [feature](Nereids): hashCode(), equals() and UT.

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #10870:
URL: https://github.com/apache/doris/pull/10870#issuecomment-1186763434

   PR approved by anyone and no changes requested.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] jackwener commented on a diff in pull request #10870: [feature](Nereids): hashCode(), equals() and UT.

Posted by GitBox <gi...@apache.org>.
jackwener commented on code in PR #10870:
URL: https://github.com/apache/doris/pull/10870#discussion_r922788255


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalSort.java:
##########
@@ -84,6 +84,24 @@ public String toString() {
         return "Sort (" + StringUtils.join(orderKeys, ", ") + ")";
     }
 
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+        LogicalSort that = (LogicalSort) o;
+        return offset == that.offset && Objects.equals(orderKeys, that.orderKeys);

Review Comment:
   Yes, But we can do it in another PR (support limit operator)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] github-actions[bot] commented on pull request #10870: [feature](Nereids): hashCode(), equals() and UT.

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #10870:
URL: https://github.com/apache/doris/pull/10870#issuecomment-1186763412

   PR approved by at least one committer and no changes requested.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] github-actions[bot] commented on pull request #10870: [feature](Nereids): hashCode(), equals() and UT.

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #10870:
URL: https://github.com/apache/doris/pull/10870#issuecomment-1187292969

   PR approved by at least one committer and no changes requested.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] morrySnow commented on a diff in pull request #10870: [feature](Nereids): hashCode(), equals() and UT.

Posted by GitBox <gi...@apache.org>.
morrySnow commented on code in PR #10870:
URL: https://github.com/apache/doris/pull/10870#discussion_r921329106


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalAggregate.java:
##########
@@ -163,7 +163,7 @@ public boolean equals(Object o) {
 
     @Override
     public int hashCode() {
-        return Objects.hash(groupByExpressionList, outputExpressionList, partitionExprList, aggPhase);
+        return Objects.hash(super.hashCode(), groupByExpressionList, outputExpressionList, partitionExprList, aggPhase);

Review Comment:
   why need super ?



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/physical/PhysicalHeapSort.java:
##########
@@ -71,6 +72,23 @@ public boolean hasLimit() {
         return limit > -1;
     }
 
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+        PhysicalHeapSort that = (PhysicalHeapSort) o;
+        return offset == that.offset && Objects.equals(orderKeys, that.orderKeys);

Review Comment:
   limit?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] EmmyMiao87 merged pull request #10870: [feature](Nereids): hashCode(), equals() to Plan

Posted by GitBox <gi...@apache.org>.
EmmyMiao87 merged PR #10870:
URL: https://github.com/apache/doris/pull/10870


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] 924060929 commented on a diff in pull request #10870: [feature](Nereids): hashCode(), equals() and UT.

Posted by GitBox <gi...@apache.org>.
924060929 commented on code in PR #10870:
URL: https://github.com/apache/doris/pull/10870#discussion_r922612190


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalSort.java:
##########
@@ -84,6 +84,24 @@ public String toString() {
         return "Sort (" + StringUtils.join(orderKeys, ", ") + ")";
     }
 
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+        LogicalSort that = (LogicalSort) o;
+        return offset == that.offset && Objects.equals(orderKeys, that.orderKeys);

Review Comment:
   we should remove all limit/offset from AbstractPlan/Plan, and provide a Limit plan



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] morrySnow commented on a diff in pull request #10870: [feature](Nereids): hashCode(), equals() and UT.

Posted by GitBox <gi...@apache.org>.
morrySnow commented on code in PR #10870:
URL: https://github.com/apache/doris/pull/10870#discussion_r921885889


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/physical/PhysicalHeapSort.java:
##########
@@ -71,6 +72,23 @@ public boolean hasLimit() {
         return limit > -1;
     }
 
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+        PhysicalHeapSort that = (PhysicalHeapSort) o;
+        return offset == that.offset && limit == that.limit && Objects.equals(orderKeys, that.orderKeys);

Review Comment:
   we need to discuss later, should we split PhysicalHeapSort to PhysicalHeapSort and PhysicalTopN



##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/logical/LogicalSort.java:
##########
@@ -84,6 +84,24 @@ public String toString() {
         return "Sort (" + StringUtils.join(orderKeys, ", ") + ")";
     }
 
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+        LogicalSort that = (LogicalSort) o;
+        return offset == that.offset && Objects.equals(orderKeys, that.orderKeys);

Review Comment:
   logical sort has no limit, should we remove offset?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org