diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/PlanBuilder.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/PlanBuilder.java index fb1729480f5e..7d8cfa961103 100644 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/PlanBuilder.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/PlanBuilder.java @@ -132,8 +132,7 @@ public PlanBuilder appendProjections( // or that are duplicated in the list of exp if (!mappings.containsKey(scopeAwareKey(expression, analysis, translations.getScope())) && !alreadyHasTranslation.test(translations, expression)) { - Symbol symbol = - symbolAllocator.newSymbol(expression.toString(), analysis.getType(expression)); + Symbol symbol = symbolAllocator.newSymbol(expression, analysis.getType(expression)); queryContext.getTypeProvider().putTableModelType(symbol, analysis.getType(expression)); projections.put(symbol, rewriter.apply(translations, expression)); mappings.put(scopeAwareKey(expression, analysis, translations.getScope()), symbol); diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/QueryPlanner.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/QueryPlanner.java index a44ee2f7bf62..8eaca681005e 100644 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/QueryPlanner.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/QueryPlanner.java @@ -209,7 +209,7 @@ private static List computeOutputs( FieldReference reference = (FieldReference) expression; symbol = builder.getFieldSymbols()[reference.getFieldIndex()]; } - outputSymbols.add(symbol != null ? symbol : new Symbol(expression.toString())); + outputSymbols.add(symbol != null ? symbol : builder.translate(expression)); } return outputSymbols.build(); }