You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by hu...@apache.org on 2026/05/13 04:40:53 UTC

(doris) 02/07: [fix](build) Fix compilation issues after rebasing on apache/master

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

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

commit 4c69e81e7ee5b36a162ad83339c13ac1212db867
Author: 924060929 <la...@selectdb.com>
AuthorDate: Tue May 12 17:49:30 2026 +0800

    [fix](build) Fix compilation issues after rebasing on apache/master
    
    - multi_version.h: use atomic_load/atomic_store for shared_ptr (LLVM 20 libc++ compat)
    - memory.cpp: fix std::max type mismatch (long vs int64_t on macOS)
    - bucketed_aggregation_sink_operator.h: fix ExchangeType::NOOP → TLocalPartitionType::NOOP
    - BucketedAggregationNode.java: rename isSerialOperator → isSerialOperatorOnBe
    - AnalyzeWhereSubqueryTest.java: remove unused imports
    - LocalShuffleNodeCoverageTest.java: fix CTEScanNode ctor + AnalyticEval NOOP expectations
---
 be/src/common/multi_version.h                                | 11 +++++++----
 be/src/exec/common/memory.cpp                                |  2 +-
 be/src/exec/operator/bucketed_aggregation_sink_operator.h    |  2 +-
 .../org/apache/doris/planner/BucketedAggregationNode.java    |  3 ++-
 .../nereids/rules/analysis/AnalyzeWhereSubqueryTest.java     |  3 ---
 .../apache/doris/planner/LocalShuffleNodeCoverageTest.java   | 12 +++++-------
 6 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/be/src/common/multi_version.h b/be/src/common/multi_version.h
index 441f8dedae3..aadd2ef3237 100644
--- a/be/src/common/multi_version.h
+++ b/be/src/common/multi_version.h
@@ -20,7 +20,6 @@
 
 #pragma once
 
