diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/SlotRef.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/SlotRef.java index 29f99b219aa78c..6bf11b0a953e90 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/analysis/SlotRef.java +++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/SlotRef.java @@ -271,7 +271,7 @@ public String toSqlImpl() { // virtual slot of an alias function // when we try to translate an alias function to Nereids style, the desc in the place holding slotRef // is null, and we just need the name of col. - return col; + return "`" + col + "`"; } else if (desc.getSourceExprs() != null) { if (!disableTableName && (ToSqlContext.get() == null || ToSqlContext.get().isNeedSlotRefId())) { if (desc.getId().asInt() != 1) {