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/19 11:51:29 UTC

[GitHub] [doris] jackwener commented on a diff in pull request #10882: [enhancement](Nereids)expression equals and hashCode function

jackwener commented on code in PR #10882:
URL: https://github.com/apache/doris/pull/10882#discussion_r924400463


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/analyzer/UnboundFunction.java:
##########
@@ -77,4 +77,24 @@ public <R, C> R accept(ExpressionVisitor<R, C> visitor, C context) {
     public Expression withChildren(List<Expression> children) {
         return new UnboundFunction(name, isDistinct, children);
     }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+        if (!super.equals(o)) {
+            return false;
+        }
+        UnboundFunction that = (UnboundFunction) o;
+        return isDistinct == that.isDistinct && name.equals(that.name);

Review Comment:
   I'm not sure whether `equals` of `Expression` should use children `equals()`.
   
   `Equal (1, 2)` not equals to ``Equal(1, 3)`. 



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