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

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


The following commit(s) were added to refs/heads/master by this push:
     new 91d33b2744d [fix](be) Make the BE unit tests build and run on macOS 
(#68520)
91d33b2744d is described below

commit 91d33b2744d800f753e3a96c63e65946d356a2e9
Author: Mingyu Chen (Rayner) <[email protected]>
AuthorDate: Mon Sep 28 09:56:12 2026 +0800

    [fix](be) Make the BE unit tests build and run on macOS (#68520)
    
    ### What problem does this PR solve?
    
    Issue Number: N/A
    
    Problem Summary:
    
    **Context.** `run-be-ut.sh` is the only entry point for the BE unit
    tests, and on macOS it is also the only way to run them: the `BE UT
    (macOS)` workflow runs `build.sh --be`, which configures with
    `-DMAKE_TEST=OFF`, so nothing under `be/test` is compiled there (the
    workflow says so in its own comment at
    `.github/workflows/be-ut-mac.yml:123`). On a clean worktree the script
    therefore fails twice before a single test executes, and then stops
    seven more times while compiling `be/test`.
    
    **1. The problem, and what it cost**
    
    *The script never initializes two of the submodules it needs.*
    `run-be-ut.sh` initializes three submodules (`contrib/datasketches-cpp`,
    `contrib/apache-orc`, `contrib/clucene`); `build.sh` initializes five,
    and the two it adds — `contrib/faiss` and `contrib/openblas` — are
    required before a single file is compiled. `be/CMakeLists.txt:1038` adds
    `be/src/storage/index/ann` unconditionally, and that directory's
    `cmake-protect/CMakeLists.txt:48,66` calls `add_subdirectory()` on both.
    On a fresh clone or a new git worktree the configure step therefore ends
    with
    
    CMake Error at src/storage/index/ann/cmake-protect/CMakeLists.txt:48
    (add_subdirectory):
    The source directory .../contrib/openblas does not contain a
    CMakeLists.txt file.
    CMake Error at src/storage/index/ann/cmake-protect/CMakeLists.txt:66
    (add_subdirectory):
    The source directory .../contrib/faiss does not contain a CMakeLists.txt
    file.
    
    Running `build.sh` once first hides it, which is why it goes unnoticed.
    
    *Seven `be/test` translation units do not compile on macOS.* The Linux
    BE UT build is green for all seven. `run-be-ut.sh` invokes ninja without
    `-k`, so the developer fixes one file, waits out another full compile,
    and meets the next one — seven round trips, each of them tens of
    minutes, for a task whose whole point is to run a test.
    
    | # | TU | Error | Root cause |
    |---|---|---|---|
    | 1 | `exprs/function/function_map_inner_product_test.cpp` |
    `'faiss/impl/platform_macros.h' file not found` | The `APPLE` branch of
    `be/test/CMakeLists.txt:170` links `vector_search_test` as
    `-Wl,-force_load,$<TARGET_FILE:vector_search_test>`: a file path, which
    carries no usage requirements. Every other platform links
    `-Wl,--whole-archive vector_search_test`, which is a target in the link
    list and does propagate them. |
    | 2 | `exprs/function/function_format_round_test.cpp` | `ambiguous
    conversion for functional-style cast from 'long' to 'Decimal64'` (11
    sites) | `Decimal64` is `Decimal<int64_t>`, so on Darwin the constructor
    parameter is `long long` while these literals are `long`; every integral
    and floating constructor is then an equally ranked conversion away. |
    | 3 | `storage/index/snii/bench/bkd_native_vs_clucene_bench_test.cpp` |
    six `-Werror,-Wformat` | `uint64_t` is `unsigned long long` on Darwin
    and `unsigned long` on Linux, so `%lu` / `%ld` is right on one and wrong
    on the other. |
    | 4 | `storage/index/snii/bench/snii_vs_v3_benchmark_test.cpp` | `no
    member named 'posix_fadvise'`, `mincore` argument type | `posix_fadvise`
    / `POSIX_FADV_DONTNEED` do not exist on Darwin; `mincore(2)` takes
    `char*` there and `unsigned char*` on Linux. |
    | 5 | `storage/index/snii/bkd/bkd_corruption_test.cpp` | `deduced
    conflicting types ('size_type' vs 'uint64_t')` | An initializer list
    mixing `payload.size()` (size_t) with `uint64_t` literals. |
    | 6 | `storage/index/snii/writer/spimi_locality_bench_test.cpp` | libc++
    `no matching function for call to object of type 'key_equal'` | The
    transparent equality functor defines one argument order only. libc++
    calls `key_equal` as `(key, lookup key)`, libstdc++ as `(lookup key,
    key)`. |
    | 7 | `storage/segment/hierarchical_data_iterator_test.cpp` | three `no
    matching function for call to 'min'` | `kRows` is `size_t` and
    `current_ordinal` is `ordinal_t` (`uint64_t`), which are distinct types
    on Darwin, so `std::min` cannot deduce a common type. |
    
    None of the seven is related to a local change; a clean master
    reproduces all of them. #2 arrived on 2026-09-24 with #68397 (`[fix](be)
    Preserve decimal precision in format_round`, by TengJianPing), which is
    the commit that added `function_format_round_test.cpp` — after the last
    full macOS sweep. So this class of breakage is still being produced:
    "green on Linux, red on macOS" is invisible to every CI job we have, and
    the two obstacles above make the one manual path that would find it
    expensive enough that nobody walks it.
    
    **2. What this PR does, and why it helps**
    
    - `run-be-ut.sh`: the `update_submodule` list gains `contrib/openblas`
    and `contrib/faiss`, with the same archive URLs `build.sh:941` already
    uses, plus a comment that the list has to stay in sync with `build.sh`.
    - `be/test/CMakeLists.txt`: the `APPLE` branch links `ann_index` in
    addition to the `force_load` flag. `ann_index` is the target that
    exports the faiss include directories `PUBLIC`, so the APPLE link line
    now feeds the same compile and link inputs as every other platform,
    instead of being a macOS special case.
    - Six test files: the smallest change that removes the platform
    difference, each spelled the way the file's neighbours already spell it
    — `PRIu64` / `PRId64` (`core/decimal12.h`, `util/histogram.cpp`),
    `int64_t(...)` around the literals (`storage/key_coder_test.cpp:392`,
    `runtime/jsonb_document_test.cpp:433`), `#if
    defined(POSIX_FADV_DONTNEED)` around the call.
    
    Linux behaviour is unchanged: every edit is either inside an
    `APPLE`-only path or a strictly more portable spelling of the same
    value. On macOS `run-be-ut.sh` becomes a usable test line for the first
    time.
    
    One cost worth naming: because the APPLE link line now propagates
    include directories, the compile command of every `be/test` TU changes
    once, so the first macOS build after this lands rebuilds `be/test`
    (about 1230 TUs). Later builds are incremental again.
    
    **Branch pick.** #68397 was never picked to `branch-4.1`, so
    `function_format_round_test.cpp` does not exist there. Of the seven
    files, only `storage/segment/hierarchical_data_iterator_test.cpp` exists
    on `branch-4.1`, with the same three `std::min(*rows, ROWS -
    current_ordinal)` sites and the same types (`ROWS` is `size_t`,
    `ordinal_t` is `uint64_t`), so it fails to compile on macOS there too;
    that branch also has no `APPLE` `force_load` branch in
    `be/test/CMakeLists.txt`, so the faiss part is master-only. If 4.1 is
    meant to run BE UT on macOS, the pick is that one file's hunk.
    
    **3. The classes, and how they call each other**
    
    - `run-be-ut.sh` (changed): `update_submodule()` calls `git submodule
    update --init --recursive <path>` and falls back to the branch tarball;
    the two added lines are identical in shape to the three that were
    already there.
    - `be/test/CMakeLists.txt` (changed): the `APPLE` branch of the
    `doris_be_test` link step.
    - `be/src/storage/index/ann/cmake-protect/CMakeLists.txt` (unchanged,
    the reason the submodules are mandatory): `add_subdirectory()` on
    `contrib/openblas` and `contrib/faiss`, reached unconditionally from
    `be/CMakeLists.txt:1038`.
    - `ann_index` (unchanged target in `be/src/storage/index/ann`): links
    `faiss` `PUBLIC`, so its `INTERFACE_INCLUDE_DIRECTORIES` carry the faiss
    include path.
    - `vector_search_test` (unchanged target in
    `be/test/storage/index/ann`): links `ann_index` `PUBLIC`; on APPLE it
    reaches `doris_be_test` as forced-in objects rather than as a target.
    - The seven test TUs: unchanged in behaviour, three of them compiled in
    a portable spelling.
    
    ```
    run-be-ut.sh
      |- update_submodule contrib/{datasketches-cpp, apache-orc, clucene}   
[already there]
      '- update_submodule contrib/{openblas, faiss}                        
[added here]
            '- git submodule update --init --recursive
    
    be/CMakeLists.txt:1038  add_subdirectory(be/src/storage/index/ann)
      '- storage/index/ann/CMakeLists.txt:18  add_subdirectory(cmake-protect)
            '- cmake-protect/CMakeLists.txt:48,66  
add_subdirectory(contrib/{openblas, faiss})
                  '- target faiss --(PUBLIC)--> target ann_index --(PUBLIC)--> 
vector_search_test
                                                                                
  |
    be/test/CMakeLists.txt:170  if (APPLE)                                      
  |
      |- before: -Wl,-force_load,<path to libvector_search_test.a>  -- 
propagates nothing
      '- after:  the same flag + ann_index                          -- 
propagates the faiss include dirs
                                                                                
  |
                                            function_map_inner_product_test.cpp 
<--'
                                            (and every other be/test TU, which 
now
                                             compiles with the same inputs as 
on Linux)
    
    be/test/CMakeLists.txt  add_executable(doris_be_test ${UT_FILES})   <- the 
other six TUs, no link involvement
    ```
---
 be/test/CMakeLists.txt                             |  7 ++++++-
 .../exprs/function/function_format_round_test.cpp  | 22 +++++++++++-----------
 .../bench/bkd_native_vs_clucene_bench_test.cpp     | 15 +++++++++------
 .../index/snii/bench/snii_vs_v3_benchmark_test.cpp | 14 ++++++++++++--
 .../storage/index/snii/bkd/bkd_corruption_test.cpp |  7 +++++--
 .../snii/writer/spimi_locality_bench_test.cpp      |  9 ++++++++-
 .../segment/hierarchical_data_iterator_test.cpp    | 13 ++++++++++---
 run-be-ut.sh                                       |  5 +++++
 8 files changed, 66 insertions(+), 26 deletions(-)

diff --git a/be/test/CMakeLists.txt b/be/test/CMakeLists.txt
index d3c48e16c75..d89803ff7fe 100644
--- a/be/test/CMakeLists.txt
+++ b/be/test/CMakeLists.txt
@@ -167,9 +167,14 @@ endif()
 target_compile_definitions(doris_be_test PRIVATE
     KUROMOJI_SOURCE_DICT_DIR="${BASE_DIR}/dict/kuromoji")
 
+# -force_load takes a file path rather than a target, so unlike 
--whole-archive <target> below it
+# propagates no usage requirements. Link ann_index explicitly: it exports the 
faiss include
+# directories PUBLIC, and the test TUs that include faiss headers 
(function_array_distance.h and
+# what includes it) need them.
 if (APPLE)
     target_link_libraries(doris_be_test ${TEST_LINK_LIBS}
-        -Wl,-force_load,$<TARGET_FILE:vector_search_test>)
+        -Wl,-force_load,$<TARGET_FILE:vector_search_test>
+        ann_index)
     # $<TARGET_FILE:...> inside a link flag does not create a target-level
     # dependency, so parallel ninja could link doris_be_test before the
     # archive exists.
diff --git a/be/test/exprs/function/function_format_round_test.cpp 
b/be/test/exprs/function/function_format_round_test.cpp
index de6b3a2f395..cedf41c1734 100644
--- a/be/test/exprs/function/function_format_round_test.cpp
+++ b/be/test/exprs/function/function_format_round_test.cpp
@@ -50,16 +50,16 @@ TEST(FormatRoundTest, decimal_padding) {
 TEST(FormatRoundTest, decimal64_rounding) {
     const InputTypeSet arguments = {{TYPE_DECIMAL64, 17, 18}, TYPE_INT};
     const DataSet data = {
-            {{Decimal64(112499999999999999), 2}, std::string("1.12")},
-            {{Decimal64(-112499999999999999), 2}, std::string("-1.12")},
-            {{Decimal64(112499999999999999), 10}, std::string("1.1250000000")},
-            {{Decimal64(112345678901234567), 17}, 
std::string("1.12345678901234567")},
-            {{Decimal64(-112345678901234567), 16}, 
std::string("-1.1234567890123457")},
-            {{Decimal64(999999999999999999), 16}, 
std::string("10.0000000000000000")},
-            {{Decimal64(-999999999999999999), 10}, 
std::string("-10.0000000000")},
-            {{Decimal64(999999999999999999), 0}, std::string("10")},
-            {{Decimal64(-49999999999999999), 0}, std::string("-0")},
-            {{Decimal64(-50000000000000000), 0}, std::string("-1")}};
+            {{Decimal64(int64_t(112499999999999999)), 2}, std::string("1.12")},
+            {{Decimal64(int64_t(-112499999999999999)), 2}, 
std::string("-1.12")},
+            {{Decimal64(int64_t(112499999999999999)), 10}, 
std::string("1.1250000000")},
+            {{Decimal64(int64_t(112345678901234567)), 17}, 
std::string("1.12345678901234567")},
+            {{Decimal64(int64_t(-112345678901234567)), 16}, 
std::string("-1.1234567890123457")},
+            {{Decimal64(int64_t(999999999999999999)), 16}, 
std::string("10.0000000000000000")},
+            {{Decimal64(int64_t(-999999999999999999)), 10}, 
std::string("-10.0000000000")},
+            {{Decimal64(int64_t(999999999999999999)), 0}, std::string("10")},
+            {{Decimal64(int64_t(-49999999999999999)), 0}, std::string("-0")},
+            {{Decimal64(int64_t(-50000000000000000)), 0}, std::string("-1")}};
     check_function_all_arg_comb<DataTypeString, true>("format_round", 
arguments, data);
 }
 
@@ -149,7 +149,7 @@ TEST(FormatRoundTest, money_format_high_scale) {
             {{{Decimal32(112499999)}, std::string("1.12")}});
     check_function_all_arg_comb<DataTypeString, true>(
             "money_format", {{TYPE_DECIMAL64, 17, 18}},
-            {{{Decimal64(112499999999999999)}, std::string("1.12")}});
+            {{{Decimal64(int64_t(112499999999999999))}, std::string("1.12")}});
     const Int128 value =
             common::exp10_i128(37) + common::exp10_i128(36) + 
common::exp10_i128(34) * 25 - 1;
     check_function_all_arg_comb<DataTypeString, true>(
diff --git 
a/be/test/storage/index/snii/bench/bkd_native_vs_clucene_bench_test.cpp 
b/be/test/storage/index/snii/bench/bkd_native_vs_clucene_bench_test.cpp
index 79d2cef83d7..0acc8538aeb 100644
--- a/be/test/storage/index/snii/bench/bkd_native_vs_clucene_bench_test.cpp
+++ b/be/test/storage/index/snii/bench/bkd_native_vs_clucene_bench_test.cpp
@@ -57,6 +57,7 @@
 #include <time.h>
 
 #include <algorithm>
+#include <cinttypes>
 #include <cmath>
 #include <cstdint>
 #include <cstdlib>
@@ -372,7 +373,7 @@ TEST_F(BkdNativeVsCluceneBench, DISABLED_BuildAndQuery) {
     const int64_t span = 1 << 20;
 
     printf("\n=== SNII-native BKD vs CLucene BKD ===\n");
-    printf("points=%u  span=+/-%ld  iterations=%d  points_per_leaf=%u\n", 
point_count, span,
+    printf("points=%u  span=+/-%" PRId64 "  iterations=%d  
points_per_leaf=%u\n", point_count, span,
            iterations, kDefaultPointsPerLeaf);
 
     const std::vector<EncodedPoint> points = make_points(point_count, span);
@@ -399,9 +400,10 @@ TEST_F(BkdNativeVsCluceneBench, DISABLED_BuildAndQuery) {
     const Measurement clucene_build = measure([&] { clucene.build(points); });
 
     const uint64_t native_bytes = native_index_bytes.size() + 
native_data.bytes().size();
-    printf("\nbuild   native  cpu=%8.3f s  bytes=%10lu  leaves=%u\n", 
native_build.cpu_s,
+    printf("\nbuild   native  cpu=%8.3f s  bytes=%10" PRIu64 "  leaves=%u\n", 
native_build.cpu_s,
            native_bytes, stats.leaf_count);
-    printf("build   clucene cpu=%8.3f s  bytes=%10lu\n", clucene_build.cpu_s, 
clucene.bytes());
+    printf("build   clucene cpu=%8.3f s  bytes=%10" PRIu64 "\n", 
clucene_build.cpu_s,
+           clucene.bytes());
     printf("build   ratio   cpu=%8.3fx  bytes=%8.3fx  (>1 means native is 
worse)\n",
            native_build.cpu_s / clucene_build.cpu_s,
            static_cast<double>(native_bytes) / 
static_cast<double>(clucene.bytes()));
@@ -479,7 +481,7 @@ TEST_F(BkdNativeVsCluceneBench, DISABLED_BuildAndQuery) {
         // the ANSWER is meaningless; assert equality before reporting.
         ASSERT_EQ(native_hits, clucene_hits) << "case " << c.label << " 
disagrees on the result";
 
-        printf("%s (hits=%lu)\n", c.label, native_hits);
+        printf("%s (hits=%" PRIu64 ")\n", c.label, native_hits);
         report("native", c.label, native_cpu, native_wall);
         report("clucene", c.label, clucene_cpu, clucene_wall);
         std::sort(native_cpu.begin(), native_cpu.end());
@@ -579,7 +581,7 @@ TEST_F(BkdNativeVsCluceneBench, DISABLED_InListManyValues) {
     }
 
     ASSERT_EQ(native_hits, clucene_hits) << "in_list disagrees on the result";
-    printf("in_list (values=%zu, hits=%lu)\n", encoded.size(), native_hits);
+    printf("in_list (values=%zu, hits=%" PRIu64 ")\n", encoded.size(), 
native_hits);
     report("native", "in_list", native_cpu, native_wall);
     report("clucene", "in_list", clucene_cpu, clucene_wall);
     std::sort(native_cpu.begin(), native_cpu.end());
@@ -704,7 +706,8 @@ TEST_F(BkdNativeVsCluceneBench, 
DISABLED_ResultMaterializationFloor) {
     std::sort(floor_only.begin(), floor_only.end());
     const double q = nearest_rank_percentile(full, 50) * 1e3;
     const double f = nearest_rank_percentile(floor_only, 50) * 1e3;
-    printf("\n=== result materialization floor (range_wide, %lu hits) ===\n", 
answer.cardinality());
+    printf("\n=== result materialization floor (range_wide, %" PRIu64 " hits) 
===\n",
+           answer.cardinality());
     printf("  full query          p50 = %8.3f ms\n", q);
     printf("  bitmap build only   p50 = %8.3f ms  (%.1f%% of the query)\n", f, 
100.0 * f / q);
     printf("  index work          p50 = %8.3f ms\n", q - f);
diff --git a/be/test/storage/index/snii/bench/snii_vs_v3_benchmark_test.cpp 
b/be/test/storage/index/snii/bench/snii_vs_v3_benchmark_test.cpp
index b3674d83acf..0fc14aab532 100644
--- a/be/test/storage/index/snii/bench/snii_vs_v3_benchmark_test.cpp
+++ b/be/test/storage/index/snii/bench/snii_vs_v3_benchmark_test.cpp
@@ -1027,6 +1027,13 @@ protected:
     // Pages of `path` still resident in the OS page cache. Used to prove the 
eviction below
     // actually worked instead of assuming it did.
     static std::pair<size_t, size_t> _resident_pages(const std::string& path) {
+        // mincore(2) takes char* on Darwin and unsigned char* on Linux; only 
the low bit of
+        // each entry is read, so one element type keeps a single call for 
both.
+#if defined(__APPLE__)
+        using mincore_vec_t = char;
+#else
+        using mincore_vec_t = unsigned char;
+#endif
         const int fd = ::open(path.c_str(), O_RDONLY);
         if (fd < 0) {
             return {0, 0};
@@ -1043,10 +1050,10 @@ protected:
         }
         const size_t page_size = static_cast<size_t>(::sysconf(_SC_PAGESIZE));
         const size_t pages = (static_cast<size_t>(st.st_size) + page_size - 1) 
/ page_size;
-        std::vector<unsigned char> vec(pages, 0);
+        std::vector<mincore_vec_t> vec(pages, 0);
         size_t resident = 0;
         if (::mincore(addr, static_cast<size_t>(st.st_size), vec.data()) == 0) 
{
-            for (unsigned char v : vec) {
+            for (mincore_vec_t v : vec) {
                 resident += (v & 1u);
             }
         }
@@ -1080,7 +1087,10 @@ protected:
                 continue;
             }
             ::fsync(fd);
+            // posix_fadvise is Linux-only; elsewhere the fsync above is all 
this can do.
+#if defined(POSIX_FADV_DONTNEED)
             ::posix_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED);
+#endif
             ::close(fd);
         }
     }
diff --git a/be/test/storage/index/snii/bkd/bkd_corruption_test.cpp 
b/be/test/storage/index/snii/bkd/bkd_corruption_test.cpp
index 55ef5d07ec9..9032fd1092a 100644
--- a/be/test/storage/index/snii/bkd/bkd_corruption_test.cpp
+++ b/be/test/storage/index/snii/bkd/bkd_corruption_test.cpp
@@ -548,13 +548,16 @@ TEST(BkdCorruptionTest, 
InflatedSectionLengthIsCaughtByTheBoundsCheckNotTheCheck
             original.bytes.begin() + static_cast<long>(original.data_begin),
             original.bytes.begin() + static_cast<long>(original.data_begin + 
original.data_size));
     const std::vector<uint8_t> payload = payload_of(original.index_bytes());
+    // payload.size() is size_t, which is not uint64_t on every platform; 
mixing the two in
+    // one initializer list leaves the element type undeducible.
+    const uint64_t payload_size = payload.size();
 
     // THE old defect, reproduced: a length field read off disk and then 
trusted
     // as a size. The checksum here is CORRECT for the bytes present, so 
nothing
     // but a bounds check inside ByteSource can stop it -- and in the old
     // implementation nothing did: ByteArrayDataInput::readBytes was a plain
     // std::copy of the declared length, i.e. a heap overread.
-    for (const uint64_t declared : {payload.size() + 1, payload.size() + 4096, 
uint64_t {1} << 20,
+    for (const uint64_t declared : {payload_size + 1, payload_size + 4096, 
uint64_t {1} << 20,
                                     uint64_t {1} << 40, uint64_t 
{0xFFFFFFFFFFFFFFFFULL}}) {
         SCOPED_TRACE("declared payload length " + std::to_string(declared));
         const Image damaged = assemble(frame_with_declared_length(payload, 
declared), data_bytes);
@@ -563,7 +566,7 @@ TEST(BkdCorruptionTest, 
InflatedSectionLengthIsCaughtByTheBoundsCheckNotTheCheck
     }
 
     // A shrunken one is damage too: the payload then has bytes nobody claims.
-    for (const uint64_t declared : {uint64_t {0}, uint64_t {1}, payload.size() 
- 1}) {
+    for (const uint64_t declared : {uint64_t {0}, uint64_t {1}, payload_size - 
1}) {
         SCOPED_TRACE("declared payload length " + std::to_string(declared));
         const Image damaged = assemble(frame_with_declared_length(payload, 
declared), data_bytes);
         const Outcome outcome = probe(damaged);
diff --git a/be/test/storage/index/snii/writer/spimi_locality_bench_test.cpp 
b/be/test/storage/index/snii/writer/spimi_locality_bench_test.cpp
index 4ef4a4ff411..6541cde2a74 100644
--- a/be/test/storage/index/snii/writer/spimi_locality_bench_test.cpp
+++ b/be/test/storage/index/snii/writer/spimi_locality_bench_test.cpp
@@ -237,13 +237,20 @@ TEST(SniiSpimiLocalityBenchTest, 
InternSetReserveUpperBound) {
             return operator()(std::string_view((*vocab)[id]));
         }
     };
+    // Transparent equality for the intern set. Both argument orders are 
needed because libc++
+    // calls key_equal as (key, lookup key) and libstdc++ as (lookup key, 
key); whichever order
+    // the standard library in use never calls looks like an unused member 
function to clang
+    // (-Wunused-member-function is on), hence the [[maybe_unused]] on both.
     struct Equal {
         using is_transparent = void;
         const std::vector<std::string>* vocab;
         bool operator()(uint32_t lhs, uint32_t rhs) const noexcept { return 
lhs == rhs; }
-        bool operator()(std::string_view lhs, uint32_t rhs) const noexcept {
+        [[maybe_unused]] bool operator()(std::string_view lhs, uint32_t rhs) 
const noexcept {
             return lhs == std::string_view((*vocab)[rhs]);
         }
+        [[maybe_unused]] bool operator()(uint32_t lhs, std::string_view rhs) 
const noexcept {
+            return std::string_view((*vocab)[lhs]) == rhs;
+        }
     };
 
     std::unordered_set<uint32_t> distinct_ids(input.tokens.begin(), 
input.tokens.end());
diff --git a/be/test/storage/segment/hierarchical_data_iterator_test.cpp 
b/be/test/storage/segment/hierarchical_data_iterator_test.cpp
index 918b079af71..89edd15f3bd 100644
--- a/be/test/storage/segment/hierarchical_data_iterator_test.cpp
+++ b/be/test/storage/segment/hierarchical_data_iterator_test.cpp
@@ -118,7 +118,11 @@ public:
             return Status::InvalidArgument("JSONB destination is not a string 
column");
         }
 
-        const size_t produced = std::min(*rows, kRows - 
_state->current_ordinal);
+        // kRows is size_t while current_ordinal is ordinal_t (uint64_t); on 
platforms where
+        // those are distinct types std::min cannot deduce a common argument 
type, so narrow
+        // the remaining row count first.
+        const size_t available = kRows - _state->current_ordinal;
+        const size_t produced = std::min(*rows, available);
         auto serde = std::make_shared<DataTypeJsonb>()->get_serde();
         DataTypeSerDe::FormatOptions options;
         for (size_t row = 0; row < produced; ++row) {
@@ -166,7 +170,9 @@ public:
             return Status::InvalidArgument("sparse destination is not a map");
         }
 
-        const size_t produced = std::min(*rows, kRows - 
_state->current_ordinal);
+        // Same as above: keep the min() arguments a single type.
+        const size_t available = kRows - _state->current_ordinal;
+        const size_t produced = std::min(*rows, available);
         auto& keys = assert_cast<ColumnString&>(map->get_keys());
         auto& values = assert_cast<ColumnString&>(map->get_values());
         auto& offsets = map->get_offsets();
@@ -221,7 +227,8 @@ public:
             return Status::InvalidArgument("JSONB sparse destination is not a 
map");
         }
 
-        const size_t produced = std::min(*rows, kRows - _current_ordinal);
+        const size_t available = kRows - _current_ordinal;
+        const size_t produced = std::min(*rows, available);
         auto& keys = assert_cast<ColumnString&>(map->get_keys());
         auto& values = assert_cast<ColumnString&>(map->get_values());
         auto& offsets = map->get_offsets();
diff --git a/run-be-ut.sh b/run-be-ut.sh
index d0470b64bb8..7c91c01333b 100755
--- a/run-be-ut.sh
+++ b/run-be-ut.sh
@@ -251,9 +251,14 @@ update_submodule() {
     fi
 }
 
+# Keep this list in sync with build.sh: be/CMakeLists.txt adds 
storage/index/ann
+# unconditionally, and its cmake-protect target add_subdirectory()s both faiss 
and openblas,
+# so the configure step fails outright when either is missing.
 update_submodule "contrib/datasketches-cpp" "datasketches-cpp" 
"https://github.com/apache/datasketches-cpp/archive/refs/heads/master.tar.gz";
 update_submodule "contrib/apache-orc" "apache-orc" 
"https://github.com/apache/doris-thirdparty/archive/refs/heads/orc.tar.gz";
 update_submodule "contrib/clucene" "clucene" 
"https://github.com/apache/doris-thirdparty/archive/refs/heads/clucene.tar.gz";
+update_submodule "contrib/openblas" "openblas" 
"https://github.com/apache/doris-thirdparty/archive/refs/heads/openblas.tar.gz";
+update_submodule "contrib/faiss" "faiss" 
"https://github.com/apache/doris-thirdparty/archive/refs/heads/faiss.tar.gz";
 
 if [[ "_${DENABLE_CLANG_COVERAGE}" == "_ON" ]]; then
     echo "export DORIS_TOOLCHAIN=clang" >>custom_env.sh


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

Reply via email to