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

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


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new 9253f66bcf0 [opt](coordinator) optimize parallel degree of shuffle 
when use nereids (#44754) (#46399)
9253f66bcf0 is described below

commit 9253f66bcf0deed2bf9522ffd379e112225dffef
Author: 924060929 <[email protected]>
AuthorDate: Tue Jan 7 20:54:33 2025 +0800

    [opt](coordinator) optimize parallel degree of shuffle when use nereids 
(#44754) (#46399)
    
    optimize parallel degree of shuffle when use nereids , this pr can fix some 
performance rollback when upgrade doris from 1.2 to 2.x/3.x
---
 be/src/vec/aggregate_functions/aggregate_function_collect.h   | 8 ++++----
 fe/fe-core/src/main/java/org/apache/doris/qe/Coordinator.java | 3 ++-
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/be/src/vec/aggregate_functions/aggregate_function_collect.h 
b/be/src/vec/aggregate_functions/aggregate_function_collect.h
index 68de426ea1f..7a475b345ee 100644
--- a/be/src/vec/aggregate_functions/aggregate_function_collect.h
+++ b/be/src/vec/aggregate_functions/aggregate_function_collect.h
@@ -258,10 +258,10 @@ struct AggregateFunctionCollectListData<StringRef, 
HasLimit> {
             }
             max_size = rhs.max_size;
 
-            data->insert_range_from(
-                    *rhs.data, 0,
-                    std::min(assert_cast<size_t, 
TypeCheckOnRelease::DISABLE>(max_size - size()),
-                             rhs.size()));
+            data->insert_range_from(*rhs.data, 0,
+                                    std::min(assert_cast<size_t, 
TypeCheckOnRelease::DISABLE>(
+                                                     
static_cast<size_t>(max_size - size())),
+                                             rhs.size()));
         } else {
             data->insert_range_from(*rhs.data, 0, rhs.size());
         }
diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/Coordinator.java 
b/fe/fe-core/src/main/java/org/apache/doris/qe/Coordinator.java
index 6c94be89c91..94fb9281296 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/qe/Coordinator.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/qe/Coordinator.java
@@ -1814,7 +1814,8 @@ public class Coordinator implements CoordInterface {
                     exchangeInstances = 
ConnectContext.get().getSessionVariable().getExchangeInstanceParallel();
                 }
                 // when we use nested loop join do right outer / semi / anti 
join, the instance must be 1.
-                if (leftMostNode.getNumInstances() == 1) {
+                boolean isNereids = context != null && 
context.getState().isNereids();
+                if (!isNereids && leftMostNode.getNumInstances() == 1) {
                     exchangeInstances = 1;
                 }
                 // Using serial source means a serial source operator will be 
used in this fragment (e.g. data will be


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

Reply via email to