Skip to content

Commit 69e535f

Browse files
committed
Merge branch 'master' of github.com:ClickHouse/ClickHouse into client-fault-tolerant-connection
2 parents e780c12 + 4507f88 commit 69e535f

File tree

595 files changed

+11551
-8443
lines changed

Some content is hidden

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

595 files changed

+11551
-8443
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,4 @@ Changelog entry (a user-readable short description of the changes that goes to C
1313
...
1414

1515

16-
Detailed description / Documentation draft:
17-
...
18-
19-
20-
> By adding documentation, you'll allow users to try your new feature immediately, not when someone else will have time to document it later. Documentation is necessary for all features that affect user experience in any way. You can add brief documentation draft above, or add documentation right into your patch as Markdown files in [docs](https://github.com/ClickHouse/ClickHouse/tree/master/docs) folder.
21-
22-
> If you are doing this for the first time, it's recommended to read the lightweight [Contributing to ClickHouse Documentation](https://github.com/ClickHouse/ClickHouse/tree/master/docs/README.md) guide first.
23-
24-
2516
> Information about CI checks: https://clickhouse.tech/docs/en/development/continuous-integration/

.github/actionlint.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
self-hosted-runner:
22
labels:
33
- builder
4+
- func-tester
5+
- func-tester-aarch64
46
- fuzzer-unit-tester
57
- stress-tester
68
- style-checker
7-
- func-tester-aarch64
8-
- func-tester
9+
- style-checker-aarch64

.github/workflows/backport_branches.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on: # yamllint disable-line rule:truthy
1010
- 'backport/**'
1111
jobs:
1212
DockerHubPushAarch64:
13-
runs-on: [self-hosted, func-tester-aarch64]
13+
runs-on: [self-hosted, style-checker-aarch64]
1414
steps:
1515
- name: Clear repository
1616
run: |

.github/workflows/docs_check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
python3 run_check.py
3131
DockerHubPushAarch64:
3232
needs: CheckLabels
33-
runs-on: [self-hosted, func-tester-aarch64]
33+
runs-on: [self-hosted, style-checker-aarch64]
3434
steps:
3535
- name: Clear repository
3636
run: |

.github/workflows/docs_release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ on: # yamllint disable-line rule:truthy
2020
workflow_dispatch:
2121
jobs:
2222
DockerHubPushAarch64:
23-
runs-on: [self-hosted, func-tester-aarch64]
23+
runs-on: [self-hosted, style-checker-aarch64]
2424
steps:
2525
- name: Clear repository
2626
run: |

.github/workflows/master.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,20 @@ on: # yamllint disable-line rule:truthy
99
branches:
1010
- 'master'
1111
jobs:
12+
PythonUnitTests:
13+
runs-on: [self-hosted, style-checker]
14+
steps:
15+
- name: Clear repository
16+
run: |
17+
sudo rm -fr "$GITHUB_WORKSPACE" && mkdir "$GITHUB_WORKSPACE"
18+
- name: Check out repository code
19+
uses: actions/checkout@v2
20+
- name: Python unit tests
21+
run: |
22+
cd "$GITHUB_WORKSPACE/tests/ci"
23+
python3 -m unittest discover -s . -p '*_test.py'
1224
DockerHubPushAarch64:
13-
runs-on: [self-hosted, func-tester-aarch64]
25+
runs-on: [self-hosted, style-checker-aarch64]
1426
steps:
1527
- name: Clear repository
1628
run: |
@@ -44,7 +56,7 @@ jobs:
4456
name: changed_images_amd64
4557
path: ${{ runner.temp }}/docker_images_check/changed_images_amd64.json
4658
DockerHubPush:
47-
needs: [DockerHubPushAmd64, DockerHubPushAarch64]
59+
needs: [DockerHubPushAmd64, DockerHubPushAarch64, PythonUnitTests]
4860
runs-on: [self-hosted, style-checker]
4961
steps:
5062
- name: Clear repository

.github/workflows/pull_request.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,22 @@ jobs:
3131
run: |
3232
cd "$GITHUB_WORKSPACE/tests/ci"
3333
python3 run_check.py
34+
PythonUnitTests:
35+
needs: CheckLabels
36+
runs-on: [self-hosted, style-checker]
37+
steps:
38+
- name: Clear repository
39+
run: |
40+
sudo rm -fr "$GITHUB_WORKSPACE" && mkdir "$GITHUB_WORKSPACE"
41+
- name: Check out repository code
42+
uses: actions/checkout@v2
43+
- name: Python unit tests
44+
run: |
45+
cd "$GITHUB_WORKSPACE/tests/ci"
46+
python3 -m unittest discover -s . -p '*_test.py'
3447
DockerHubPushAarch64:
3548
needs: CheckLabels
36-
runs-on: [self-hosted, func-tester-aarch64]
49+
runs-on: [self-hosted, style-checker-aarch64]
3750
steps:
3851
- name: Clear repository
3952
run: |
@@ -68,7 +81,7 @@ jobs:
6881
name: changed_images_amd64
6982
path: ${{ runner.temp }}/docker_images_check/changed_images_amd64.json
7083
DockerHubPush:
71-
needs: [DockerHubPushAmd64, DockerHubPushAarch64]
84+
needs: [DockerHubPushAmd64, DockerHubPushAarch64, PythonUnitTests]
7285
runs-on: [self-hosted, style-checker]
7386
steps:
7487
- name: Clear repository

.github/workflows/release_branches.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on: # yamllint disable-line rule:truthy
1313

1414
jobs:
1515
DockerHubPushAarch64:
16-
runs-on: [self-hosted, func-tester-aarch64]
16+
runs-on: [self-hosted, style-checker-aarch64]
1717
steps:
1818
- name: Clear repository
1919
run: |

CHANGELOG.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* A tool for collecting diagnostics data if you need support. [#33175](https://github.com/ClickHouse/ClickHouse/pull/33175) ([Alexander Burmak](https://github.com/Alex-Burmak)).
1313
* Automatic cluster discovery via Zoo/Keeper. It allows to add replicas to the cluster without changing configuration on every server. [#31442](https://github.com/ClickHouse/ClickHouse/pull/31442) ([vdimir](https://github.com/vdimir)).
1414
* Implement hive table engine to access apache hive from clickhouse. This implements: [#29245](https://github.com/ClickHouse/ClickHouse/issues/29245). [#31104](https://github.com/ClickHouse/ClickHouse/pull/31104) ([taiyang-li](https://github.com/taiyang-li)).
15-
* Add aggregate functions `cramersV`, `cramersVBiasCorrected`, `theilsU` and `contingency`. These functions calculate dependency (measure of association) between categorical values. All these functions are using cross-tab (histogram on pairs) for implementation. You can imagine it like a correlation coefficient but for any discrete values (not necessary numbers). [#33366](https://github.com/ClickHouse/ClickHouse/pull/33366) ([alexey-milovidov](https://github.com/alexey-milovidov)). Initial implementation by TODO
15+
* Add aggregate functions `cramersV`, `cramersVBiasCorrected`, `theilsU` and `contingency`. These functions calculate dependency (measure of association) between categorical values. All these functions are using cross-tab (histogram on pairs) for implementation. You can imagine it like a correlation coefficient but for any discrete values (not necessary numbers). [#33366](https://github.com/ClickHouse/ClickHouse/pull/33366) ([alexey-milovidov](https://github.com/alexey-milovidov)). Initial implementation by [Vanyok-All-is-OK](https://github.com/Vanyok-All-is-OK) and [antikvist](https://github.com/antikvist).
1616
* Added table function `hdfsCluster` which allows processing files from HDFS in parallel from many nodes in a specified cluster, similarly to `s3Cluster`. [#32400](https://github.com/ClickHouse/ClickHouse/pull/32400) ([Zhichang Yu](https://github.com/yuzhichang)).
1717
* Adding support for disks backed by Azure Blob Storage, in a similar way it has been done for disks backed by AWS S3. [#31505](https://github.com/ClickHouse/ClickHouse/pull/31505) ([Jakub Kuklis](https://github.com/jkuklis)).
1818
* Allow `COMMENT` in `CREATE VIEW` (for all VIEW kinds). [#31062](https://github.com/ClickHouse/ClickHouse/pull/31062) ([Vasily Nemkov](https://github.com/Enmk)).
@@ -23,7 +23,6 @@
2323
* Added function `arrayLast`. Closes [#33390](https://github.com/ClickHouse/ClickHouse/issues/33390). [#33415](https://github.com/ClickHouse/ClickHouse/pull/33415) Added function `arrayLastIndex`. [#33465](https://github.com/ClickHouse/ClickHouse/pull/33465) ([Maksim Kita](https://github.com/kitaisreal)).
2424
* Add function `decodeURLFormComponent` slightly different to `decodeURLComponent`. Close [#10298](https://github.com/ClickHouse/ClickHouse/issues/10298). [#33451](https://github.com/ClickHouse/ClickHouse/pull/33451) ([SuperDJY](https://github.com/cmsxbc)).
2525
* Allow to split `GraphiteMergeTree` rollup rules for plain/tagged metrics (optional rule_type field). [#33494](https://github.com/ClickHouse/ClickHouse/pull/33494) ([Michail Safronov](https://github.com/msaf1980)).
26-
* Potential issue, cannot be exploited: integer overflow may happen in array resize. [#33024](https://github.com/ClickHouse/ClickHouse/pull/33024) ([varadarajkumar](https://github.com/varadarajkumar)).
2726

2827

2928
#### Performance Improvement
@@ -78,7 +77,6 @@
7877
* Validate config keys for external dictionaries. [#33095](https://github.com/ClickHouse/ClickHouse/issues/33095#issuecomment-1000577517). [#33130](https://github.com/ClickHouse/ClickHouse/pull/33130) ([Kseniia Sumarokova](https://github.com/kssenii)).
7978
* Send profile info inside `clickhouse-local`. Closes [#33093](https://github.com/ClickHouse/ClickHouse/issues/33093). [#33097](https://github.com/ClickHouse/ClickHouse/pull/33097) ([Kseniia Sumarokova](https://github.com/kssenii)).
8079
* Short circuit evaluation: support for function `throwIf`. Closes [#32969](https://github.com/ClickHouse/ClickHouse/issues/32969). [#32973](https://github.com/ClickHouse/ClickHouse/pull/32973) ([Maksim Kita](https://github.com/kitaisreal)).
81-
* Added `Date32` date type support in dictionaries. Closes [#32913](https://github.com/ClickHouse/ClickHouse/issues/32913). [#32971](https://github.com/ClickHouse/ClickHouse/pull/32971) ([Maksim Kita](https://github.com/kitaisreal)).
8280
* (This only happens in unofficial builds). Fixed segfault when inserting data into compressed Decimal, String, FixedString and Array columns. This closes [#32939](https://github.com/ClickHouse/ClickHouse/issues/32939). [#32940](https://github.com/ClickHouse/ClickHouse/pull/32940) ([N. Kolotov](https://github.com/nkolotov)).
8381
* Added support for specifying subquery as SQL user defined function. Example: `CREATE FUNCTION test AS () -> (SELECT 1)`. Closes [#30755](https://github.com/ClickHouse/ClickHouse/issues/30755). [#32758](https://github.com/ClickHouse/ClickHouse/pull/32758) ([Maksim Kita](https://github.com/kitaisreal)).
8482
* Improve gRPC compression support for [#28671](https://github.com/ClickHouse/ClickHouse/issues/28671). [#32747](https://github.com/ClickHouse/ClickHouse/pull/32747) ([Vitaly Baranov](https://github.com/vitlibar)).
@@ -100,6 +98,7 @@
10098
* Use `--database` option for clickhouse-local. [#32797](https://github.com/ClickHouse/ClickHouse/pull/32797) ([Kseniia Sumarokova](https://github.com/kssenii)).
10199
* Fix surprisingly bad code in SQL ordinary function `file`. Now it supports symlinks. [#32640](https://github.com/ClickHouse/ClickHouse/pull/32640) ([alexey-milovidov](https://github.com/alexey-milovidov)).
102100
* Updating `modification_time` for data part in `system.parts` after part movement [#32964](https://github.com/ClickHouse/ClickHouse/issues/32964). [#32965](https://github.com/ClickHouse/ClickHouse/pull/32965) ([save-my-heart](https://github.com/save-my-heart)).
101+
* Potential issue, cannot be exploited: integer overflow may happen in array resize. [#33024](https://github.com/ClickHouse/ClickHouse/pull/33024) ([varadarajkumar](https://github.com/varadarajkumar)).
103102

104103

105104
#### Build/Testing/Packaging Improvement

CMakeLists.txt

Lines changed: 7 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,8 @@ message (STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
104104
string (TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UC)
105105

106106
option(USE_STATIC_LIBRARIES "Disable to use shared libraries" ON)
107-
option(MAKE_STATIC_LIBRARIES "Disable to make shared libraries" ${USE_STATIC_LIBRARIES})
108107

109-
if (NOT MAKE_STATIC_LIBRARIES)
108+
if (NOT USE_STATIC_LIBRARIES)
110109
# DEVELOPER ONLY.
111110
# Faster linking if turned on.
112111
option(SPLIT_SHARED_LIBRARIES "Keep all internal libraries as separate .so files")
@@ -115,11 +114,11 @@ if (NOT MAKE_STATIC_LIBRARIES)
115114
"Make several binaries (clickhouse-server, clickhouse-client etc.) instead of one bundled")
116115
endif ()
117116

118-
if (MAKE_STATIC_LIBRARIES AND SPLIT_SHARED_LIBRARIES)
119-
message(FATAL_ERROR "Defining SPLIT_SHARED_LIBRARIES=1 without MAKE_STATIC_LIBRARIES=0 has no effect.")
117+
if (USE_STATIC_LIBRARIES AND SPLIT_SHARED_LIBRARIES)
118+
message(FATAL_ERROR "Defining SPLIT_SHARED_LIBRARIES=1 without USE_STATIC_LIBRARIES=0 has no effect.")
120119
endif()
121120

122-
if (NOT MAKE_STATIC_LIBRARIES AND SPLIT_SHARED_LIBRARIES)
121+
if (NOT USE_STATIC_LIBRARIES AND SPLIT_SHARED_LIBRARIES)
123122
set(BUILD_SHARED_LIBS 1 CACHE INTERNAL "")
124123
endif ()
125124

@@ -139,7 +138,6 @@ if (ENABLE_FUZZING)
139138
set (ENABLE_CLICKHOUSE_ODBC_BRIDGE OFF)
140139
set (ENABLE_LIBRARIES 0)
141140
set (ENABLE_SSL 1)
142-
set (USE_INTERNAL_SSL_LIBRARY 1)
143141
set (USE_UNWIND ON)
144142
set (ENABLE_EMBEDDED_COMPILER 0)
145143
set (ENABLE_EXAMPLES 0)
@@ -152,7 +150,6 @@ if (ENABLE_FUZZING)
152150

153151
# For codegen_select_fuzzer
154152
set (ENABLE_PROTOBUF 1)
155-
set (USE_INTERNAL_PROTOBUF_LIBRARY 1)
156153
endif()
157154

158155
# Global libraries
@@ -203,21 +200,13 @@ endif ()
203200
option(ENABLE_TESTS "Provide unit_test_dbms target with Google.Test unit tests" ON)
204201
option(ENABLE_EXAMPLES "Build all example programs in 'examples' subdirectories" OFF)
205202

206-
if (OS_LINUX AND (ARCH_AMD64 OR ARCH_AARCH64) AND MAKE_STATIC_LIBRARIES AND NOT SPLIT_SHARED_LIBRARIES AND NOT USE_MUSL)
203+
if (OS_LINUX AND (ARCH_AMD64 OR ARCH_AARCH64) AND USE_STATIC_LIBRARIES AND NOT SPLIT_SHARED_LIBRARIES AND NOT USE_MUSL)
207204
# Only for Linux, x86_64 or aarch64.
208205
option(GLIBC_COMPATIBILITY "Enable compatibility with older glibc libraries." ON)
209206
elseif(GLIBC_COMPATIBILITY)
210207
message (${RECONFIGURE_MESSAGE_LEVEL} "Glibc compatibility cannot be enabled in current configuration")
211208
endif ()
212209

213-
if (GLIBC_COMPATIBILITY)
214-
# NOTE: we may also want to check glibc version and add -include only for 2.32+
215-
# however this is extra complexity, especially for cross compiling.
216-
# And anyway it should not break anything for <2.32.
217-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -include ${CMAKE_CURRENT_SOURCE_DIR}/base/glibc-compatibility/glibc-compat-2.32.h")
218-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -include ${CMAKE_CURRENT_SOURCE_DIR}/base/glibc-compatibility/glibc-compat-2.32.h")
219-
endif()
220-
221210
# Make sure the final executable has symbols exported
222211
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -rdynamic")
223212

@@ -446,7 +435,7 @@ endif ()
446435

447436
set (CMAKE_POSTFIX_VARIABLE "CMAKE_${CMAKE_BUILD_TYPE_UC}_POSTFIX")
448437

449-
if (MAKE_STATIC_LIBRARIES)
438+
if (USE_STATIC_LIBRARIES)
450439
set (CMAKE_POSITION_INDEPENDENT_CODE OFF)
451440
if (OS_LINUX AND NOT ARCH_ARM)
452441
# Slightly more efficient code can be generated
@@ -482,87 +471,10 @@ endif ()
482471
message (STATUS
483472
"Building for: ${CMAKE_SYSTEM} ${CMAKE_SYSTEM_PROCESSOR} ${CMAKE_LIBRARY_ARCHITECTURE} ;
484473
USE_STATIC_LIBRARIES=${USE_STATIC_LIBRARIES}
485-
MAKE_STATIC_LIBRARIES=${MAKE_STATIC_LIBRARIES}
486474
SPLIT_SHARED=${SPLIT_SHARED_LIBRARIES}
487475
CCACHE=${CCACHE_FOUND} ${CCACHE_VERSION}")
488476

489477
include (GNUInstallDirs)
490-
include (cmake/contrib_finder.cmake)
491-
492-
find_contrib_lib(double-conversion) # Must be before parquet
493-
include (cmake/find/ssl.cmake)
494-
include (cmake/find/ldap.cmake) # after ssl
495-
include (cmake/find/icu.cmake)
496-
include (cmake/find/xz.cmake)
497-
include (cmake/find/zlib.cmake)
498-
include (cmake/find/zstd.cmake)
499-
include (cmake/find/ltdl.cmake) # for odbc
500-
# openssl, zlib before poco
501-
include (cmake/find/sparsehash.cmake)
502-
include (cmake/find/re2.cmake)
503-
include (cmake/find/krb5.cmake)
504-
include (cmake/find/libgsasl.cmake)
505-
include (cmake/find/cyrus-sasl.cmake)
506-
include (cmake/find/rdkafka.cmake)
507-
include (cmake/find/libuv.cmake) # for amqpcpp and cassandra
508-
include (cmake/find/amqpcpp.cmake)
509-
include (cmake/find/capnp.cmake)
510-
include (cmake/find/llvm.cmake)
511-
include (cmake/find/h3.cmake)
512-
include (cmake/find/libxml2.cmake)
513-
include (cmake/find/brotli.cmake)
514-
include (cmake/find/protobuf.cmake)
515-
include (cmake/find/thrift.cmake)
516-
include (cmake/find/grpc.cmake)
517-
include (cmake/find/pdqsort.cmake)
518-
include (cmake/find/miniselect.cmake)
519-
include (cmake/find/hdfs3.cmake) # uses protobuf
520-
include (cmake/find/poco.cmake)
521-
include (cmake/find/curl.cmake)
522-
include (cmake/find/s3.cmake)
523-
include (cmake/find/blob_storage.cmake)
524-
include (cmake/find/base64.cmake)
525-
include (cmake/find/parquet.cmake) # uses protobuf and thrift
526-
include (cmake/find/simdjson.cmake)
527-
include (cmake/find/fast_float.cmake)
528-
include (cmake/find/rapidjson.cmake)
529-
include (cmake/find/fastops.cmake)
530-
include (cmake/find/odbc.cmake)
531-
include (cmake/find/nanodbc.cmake)
532-
include (cmake/find/sqlite.cmake)
533-
include (cmake/find/rocksdb.cmake)
534-
include (cmake/find/libpqxx.cmake)
535-
include (cmake/find/nuraft.cmake)
536-
include (cmake/find/yaml-cpp.cmake)
537-
include (cmake/find/s2geometry.cmake)
538-
include (cmake/find/nlp.cmake)
539-
include (cmake/find/bzip2.cmake)
540-
include (cmake/find/filelog.cmake)
541-
542-
if(NOT USE_INTERNAL_PARQUET_LIBRARY)
543-
set (ENABLE_ORC OFF CACHE INTERNAL "")
544-
endif()
545-
include (cmake/find/orc.cmake)
546-
547-
include (cmake/find/avro.cmake)
548-
include (cmake/find/msgpack.cmake)
549-
include (cmake/find/cassandra.cmake)
550-
include (cmake/find/sentry.cmake)
551-
include (cmake/find/datasketches.cmake)
552-
include (cmake/find/libprotobuf-mutator.cmake)
553-
include (cmake/find/hive-metastore.cmake)
554-
555-
set (USE_INTERNAL_CITYHASH_LIBRARY ON CACHE INTERNAL "")
556-
find_contrib_lib(cityhash)
557-
558-
find_contrib_lib(farmhash)
559-
560-
if (ENABLE_TESTS)
561-
include (cmake/find/gtest.cmake)
562-
endif ()
563-
564-
# Need to process before "contrib" dir:
565-
include (cmake/find/mysqlclient.cmake)
566478

567479
# When testing for memory leaks with Valgrind, don't link tcmalloc or jemalloc.
568480

@@ -606,7 +518,7 @@ macro (add_executable target)
606518
# - _je_zone_register due to JEMALLOC_PRIVATE_NAMESPACE=je_ under OS X.
607519
# - but jemalloc-cmake does not run private_namespace.sh
608520
# so symbol name should be _zone_register
609-
if (ENABLE_JEMALLOC AND MAKE_STATIC_LIBRARIES AND OS_DARWIN)
521+
if (ENABLE_JEMALLOC AND USE_STATIC_LIBRARIES AND OS_DARWIN)
610522
set_property(TARGET ${target} APPEND PROPERTY LINK_OPTIONS -u_zone_register)
611523
endif()
612524
endif()
@@ -625,6 +537,4 @@ add_subdirectory (programs)
625537
add_subdirectory (tests)
626538
add_subdirectory (utils)
627539

628-
include (cmake/print_include_directories.cmake)
629-
630540
include (cmake/sanitize_target_link_libraries.cmake)

0 commit comments

Comments
 (0)