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

yiguolei pushed a commit to branch branch-4.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-4.0 by this push:
     new baa145d1b37 branch-4.0: [fix](schema_change) fix incorrect unique id 
in rollup after schema change #57073 (#57081)
baa145d1b37 is described below

commit baa145d1b3744c97822f16df2b0fe99249cfa6ac
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Fri Oct 17 17:05:04 2025 +0800

    branch-4.0: [fix](schema_change) fix incorrect unique id in rollup after 
schema change #57073 (#57081)
    
    Cherry-picked from #57073
    
    Co-authored-by: Luwei <[email protected]>
---
 .../main/java/org/apache/doris/alter/SchemaChangeHandler.java    | 1 +
 .../suites/schema_change_p0/test_alter_rollup_table.groovy       | 9 ++++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/alter/SchemaChangeHandler.java 
b/fe/fe-core/src/main/java/org/apache/doris/alter/SchemaChangeHandler.java
index 092262c1a76..8ceb3a01def 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/alter/SchemaChangeHandler.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/alter/SchemaChangeHandler.java
@@ -748,6 +748,7 @@ public class SchemaChangeHandler extends AlterHandler {
                     modColIndex = i;
                     otherCol = new Column(modColumn);
                     otherCol.setName(col.getName());
+                    otherCol.setUniqueId(col.getUniqueId());
                     otherCol.setDefineExpr(col.getDefineExpr());
                     Preconditions.checkState(modColIndex != -1);
                     Preconditions.checkState(otherCol != null);
diff --git 
a/regression-test/suites/schema_change_p0/test_alter_rollup_table.groovy 
b/regression-test/suites/schema_change_p0/test_alter_rollup_table.groovy
index fb492c63fe7..6beb145a10e 100644
--- a/regression-test/suites/schema_change_p0/test_alter_rollup_table.groovy
+++ b/regression-test/suites/schema_change_p0/test_alter_rollup_table.groovy
@@ -64,6 +64,7 @@ suite("test_alter_rollup_table") {
         DUPLICATE KEY(`user_id`, `event_time`, `event_date`)
         DISTRIBUTED BY HASH(`user_id`) BUCKETS 3
         PROPERTIES (
+        "replication_num" = "1",
         "file_cache_ttl_seconds" = "0",
         "bloom_filter_columns" = "country, city",
         "is_being_synced" = "false",
@@ -101,7 +102,7 @@ suite("test_alter_rollup_table") {
             balance
         );
     """
-    
+
     sleep(10000)
 
     sql """
@@ -132,5 +133,11 @@ suite("test_alter_rollup_table") {
         (1003, '2025-09-19', '2025-09-19 10:00:00', 'japan', 'tokyo', 30, 1, 
1000.50, 88.8, '192.168.0.1', '{"device":"iphone"}', 1),
         (1004, '2025-09-19', '2025-09-19 11:30:00', 'usa', null, null, 0, 
500.00, null, '10.0.0.2', '{"device":"android"}', 2);
     """
+
+    sleep(10000)
+
+    sql """
+        select event_date, user_id from ${tbName}
+    """
 }
 


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

Reply via email to