This is an automated email from the ASF dual-hosted git repository. yiguolei pushed a commit to branch branch-2.1 in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.1 by this push: new cd37e98a93c [opt](nereids) cache hash code for expression (#46763) (#46883) cd37e98a93c is described below commit cd37e98a93c29e1c501302ed466608116964dfff Author: 924060929 <lanhuaj...@selectdb.com> AuthorDate: Mon Jan 13 17:48:57 2025 +0800 [opt](nereids) cache hash code for expression (#46763) (#46883) cherry pick from #46763 --- .../org/apache/doris/nereids/analyzer/PlaceholderExpression.java | 4 ++-- .../main/java/org/apache/doris/nereids/analyzer/UnboundFunction.java | 2 +- .../src/main/java/org/apache/doris/nereids/analyzer/UnboundSlot.java | 2 +- .../src/main/java/org/apache/doris/nereids/analyzer/UnboundStar.java | 4 ++-- .../apache/doris/nereids/trees/expressions/AggregateExpression.java | 4 ++-- .../main/java/org/apache/doris/nereids/trees/expressions/Alias.java | 2 +- .../apache/doris/nereids/trees/expressions/ArrayItemReference.java | 2 +- .../main/java/org/apache/doris/nereids/trees/expressions/Cast.java | 4 ++-- .../main/java/org/apache/doris/nereids/trees/expressions/Exists.java | 2 +- .../java/org/apache/doris/nereids/trees/expressions/Expression.java | 5 +++++ .../java/org/apache/doris/nereids/trees/expressions/InPredicate.java | 2 +- .../java/org/apache/doris/nereids/trees/expressions/InSubquery.java | 2 +- .../main/java/org/apache/doris/nereids/trees/expressions/IsNull.java | 2 +- .../main/java/org/apache/doris/nereids/trees/expressions/Not.java | 2 +- .../org/apache/doris/nereids/trees/expressions/OrderExpression.java | 4 ++-- .../java/org/apache/doris/nereids/trees/expressions/Properties.java | 4 ++-- .../org/apache/doris/nereids/trees/expressions/SlotReference.java | 2 +- .../org/apache/doris/nereids/trees/expressions/SubqueryExpr.java | 2 +- .../org/apache/doris/nereids/trees/expressions/UnaryOperator.java | 2 +- .../java/org/apache/doris/nereids/trees/expressions/Variable.java | 4 ++-- .../org/apache/doris/nereids/trees/expressions/VariableDesc.java | 2 +- .../apache/doris/nereids/trees/expressions/VirtualSlotReference.java | 2 +- .../java/org/apache/doris/nereids/trees/expressions/WhenClause.java | 2 +- .../org/apache/doris/nereids/trees/expressions/WindowExpression.java | 2 +- .../java/org/apache/doris/nereids/trees/expressions/WindowFrame.java | 2 +- .../doris/nereids/trees/expressions/functions/BoundFunction.java | 2 +- .../nereids/trees/expressions/functions/agg/AggregateFunction.java | 2 +- .../trees/expressions/functions/agg/NullableAggregateFunction.java | 4 ++-- .../nereids/trees/expressions/functions/window/WindowFunction.java | 2 +- .../org/apache/doris/nereids/trees/expressions/literal/Literal.java | 2 +- .../apache/doris/nereids/trees/expressions/literal/NullLiteral.java | 4 ++-- .../doris/nereids/trees/expressions/literal/StringLikeLiteral.java | 5 ----- .../doris/nereids/trees/expressions/literal/StructLiteral.java | 4 ++-- 33 files changed, 46 insertions(+), 46 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/analyzer/PlaceholderExpression.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/analyzer/PlaceholderExpression.java index 9b2dcde49bd..14ec2534b27 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/analyzer/PlaceholderExpression.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/analyzer/PlaceholderExpression.java @@ -95,7 +95,7 @@ public class PlaceholderExpression extends Expression implements AlwaysNotNullab } @Override - public int hashCode() { - return Objects.hash(super.hashCode(), delegateClazzSet, position); + public int computeHashCode() { + return Objects.hash(super.computeHashCode(), delegateClazzSet, position); } } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/analyzer/UnboundFunction.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/analyzer/UnboundFunction.java index d1d2736914e..085647161c1 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/analyzer/UnboundFunction.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/analyzer/UnboundFunction.java @@ -125,7 +125,7 @@ public class UnboundFunction extends Function implements Unbound, PropagateNulla } @Override - public int hashCode() { + public int computeHashCode() { return Objects.hash(getName(), isDistinct); } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/analyzer/UnboundSlot.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/analyzer/UnboundSlot.java index fdcb9547837..227aefa1c64 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/analyzer/UnboundSlot.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/analyzer/UnboundSlot.java @@ -117,7 +117,7 @@ public class UnboundSlot extends Slot implements Unbound, PropagateNullable { } @Override - public int hashCode() { + public int computeHashCode() { return nameParts.hashCode(); } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/analyzer/UnboundStar.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/analyzer/UnboundStar.java index 0a0c3031f4e..33ea9dafc36 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/analyzer/UnboundStar.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/analyzer/UnboundStar.java @@ -86,8 +86,8 @@ public class UnboundStar extends NamedExpression implements LeafExpression, Unbo } @Override - public int hashCode() { - return Objects.hash(super.hashCode(), qualifier); + public int computeHashCode() { + return Objects.hash(super.computeHashCode(), qualifier); } @Override diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/AggregateExpression.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/AggregateExpression.java index 86d7eb72382..1a2d2765938 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/AggregateExpression.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/AggregateExpression.java @@ -145,8 +145,8 @@ public class AggregateExpression extends Expression implements UnaryExpression { } @Override - public int hashCode() { - return Objects.hash(super.hashCode(), function, aggregateParam, child()); + public int computeHashCode() { + return Objects.hash(super.computeHashCode(), function, aggregateParam, child()); } @Override diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/Alias.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/Alias.java index 53a82011ac4..9ff90b5ac96 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/Alias.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/Alias.java @@ -144,7 +144,7 @@ public class Alias extends NamedExpression implements UnaryExpression { } @Override - public int hashCode() { + public int computeHashCode() { return Objects.hash(exprId, qualifier); } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/ArrayItemReference.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/ArrayItemReference.java index edc074af2b5..eca81d82028 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/ArrayItemReference.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/ArrayItemReference.java @@ -121,7 +121,7 @@ public class ArrayItemReference extends NamedExpression implements ExpectsInputT } @Override - public int hashCode() { + public int computeHashCode() { return Objects.hash(exprId); } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/Cast.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/Cast.java index 20f8079bd9f..c6104777bb5 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/Cast.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/Cast.java @@ -114,7 +114,7 @@ public class Cast extends Expression implements UnaryExpression { } @Override - public int hashCode() { - return Objects.hash(super.hashCode(), targetType); + public int computeHashCode() { + return Objects.hash(super.computeHashCode(), targetType); } } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/Exists.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/Exists.java index 8d097d0faa6..dc5a348bec6 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/Exists.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/Exists.java @@ -94,7 +94,7 @@ public class Exists extends SubqueryExpr { } @Override - public int hashCode() { + public int computeHashCode() { return Objects.hash(this.queryPlan, this.isNot); } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/Expression.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/Expression.java index 27201fd1350..fabf3b8f1ef 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/Expression.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/Expression.java @@ -72,6 +72,7 @@ public abstract class Expression extends AbstractTreeNode<Expression> implements () -> collect(e -> e instanceof Slot && !(e instanceof ArrayItemSlot))); private final int fastChildrenHashCode; private final Supplier<String> toSqlCache = Suppliers.memoize(this::computeToSql); + private final Supplier<Integer> hashCodeCache = Suppliers.memoize(this::computeHashCode); protected Expression(Expression... children) { super(children); @@ -458,6 +459,10 @@ public abstract class Expression extends AbstractTreeNode<Expression> implements @Override public int hashCode() { + return hashCodeCache.get(); + } + + protected int computeHashCode() { return getClass().hashCode() + fastChildrenHashCode(); } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/InPredicate.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/InPredicate.java index 1f022962787..57cc8c73c8b 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/InPredicate.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/InPredicate.java @@ -144,7 +144,7 @@ public class InPredicate extends Expression { } @Override - public int hashCode() { + protected int computeHashCode() { return Objects.hash(compareExpr, options); } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/InSubquery.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/InSubquery.java index 71dc1f5eb4f..89b51e37465 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/InSubquery.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/InSubquery.java @@ -127,7 +127,7 @@ public class InSubquery extends SubqueryExpr { } @Override - public int hashCode() { + public int computeHashCode() { return Objects.hash(this.compareExpr, this.listQuery, this.isNot); } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/IsNull.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/IsNull.java index 22216a84baf..a5ea5fd9495 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/IsNull.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/IsNull.java @@ -74,7 +74,7 @@ public class IsNull extends Expression implements UnaryExpression, AlwaysNotNull } @Override - public int hashCode() { + public int computeHashCode() { return child().hashCode(); } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/Not.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/Not.java index 1d02be64837..653ad9475cd 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/Not.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/Not.java @@ -87,7 +87,7 @@ public class Not extends Expression implements UnaryExpression, ExpectsInputType } @Override - public int hashCode() { + public int computeHashCode() { return Objects.hash(child().hashCode(), isGeneratedIsNotNull); } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/OrderExpression.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/OrderExpression.java index 7e33d4315d8..b0564b70737 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/OrderExpression.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/OrderExpression.java @@ -101,7 +101,7 @@ public class OrderExpression extends Expression implements UnaryExpression, Prop } @Override - public int hashCode() { - return Objects.hash(super.hashCode(), orderKey); + public int computeHashCode() { + return Objects.hash(super.computeHashCode(), orderKey); } } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/Properties.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/Properties.java index d604e919e31..09dc6a5c216 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/Properties.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/Properties.java @@ -85,8 +85,8 @@ public class Properties extends Expression implements LeafExpression { } @Override - public int hashCode() { - return Objects.hash(super.hashCode(), keyValues); + public int computeHashCode() { + return Objects.hash(super.computeHashCode(), keyValues); } @Override diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/SlotReference.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/SlotReference.java index fb7d0a32303..a2914b2af6b 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/SlotReference.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/SlotReference.java @@ -232,7 +232,7 @@ public class SlotReference extends Slot { // The contains method needs to use hashCode, so similar to equals, it only compares exprId @Override - public int hashCode() { + public int computeHashCode() { // direct return exprId to speed up return exprId.asInt(); } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/SubqueryExpr.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/SubqueryExpr.java index c08fda1dc6b..2011aa9607d 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/SubqueryExpr.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/SubqueryExpr.java @@ -128,7 +128,7 @@ public abstract class SubqueryExpr extends Expression implements LeafExpression } @Override - public int hashCode() { + public int computeHashCode() { return Objects.hash(queryPlan, correlateSlots, typeCoercionExpr); } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/UnaryOperator.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/UnaryOperator.java index 61efa91f262..299e00d0dc4 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/UnaryOperator.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/UnaryOperator.java @@ -56,7 +56,7 @@ public abstract class UnaryOperator extends Expression implements UnaryExpressio } @Override - public int hashCode() { + public int computeHashCode() { return Objects.hash(symbol, child()); } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/Variable.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/Variable.java index 5944ec08744..3e753168318 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/Variable.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/Variable.java @@ -112,7 +112,7 @@ public class Variable extends Expression implements LeafExpression { } @Override - public int hashCode() { - return Objects.hash(super.hashCode(), name, type, realExpression); + public int computeHashCode() { + return Objects.hash(super.computeHashCode(), name, type, realExpression); } } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/VariableDesc.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/VariableDesc.java index 3a16b38f9e1..24774afb988 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/VariableDesc.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/VariableDesc.java @@ -70,7 +70,7 @@ public class VariableDesc extends Expression implements LeafExpression { } @Override - public int hashCode() { + public int computeHashCode() { return Objects.hash(isSystemVariable, setType, name); } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/VirtualSlotReference.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/VirtualSlotReference.java index 1b46a8552ba..42be6210459 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/VirtualSlotReference.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/VirtualSlotReference.java @@ -112,7 +112,7 @@ public class VirtualSlotReference extends SlotReference implements SlotNotFromCh } @Override - public int hashCode() { + public int computeHashCode() { return Objects.hash(realExpressions, originExpression, getExprId()); } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/WhenClause.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/WhenClause.java index adb862bb2f1..6e10701faaa 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/WhenClause.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/WhenClause.java @@ -90,7 +90,7 @@ public class WhenClause extends Expression implements BinaryExpression, ExpectsI } @Override - public int hashCode() { + public int computeHashCode() { return Objects.hash(left(), right()); } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/WindowExpression.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/WindowExpression.java index 7f26298c700..7c0f4651a42 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/WindowExpression.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/WindowExpression.java @@ -174,7 +174,7 @@ public class WindowExpression extends Expression { } @Override - public int hashCode() { + public int computeHashCode() { return Objects.hash(function, partitionKeys, orderKeys, windowFrame); } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/WindowFrame.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/WindowFrame.java index 58ed4f15f9b..2c0d7d65b80 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/WindowFrame.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/WindowFrame.java @@ -90,7 +90,7 @@ public class WindowFrame extends Expression implements PropagateNullable, LeafEx } @Override - public int hashCode() { + public int computeHashCode() { return Objects.hash(frameUnits, leftBoundary, rightBoundary); } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/BoundFunction.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/BoundFunction.java index d898ef58700..f5342a3c0db 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/BoundFunction.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/BoundFunction.java @@ -76,7 +76,7 @@ public abstract class BoundFunction extends Function implements ComputeSignature } @Override - public int hashCode() { + public int computeHashCode() { return Objects.hash(getName(), children); } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/AggregateFunction.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/AggregateFunction.java index 777c9c4cc7a..7aa5da02ff3 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/AggregateFunction.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/AggregateFunction.java @@ -92,7 +92,7 @@ public abstract class AggregateFunction extends BoundFunction implements Expects } @Override - public int hashCode() { + public int computeHashCode() { return Objects.hash(distinct, getName(), children); } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/NullableAggregateFunction.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/NullableAggregateFunction.java index 3cad46ef408..55a304ccd37 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/NullableAggregateFunction.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/NullableAggregateFunction.java @@ -90,7 +90,7 @@ public abstract class NullableAggregateFunction extends AggregateFunction implem } @Override - public int hashCode() { - return Objects.hash(super.hashCode(), alwaysNullable); + public int computeHashCode() { + return Objects.hash(super.computeHashCode(), alwaysNullable); } } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/window/WindowFunction.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/window/WindowFunction.java index 57ba66ac5a7..1265f685b26 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/window/WindowFunction.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/window/WindowFunction.java @@ -52,7 +52,7 @@ public abstract class WindowFunction extends BoundFunction implements SupportWin } @Override - public int hashCode() { + public int computeHashCode() { return Objects.hash(getName(), children); } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/Literal.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/Literal.java index 69e61b03c82..bb6bbe62a6c 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/Literal.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/Literal.java @@ -361,7 +361,7 @@ public abstract class Literal extends Expression implements LeafExpression, Comp } @Override - public int hashCode() { + protected int computeHashCode() { return Objects.hashCode(getValue()); } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/NullLiteral.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/NullLiteral.java index 04da5827288..5af08e6d130 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/NullLiteral.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/NullLiteral.java @@ -80,7 +80,7 @@ public class NullLiteral extends Literal { } @Override - public int hashCode() { - return Objects.hash(super.hashCode(), dataType); + protected int computeHashCode() { + return Objects.hash(super.computeHashCode(), dataType); } } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/StringLikeLiteral.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/StringLikeLiteral.java index f5fe33a0ab1..dba9247fe70 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/StringLikeLiteral.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/StringLikeLiteral.java @@ -74,11 +74,6 @@ public abstract class StringLikeLiteral extends Literal { return Objects.equals(value, that.value); } - @Override - public int hashCode() { - return Objects.hash(value); - } - @Override public String toString() { return "'" + value + "'"; diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/StructLiteral.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/StructLiteral.java index f44aa663c9e..c9048f288e7 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/StructLiteral.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/StructLiteral.java @@ -114,8 +114,8 @@ public class StructLiteral extends Literal { } @Override - public int hashCode() { - return Objects.hash(super.hashCode(), fields); + protected int computeHashCode() { + return Objects.hash(super.computeHashCode(), fields); } @Override --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org