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 90e111126b1 branch-4.0: [feat](load) alias compute_group to 
cloud_cluster #53031 (#56596)
90e111126b1 is described below

commit 90e111126b180af6d1d30b6accfb0eb1ebb3aee8
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Mon Sep 29 09:14:45 2025 +0800

    branch-4.0: [feat](load) alias compute_group to cloud_cluster #53031 
(#56596)
    
    Cherry-picked from #53031
    
    Co-authored-by: Kaijie Chen <[email protected]>
---
 be/src/http/action/stream_load.cpp                        |  4 +++-
 be/src/http/http_common.h                                 |  1 +
 .../main/java/org/apache/doris/qe/SessionVariable.java    |  3 ++-
 .../src/main/java/org/apache/doris/qe/VariableMgr.java    | 15 ++++++++++++---
 .../virtual_compute_group/use_vcg_read_write.groovy       |  2 +-
 .../use_vcg_read_write_unhealthy_node_50.groovy           |  4 ++--
 .../virtual_compute_group/vcg_auto_failover.groovy        |  4 ++--
 .../vcg_auto_failover_manual_failback.groovy              |  4 ++--
 8 files changed, 25 insertions(+), 12 deletions(-)

diff --git a/be/src/http/action/stream_load.cpp 
b/be/src/http/action/stream_load.cpp
index 40c4f9742a3..b4f4b654029 100644
--- a/be/src/http/action/stream_load.cpp
+++ b/be/src/http/action/stream_load.cpp
@@ -742,7 +742,9 @@ Status StreamLoadAction::_process_put(HttpRequest* http_req,
         }
     }
 
-    if (!http_req->header(HTTP_CLOUD_CLUSTER).empty()) {
+    if (!http_req->header(HTTP_COMPUTE_GROUP).empty()) {
+        request.__set_cloud_cluster(http_req->header(HTTP_COMPUTE_GROUP));
+    } else if (!http_req->header(HTTP_CLOUD_CLUSTER).empty()) {
         request.__set_cloud_cluster(http_req->header(HTTP_CLOUD_CLUSTER));
     }
 
diff --git a/be/src/http/http_common.h b/be/src/http/http_common.h
index 7719070cb24..37037757f21 100644
--- a/be/src/http/http_common.h
+++ b/be/src/http/http_common.h
@@ -72,5 +72,6 @@ static const std::string HTTP_AUTH_CODE = "auth_code"; // 
deprecated
 static const std::string HTTP_GROUP_COMMIT = "group_commit";
 static const std::string HTTP_CLOUD_CLUSTER = "cloud_cluster";
 static const std::string HTTP_EMPTY_FIELD_AS_NULL = "empty_field_as_null";
+static const std::string HTTP_COMPUTE_GROUP = "compute_group";
 
 } // namespace doris
diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java 
b/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
index 60647837417..83d8e885624 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
@@ -730,6 +730,7 @@ public class SessionVariable implements Serializable, 
Writable {
 
     // CLOUD_VARIABLES_BEGIN
     public static final String CLOUD_CLUSTER = "cloud_cluster";
+    public static final String COMPUTE_GROUP = "compute_group";
     public static final String DISABLE_EMPTY_PARTITION_PRUNE = 
"disable_empty_partition_prune";
     public static final String CLOUD_PARTITION_VERSION_CACHE_TTL_MS =
             "cloud_partition_version_cache_ttl_ms";
@@ -2692,7 +2693,7 @@ public class SessionVariable implements Serializable, 
Writable {
 
 
     // CLOUD_VARIABLES_BEGIN
-    @VariableMgr.VarAttr(name = CLOUD_CLUSTER)
+    @VariableMgr.VarAttr(name = CLOUD_CLUSTER, alias = {COMPUTE_GROUP})
     public String cloudCluster = "";
     @VariableMgr.VarAttr(name = DISABLE_EMPTY_PARTITION_PRUNE)
     public boolean disableEmptyPartitionPrune = false;
diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/VariableMgr.java 
b/fe/fe-core/src/main/java/org/apache/doris/qe/VariableMgr.java
index 94f5d230932..c2357e937a0 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/qe/VariableMgr.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/qe/VariableMgr.java
@@ -853,6 +853,8 @@ public class VariableMgr {
         // Name in show variables and set statement;
         String name();
 
+        String[] alias() default {};
+
         int flag() default 0;
 
         // TODO(zhaochun): min and max is not used.
@@ -945,9 +947,16 @@ public class VariableMgr {
             }
 
             field.setAccessible(true);
-            builder.put(attr.name(),
-                    new VarContext(field, sessionVariable, SESSION | 
attr.flag(),
-                            getValue(sessionVariable, field)));
+            VarContext varContext = new VarContext(field, sessionVariable, 
SESSION | attr.flag(),
+                    getValue(sessionVariable, field));
+
+            // 1. Register the primary name.
+            builder.put(attr.name(), varContext);
+
+            // 2. Register all aliases, pointing to the SAME VarContext.
+            for (String aliasName : attr.alias()) {
+                builder.put(aliasName, varContext);
+            }
         }
 
         // Variables only exist in global environment.
diff --git 
a/regression-test/suites/cloud_p0/multi_cluster/virtual_compute_group/use_vcg_read_write.groovy
 
b/regression-test/suites/cloud_p0/multi_cluster/virtual_compute_group/use_vcg_read_write.groovy
index 66406d2daa2..01f19162ea1 100644
--- 
a/regression-test/suites/cloud_p0/multi_cluster/virtual_compute_group/use_vcg_read_write.groovy
+++ 
b/regression-test/suites/cloud_p0/multi_cluster/virtual_compute_group/use_vcg_read_write.groovy
@@ -288,7 +288,7 @@ suite('use_vcg_read_write', 'multi_cluster,docker') {
                 table "${tableName}"
 
                 set 'column_separator', ','
-                set 'cloud_cluster', 'normalVirtualClusterName'
+                set 'compute_group', 'normalVirtualClusterName'
 
                 file 'all_types.csv'
                 time 10000 // limit inflight 10s
diff --git 
a/regression-test/suites/cloud_p0/multi_cluster/virtual_compute_group/use_vcg_read_write_unhealthy_node_50.groovy
 
b/regression-test/suites/cloud_p0/multi_cluster/virtual_compute_group/use_vcg_read_write_unhealthy_node_50.groovy
index 40a875f64b8..78b510b1857 100644
--- 
a/regression-test/suites/cloud_p0/multi_cluster/virtual_compute_group/use_vcg_read_write_unhealthy_node_50.groovy
+++ 
b/regression-test/suites/cloud_p0/multi_cluster/virtual_compute_group/use_vcg_read_write_unhealthy_node_50.groovy
@@ -186,7 +186,7 @@ suite('use_vcg_read_write_unhealthy_node_50', 
'multi_cluster,docker') {
                 table "${tableName}"
 
                 set 'column_separator', ','
-                set 'cloud_cluster', 'normalVirtualClusterName'
+                set 'compute_group', 'normalVirtualClusterName'
 
                 file 'all_types.csv'
                 time 10000 // limit inflight 10s
@@ -372,7 +372,7 @@ suite('use_vcg_read_write_unhealthy_node_50', 
'multi_cluster,docker') {
                 table "${tableName}"
 
                 set 'column_separator', ','
-                set 'cloud_cluster', 'normalVirtualClusterName'
+                set 'compute_group', 'normalVirtualClusterName'
 
                 file 'all_types.csv'
                 time 10000 // limit inflight 10s
diff --git 
a/regression-test/suites/cloud_p0/multi_cluster/virtual_compute_group/vcg_auto_failover.groovy
 
b/regression-test/suites/cloud_p0/multi_cluster/virtual_compute_group/vcg_auto_failover.groovy
index 6cac6891a29..05e78333923 100644
--- 
a/regression-test/suites/cloud_p0/multi_cluster/virtual_compute_group/vcg_auto_failover.groovy
+++ 
b/regression-test/suites/cloud_p0/multi_cluster/virtual_compute_group/vcg_auto_failover.groovy
@@ -179,7 +179,7 @@ suite('vcg_auto_failover', 'multi_cluster,docker') {
                 table "${tableName}"
 
                 set 'column_separator', ','
-                set 'cloud_cluster', 'normalVirtualClusterName'
+                set 'compute_group', 'normalVirtualClusterName'
 
                 file 'all_types.csv'
                 time 10000 // limit inflight 10s
@@ -343,7 +343,7 @@ suite('vcg_auto_failover', 'multi_cluster,docker') {
                 table "${tableName}"
 
                 set 'column_separator', ','
-                set 'cloud_cluster', 'normalVirtualClusterName'
+                set 'compute_group', 'normalVirtualClusterName'
 
                 file 'all_types.csv'
                 time 10000 // limit inflight 10s
diff --git 
a/regression-test/suites/cloud_p0/multi_cluster/virtual_compute_group/vcg_auto_failover_manual_failback.groovy
 
b/regression-test/suites/cloud_p0/multi_cluster/virtual_compute_group/vcg_auto_failover_manual_failback.groovy
index 11514a43cb9..f0a40fa7945 100644
--- 
a/regression-test/suites/cloud_p0/multi_cluster/virtual_compute_group/vcg_auto_failover_manual_failback.groovy
+++ 
b/regression-test/suites/cloud_p0/multi_cluster/virtual_compute_group/vcg_auto_failover_manual_failback.groovy
@@ -263,7 +263,7 @@ suite('vcg_auto_failover_manual_failback', 
'multi_cluster,docker') {
                 table "${tableName}"
 
                 set 'column_separator', ','
-                set 'cloud_cluster', 'normalVirtualClusterName'
+                set 'compute_group', 'normalVirtualClusterName'
 
                 file 'all_types.csv'
                 time 10000 // limit inflight 10s
@@ -442,7 +442,7 @@ suite('vcg_auto_failover_manual_failback', 
'multi_cluster,docker') {
                 table "${tableName}"
 
                 set 'column_separator', ','
-                set 'cloud_cluster', 'normalVirtualClusterName'
+                set 'compute_group', 'normalVirtualClusterName'
 
                 file 'all_types.csv'
                 time 10000 // limit inflight 10s


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

Reply via email to