github-actions[bot] commented on code in PR #65346:
URL: https://github.com/apache/doris/pull/65346#discussion_r3540592264


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/SlotReference.java:
##########
@@ -206,9 +207,9 @@ public Optional<Column> getOneLevelColumn() {
     @Override
     public String computeToSql() {
         if (subPath.isEmpty()) {
-            return name.get();

Review Comment:
   This changes more than display text: `toSql()` is also used as an internal 
generated slot/alias name. For example, `LogicalSetOperation.buildNewOutputs()` 
creates the union output with `new SlotReference(..., slot.toSql(), ..., 
ImmutableList.of())`, and `LogicalRecursiveUnion`/`AnalyzeCTE` have the same 
pattern. With this change, a qualified left input slot such as 
`setOperationTable.k1` becomes a union output whose *name* is literally 
`setOperationTable.k1`; an outer `SELECT k1 FROM (...) u` then cannot bind 
because `Scope.findSlotIgnoreCase` compares against `slot.getName()`. The same 
leak affects rewrite aliases such as `EliminateJoinByFK`'s `new Alias(..., 
e.toSql())`, changing labels like `id1` to `pri.id1`. Please keep 
`SlotReference.toSql()` returning the bare slot name for generated names, or 
fix these callers to use `getName()` and reserve `shapeInfo()` for display-only 
explain text.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to