This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-4.1
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-4.1 by this push:
new 702bbdc1373 branch-4.1: [fix](audit) Fix UnboundAlias digest when name
comes from child #62160 (#62175)
702bbdc1373 is described below
commit 702bbdc1373bcf0076d50910db27b24828407139
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Wed Apr 8 10:43:00 2026 +0800
branch-4.1: [fix](audit) Fix UnboundAlias digest when name comes from child
#62160 (#62175)
Cherry-picked from #62160
Co-authored-by: HonestManXin <[email protected]>
---
.../main/java/org/apache/doris/nereids/analyzer/UnboundAlias.java | 2 +-
.../org/apache/doris/nereids/parser/NereidsParserDigestTest.java | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/analyzer/UnboundAlias.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/analyzer/UnboundAlias.java
index 232c705df98..d0ef75c4bd8 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/nereids/analyzer/UnboundAlias.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/nereids/analyzer/UnboundAlias.java
@@ -108,7 +108,7 @@ public class UnboundAlias extends NamedExpression
implements UnaryExpression, Un
public String toDigest() {
StringBuilder sb = new StringBuilder();
sb.append(child().toDigest());
- if (alias.isPresent()) {
+ if (!nameFromChild && alias.isPresent()) {
sb.append(" AS " + alias.get());
}
return sb.toString();
diff --git
a/fe/fe-core/src/test/java/org/apache/doris/nereids/parser/NereidsParserDigestTest.java
b/fe/fe-core/src/test/java/org/apache/doris/nereids/parser/NereidsParserDigestTest.java
index ddbdcbdf0c4..be2bd718f11 100644
---
a/fe/fe-core/src/test/java/org/apache/doris/nereids/parser/NereidsParserDigestTest.java
+++
b/fe/fe-core/src/test/java/org/apache/doris/nereids/parser/NereidsParserDigestTest.java
@@ -93,8 +93,8 @@ public class NereidsParserDigestTest extends ParserTestBase {
// test lambda
sql = "SELECT ARRAY_MAP(x->x+1, ARRAY(87, 33, -49))";
logicalPlanList = nereidsParser.parseMultiple(sql);
- assertDigestEquals("SELECT ARRAY_MAP(x -> x + ?, ARRAY(?, ?, ?)) "
- + "AS ARRAY_MAP(x->x+1, ARRAY(87, 33, -49))", logicalPlanList);
+ assertDigestEquals("SELECT ARRAY_MAP(x -> x + ?, ARRAY(?, ?, ?))",
+ logicalPlanList);
// test set operation
sql = "SELECT student_id, name\n"
@@ -216,7 +216,7 @@ public class NereidsParserDigestTest extends ParserTestBase
{
sql = "select k1, sum(k2), rank() over(partition by k1 order by k1) as
ranking from t1 group by k1";
logicalPlanList = nereidsParser.parseMultiple(sql);
assertDigestEquals(
- "SELECT k1, SUM(k2) AS sum(k2), RANK() OVER (PARTITION BY k1
ORDER BY k1 ASC NULLS FIRST) AS ranking FROM t1 GROUP BY k1",
+ "SELECT k1, SUM(k2), RANK() OVER (PARTITION BY k1 ORDER BY k1
ASC NULLS FIRST) AS ranking FROM t1 GROUP BY k1",
logicalPlanList);
// test binary keyword
@@ -228,7 +228,7 @@ public class NereidsParserDigestTest extends ParserTestBase
{
sql = "SELECT a, b, sum(c) from test group by a ASC, b ASC WITH
ROLLUP";
logicalPlanList = nereidsParser.parseMultiple(sql);
assertDigestEquals(
- "SELECT a, b, SUM(c) AS sum(c) FROM test GROUP BY GROUPING
SETS ((a,b), (a), ()) ORDER BY a ASC NULLS FIRST, b ASC NULLS FIRST",
+ "SELECT a, b, SUM(c) FROM test GROUP BY GROUPING SETS ((a,b),
(a), ()) ORDER BY a ASC NULLS FIRST, b ASC NULLS FIRST",
logicalPlanList);
sql = "SELECT a, b from test group by a, b WITH ROLLUP";
logicalPlanList = nereidsParser.parseMultiple(sql);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]