Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 27 additions & 6 deletions .github/workflows/be-ut-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ jobs:
max-size: "5G"
restore-keys: BE-UT-macOS-

- name: Set up JDK 17
if: ${{ github.event_name == 'schedule' || steps.filter.outputs.be_changes == 'true' }}
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'

- name: Run UT ${{ github.ref }}
if: ${{ github.event_name == 'schedule' || steps.filter.outputs.be_changes == 'true' }}
run: |
Expand Down Expand Up @@ -86,15 +93,29 @@ jobs:

pushd thirdparty
branch="${{ github.base_ref }}"
arch="$(uname -m)"
if [[ "${arch}" == "amd64" ]]; then
arch="x86_64"
fi
thirdparty_archive="doris-thirdparty-prebuilt-darwin-${arch}.tar.xz"
if [[ -z "${branch}" ]] || [[ "${branch}" == 'master' ]]; then
curl -L https://github.com/apache/doris-thirdparty/releases/download/automation/doris-thirdparty-prebuilt-darwin-x86_64.tar.xz \
-o doris-thirdparty-prebuilt-darwin-x86_64.tar.xz
curl -L "https://github.com/apache/doris-thirdparty/releases/download/automation/${thirdparty_archive}" \
-o "${thirdparty_archive}"
else
curl -L "https://github.com/apache/doris-thirdparty/releases/download/automation-${branch/branch-/}/doris-thirdparty-prebuilt-darwin-x86_64.tar.xz" \
-o doris-thirdparty-prebuilt-darwin-x86_64.tar.xz
curl -L "https://github.com/apache/doris-thirdparty/releases/download/automation-${branch/branch-/}/${thirdparty_archive}" \
-o "${thirdparty_archive}"
fi
tar -xvf doris-thirdparty-prebuilt-darwin-x86_64.tar.xz
tar -xvf "${thirdparty_archive}"
popd

export JAVA_HOME="${JAVA_HOME_17_X64%\/}"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This workflow still fails on the PR check after this change. The log for BE UT (macOS) shows the macos-15 runner is arm64 (/opt/homebrew, ARM_MARCH is armv8-a+crc, Temurin path under arm64), and these new exports make CMake configure a native arm64 clang build. However the job still downloads and extracts doris-thirdparty-prebuilt-darwin-x86_64.tar.xz, and the build then stops with ninja: error: .../thirdparty/installed/lib64/libarrow_dataset.a, needed by 'test/doris_be_test', missing and no known rule to make it. So the workflow fix is incomplete: please either run this job on an Intel macOS label / x86_64 toolchain, or switch the downloaded third-party archive and toolchain setup to the matching arm64 package so ./run-be-ut.sh can actually build.

llvm_prefix="$(brew --prefix llvm@16)"
export DORIS_TOOLCHAIN=clang
export DORIS_CLANG_HOME="${llvm_prefix}"
export CC="${llvm_prefix}/bin/clang"
export CXX="${llvm_prefix}/bin/clang++"
export PATH="${llvm_prefix}/bin:${PATH}"
export LDFLAGS="-L${llvm_prefix}/lib ${LDFLAGS:-}"
export CPPFLAGS="-I${llvm_prefix}/include ${CPPFLAGS:-}"
export CMAKE_PREFIX_PATH="${llvm_prefix}:${CMAKE_PREFIX_PATH:-}"
export JAVA_HOME="${JAVA_HOME%\/}"
./run-be-ut.sh --run -j "$(nproc)" --clean
5 changes: 3 additions & 2 deletions be/src/exprs/function/function_jsonb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2048,6 +2048,7 @@ class FunctionJsonbModify : public IFunction {

bool replace = false;
parents.emplace_back(json_documents[row_idx]->getValue());
const auto legs_count = json_path[path_index].get_leg_vector_size();
if (find_result.value) {
// find target path, replace it with the new value.
replace = true;
Expand All @@ -2059,7 +2060,8 @@ class FunctionJsonbModify : public IFunction {
} else {
// does not find target path, insert the new value.
JsonbPath new_path;
for (size_t j = 0; j < json_path[path_index].get_leg_vector_size() - 1; ++j) {
DCHECK_GT(legs_count, 0);
for (size_t j = 0; j + 1 < legs_count; ++j) {
auto* current_leg = json_path[path_index].get_leg_from_leg_vector(j);
std::unique_ptr<leg_info> leg = std::make_unique<leg_info>(
current_leg->leg_ptr, current_leg->leg_len,
Expand All @@ -2073,7 +2075,6 @@ class FunctionJsonbModify : public IFunction {
}
}

const auto legs_count = json_path[path_index].get_leg_vector_size();
leg_info* last_leg =
legs_count > 0
? json_path[path_index].get_leg_from_leg_vector(legs_count - 1)
Expand Down
Loading