This is an automated email from the ASF dual-hosted git repository.

starocean999 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 080367da844 [fix](nereids)keep NamedExpression's name unchanged when 
create an Alias in BindSink (#57670)
080367da844 is described below

commit 080367da8445f4b4eefcd3c2b7725ac28df40027
Author: starocean999 <[email protected]>
AuthorDate: Fri Nov 7 16:59:22 2025 +0800

    [fix](nereids)keep NamedExpression's name unchanged when create an Alias in 
BindSink (#57670)
    
    Using the original name keeps the output schema stable and ensures slot
    binding logic still find the correct slot. Such as bind
    LogicalPostFilter in stream load plan
---
 .../main/java/org/apache/doris/nereids/rules/analysis/BindSink.java   | 4 +++-
 .../load_p0/stream_load/test_stream_load_include_where_expr.groovy    | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/BindSink.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/BindSink.java
index 12469b51de5..34462634f44 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/BindSink.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/BindSink.java
@@ -329,7 +329,9 @@ public class BindSink implements AnalysisRuleFactory {
             if (castExpr instanceof NamedExpression) {
                 castExprs.add(((NamedExpression) castExpr));
             } else {
-                castExprs.add(new Alias(castExpr));
+                // use expr's original name as alias name
+                // so that the LogicalPostFilter node in stream load can bind 
its slot successfully
+                castExprs.add(new Alias(castExpr, expr.getName()));
             }
         }
         if (!castExprs.equals(fullOutputExprs)) {
diff --git 
a/regression-test/suites/load_p0/stream_load/test_stream_load_include_where_expr.groovy
 
b/regression-test/suites/load_p0/stream_load/test_stream_load_include_where_expr.groovy
index a94ecd05a10..faa88f8305a 100644
--- 
a/regression-test/suites/load_p0/stream_load/test_stream_load_include_where_expr.groovy
+++ 
b/regression-test/suites/load_p0/stream_load/test_stream_load_include_where_expr.groovy
@@ -26,7 +26,7 @@ suite("test_stream_load_include_where_expr", "p0") {
                     `a` INT COMMENT 'timestamp',
                     `b` INT   COMMENT 'a int value',
                     `c` INT COMMENT 'b int value',
-                    `d` varchar(100)
+                    `d` STRING
                 )
                 DUPLICATE KEY(`a`)
                 DISTRIBUTED BY HASH(a) BUCKETS AUTO


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

Reply via email to