Skip to content

Commit 9a332eb

Browse files
authored
Merge pull request #338 from wudidapaopao/upgrade-to-v25.5.2.47
Upgrade ClickHouse version to v25.5.2.47
2 parents d4f2c62 + f9a0b3a commit 9a332eb

File tree

5,511 files changed

+589419
-167724
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

5,511 files changed

+589419
-167724
lines changed

.clang-format

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ NamespaceIndentation: None
8383
ObjCBlockIndentWidth: 4
8484
ObjCSpaceAfterProperty: true
8585
ObjCSpaceBeforeProtocolList: true
86+
PackConstructorInitializers: Never
8687
PenaltyBreakBeforeFirstCallParameter: 19
8788
PenaltyBreakComment: 300
8889
PenaltyBreakFirstLessLess: 120

.clang-tidy

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,40 +10,30 @@ HeaderFilterRegex: '^.*/(base|src|programs|utils)/.*(h|hpp)$'
1010
Checks: [
1111
'*',
1212

13-
'-abseil-*',
13+
'-abseil-string-find-str-contains', # disabled to avoid a misleading suggestion (obsolete absl::StrContains() instead of C++23 std::string::contains())
1414

1515
'-altera-*',
1616

1717
'-android-*',
1818

19+
'-boost-use-ranges',
20+
1921
'-bugprone-assignment-in-if-condition',
2022
'-bugprone-branch-clone',
2123
'-bugprone-easily-swappable-parameters',
2224
'-bugprone-exception-escape',
23-
'-bugprone-forward-declaration-namespace',
2425
'-bugprone-implicit-widening-of-multiplication-result',
2526
'-bugprone-multi-level-implicit-pointer-conversion',
2627
'-bugprone-narrowing-conversions',
27-
'-bugprone-not-null-terminated-result',
28-
'-bugprone-reserved-identifier', # useful but too slow, TODO retry when https://reviews.llvm.org/rG1c282052624f9d0bd273bde0b47b30c96699c6c7 is merged
2928
'-bugprone-unchecked-optional-access',
3029
'-bugprone-crtp-constructor-accessibility',
31-
'-bugprone-suspicious-stringview-data-usage',
30+
'-bugprone-not-null-terminated-result',
3231

3332
'-cert-dcl16-c',
34-
'-cert-dcl37-c',
35-
'-cert-dcl51-cpp',
3633
'-cert-err58-cpp',
37-
'-cert-msc32-c',
38-
'-cert-msc51-cpp',
39-
'-cert-oop54-cpp',
40-
'-cert-oop57-cpp',
41-
'-cert-err33-c', # Misreports on clang-19: it warns about all functions containing 'remove' in the name, not only about the standard library.
4234

4335
'-clang-analyzer-optin.performance.Padding',
4436

45-
'-clang-analyzer-unix.Malloc',
46-
4737
'-cppcoreguidelines-*', # impractical in a codebase as large as ClickHouse, also slow
4838

4939
'-darwin-*',
@@ -76,38 +66,34 @@ Checks: [
7666
'-hicpp-use-emplace',
7767
'-hicpp-vararg',
7868

79-
'-linuxkernel-*',
80-
8169
'-llvm-*',
8270

8371
'-llvmlibc-*',
8472

85-
'-openmp-*',
86-
8773
'-misc-const-correctness',
8874
'-misc-include-cleaner', # useful but far too many occurrences
8975
'-misc-no-recursion',
9076
'-misc-non-private-member-variables-in-classes',
91-
'-misc-confusable-identifiers', # useful but slooo
9277
'-misc-use-anonymous-namespace',
78+
'-misc-use-internal-linkage',
9379

9480
'-modernize-avoid-c-arrays',
9581
'-modernize-concat-nested-namespaces',
96-
'-modernize-macro-to-enum',
9782
'-modernize-pass-by-value',
9883
'-modernize-return-braced-init-list',
9984
'-modernize-use-auto',
100-
'-modernize-use-constraints', # This is a good check, but clang-tidy crashes, see https://github.com/llvm/llvm-project/issues/91872
10185
'-modernize-use-default-member-init',
10286
'-modernize-use-emplace',
10387
'-modernize-use-nodiscard',
88+
'-modernize-use-ranges',
10489
'-modernize-use-trailing-return-type',
10590
'-modernize-use-designated-initializers',
10691

92+
'-performance-avoid-endl',
10793
'-performance-enum-size',
10894
'-performance-inefficient-string-concatenation',
95+
'-performance-inefficient-vector-operation',
10996
'-performance-no-int-to-ptr',
110-
'-performance-avoid-endl',
11197
'-performance-unnecessary-value-param',
11298

11399
'-portability-simd-intrinsics',
@@ -122,7 +108,6 @@ Checks: [
122108
'-readability-identifier-length',
123109
'-readability-identifier-naming', # useful but too slow
124110
'-readability-implicit-bool-conversion',
125-
'-readability-isolate-declaration',
126111
'-readability-magic-numbers',
127112
'-readability-named-parameter',
128113
'-readability-redundant-declaration',
@@ -137,6 +122,7 @@ Checks: [
137122
'-readability-suspicious-call-argument',
138123
'-readability-uppercase-literal-suffix',
139124
'-readability-use-anyofallof',
125+
'-readability-math-missing-parentheses',
140126

141127
'-zircon-*'
142128
]
@@ -173,4 +159,4 @@ CheckOptions:
173159
performance-move-const-arg.CheckTriviallyCopyableMove: false
174160
# Workaround clang-tidy bug: https://github.com/llvm/llvm-project/issues/46097
175161
readability-identifier-naming.TypeTemplateParameterIgnoredRegexp: expr-type
176-
cppcoreguidelines-avoid-do-while.IgnoreMacros: true
162+
cppcoreguidelines-avoid-do-while.IgnoreMacros: true

.clangd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,6 @@ Diagnostics:
1414
readability-identifier-naming,
1515
bugprone-reserved-identifier,
1616
]
17+
# Require LLVM 20 (https://github.com/llvm/llvm-project/pull/67749)
18+
Style:
19+
AngledHeaders: [".*"]

.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,7 @@ charset = utf-8
1919
indent_style = space
2020
indent_size = 4
2121
trim_trailing_whitespace = true
22+
23+
# Some SQL results have trailing whitespace which is removed by IDEs
24+
[tests/queries/**.reference]
25+
trim_trailing_whitespace = false

.git-blame-ignore-revs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,9 @@
1313
# dbms/ → src/
1414
# (though it is unlikely that you will see it in blame)
1515
06446b4f08a142d6f1bc30664c47ded88ab51782
16+
17+
# Applied Black formatter for Python code
18+
e6f5a3f98b21ba99cf274a9833797889e020a2b3
19+
20+
# Enabling clang-tidy readability-else-no-return rule
21+
67c1e89d90ef576e62f8b1c68269742a3c6f9b1e

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ contrib/* linguist-vendored
22
*.h linguist-language=C++
33
tests/queries/0_stateless/data_json/* binary
44
tests/queries/0_stateless/*.reference -crlf
5+
src/Core/SettingsChangesHistory.cpp merge=union

.github/workflows/build_linux_arm64_wheels-gh.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ jobs:
4545
uname -a
4646
wget https://apt.llvm.org/llvm.sh
4747
chmod +x llvm.sh
48-
sudo ./llvm.sh 18
49-
which clang++-18
50-
clang++-18 --version
48+
sudo ./llvm.sh 19
49+
which clang++-19
50+
clang++-19 --version
5151
sudo apt-get install -y make cmake ccache ninja-build yasm gawk wget
5252
ccache -s
5353
- name: Update git
@@ -68,13 +68,13 @@ jobs:
6868
key: ${{ matrix.os }}
6969
max-size: 5G
7070
append-timestamp: true
71-
- name: remove old clang and link clang-18 to clang
71+
- name: remove old clang and link clang-19 to clang
7272
if: matrix.os == 'ubuntu-24.04'
7373
run: |
7474
sudo rm -f /usr/bin/clang || true
75-
sudo ln -s /usr/bin/clang-18 /usr/bin/clang
75+
sudo ln -s /usr/bin/clang-19 /usr/bin/clang
7676
sudo rm -f /usr/bin/clang++ || true
77-
sudo ln -s /usr/bin/clang++-18 /usr/bin/clang++
77+
sudo ln -s /usr/bin/clang++-19 /usr/bin/clang++
7878
which clang++
7979
clang++ --version
8080
- name: Run chdb/build.sh

.github/workflows/build_linux_x86_wheels.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ jobs:
4545
uname -a
4646
wget https://apt.llvm.org/llvm.sh
4747
chmod +x llvm.sh
48-
sudo ./llvm.sh 18
49-
which clang++-18
50-
clang++-18 --version
48+
sudo ./llvm.sh 19
49+
which clang++-19
50+
clang++-19 --version
5151
sudo apt-get install -y make cmake ccache ninja-build yasm gawk wget
5252
ccache -s
5353
- name: Update git
@@ -68,13 +68,13 @@ jobs:
6868
key: ${{ matrix.os }}
6969
max-size: 5G
7070
append-timestamp: true
71-
- name: remove old clang and link clang-18 to clang
71+
- name: remove old clang and link clang-19 to clang
7272
if: matrix.os == 'ubuntu-22.04'
7373
run: |
7474
sudo rm -f /usr/bin/clang || true
75-
sudo ln -s /usr/bin/clang-18 /usr/bin/clang
75+
sudo ln -s /usr/bin/clang-19 /usr/bin/clang
7676
sudo rm -f /usr/bin/clang++ || true
77-
sudo ln -s /usr/bin/clang++-18 /usr/bin/clang++
77+
sudo ln -s /usr/bin/clang++-19 /usr/bin/clang++
7878
which clang++
7979
clang++ --version
8080
- name: Run chdb/build.sh
Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
name: Build macOS arm64
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
TAG_NAME:
7+
description: 'Release Version Tag'
8+
required: true
9+
release:
10+
types: [created]
11+
push:
12+
branches:
13+
- main
14+
paths-ignore:
15+
- '**/*.md'
16+
pull_request:
17+
branches:
18+
- main
19+
paths-ignore:
20+
- '**/*.md'
21+
22+
jobs:
23+
build_wheels_macos_13:
24+
name: ${{ matrix.os }} py${{ matrix.python-version }}
25+
runs-on: ${{ matrix.os }}
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
os: [ macos-13-xlarge ]
30+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
31+
env:
32+
RUNNER_OS: ${{ matrix.os }}
33+
PYTHON_VERSION: ${{ matrix.python-version }}
34+
steps:
35+
- name: Install python
36+
uses: actions/setup-python@v4
37+
with:
38+
python-version: "${{ matrix.python-version }}"
39+
- name: Remove /usr/local/bin/python3
40+
run: |
41+
sudo rm -f /usr/local/bin/python3
42+
- name: Install clang++ for macOS
43+
run: |
44+
pwd
45+
uname -a
46+
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
47+
brew update
48+
brew install ca-certificates lz4 mpdecimal openssl@3 readline sqlite xz z3 zstd
49+
brew install --ignore-dependencies llvm@19
50+
brew install git ccache ninja libtool gettext gcc binutils grep findutils nasm
51+
cd /usr/local/opt/ && sudo rm -f llvm && sudo ln -sf llvm@19 llvm
52+
export PATH=$(brew --prefix llvm@19)/bin:$PATH
53+
which clang++
54+
clang++ --version
55+
ccache -s
56+
- uses: actions/checkout@v3
57+
with:
58+
fetch-depth: 0
59+
- name: Update submodules
60+
run: |
61+
git submodule update --init --recursive --jobs 4
62+
- name: ccache
63+
uses: hendrikmuhs/[email protected]
64+
with:
65+
key: ${{ matrix.os }}
66+
max-size: 5G
67+
append-timestamp: true
68+
- name: Run chdb/build.sh
69+
timeout-minutes: 300
70+
run: |
71+
python3 -m pip install pybind11 setuptools
72+
export PATH=$(brew --prefix llvm@19)/bin:/usr/local/opt/grep/libexec/gnubin:/usr/local/opt/binutils/bin:$PATH:/usr/local/opt/findutils/libexec/gnubin
73+
export CC=$(brew --prefix llvm@19)/bin/clang
74+
export CXX=$(brew --prefix llvm@19)/bin/clang++
75+
bash gen_manifest.sh
76+
bash ./chdb/build.sh
77+
python3 -m pip install pandas pyarrow
78+
bash -x ./chdb/test_smoke.sh
79+
continue-on-error: false
80+
- name: Debug libchdb
81+
run: |
82+
ls -lh
83+
llvm-nm libchdb.so | grep query_stable || true
84+
echo "Global Symbol in libchdb.so:"
85+
llvm-nm -g libchdb.so || true
86+
echo "Global Symbol in libclickhouse-local-chdb.a:"
87+
llvm-nm -g buildlib/programs/local/libclickhouse-local-chdb.a || true
88+
echo "Global Symbol in libclickhouse-local-lib.a:"
89+
llvm-nm -g buildlib/programs/local/libclickhouse-local-lib.a || true
90+
echo "pychdb_cmd.sh:"
91+
cat buildlib/pychdb_cmd.sh
92+
echo "libchdb_cmd.sh:"
93+
cat buildlib/libchdb_cmd.sh
94+
- name: Run libchdb stub in examples dir
95+
run: |
96+
bash -x ./examples/runStub.sh
97+
- name: Keep killall ccache and wait for ccache to finish
98+
if: always()
99+
run: |
100+
sleep 60
101+
while ps -ef | grep ccache | grep -v grep; do \
102+
killall ccache; \
103+
sleep 10; \
104+
done
105+
- name: Check ccache statistics
106+
run: |
107+
ccache -s
108+
ls -lh chdb
109+
df -h
110+
env:
111+
CIBW_ENVIRONMENT_MACOS: "PATH=$(brew --prefix llvm@19)/bin:/usr/local/opt/grep/libexec/gnubin:/usr/local/opt/binutils/bin:$PATH:/usr/local/opt/findutils/libexec/gnubin CC=$(brew --prefix llvm@19)/bin/clang CXX=$(brew --prefix llvm@19)/bin/clang++"
112+
- name: Install dependencies for building wheels
113+
run: |
114+
python3 -m pip install -U pip tox pybind11 twine setuptools wheel>=0.40.0
115+
- name: Build wheels
116+
run: |
117+
export PATH=$(brew --prefix llvm@19)/bin:/usr/local/opt/grep/libexec/gnubin:/usr/local/opt/binutils/bin:$PATH:/usr/local/opt/findutils/libexec/gnubin
118+
export CC=$(brew --prefix llvm@19)/bin/clang
119+
export CXX=$(brew --prefix llvm@19)/bin/clang++
120+
make wheel
121+
- name: Fix wheel platform tag
122+
run: |
123+
python3 -m wheel tags --platform-tag=macosx_11_0_arm64 --remove dist/*.whl
124+
- name: Run tests
125+
run: |
126+
python3 -m pip install dist/*.whl
127+
python3 -m pip install pandas pyarrow psutil
128+
python3 -c "import chdb; res = chdb.query('select 1112222222,555', 'CSV'); print(res)"
129+
make test
130+
continue-on-error: false
131+
- name: Show files
132+
run: ls -lh dist
133+
shell: bash
134+
- name: Upload wheels to release
135+
if: startsWith(github.ref, 'refs/tags/v')
136+
run: |
137+
gh release upload ${{ github.ref_name }} dist/*.whl --clobber
138+
env:
139+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
140+
- name: Packege libchdb.so
141+
if: matrix.python-version == '3.12'
142+
run: |
143+
cp programs/local/chdb.h chdb.h
144+
tar -czvf macos-arm64-libchdb.tar.gz libchdb.so chdb.h
145+
- name: Upload libchdb.so to release
146+
if: startsWith(github.ref, 'refs/tags/v') && matrix.python-version == '3.12'
147+
run: |
148+
gh release upload ${{ github.ref_name }} macos-arm64-libchdb.tar.gz --clobber
149+
env:
150+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
151+
- uses: actions/upload-artifact@v4
152+
with:
153+
name: chdb-artifacts-macos-arm64-${{ matrix.python-version }}
154+
path: |
155+
./dist/*.whl
156+
./macos-arm64-libchdb.tar.gz
157+
overwrite: true
158+
- name: Upload pypi
159+
if: startsWith(github.ref, 'refs/tags/v')
160+
run: |
161+
python3 -m pip install twine
162+
python3 -m twine upload dist/*.whl
163+
env:
164+
TWINE_USERNAME: __token__
165+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}

0 commit comments

Comments
 (0)