diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/PlaceHolderExpr.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/PlaceHolderExpr.java index ca0596258f6f9f..50bea1c2d5647e 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/analysis/PlaceHolderExpr.java +++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/PlaceHolderExpr.java @@ -58,6 +58,20 @@ public void setLiteral(LiteralExpr literal) { this.type = literal.getType(); } + public LiteralExpr getLiteral() { + return lExpr; + } + + @Override + protected void analysisDone() { + if (lExpr != null && !lExpr.isAnalyzed) { + lExpr.analysisDone(); + } + if (!isAnalyzed) { + super.analysisDone(); + } + } + public LiteralExpr createLiteralFromType() throws AnalysisException { Preconditions.checkState(mysqlTypeCode > 0); return LiteralExpr.getLiteralByMysqlType(mysqlTypeCode, isUnsigned()); @@ -134,11 +148,6 @@ public String toDigestImpl() { return "?"; } - @Override - protected Expr uncheckedCastTo(Type targetType) throws AnalysisException { - return this.lExpr.uncheckedCastTo(targetType); - } - // Swaps the sign of numeric literals. // Throws for non-numeric literals. public void swapSign() throws NotImplementedException { diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/PrepareStmt.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/PrepareStmt.java index 90da98c14f4e76..1c7b5459979be9 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/analysis/PrepareStmt.java +++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/PrepareStmt.java @@ -268,6 +268,7 @@ public void asignValues(List values) throws UserException { } for (int i = 0; i < values.size(); ++i) { inner.getPlaceHolders().get(i).setLiteral(values.get(i)); + inner.getPlaceHolders().get(i).analysisDone(); } if (!values.isEmpty()) { if (LOG.isDebugEnabled()) { diff --git a/fe/fe-core/src/main/java/org/apache/doris/planner/ScanNode.java b/fe/fe-core/src/main/java/org/apache/doris/planner/ScanNode.java index 9c896bd75042b3..342ec3c91490a1 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/planner/ScanNode.java +++ b/fe/fe-core/src/main/java/org/apache/doris/planner/ScanNode.java @@ -29,6 +29,7 @@ import org.apache.doris.analysis.IsNullPredicate; import org.apache.doris.analysis.LiteralExpr; import org.apache.doris.analysis.NullLiteral; +import org.apache.doris.analysis.PlaceHolderExpr; import org.apache.doris.analysis.PredicateUtils; import org.apache.doris.analysis.SlotDescriptor; import org.apache.doris.analysis.SlotId; @@ -407,7 +408,8 @@ private PartitionColumnFilter createPartitionFilter(SlotDescriptor desc, List