Skip to content
Merged
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
1 change: 1 addition & 0 deletions .github/.rat-excludes
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ iwyu_tool\.py
arrow\.diff
jieba\.diff
orc\.diff
oss_sdk_v2\.diff
vortex\.diff
licenses/*
.codespell_ignore
Expand Down
41 changes: 41 additions & 0 deletions .github/actions/setup-release-assets/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Prepare release assets
description: Cache and verify pinned GitHub release archives before building
runs:
using: composite
steps:
- uses: actions/cache@v4
with:
path: ${{ runner.temp }}/paimon-release-assets
key: release-assets-v1-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('third_party/versions.txt', 'ci/scripts/setup_rust.sh') }}
- shell: bash
run: |
set -eu
source third_party/versions.txt
cache_dir="${RUNNER_TEMP}/paimon-release-assets"
for entry in "${DEPENDENCIES[@]}"; do
read -r var archive url <<< "${entry}"
case "${var}" in
PAIMON_ZLIB_URL|PAIMON_ZSTD_URL|PAIMON_PROTOBUF_URL|PAIMON_ARROW_URL)
checksum_var="${var%_URL}_BUILD_SHA256_CHECKSUM"
bash ci/scripts/download_release_asset.sh "${url}" "${cache_dir}/${archive}" "${!checksum_var}"
echo "${var}=${cache_dir}/${archive}" >> "${GITHUB_ENV}"
;;
esac
done
echo "PAIMON_RELEASE_ASSET_DIR=${cache_dir}" >> "${GITHUB_ENV}"
24 changes: 24 additions & 0 deletions .github/workflows/build_and_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ jobs:
- name: Run CMake module tests
shell: bash
run: ci/scripts/test_cmake_modules.sh
- name: Test release asset downloads
shell: bash
run: bash ci/scripts/test_download_release_asset.sh
- name: Run packaging argument tests
shell: bash
run: ci/scripts/test_packaging_args.sh
Expand Down Expand Up @@ -88,6 +91,12 @@ jobs:
cc: gcc-14
cxx: g++-14
build_args: --build_type Release
- name: gcc13-release-aarch64
runner: ubuntu-24.04-arm
cc: gcc-13
cxx: g++-13
gcc_version: '13.3.0'
build_args: --build_type Release
- name: clang-debug-aarch64
runner: ubuntu-24.04-arm
- name: asan-ubsan-aarch64
Expand All @@ -109,13 +118,28 @@ jobs:
uses: ./.github/actions/setup-ccache
with:
cache-key-prefix: ccache-${{ matrix.name }}
- name: Prepare release assets
uses: ./.github/actions/setup-release-assets
- name: Install Rust and protobuf tools
shell: bash
run: ci/scripts/setup_rust.sh
- name: Install build and debugging dependencies
run: |
sudo apt-get update
sudo apt-get install -y gdb libcurl4-openssl-dev libssl-dev
- name: Install and verify regression compiler
if: matrix.gcc_version
shell: bash
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
EXPECTED_GCC_VERSION: ${{ matrix.gcc_version }}
run: |
sudo apt-get install -y "${CC}" "${CXX}"
"${CC}" --version
"${CXX}" --version
test "$("${CC}" -dumpfullversion)" = "${EXPECTED_GCC_VERSION}"
test "$("${CXX}" -dumpfullversion)" = "${EXPECTED_GCC_VERSION}"
- name: Install flatc and libclang (Vortex)
shell: bash
run: ci/scripts/setup_flatc.sh
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/gcc8_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,19 @@ jobs:
container:
image: ubuntu:20.04
options: --privileged
volumes:
# The minimal image has no CA bundle until apt installs ca-certificates.
- /etc/ssl/certs/ca-certificates.crt:/etc/apt/runner-ca-certificates.crt:ro
timeout-minutes: 120
strategy:
fail-fast: false
steps:
- name: Install dependencies
run: |
sed -i -e 's|http://archive.ubuntu.com/ubuntu|https://archive.ubuntu.com/ubuntu|g' \
-e 's|http://security.ubuntu.com/ubuntu|https://security.ubuntu.com/ubuntu|g' /etc/apt/sources.list
printf '%s\n' 'Acquire::https::CaInfo "/etc/apt/runner-ca-certificates.crt";' \
'Acquire::Retries "3";' > /etc/apt/apt.conf.d/80-ci-downloads
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y gcc-8 g++-8 ninja-build git tar curl libcurl4-openssl-dev libssl-dev tzdata zip unzip pkg-config build-essential python3-dev gdb sudo
curl -L -O https://github.com/Kitware/CMake/releases/download/v3.28.3/cmake-3.28.3-linux-x86_64.tar.gz
Expand All @@ -60,10 +67,13 @@ jobs:
ls -la
- name: Checkout paimon-cpp
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Prepare release assets
uses: ./.github/actions/setup-release-assets
- name: Install Rust and protobuf tools
shell: bash
run: ci/scripts/setup_rust.sh
- name: Setup ccache
id: setup-ccache
uses: ./.github/actions/setup-ccache
with:
cache-key-prefix: ccache-gcc8-test
Expand All @@ -77,5 +87,5 @@ jobs:
CXX: g++-8
run: ci/scripts/build_paimon.sh --source_dir "$(pwd)"
- name: Show ccache statistics
if: always()
if: always() && steps.setup-ccache.outcome == 'success'
run: ccache -s
9 changes: 9 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,15 @@ License: https://www.apache.org/licenses/LICENSE-2.0

--------------------------------------------------------------------------------

This product includes code from Alibaba Cloud OSS SDK for C++ V2 0.1.2.

* Upstream source patch in cmake_modules/oss_sdk_v2.diff

Home page: https://github.com/aliyun/alibabacloud-oss-cpp-sdk-v2
License: https://www.apache.org/licenses/LICENSE-2.0

--------------------------------------------------------------------------------

This product includes code from xxHash.

* MMH_rotl32 utility in src/paimon/common/utils/murmurhash_utils.h
Expand Down
9 changes: 5 additions & 4 deletions benchmark/parquet_format_benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,10 +386,11 @@ Result<std::shared_ptr<arrow::Array>> MakeVectorColumn(int64_t num_rows, int64_t
// A Parquet MAP is a LIST of a two-field STRUCT, so against LIST the difference is the key leaf.
Result<std::shared_ptr<arrow::Array>> MakeMapColumn(int64_t num_rows, int64_t offset,
int32_t entries) {
auto key_builder = std::make_shared<arrow::StringBuilder>();
auto item_builder = std::make_shared<arrow::Int64Builder>();
arrow::MapBuilder builder(arrow::default_memory_pool(), key_builder, item_builder,
MapColumnType());
arrow::MapBuilder builder(arrow::default_memory_pool(),
std::make_shared<arrow::StringBuilder>(),
std::make_shared<arrow::Int64Builder>(), MapColumnType());
auto* key_builder = paimon::checked_cast<arrow::StringBuilder*>(builder.key_builder());
auto* item_builder = paimon::checked_cast<arrow::Int64Builder*>(builder.item_builder());
PAIMON_RETURN_NOT_OK_FROM_ARROW(builder.Reserve(num_rows));
PAIMON_RETURN_NOT_OK_FROM_ARROW(key_builder->Reserve(num_rows * entries));
PAIMON_RETURN_NOT_OK_FROM_ARROW(item_builder->Reserve(num_rows * entries));
Expand Down
14 changes: 8 additions & 6 deletions benchmark/parquet_format_benchmark_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -483,13 +483,15 @@ TEST_F(ParquetFormatBenchmarkTest, DecimalPrecisionRoundTrip) {
// trip with the shape the read schema asks for.
TEST_F(ParquetFormatBenchmarkTest, NestedRoundTrip) {
constexpr int32_t kEntries = 4;
auto list_values = std::make_shared<arrow::Int64Builder>();
arrow::ListBuilder list_builder(arrow::default_memory_pool(), list_values,
arrow::ListBuilder list_builder(arrow::default_memory_pool(),
std::make_shared<arrow::Int64Builder>(),
arrow::list(arrow::int64()));
auto key_builder = std::make_shared<arrow::StringBuilder>();
auto item_builder = std::make_shared<arrow::Int64Builder>();
arrow::MapBuilder map_builder(arrow::default_memory_pool(), key_builder, item_builder,
arrow::map(arrow::utf8(), arrow::int64()));
auto* list_values = checked_cast<arrow::Int64Builder*>(list_builder.value_builder());
arrow::MapBuilder map_builder(
arrow::default_memory_pool(), std::make_shared<arrow::StringBuilder>(),
std::make_shared<arrow::Int64Builder>(), arrow::map(arrow::utf8(), arrow::int64()));
auto* key_builder = checked_cast<arrow::StringBuilder*>(map_builder.key_builder());
auto* item_builder = checked_cast<arrow::Int64Builder*>(map_builder.item_builder());
for (int64_t i = 0; i < kRows; ++i) {
ASSERT_TRUE(list_builder.Append().ok());
ASSERT_TRUE(map_builder.Append().ok());
Expand Down
5 changes: 3 additions & 2 deletions ci/scripts/build_paimon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,10 @@ if [[ "${enable_tsan}" == "true" ]]; then
fi
# CI always builds natively, so the host architecture is the target architecture.
host_arch=$(uname -m)
if [[ "${host_arch}" != "x86_64" ]]; then
if [[ "$(uname -s)" != "Linux" ||
( "${host_arch}" != "x86_64" && "${host_arch}" != "aarch64" && "${host_arch}" != "arm64" ) ]]; then
ENABLE_LUMINA="OFF"
echo "=== Lumina disabled: no prebuilt artifacts for ${host_arch} ==="
echo "=== Lumina disabled: no prebuilt artifacts for $(uname -s)-${host_arch} ==="
fi
if [[ "${verify_full_text_archives}" == "true" && "${ENABLE_FULL_TEXT}" != "ON" ]]; then
echo "--verify_full_text_archives requires the full-text index, which this build disables" >&2
Expand Down
54 changes: 54 additions & 0 deletions ci/scripts/download_release_asset.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/usr/bin/env bash
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Fetch a pinned GitHub release asset. Use the release API if the browser
# download endpoint times out, and publish a file only after verification.
set -euo pipefail

url=$1
output=$2
sha256=$3

verify() {
if command -v sha256sum >/dev/null; then
echo "${sha256} $1" | sha256sum -c -
else
echo "${sha256} $1" | shasum -a 256 -c -
fi
}

if [[ -f "${output}" ]] && verify "${output}"; then
exit 0
fi

mkdir -p "$(dirname "${output}")"
tmp=$(mktemp "${output}.XXXXXX")
trap 'rm -f "${tmp}"' EXIT
curl_args=(--proto '=https' --tlsv1.2 -fsSL --retry 3 --connect-timeout 15 --max-time 180)
if ! curl "${curl_args[@]}" "${url}" -o "${tmp}" || ! verify "${tmp}"; then
release=${url#https://github.com/}
repo=${release%%/releases/download/*}
asset=${release##*/}
tag=${release#*/releases/download/}
tag=${tag%/*}
asset_url=$(curl "${curl_args[@]}" "https://api.github.com/repos/${repo}/releases/tags/${tag}" |
python3 -c 'import json, sys
print(next(a["url"] for a in json.load(sys.stdin)["assets"] if a["name"] == sys.argv[1]))' "${asset}")
curl "${curl_args[@]}" -H 'Accept: application/octet-stream' "${asset_url}" -o "${tmp}"
verify "${tmp}"
fi
mv -f "${tmp}" "${output}"
7 changes: 3 additions & 4 deletions ci/scripts/setup_rust.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,11 @@ if ! command -v protoc >/dev/null 2>&1 || \
;;
esac
protoc_home="${HOME}/.local/protoc-${PROTOC_VERSION}"
protoc_archive="/tmp/protoc-${PROTOC_VERSION}-${protoc_arch}.zip"
protoc_archive="${PAIMON_RELEASE_ASSET_DIR:-/tmp}/protoc-${PROTOC_VERSION}-${protoc_arch}.zip"
if [[ ! -x "${protoc_home}/bin/protoc" ]]; then
curl --proto '=https' --tlsv1.2 -fL \
bash "$(dirname "${BASH_SOURCE[0]}")/download_release_asset.sh" \
"https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-${protoc_arch}.zip" \
-o "${protoc_archive}"
echo "${protoc_sha256} ${protoc_archive}" | sha256sum --check
"${protoc_archive}" "${protoc_sha256}"
mkdir -p "${protoc_home}"
unzip -oq "${protoc_archive}" -d "${protoc_home}"
fi
Expand Down
57 changes: 57 additions & 0 deletions ci/scripts/test_download_release_asset.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/usr/bin/env bash
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
set -euo pipefail

script="$(dirname "${BASH_SOURCE[0]}")/download_release_asset.sh"
work=$(mktemp -d)
trap 'rm -rf "${work}"' EXIT
export PATH="${work}:${PATH}"
export REQUEST_LOG="${work}/requests"
cat > "${work}/curl" <<'MOCK'
#!/usr/bin/env bash
set -eu
echo request >> "${REQUEST_LOG}"
case "$*" in
*github.com/org/repo/releases/download/*) exit 22 ;;
*api.github.com/repos/org/repo/releases/tags/v1*)
echo '{"assets":[{"name":"archive","url":"https://api.github.com/assets/123"}]}' ;;
*application/octet-stream*https://api.github.com/assets/123*)
printf '%s' "${ASSET_CONTENT:-abc}" > "${!#}" ;;
*) exit 1 ;;
esac
MOCK
chmod +x "${work}/curl"
url=https://github.com/org/repo/releases/download/v1/archive
checksum=ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad
fetch() {
bash "${script}" "${url}" "${work}/archive" "${checksum}"
}

fetch
[[ $(cat "${work}/archive") == abc ]]
fetch
[[ $(wc -l < "${REQUEST_LOG}") -eq 3 ]]
echo corrupt > "${work}/archive"
fetch
[[ $(cat "${work}/archive") == abc ]]
rm "${work}/archive"
if ASSET_CONTENT=invalid fetch; then
echo "Checksum mismatch accepted" >&2
exit 1
fi
[[ ! -e "${work}/archive" ]]
14 changes: 11 additions & 3 deletions cmake_modules/ThirdpartyToolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1089,8 +1089,10 @@ macro(build_boost)
-sZLIB_LIBRARY_PATH=${ZLIB_PREFIX}/lib
runtime-link=shared threading=multi variant=release
--user-config=${BOOST_USER_CONFIG}
toolset=${BOOST_TOOLSET} cxxflags=${EP_CXX_FLAGS}
linkflags=${EP_CXX_FLAGS} install
toolset=${BOOST_TOOLSET}
cxxstd=${CMAKE_CXX_STANDARD}
cxxflags=${EP_CXX_FLAGS} linkflags=${EP_CXX_FLAGS}
install
INSTALL_COMMAND ""
DEPENDS zlib
BUILD_BYPRODUCTS ${BOOST_BYPRODUCTS}
Expand Down Expand Up @@ -1332,7 +1334,7 @@ endmacro()
macro(build_lumina)
# The release tarball ships one prebuilt artifact tree per platform; keep this
# list in sync with the platforms the pinned release actually contains.
set(LUMINA_SUPPORTED_PLATFORMS "linux-x86_64")
set(LUMINA_SUPPORTED_PLATFORMS "linux-x86_64" "linux-aarch64")
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND PAIMON_TARGET_CPU_FAMILY STREQUAL "x86")
set(LUMINA_ARTIFACT_PLATFORM "linux-x86_64")
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND PAIMON_TARGET_CPU_FAMILY STREQUAL
Expand Down Expand Up @@ -1681,10 +1683,16 @@ macro(build_oss_sdk_v2)
"-DCURL_LIBRARY_RELEASE=${OSS_SDK_V2_CURL_LIBRARY}")
endif()

# Avoid copying the metadata variant, which triggers GCC 12's
# -Wmaybe-uninitialized warning in optimized builds.
set(OSS_SDK_V2_PATCH_FILE "${CMAKE_CURRENT_LIST_DIR}/oss_sdk_v2.diff")
externalproject_add(oss_sdk_v2_ep
${EP_COMMON_OPTIONS}
URL ${OSS_SDK_V2_SOURCE_URL}
URL_HASH "SHA256=${PAIMON_OSS_SDK_V2_BUILD_SHA256_CHECKSUM}"
LOG_PATCH ON
PATCH_COMMAND ${CMAKE_COMMAND} -E chdir <SOURCE_DIR> bash -c
"[ -f .patched ] && echo '<SOURCE_DIR> patch already applied, ignore...' || patch -s -N -p1 -i '${OSS_SDK_V2_PATCH_FILE}' && touch .patched"
CMAKE_ARGS ${OSS_SDK_V2_CMAKE_ARGS} ${THIRDPARTY_LOG_OPTIONS}
BUILD_BYPRODUCTS "${OSS_SDK_V2_STATIC_LIB}")

Expand Down
11 changes: 11 additions & 0 deletions cmake_modules/oss_sdk_v2.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
diff --git a/sdk/src/internal/ClientImplBase.cpp b/sdk/src/internal/ClientImplBase.cpp
--- a/sdk/src/internal/ClientImplBase.cpp
+++ b/sdk/src/internal/ClientImplBase.cpp
@@ -354,6 +354,6 @@
context.signingContext.expirationInEpoch = 0;
if (input.opMetadata.find("EXPIRATION_TIME") != input.opMetadata.end()) {
- auto value = input.opMetadata.at("EXPIRATION_TIME");
+ const auto& value = input.opMetadata.at("EXPIRATION_TIME");
if (auto* val = std::get_if<std::int64_t>(&value)) {
context.signingContext.expirationInEpoch = static_cast<std::time_t>(*val);
}
Loading
Loading