-#include <atomic>
 #include <memory>
 
 /** Allow to store and read-only usage of an object in several threads,
@@ -50,14 +49,18 @@ public:
 
     explicit MultiVersion(std::unique_ptr<const T>&& value) : current_version(std::move(value)) {}
 
+    // Use the pre-C++20 atomic free functions for shared_ptr instead of
+    // std::atomic<shared_ptr>, which requires a trivially_copyable specialization
+    // not available in all libc++ versions (e.g., LLVM 20).
+
     /// Obtain current version for read-only usage. Returns shared_ptr, that manages lifetime of version.
-    Version get() const { return current_version.load(); }
+    Version get() const { return std::atomic_load(&current_version); }
 
     /// Update an object with new version.
     void set(std::unique_ptr<const T>&& value) {
-        current_version.store(Version {std::move(value)});
+        std::atomic_store(&current_version, Version {std::move(value)});
     }
 
 private:
-    std::atomic<Version> current_version;
+    Version current_version;
 };
diff --git a/be/src/exec/common/memory.cpp b/be/src/exec/common/memory.cpp
index 4ca4af037b3..ef5887e1ca7 100644
--- a/be/src/exec/common/memory.cpp
+++ b/be/src/exec/common/memory.cpp
@@ -51,7 +51,7 @@ int MemLimiter::available_scanner_count(int ins_idx) const {
     int64_t estimated_block_mem_bytes_value = get_estimated_block_mem_bytes();
     DCHECK_GT(estimated_block_mem_bytes_value, 0);
 
-    int64_t max_count = std::max(1L, mem_limit_value / estimated_block_mem_bytes_value);
+    int64_t max_count = std::max(int64_t(1), mem_limit_value / estimated_block_mem_bytes_value);
     int64_t avail_count = max_count;
     int64_t per_count = avail_count / parallelism;
     if (serial_operator) {
diff --git a/be/src/exec/operator/bucketed_aggregation_sink_operator.h b/be/src/exec/operator/bucketed_aggregation_sink_operator.h
index 34b8103155e..03161dd79d4 100644
--- a/be/src/exec/operator/bucketed_aggregation_sink_operator.h
+++ b/be/src/exec/operator/bucketed_aggregation_sink_operator.h
@@ -114,7 +114,7 @@ public:
 
     // No local exchange needed — each instance builds its own hash tables independently.
     DataDistribution required_data_distribution(RuntimeState* state) const override {
-        return DataDistribution(ExchangeType::NOOP);
+        return DataDistribution(TLocalPartitionType::NOOP);
     }
 
     size_t get_reserve_mem_size(RuntimeState* state, bool eos) override;
diff --git a/fe/fe-core/src/main/java/org/apache/doris/planner/BucketedAggregationNode.java b/fe/fe-core/src/main/java/org/apache/doris/planner/BucketedAggregationNode.java
index 96dbd579388..f49c316cf24 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/planner/BucketedAggregationNode.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/planner/BucketedAggregationNode.java
@@ -20,6 +20,7 @@ package org.apache.doris.planner;
 import org.apache.doris.analysis.AggregateInfo;
 import org.apache.doris.analysis.ExprToThriftVisitor;
 import org.apache.doris.analysis.FunctionCallExpr;
+import org.apache.doris.qe.ConnectContext;
 import org.apache.doris.thrift.TBucketedAggregationNode;
 import org.apache.doris.thrift.TExplainLevel;
 import org.apache.doris.thrift.TExpr;
@@ -97,7 +98,7 @@ public class BucketedAggregationNode extends PlanNode {
     }
 
     @Override
-    public boolean isSerialOperator() {
+    public boolean isSerialOperatorOnBe(ConnectContext context) {
         // Bucketed agg handles group-by keys only (no without-key in initial version),
         // so it's never a serial operator.
         return false;
diff --git a/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/analysis/AnalyzeWhereSubqueryTest.java b/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/analysis/AnalyzeWhereSubqueryTest.java
index f813988dd91..4e51d196113 100644
--- a/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/analysis/AnalyzeWhereSubqueryTest.java
+++ b/fe/fe-core/src/test/java/org/apache/doris/nereids/rules/analysis/AnalyzeWhereSubqueryTest.java
@@ -51,9 +51,6 @@ import org.apache.doris.nereids.util.PlanChecker;
 import org.apache.doris.utframe.TestWithFeService;
 
 import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Lists;
-import mockit.Mock;
-import mockit.MockUp;
 import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.Test;
 
diff --git a/fe/fe-core/src/test/java/org/apache/doris/planner/LocalShuffleNodeCoverageTest.java b/fe/fe-core/src/test/java/org/apache/doris/planner/LocalShuffleNodeCoverageTest.java
index 3bfaadee8be..9f3fea43869 100644
--- a/fe/fe-core/src/test/java/org/apache/doris/planner/LocalShuffleNodeCoverageTest.java
+++ b/fe/fe-core/src/test/java/org/apache/doris/planner/LocalShuffleNodeCoverageTest.java
@@ -158,8 +158,7 @@ public class LocalShuffleNodeCoverageTest {
     public void testCteAndRecursiveNodesAndEmptySet() {
         PlanTranslatorContext ctx = new PlanTranslatorContext();
 
-        CTEScanNode cteScanNode = new CTEScanNode(new TupleDescriptor(new TupleId(NEXT_ID.getAndIncrement())),
-                ScanContext.EMPTY);
+        CTEScanNode cteScanNode = new CTEScanNode(ScanContext.EMPTY);
         Pair<PlanNode, LocalExchangeType> cteOutput = cteScanNode.enforceAndDeriveLocalExchange(
                 ctx, null, LocalExchangeTypeRequire.requireHash());
         Assertions.assertEquals(LocalExchangeType.NOOP, cteOutput.second);
@@ -464,11 +463,10 @@ public class LocalShuffleNodeCoverageTest {
         AnalyticEvalNode noPartition = new AnalyticEvalNode(nextPlanNodeId(), noPartitionChild,
                 Collections.emptyList(), Collections.emptyList(), Collections.emptyList(),
                 null, new TupleDescriptor(new TupleId(NEXT_ID.getAndIncrement())));
-        // No partition → isSerialNode()=true → enforceChild skips exchange.
-        // Output is still PASSTHROUGH (hardcoded for empty partitions).
+        // No partition → isSerialNode()=true → returns NOOP (serial nodes let framework handle).
         Pair<PlanNode, LocalExchangeType> noPartitionOutput = noPartition.enforceAndDeriveLocalExchange(
                 ctx, null, LocalExchangeTypeRequire.requireHash());
-        Assertions.assertEquals(LocalExchangeType.PASSTHROUGH, noPartitionOutput.second);
+        Assertions.assertEquals(LocalExchangeType.NOOP, noPartitionOutput.second);
         Assertions.assertSame(noPartitionChild, noPartition.getChild(0));
 
         // Analytic with partition but no orderBy, non-colocated → noRequire/NOOP.
@@ -492,8 +490,8 @@ public class LocalShuffleNodeCoverageTest {
         Mockito.when(orderedAnalytic.fragment.useSerialSource(Mockito.any())).thenReturn(true);
         Pair<PlanNode, LocalExchangeType> orderedOutput = orderedAnalytic.enforceAndDeriveLocalExchange(
                 ctx, null, LocalExchangeTypeRequire.noRequire());
-        Assertions.assertEquals(LocalExchangeType.PASSTHROUGH, orderedOutput.second);
-        assertChildLocalExchangeType(orderedAnalytic, 0, LocalExchangeType.PASSTHROUGH);
+        // Serial AnalyticEval returns NOOP — lets framework serial check handle fan-out
+        Assertions.assertEquals(LocalExchangeType.NOOP, orderedOutput.second);
     }
 
     @Test


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org