From 3d91035ef37833751cf9dbac8e9b186779b44f34 Mon Sep 17 00:00:00 2001 From: morrySnow Date: Wed, 27 Nov 2024 18:06:11 +0800 Subject: [PATCH] [fix](planner) FunctionCallExpr clone should be deep copy should deep copy all attribute of FunctionCallExpr in copy constructor --- .../java/org/apache/doris/analysis/FunctionCallExpr.java | 2 +- .../main/java/org/apache/doris/analysis/FunctionName.java | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/FunctionCallExpr.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/FunctionCallExpr.java index 53bb2ba95acb25..51e18d750f263f 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/analysis/FunctionCallExpr.java +++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/FunctionCallExpr.java @@ -432,7 +432,7 @@ public FunctionCallExpr(FunctionCallExpr e, FunctionParams params) { protected FunctionCallExpr(FunctionCallExpr other) { super(other); - fnName = other.fnName; + fnName = other.fnName != null ? other.fnName.clone() : null; orderByElements = other.orderByElements; isAnalyticFnCall = other.isAnalyticFnCall; // aggOp = other.aggOp; diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/FunctionName.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/FunctionName.java index b6feddb7d256ed..d0e695f6660a43 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/analysis/FunctionName.java +++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/FunctionName.java @@ -183,4 +183,9 @@ public static FunctionName read(DataInput in) throws IOException { public int hashCode() { return 31 * Objects.hashCode(db) + Objects.hashCode(fn); } + + @Override + public FunctionName clone() { + return new FunctionName(db, fn); + } }