From 7a223a1c539b45b6542445cd2c5d78ce01018361 Mon Sep 17 00:00:00 2001 From: victor Date: Mon, 15 Sep 2025 17:57:52 +0800 Subject: [PATCH 01/48] update ch core to v25.8.2.29 --- .clang-tidy | 4 + .github/PULL_REQUEST_TEMPLATE.md | 2 +- .github/workflows/vectorsearchstress.yml | 128 + .gitignore | 2 + .gitmodules | 33 +- .snyk | 4 - CMakeLists.txt | 57 +- SECURITY.md | 7 +- base/base/Decimal.cpp | 5 +- base/base/Decimal.h | 24 +- base/base/Decimal_fwd.h | 4 +- base/base/JSON.h | 102 +- base/base/TypeName.h | 1 + base/base/extended_types.h | 2 + base/base/map.h | 52 - base/glibc-compatibility/memcpy/memcpy.h | 9 +- base/glibc-compatibility/musl/posix_spawn.c | 19 +- base/glibc-compatibility/spawn.h | 7 +- base/poco/Foundation/include/Poco/Channel.h | 4 + .../include/Poco/FormattingChannel.h | 1 + base/poco/Foundation/include/Poco/Logger.h | 1 + base/poco/Foundation/include/Poco/Message.h | 60 +- .../include/Poco/NotificationQueue.h | 5 +- .../Foundation/include/Poco/Thread_POSIX.h | 2 + base/poco/Foundation/src/Exception.cpp | 13 +- .../poco/Foundation/src/FormattingChannel.cpp | 18 + base/poco/Foundation/src/Logger.cpp | 8 + base/poco/Foundation/src/Message.cpp | 155 +- .../poco/Foundation/src/NotificationQueue.cpp | 7 + base/poco/Foundation/src/PatternFormatter.cpp | 9 +- base/poco/Foundation/src/Thread_POSIX.cpp | 21 +- base/poco/Foundation/src/pcre_compile.c | 4 +- .../Net/include/Poco/Net/HTTPChunkedStream.h | 8 +- .../Net/include/Poco/Net/HTTPClientSession.h | 3 + base/poco/Net/include/Poco/Net/HTTPSession.h | 9 + .../Net/include/Poco/Net/MultipartReader.h | 3 +- .../include/Poco/Net/NameValueCollection.h | 4 + .../include/Poco/Net/RemoteSyslogListener.h | 1 - base/poco/Net/include/Poco/Net/Socket.h | 35 + base/poco/Net/include/Poco/Net/SocketImpl.h | 34 +- base/poco/Net/include/Poco/Net/Throttler.h | 36 + .../poco/Net/include/Poco/Net/WebSocketImpl.h | 4 + base/poco/Net/src/HTTPChunkedStream.cpp | 29 +- base/poco/Net/src/HTTPResponse.cpp | 32 +- base/poco/Net/src/HTTPSession.cpp | 16 + base/poco/Net/src/MultipartReader.cpp | 20 +- base/poco/Net/src/NameValueCollection.cpp | 17 +- base/poco/Net/src/RemoteSyslogChannel.cpp | 10 +- base/poco/Net/src/RemoteSyslogListener.cpp | 5 - base/poco/Net/src/SocketImpl.cpp | 111 +- base/poco/Net/src/WebSocketImpl.cpp | 24 + .../include/Poco/Net/SecureStreamSocketImpl.h | 3 + .../NetSSL_OpenSSL/src/SecureSocketImpl.cpp | 10 + .../src/SecureStreamSocketImpl.cpp | 12 + base/poco/XML/CMakeLists.txt | 3 + base/poco/XML/include/Poco/XML/expat.h | 498 +- .../XML/include/Poco/XML/expat_external.h | 78 +- base/poco/XML/src/ascii.h | 10 +- base/poco/XML/src/asciitab.h | 8 +- base/poco/XML/src/iasciitab.h | 8 +- base/poco/XML/src/internal.h | 102 +- base/poco/XML/src/latin1tab.h | 8 +- base/poco/XML/src/nametab.h | 154 +- base/poco/XML/src/utf8tab.h | 8 +- base/poco/XML/src/xmlparse.cpp | 1331 ++++-- base/poco/XML/src/xmlrole.c | 28 +- base/poco/XML/src/xmlrole.h | 165 +- base/poco/XML/src/xmltok.c | 60 +- base/poco/XML/src/xmltok.h | 244 +- base/poco/XML/src/xmltok_impl.c | 26 +- base/poco/XML/src/xmltok_impl.h | 83 +- base/poco/XML/src/xmltok_ns.c | 24 +- base/readpassphrase/readpassphrase.c | 4 +- ci/.gitignore | 1 + ci/README.md | 40 +- ci/defs/defs.py | 491 +- ci/defs/job_configs.py | 1244 ++--- ci/docker/binary-builder/Dockerfile | 26 +- ci/docker/binary-builder/clang-tidy-cache.sh | 10 + ci/docker/cctools/Dockerfile | 142 + .../docker_related_config.xml | 12 - ci/docker/clickhouse-server/entrypoint.sh | 222 - .../from_binary/Dockerfile.ubuntu | 55 - .../from_deb/Dockerfile.ubuntu | 58 - ci/docker/fasttest/Dockerfile | 13 +- ci/docker/fasttest/requirements.txt | 6 +- {docker/test => ci/docker}/fuzzer/Dockerfile | 15 +- .../test => ci/docker}/install/deb/Dockerfile | 0 .../test => ci/docker}/install/rpm/Dockerfile | 0 .../test => ci/docker}/integration/README.md | 0 ci/docker/integration/arrowflight/Dockerfile | 16 + .../integration/arrowflight/flight_server.py | 54 + .../docker}/integration/base/Dockerfile | 0 .../requirements.txt | 14 +- .../integration/dotnet_client/.gitignore | 0 .../integration/dotnet_client/Dockerfile | 0 .../integration/dotnet_client/Program.cs | 0 .../dotnet_client/clickhouse.test.csproj | 0 .../integration/helper_container/Dockerfile | 0 .../integration/hive_server/Dockerfile | 0 .../hive_server/core-site.xml.template | 0 .../integration/hive_server/demo_data.txt | 0 .../integration/hive_server/hadoop-env.sh | 0 .../integration/hive_server/hdfs-site.xml | 0 .../integration/hive_server/hive-site.xml | 0 .../hive_server/http_api_server.py | 0 .../integration/hive_server/mapred-site.xml | 0 .../docker}/integration/hive_server/start.sh | 0 .../integration/hive_server/yarn-site.xml | 0 .../integration/integration-test/Dockerfile | 102 - .../integration/kerberos_kdc/Dockerfile | 0 .../mysql_dotnet_client/Dockerfile | 12 + .../mysql_dotnet_client/Program.cs | 98 + .../mysql_dotnet_client/testapp.csproj | 15 + .../mysql_golang_client/Dockerfile | 0 .../integration/mysql_golang_client/main.go | 0 .../integration/mysql_java_client/Dockerfile | 0 .../MySQLJavaClientTest.java | 0 .../integration/mysql_js_client/Dockerfile | 0 .../integration/mysql_js_client/test.js | 0 .../integration/mysql_php_client/Dockerfile | 0 .../integration/mysql_php_client/client.crt | 0 .../integration/mysql_php_client/client.key | 0 .../integration/mysql_php_client/test.php | 0 .../integration/mysql_php_client/test_ssl.php | 0 .../docker}/integration/nginx_dav/Dockerfile | 0 .../integration/nginx_dav/default.conf | 0 .../postgresql_java_client/Dockerfile | 0 .../postgresql_java_client/Test.java | 0 .../docker}/integration/resolver/Dockerfile | 0 .../docker}/integration/runner/Dockerfile | 0 .../integration/runner/dockerd-entrypoint.sh | 2 + .../integration/runner/misc/client.crt | 0 .../runner/misc/zookeeper-ssl-entrypoint.sh | 0 .../docker}/integration/runner/modprobe.sh | 0 .../docker}/integration/s3_proxy/Dockerfile | 0 .../docker}/integration/s3_proxy/nginx.conf | 0 .../docker}/integration/s3_proxy/run.sh | 0 .../docker}/integration/s3_proxy/server.crt | 0 .../docker}/integration/s3_proxy/server.key | 0 .../docker/keeper-jepsen-test}/Dockerfile | 0 .../docker/keeper-jepsen-test}/run.sh | 4 +- .../test => ci/docker}/libfuzzer/Dockerfile | 7 +- .../docker}/performance-comparison/Dockerfile | 0 .../docker/server-jepsen-test}/Dockerfile | 0 .../docker/server-jepsen-test}/run.sh | 0 ci/docker/sqlancer-test/Dockerfile | 6 +- ci/docker/stateful-test/Dockerfile | 14 - ci/docker/stateless-test/Dockerfile | 119 +- ci/docker/stateless-test/requirements.txt | 8 +- .../docker/stress-test}/Dockerfile | 0 .../docker/stress-test}/README.md | 0 ci/docker/style-test/Dockerfile | 7 +- ci/docker/style-test/requirements.txt | 53 +- ci/docker/test-base/Dockerfile | 107 + ci/docker/test-base/jeprof | 6 + ci/jobs/build_clickhouse.py | 107 +- ci/jobs/check_style.py | 16 +- ci/jobs/clickbench.py | 24 +- ci/jobs/docs_job.py | 1 - ci/jobs/fast_test.py | 13 +- ci/jobs/functional_stateful_tests.py | 171 - ci/jobs/functional_stateless_tests.py | 185 - ci/jobs/functional_tests.py | 455 ++ ci/jobs/fuzzers_job.py | 22 +- ci/jobs/integration_test_check.py | 320 ++ ci/jobs/performance_tests.py | 220 +- .../aspell-ignore/en/aspell-dict.txt | 198 +- .../scripts/check_style/check-settings-style | 22 +- ci/jobs/scripts/check_style/check_cpp.sh | 66 +- ci/jobs/scripts/check_style/check_typos.sh | 4 +- .../check_style}/codespell-ignore-lines.list | 0 .../check_style}/codespell-ignore-words.list | 0 .../scripts/check_style/double_whitespaces.pl | 16 + ci/jobs/scripts/check_style/various_checks.sh | 6 + ci/jobs/scripts/cidb_cluster.py | 62 +- ci/jobs/scripts/clickhouse_proc.py | 1064 ++++- ci/jobs/scripts/clickhouse_version.py | 2 +- ci/jobs/scripts/docker_image.py | 47 + .../functional_tests/setup_ch_cluster.sh | 2 +- .../functional_tests/setup_log_cluster.sh | 45 +- .../scripts/functional_tests/setup_minio.sh | 6 +- ci/jobs/scripts/functional_tests_results.py | 122 +- .../jobs/scripts}/fuzzer/run-fuzzer.sh | 31 +- ci/jobs/scripts/fuzzer/runner.sh | 237 - .../job_hooks/build_master_head_hook.py | 2 + ci/jobs/scripts/perf/compare.sh | 133 +- ci/jobs/scripts/perf/download.sh | 10 - .../scripts/workflow_hooks/can_be_merged.py | 1 + .../scripts/workflow_hooks/feature_docs.py | 67 +- ci/jobs/scripts/workflow_hooks/filter_job.py | 48 +- .../scripts/workflow_hooks/new_tests_check.py | 48 + .../scripts/workflow_hooks/pr_description.py | 4 +- ci/jobs/scripts/workflow_hooks/store_data.py | 46 +- .../workflow_hooks/team_notifications.py | 27 + ci/jobs/scripts/workflow_hooks/trusted.py | 15 +- ci/jobs/unit_tests_job.py | 9 + ci/jobs/vector_search_stress_job.py | 121 + ci/praktika/_environment.py | 10 +- ci/praktika/cache.py | 6 +- ci/praktika/cidb.py | 2 +- ci/praktika/docker.py | 2 +- ci/praktika/gh.py | 274 +- ci/praktika/hook_cache.py | 8 +- ci/praktika/hook_html.py | 17 +- ci/praktika/info.py | 19 +- ci/praktika/job.py | 68 +- ci/praktika/json.html | 577 ++- ci/praktika/mangle.py | 78 +- ci/praktika/native_jobs.py | 124 +- ci/praktika/parser.py | 6 +- ci/praktika/result.py | 258 +- ci/praktika/runner.py | 163 +- ci/praktika/settings.py | 11 +- ci/praktika/utils.py | 145 +- ci/praktika/validator.py | 39 +- ci/praktika/workflow.py | 17 +- ci/praktika/yaml_generator.py | 4 +- ci/settings/settings.py | 3 +- ci/workflows/VectorSearchStress.py | 29 + ci/workflows/backport_branches.py | 7 +- ci/workflows/master.py | 24 +- ci/workflows/pull_request.py | 98 +- ci/workflows/release_branches.py | 2 +- cmake/autogenerated_versions.txt | 10 +- cmake/darwin/default_libs.cmake | 6 +- cmake/limit_jobs.cmake | 2 +- cmake/split_debug_symbols.cmake | 10 +- cmake/target.cmake | 5 +- cmake/warnings.cmake | 21 +- contrib/CMakeLists.txt | 36 +- contrib/FastPFOR-cmake/CMakeLists.txt | 25 + contrib/NuRaft | 2 +- contrib/SimSIMD | 2 +- contrib/abseil-cpp | 2 +- contrib/abseil-cpp-cmake/CMakeLists.txt | 178 +- contrib/ai-sdk-cpp-cmake/CMakeLists.txt | 190 + .../antlr4-cpp-runtime-cmake/CMakeLists.txt | 45 + contrib/antlr4-grammars-cmake/CMakeLists.txt | 22 + contrib/antlr4-grammars-cmake/generate.sh | 25 + .../generated/antlr4_grammars/PromQLLexer.cpp | 498 ++ .../generated/antlr4_grammars/PromQLLexer.h | 62 + .../antlr4_grammars/PromQLLexer.interp | 157 + .../antlr4_grammars/PromQLLexer.tokens | 78 + .../antlr4_grammars/PromQLParser.cpp | 3695 +++++++++++++++ .../generated/antlr4_grammars/PromQLParser.h | 730 +++ .../antlr4_grammars/PromQLParser.interp | 134 + .../antlr4_grammars/PromQLParser.tokens | 78 + .../PromQLParserBaseListener.cpp | 9 + .../PromQLParserBaseListener.h | 134 + .../PromQLParserBaseVisitor.cpp | 9 + .../antlr4_grammars/PromQLParserBaseVisitor.h | 163 + .../antlr4_grammars/PromQLParserListener.cpp | 9 + .../antlr4_grammars/PromQLParserListener.h | 127 + .../antlr4_grammars/PromQLParserVisitor.cpp | 9 + .../antlr4_grammars/PromQLParserVisitor.h | 96 + contrib/antlr4-grammars/README | 2 + contrib/antlr4-grammars/promql/PromQLLexer.g4 | 212 + .../antlr4-grammars/promql/PromQLParser.g4 | 231 + contrib/antlr4-grammars/promql/README.md | 5 + contrib/antlr4-grammars/promql/desc.xml | 5 + contrib/arrow | 2 +- contrib/arrow-cmake/CMakeLists.txt | 14 +- contrib/arrow-cmake/flight.cmake | 67 + contrib/avro | 2 +- contrib/avro-cmake/CMakeLists.txt | 2 +- contrib/aws | 2 +- contrib/aws-cmake/CMakeLists.txt | 46 +- contrib/aws-cmake/aws_stubs.cpp | 25 + contrib/aws-s2n-tls | 1 - contrib/azure | 2 +- contrib/bech32/CMakeLists.txt | 14 + contrib/bech32/LICENSE-MIT | 19 + contrib/bech32/README.md | 9 + contrib/bech32/include/bech32.h | 64 + contrib/bech32/src/bech32.cpp | 248 + contrib/c-ares | 2 +- contrib/c-ares-cmake/CMakeLists.txt | 102 +- contrib/chdig-cmake/CMakeLists.txt | 23 + contrib/corrosion-cmake/CMakeLists.txt | 83 +- contrib/corrosion-cmake/config.toml.in | 34 +- contrib/crc32c-cmake/CMakeLists.txt | 34 + .../aarch64/crc32c/crc32c_config.h | 36 + .../x86_64/no_sse42/crc32c/crc32c_config.h | 36 + .../x86_64/sse42/crc32c/crc32c_config.h | 36 + contrib/croaring-cmake/CMakeLists.txt | 10 - contrib/curl | 2 +- contrib/curl-cmake/CMakeLists.txt | 60 +- contrib/curl-cmake/curl_config.h | 4 +- contrib/delta-kernel-rs | 2 +- contrib/delta-kernel-rs-cmake/CMakeLists.txt | 7 +- contrib/google-cloud-cpp-cmake/CMakeLists.txt | 114 +- .../cmake/CompileProtos.cmake | 452 ++ .../{ => cmake}/GoogleApis.cmake | 99 +- .../cmake/GoogleCloudCppLibrary.cmake | 229 + .../cmake/GoogleapisConfig.cmake | 39 + .../{ => cmake}/google_cloud_cpp_common.cmake | 241 +- .../cmake/google_cloud_cpp_grpc_utils.cmake | 142 + .../google_cloud_cpp_rest_internal.cmake | 146 + .../cmake/google_cloud_cpp_storage.cmake | 301 ++ .../google_cloud_cpp_grpc_utils.cmake | 350 -- .../storage/google_cloud_cpp_storage.cmake | 301 ++ contrib/google-protobuf | 2 +- contrib/google-protobuf-cmake/CMakeLists.txt | 142 +- contrib/grpc | 2 +- contrib/grpc-cmake/grpc.cmake | 1816 ++++---- contrib/gwpasan-cmake/CMakeLists.txt | 24 - contrib/jemalloc | 2 +- contrib/jemalloc-cmake/CMakeLists.txt | 4 +- contrib/krb5 | 2 +- contrib/libarchive | 2 +- contrib/libarchive-cmake/CMakeLists.txt | 13 +- contrib/libarchive-cmake/config.h | 33 + contrib/libhdfs3-cmake/CMakeLists.txt | 3 + contrib/libprotobuf-mutator | 2 +- contrib/librdkafka | 2 +- contrib/libxml2 | 2 +- contrib/libxml2-cmake/CMakeLists.txt | 53 +- contrib/libxml2-cmake/README.MD | 2 + .../linux_x86_64/include/config.h | 236 +- .../linux_x86_64/include/libxml/xmlversion.h | 205 +- contrib/mongo-c-driver | 2 +- contrib/mongo-c-driver-cmake/CMakeLists.txt | 7 +- contrib/nlohmann-json-cmake/CMakeLists.txt | 8 + contrib/openssl | 2 +- contrib/openssl-cmake/CMakeLists.txt | 1 + contrib/orc | 2 +- contrib/postgres | 2 +- contrib/rapidjson | 2 +- contrib/replxx | 2 +- contrib/rust_vendor | 2 +- contrib/sentry-native | 1 - contrib/sentry-native-cmake/CMakeLists.txt | 63 - contrib/simde-cmake/CMakeLists.txt | 4 + contrib/simdjson-cmake/CMakeLists.txt | 9 + .../sparse-checkout/setup-sparse-checkout.sh | 3 + .../update-antlr4-cpp-runtime.sh | 14 + contrib/sparse-checkout/update-arrow.sh | 1 + contrib/sparse-checkout/update-crc32c.sh | 11 + .../update-google-cloud-cpp.sh | 1 + .../sparse-checkout/update-nlohmann-json.sh | 12 + contrib/sysroot | 2 +- contrib/update-submodules.sh | 2 +- contrib/usearch | 2 +- docker/test/README.md | 5 - docker/test/fuzzer/allow-nullable-key.xml | 6 - docs/changelogs/v25.3.4.190-lts.md | 109 + docs/changelogs/v25.3.5.42-lts.md | 35 + docs/changelogs/v25.3.6.56-lts.md | 44 + docs/changelogs/v25.4.10.45-stable.md | 40 + docs/changelogs/v25.4.11.15-stable.md | 25 + docs/changelogs/v25.4.12.9-stable.md | 18 + docs/changelogs/v25.4.13.22-stable.md | 26 + docs/changelogs/v25.4.5.24-stable.md | 25 + docs/changelogs/v25.4.6.67-stable.md | 51 + docs/changelogs/v25.4.7.66-stable.md | 52 + docs/changelogs/v25.4.8.56-stable.md | 46 + docs/changelogs/v25.4.9.14-stable.md | 24 + docs/changelogs/v25.5.1.2782-stable.md | 481 ++ docs/changelogs/v25.5.2.47-stable.md | 41 + docs/changelogs/v25.5.3.75-stable.md | 58 + docs/changelogs/v25.5.4.38-stable.md | 33 + docs/changelogs/v25.5.5.19-stable.md | 24 + docs/changelogs/v25.5.6.14-stable.md | 24 + docs/changelogs/v25.5.7.52-stable.md | 45 + docs/changelogs/v25.5.8.13-stable.md | 20 + docs/changelogs/v25.5.9.14-stable.md | 23 + docs/changelogs/v25.6.1.3206-stable.md | 559 +++ docs/changelogs/v25.6.2.5-stable.md | 16 + docs/changelogs/v25.6.3.116-stable.md | 77 + docs/changelogs/v25.6.4.12-stable.md | 18 + docs/changelogs/v25.6.5.41-stable.md | 32 + docs/changelogs/v25.6.6.29-stable.md | 33 + docs/changelogs/v25.6.7.23-stable.md | 26 + docs/changelogs/v25.6.8.10-stable.md | 20 + docs/changelogs/v25.7.1.3997-stable.md | 671 +++ docs/changelogs/v25.7.2.54-stable.md | 42 + docs/changelogs/v25.7.3.13-stable.md | 20 + docs/changelogs/v25.7.4.11-stable.md | 19 + docs/en/engines/database-engines/datalake.md | 66 + .../table-engines/integrations/arrowflight.md | 64 + .../table-engines/integrations/ytsaurus.md | 122 + .../mergetree-family/coalescingmergetree.md | 135 + docs/en/interfaces/arrowflight.md | 82 + docs/en/interfaces/formats/Hash.md | 64 + .../en/operations/settings/server-overload.md | 35 + .../settings/tcp-connection-limits.md | 41 + docs/en/operations/system-tables/codecs.md | 45 + .../system-tables/dead_letter_queue.md | 133 + .../system-tables/iceberg_metadata_log.md | 86 + .../system-tables/zookeeper_connection_log.md | 56 + .../reference/timeSeriesDeltaToGrid.md | 69 + .../reference/timeSeriesDerivToGrid.md | 69 + .../reference/timeSeriesGroupArray.md | 64 + .../reference/timeSeriesInstantDeltaToGrid.md | 69 + .../reference/timeSeriesInstantRateToGrid.md | 69 + .../reference/timeSeriesLastTwoSamples.md | 158 + .../timeSeriesPredictLinearToGrid.md | 72 + .../reference/timeSeriesRateToGrid.md | 69 + .../timeSeriesResampleToGridWithStaleness.md | 71 + docs/en/sql-reference/data-types/time.md | 111 + docs/en/sql-reference/data-types/time64.md | 111 + .../functions/financial-functions.md | 18 + .../numeric-indexed-vector-functions.md | 611 +++ .../time-series-analysis-functions.md | 174 + docs/en/sql-reference/statements/update.md | 123 + .../table-functions/arrowflight.md | 49 + .../table-functions/prometheusQuery.md | 43 + .../table-functions/prometheusQueryRange.md | 45 + .../table-functions/timeSeriesSelector.md | 43 + .../sql-reference/table-functions/ytsaurus.md | 43 + docs/en/sql-reference/window-functions/lag.md | 78 + .../en/sql-reference/window-functions/lead.md | 71 + packages/build | 1 + packages/clickhouse-client.yaml | 4 + programs/CMakeLists.txt | 60 +- .../completions/clickhouse-bootstrap | 12 +- programs/benchmark/Benchmark.cpp | 71 +- programs/client/CMakeLists.txt | 3 + programs/client/Client.cpp | 79 +- programs/client/Client.h | 8 +- programs/client/FuzzLoop.cpp | 342 +- programs/disks/CommandChangeDirectory.cpp | 6 +- programs/disks/CommandCopy.cpp | 8 +- .../disks/CommandGetCurrentDiskAndPath.cpp | 6 +- programs/disks/CommandHelp.cpp | 4 +- programs/disks/CommandLink.cpp | 2 +- programs/disks/CommandList.cpp | 6 +- programs/disks/CommandListDisks.cpp | 4 +- programs/disks/CommandMkDir.cpp | 2 +- programs/disks/CommandMove.cpp | 2 +- programs/disks/CommandRead.cpp | 2 +- programs/disks/CommandRemove.cpp | 4 +- programs/disks/CommandSwitchDisk.cpp | 4 +- programs/disks/CommandTouch.cpp | 6 +- programs/disks/CommandWrite.cpp | 38 +- programs/disks/DisksApp.cpp | 43 +- programs/disks/DisksApp.h | 5 +- programs/disks/DisksClient.cpp | 6 +- programs/disks/DisksClient.h | 3 +- programs/disks/ICommand.cpp | 4 +- programs/disks/ICommand.h | 8 +- programs/disks/Utils.cpp | 2 +- programs/format/Format.cpp | 88 +- programs/fst-dump-tree/CMakeLists.txt | 10 + programs/fst-dump-tree/FstDumpTree.cpp | 483 ++ programs/fst-dump-tree/README.md | 84 + programs/fst-dump-tree/fst-dump-tree.cpp | 1 + programs/install/Install.cpp | 63 +- programs/keeper-bench/Generator.cpp | 6 +- programs/keeper-bench/KeeperBench.cpp | 4 +- programs/keeper-bench/Runner.cpp | 6 +- programs/keeper-bench/Runner.h | 11 +- programs/keeper-bench/Stats.cpp | 2 +- programs/keeper-client/Commands.cpp | 60 +- programs/keeper-client/Commands.h | 16 +- programs/keeper-client/KeeperClient.cpp | 171 +- programs/keeper-client/KeeperClient.h | 8 +- programs/keeper-client/Parser.cpp | 4 +- programs/keeper-utils/CMakeLists.txt | 14 + programs/keeper-utils/KeeperUtils.cpp | 1348 ++++++ programs/keeper-utils/README.md | 289 ++ programs/keeper-utils/keeper-utils.cpp | 1 + programs/keeper/CMakeLists.txt | 3 +- programs/keeper/Keeper.cpp | 12 +- programs/keeper/keeper_main.cpp | 4 +- programs/local/LocalServer.cpp | 158 +- programs/local/LocalServer.h | 5 +- programs/local/PythonSource.cpp | 2 +- programs/local/TableFunctionPython.h | 2 +- programs/main.cpp | 81 +- programs/obfuscator/Obfuscator.cpp | 2 +- programs/self-extracting/CMakeLists.txt | 21 +- programs/server/MetricsTransmitter.cpp | 2 +- programs/server/Server.cpp | 290 +- .../config.d/zookeeper_connection_log.xml | 9 + programs/server/config.xml | 141 +- programs/server/config.yaml.example | 23 +- programs/server/dashboard.html | 8 +- programs/server/embedded.xml | 26 + programs/server/fuzzers/CMakeLists.txt | 1 + programs/server/index.html | 194 + programs/server/play.html | 419 +- rust/VENDOR.md | 68 +- rust/chcache/Cargo.lock | 872 ++-- rust/chcache/Cargo.toml | 4 +- rust/chcache/src/compilers/rustc.rs | 2 +- rust/chcache/src/config.rs | 1 - rust/chcache/src/disks/local.rs | 4 +- rust/vendor.sh | 64 + rust/workspace/Cargo.lock | 862 ++-- rust/workspace/Cargo.toml | 4 - rust/workspace/skim/Cargo.toml | 2 +- src/Access/AccessControl.cpp | 11 + src/Access/AccessControl.h | 3 + src/Access/AccessEntityIO.cpp | 2 +- src/Access/AccessRights.cpp | 43 +- src/Access/AccessRights.h | 9 + src/Access/AuthenticationData.cpp | 14 +- src/Access/Common/AccessFlags.cpp | 38 +- src/Access/Common/AccessFlags.h | 5 + src/Access/Common/AccessRightsElement.cpp | 128 +- src/Access/Common/AccessRightsElement.h | 17 +- src/Access/Common/AccessType.h | 183 +- src/Access/Common/AuthenticationType.cpp | 5 + src/Access/Common/AuthenticationType.h | 3 + .../Common/HTTPAuthenticationScheme.cpp | 2 +- src/Access/ContextAccess.cpp | 115 +- src/Access/ContextAccess.h | 10 + src/Access/DiskAccessStorage.cpp | 14 +- src/Access/EnabledQuota.cpp | 25 +- src/Access/EnabledQuota.h | 3 +- src/Access/HTTPAuthClient.h | 29 +- src/Access/IAccessStorage.cpp | 35 +- src/Access/IAccessStorage.h | 22 +- src/Access/KerberosInit.cpp | 1 - src/Access/LDAPAccessStorage.cpp | 2 +- src/Access/MemoryAccessStorage.cpp | 12 +- src/Access/MemoryAccessStorage.h | 2 + src/Access/MultipleAccessStorage.cpp | 35 +- src/Access/MultipleAccessStorage.h | 3 + src/Access/QuotaCache.cpp | 12 +- src/Access/ReplicatedAccessStorage.cpp | 586 +-- src/Access/ReplicatedAccessStorage.h | 56 +- src/Access/RoleCache.cpp | 2 +- src/Access/SettingsAuthResponseParser.cpp | 3 +- src/Access/SettingsConstraints.cpp | 44 +- src/Access/SettingsConstraints.h | 7 +- src/Access/SettingsProfileElement.cpp | 11 +- src/Access/SettingsProfileElement.h | 5 +- src/Access/UsersConfigAccessStorage.cpp | 13 + src/Access/ViewDefinerDependencies.cpp | 90 + src/Access/ViewDefinerDependencies.h | 53 + src/Access/ZooKeeperReplicator.cpp | 674 +++ src/Access/ZooKeeperReplicator.h | 98 + src/Access/tests/gtest_access_rights_ops.cpp | 41 +- .../AggregateFunctionCount.cpp | 217 + .../AggregateFunctionCount.h | 217 +- ...regateFunctionEstimateCompressionRatio.cpp | 11 +- .../AggregateFunctionFlameGraph.cpp | 29 +- .../AggregateFunctionGroupArray.cpp | 15 +- .../AggregateFunctionGroupArrayInsertAt.cpp | 6 +- .../AggregateFunctionGroupBitmapData.h | 267 +- ...egateFunctionGroupNumericIndexedVector.cpp | 174 + ...gregateFunctionGroupNumericIndexedVector.h | 95 + ...ateFunctionGroupNumericIndexedVectorData.h | 202 + ...FunctionGroupNumericIndexedVectorDataBSI.h | 1919 ++++++++ ...ateFunctionLargestTriangleThreeBuckets.cpp | 82 +- .../AggregateFunctionMLMethod.cpp | 13 +- .../AggregateFunctionMLMethod.h | 3 +- .../AggregateFunctionSequenceMatch.cpp | 8 +- .../AggregateFunctionSparkbar.cpp | 18 +- .../AggregateFunctionSumMap.cpp | 7 +- .../AggregateFunctionTopK.cpp | 2 +- .../AggregateFunctionsArgMinArgMax.cpp | 2 +- src/AggregateFunctions/CMakeLists.txt | 1 + .../Combinators/AggregateFunctionArray.cpp | 4 +- .../AggregateFunctionCombinatorFactory.cpp | 2 +- .../AggregateFunctionCombinatorFactory.h | 3 +- .../Combinators/AggregateFunctionDistinct.cpp | 4 +- .../Combinators/AggregateFunctionDistinct.h | 164 +- .../Combinators/AggregateFunctionForEach.cpp | 4 +- .../Combinators/AggregateFunctionIf.cpp | 37 +- .../Combinators/AggregateFunctionIf.h | 8 + .../Combinators/AggregateFunctionMap.cpp | 2 +- .../Combinators/AggregateFunctionMerge.cpp | 4 +- .../Combinators/AggregateFunctionNull.cpp | 8 +- .../Combinators/AggregateFunctionOrFill.cpp | 4 +- .../Combinators/AggregateFunctionResample.cpp | 4 +- .../AggregateFunctionSimpleState.cpp | 4 +- .../Combinators/AggregateFunctionState.cpp | 6 +- .../Combinators/AggregateFunctionState.h | 5 + src/AggregateFunctions/IAggregateFunction.cpp | 3 - src/AggregateFunctions/IAggregateFunction.h | 7 +- .../ReservoirSamplerDeterministic.h | 21 +- src/AggregateFunctions/SingleValueData.cpp | 187 +- src/AggregateFunctions/SingleValueData.h | 17 +- .../AggregateFunctionLast2Samples.cpp | 120 + .../AggregateFunctionLast2Samples.h | 387 ++ .../AggregateFunctionTimeSeriesGroupArray.cpp | 97 + .../AggregateFunctionTimeSeriesGroupArray.h | 459 ++ .../AggregateFunctionTimeseriesBase.h | 505 +++ ...egateFunctionTimeseriesExtrapolatedValue.h | 285 ++ .../AggregateFunctionTimeseriesHelpers.cpp | 286 ++ .../AggregateFunctionTimeseriesInstantValue.h | 174 + ...regateFunctionTimeseriesLinearRegression.h | 270 ++ .../AggregateFunctionTimeseriesToGridSparse.h | 164 + .../TimeSeries/CMakeLists.txt | 4 + src/AggregateFunctions/UniqExactSet.h | 14 +- .../examples/group_array_sorted.cpp | 2 +- src/AggregateFunctions/fuzzers/CMakeLists.txt | 2 +- .../registerAggregateFunctions.cpp | 9 + src/Analyzer/ColumnNode.cpp | 6 +- src/Analyzer/ConstantNode.cpp | 16 +- src/Analyzer/FunctionNode.cpp | 6 +- src/Analyzer/IQueryTreeNode.h | 29 +- src/Analyzer/JoinNode.cpp | 4 + .../Passes/FunctionToSubcolumnsPass.cpp | 4 +- src/Analyzer/Passes/FuseFunctionsPass.cpp | 55 +- src/Analyzer/Passes/IfChainToMultiIfPass.cpp | 3 +- src/Analyzer/Passes/MultiIfToIfPass.cpp | 3 +- .../Passes/RegexpFunctionRewritePass.cpp | 220 + .../Passes/RegexpFunctionRewritePass.h | 27 + .../Passes/ShardNumColumnToFunctionPass.cpp | 19 +- src/Analyzer/QueryNode.cpp | 27 +- src/Analyzer/QueryTreeBuilder.cpp | 3 +- src/Analyzer/QueryTreePassManager.cpp | 14 +- .../Resolve/CorrelatedColumnsCollector.h | 77 + .../Resolve/IdentifierResolveScope.cpp | 1 + src/Analyzer/Resolve/IdentifierResolveScope.h | 3 + src/Analyzer/Resolve/IdentifierResolver.cpp | 67 +- src/Analyzer/Resolve/QueryAnalyzer.cpp | 601 ++- src/Analyzer/Resolve/QueryAnalyzer.h | 13 +- ...eFunctionsWithClusterAlternativesVisitor.h | 12 +- src/Analyzer/TableNode.cpp | 5 + src/Analyzer/TableNode.h | 2 + src/Analyzer/UnionNode.cpp | 2 +- src/Analyzer/Utils.cpp | 33 +- src/Analyzer/Utils.h | 4 +- src/Analyzer/ValidationUtils.cpp | 71 +- src/Analyzer/ValidationUtils.h | 1 + src/Backups/BackupCoordinationCleaner.cpp | 12 +- src/Backups/BackupCoordinationCleaner.h | 4 +- src/Backups/BackupCoordinationLocal.h | 14 +- src/Backups/BackupCoordinationOnCluster.cpp | 59 +- src/Backups/BackupCoordinationOnCluster.h | 13 +- .../BackupCoordinationReplicatedTables.cpp | 28 +- .../BackupCoordinationReplicatedTables.h | 1 - src/Backups/BackupCoordinationStageSync.cpp | 175 +- src/Backups/BackupCoordinationStageSync.h | 19 +- src/Backups/BackupEntriesCollector.cpp | 8 +- src/Backups/BackupEntryWrappedWith.h | 4 + src/Backups/BackupFileInfo.cpp | 6 + src/Backups/BackupIO_AzureBlobStorage.cpp | 82 +- src/Backups/BackupIO_S3.cpp | 56 +- src/Backups/BackupIO_S3.h | 4 + src/Backups/BackupImpl.cpp | 150 +- src/Backups/BackupImpl.h | 28 +- src/Backups/BackupInfo.cpp | 8 + src/Backups/BackupInfo.h | 1 + src/Backups/BackupUtils.cpp | 4 +- src/Backups/BackupsWorker.cpp | 225 +- src/Backups/BackupsWorker.h | 11 +- src/Backups/IBackup.h | 5 +- src/Backups/IBackupCoordination.h | 20 +- src/Backups/IBackupEntriesLazyBatch.cpp | 2 + src/Backups/IRestoreCoordination.h | 23 +- src/Backups/RestoreCoordinationLocal.cpp | 6 + src/Backups/RestoreCoordinationLocal.h | 18 +- src/Backups/RestoreCoordinationOnCluster.cpp | 87 +- src/Backups/RestoreCoordinationOnCluster.h | 16 +- src/Backups/RestoreSettings.cpp | 1 + src/Backups/RestoreSettings.h | 3 + src/Backups/RestorerFromBackup.cpp | 75 +- .../registerBackupEngineAzureBlobStorage.cpp | 46 +- src/Backups/registerBackupEngineS3.cpp | 111 +- .../CatBoostLibraryBridgeHelper.cpp | 7 +- .../CatBoostLibraryBridgeHelper.h | 2 +- .../ExternalDictionaryLibraryBridgeHelper.cpp | 3 +- src/BridgeHelper/IBridgeHelper.cpp | 2 +- src/BridgeHelper/IBridgeHelper.h | 2 +- src/BridgeHelper/LibraryBridgeHelper.cpp | 3 +- src/BridgeHelper/LibraryBridgeHelper.h | 2 +- src/BridgeHelper/XDBCBridgeHelper.h | 8 +- src/CMakeLists.txt | 74 +- src/Client/AI/AIClientFactory.cpp | 114 + src/Client/AI/AIClientFactory.h | 31 + src/Client/AI/AIConfiguration.h | 42 + src/Client/AI/AIPrompts.h | 264 ++ src/Client/AI/AISQLGenerator.cpp | 166 + src/Client/AI/AISQLGenerator.h | 49 + src/Client/AI/AIToolExecutionDisplay.h | 178 + src/Client/AI/SchemaExplorationTools.cpp | 151 + src/Client/AI/SchemaExplorationTools.h | 40 + .../AI/tests/gtest_ai_client_factory.cpp | 316 ++ .../AI/tests/gtest_ai_sql_generator.cpp | 515 +++ src/Client/BuzzHouse/AST/SQLProtoStr.cpp | 1266 ++++-- src/Client/BuzzHouse/AST/SQLProtoStr.h | 1 + .../Generator/ExternalIntegrations.cpp | 929 +++- .../Generator/ExternalIntegrations.h | 184 +- src/Client/BuzzHouse/Generator/FuzzConfig.cpp | 479 +- src/Client/BuzzHouse/Generator/FuzzConfig.h | 146 +- .../BuzzHouse/Generator/QueryOracle.cpp | 458 +- src/Client/BuzzHouse/Generator/QueryOracle.h | 41 +- .../BuzzHouse/Generator/RandomGenerator.cpp | 33 +- .../BuzzHouse/Generator/RandomGenerator.h | 28 +- .../BuzzHouse/Generator/RandomSettings.h | 131 +- src/Client/BuzzHouse/Generator/SQLCatalog.cpp | 248 + src/Client/BuzzHouse/Generator/SQLCatalog.h | 173 +- .../BuzzHouse/Generator/SQLExpression.cpp | 534 ++- src/Client/BuzzHouse/Generator/SQLFuncs.h | 85 +- src/Client/BuzzHouse/Generator/SQLQuery.cpp | 871 ++-- src/Client/BuzzHouse/Generator/SQLTable.cpp | 1298 ++++-- src/Client/BuzzHouse/Generator/SQLTypes.cpp | 384 +- src/Client/BuzzHouse/Generator/SQLTypes.h | 62 +- .../BuzzHouse/Generator/ServerSettings.cpp | 1488 +++--- .../Generator/StatementGenerator.cpp | 1275 ++++-- .../BuzzHouse/Generator/StatementGenerator.h | 258 +- .../BuzzHouse/Generator/TableSetttings.cpp | 573 ++- src/Client/BuzzHouse/Proto/SQLGrammar.proto | 4001 +++++++++-------- src/Client/ClientApplicationBase.cpp | 19 +- src/Client/ClientBase.cpp | 375 +- src/Client/ClientBase.h | 65 +- src/Client/ClientBaseHelpers.cpp | 367 +- src/Client/ClientBaseHelpers.h | 8 +- src/Client/ClientBaseOptimizedParts.cpp | 4 + src/Client/Connection.cpp | 84 +- src/Client/Connection.h | 9 +- src/Client/ConnectionEstablisher.cpp | 11 +- src/Client/ConnectionParameters.cpp | 2 +- src/Client/ConnectionPoolWithFailover.cpp | 11 +- src/Client/ConnectionPoolWithFailover.h | 3 +- src/Client/ConnectionString.cpp | 2 +- src/Client/HedgedConnections.cpp | 3 +- src/Client/HedgedConnections.h | 2 +- src/Client/HedgedConnectionsFactory.cpp | 1 + src/Client/IConnections.h | 3 +- src/Client/LineReader.cpp | 18 +- src/Client/LineReader.h | 3 + src/Client/LocalConnection.cpp | 78 +- src/Client/LocalConnection.h | 4 +- src/Client/MultiplexedConnections.cpp | 10 +- src/Client/MultiplexedConnections.h | 2 +- src/Client/PacketReceiver.cpp | 2 +- src/Client/ProgressTable.cpp | 6 +- src/Client/ReplxxLineReader.cpp | 33 +- src/Client/ReplxxLineReader.h | 9 +- src/Client/Suggest.cpp | 16 +- src/Client/Suggest.h | 3 +- src/Client/TestTags.cpp | 2 +- src/Columns/ColumnArray.cpp | 8 +- src/Columns/ColumnArray.h | 4 +- src/Columns/ColumnBLOB.h | 236 + src/Columns/ColumnConst.cpp | 2 + src/Columns/ColumnDecimal.cpp | 16 + src/Columns/ColumnDecimal.h | 6 +- src/Columns/ColumnDynamic.cpp | 66 +- src/Columns/ColumnDynamic.h | 17 +- src/Columns/ColumnFixedString.cpp | 16 + src/Columns/ColumnFixedString.h | 5 +- src/Columns/ColumnLazy.cpp | 10 + src/Columns/ColumnLazy.h | 2 + src/Columns/ColumnNullable.cpp | 31 +- src/Columns/ColumnNullable.h | 2 + src/Columns/ColumnObject.cpp | 43 +- src/Columns/ColumnObject.h | 19 +- src/Columns/ColumnSparse.cpp | 3 +- src/Columns/ColumnString.cpp | 91 +- src/Columns/ColumnString.h | 48 +- src/Columns/ColumnStringHelpers.h | 17 +- src/Columns/ColumnUnique.cpp | 8 +- src/Columns/ColumnUnique.h | 47 +- src/Columns/ColumnVariant.cpp | 16 +- src/Columns/ColumnVector.cpp | 17 +- src/Columns/ColumnVector.h | 3 + src/Columns/ColumnsCommon.cpp | 2 +- src/Columns/ColumnsDateTime.h | 4 + src/Columns/IColumn.cpp | 227 +- src/Columns/IColumn.h | 76 +- src/Columns/IColumnUnique.h | 10 + src/Columns/MaskOperations.cpp | 1 + .../benchmark_column_insert_many_from.cpp | 4 - src/Columns/tests/gtest_column_dynamic.cpp | 43 +- src/Columns/tests/gtest_column_object.cpp | 3 +- src/Columns/tests/gtest_column_string.cpp | 5 +- src/Common/ActionLock.cpp | 2 +- src/Common/AggregatedMetrics.cpp | 34 + src/Common/AggregatedMetrics.h | 27 + ..._delete.cpp => AllocationInterceptors.cpp} | 148 + src/Common/AllocationInterceptors.h | 47 + src/Common/Allocator.cpp | 110 +- src/Common/Allocator.h | 8 +- src/Common/AllocatorWithMemoryTracking.h | 11 +- src/Common/Arena.h | 9 +- src/Common/ArenaAllocator.h | 56 +- src/Common/AsynchronousMetrics.cpp | 367 +- src/Common/AsynchronousMetrics.h | 21 + src/Common/BSONCXXHelper.h | 68 +- src/Common/Base32.h | 2 +- src/Common/BinStringDecodeHelper.h | 9 - src/Common/BufferAllocationPolicy.cpp | 4 +- src/Common/BufferAllocationPolicy.h | 4 +- src/Common/CacheBase.h | 32 +- src/Common/CalendarTimeInterval.cpp | 2 + src/Common/CaresPTRResolver.cpp | 361 +- src/Common/CaresPTRResolver.h | 23 +- src/Common/ClickHouseVersion.cpp | 41 + src/Common/ClickHouseVersion.h | 23 + src/Common/ColumnsHashing.h | 67 +- src/Common/ColumnsHashing/HashMethod.h | 2 +- src/Common/ConcurrencyControl.cpp | 16 +- src/Common/ConcurrencyControl.h | 10 +- src/Common/ConcurrentBoundedQueue.h | 54 +- src/Common/Config/ConfigProcessor.cpp | 4 +- src/Common/Config/ConfigReloader.cpp | 10 +- src/Common/Config/ConfigReloader.h | 2 +- src/Common/Crypto/OpenSSLInitializer.cpp | 9 + src/Common/Crypto/OpenSSLInitializer.h | 2 + src/Common/CurrentMemoryTracker.cpp | 41 +- src/Common/CurrentMetrics.cpp | 81 +- src/Common/CurrentThread.cpp | 52 +- src/Common/CurrentThread.h | 100 +- src/Common/DNSPTRResolverProvider.cpp | 4 +- src/Common/DNSPTRResolverProvider.h | 2 +- src/Common/DNSResolver.cpp | 19 +- src/Common/DateLUT.cpp | 35 +- src/Common/DateLUT.h | 12 +- src/Common/DateLUTImpl.cpp | 2 +- src/Common/DateLUTImpl.h | 40 +- src/Common/DimensionalMetrics.cpp | 117 + src/Common/DimensionalMetrics.h | 79 + src/Common/Dwarf.cpp | 4 +- src/Common/Elf.cpp | 69 +- src/Common/Elf.h | 122 +- src/Common/EnvironmentChecks.cpp | 2 +- .../EnvironmentProxyConfigurationResolver.cpp | 2 +- src/Common/Epoll.cpp | 2 +- src/Common/ErrorCodes.cpp | 27 +- src/Common/ErrorCodes.h | 6 +- src/Common/Exception.cpp | 162 +- src/Common/Exception.h | 42 +- src/Common/FST.cpp | 102 +- src/Common/FST.h | 31 +- src/Common/FailPoint.cpp | 37 +- src/Common/Fiber.h | 2 +- src/Common/FiberStack.cpp | 14 +- src/Common/FieldVisitorWriteBinary.cpp | 8 +- src/Common/FunctionDocumentation.cpp | 180 +- src/Common/FunctionDocumentation.h | 49 +- src/Common/GWPAsan.cpp | 239 - src/Common/GWPAsan.h | 42 - src/Common/HTTPConnectionPool.cpp | 6 + src/Common/HashTable/Hash.h | 2 +- src/Common/HashTable/HashMap.h | 4 +- src/Common/HashTable/HashSet.h | 9 +- src/Common/HashTable/HashTable.h | 2 +- src/Common/HashTable/StringHashSet.h | 3 +- src/Common/HilbertUtils.h | 2 +- src/Common/Histogram.cpp | 9 +- src/Common/Histogram.h | 6 +- src/Common/ICachePolicy.h | 2 +- src/Common/IPv6ToBinary.cpp | 2 +- src/Common/ISlotControl.h | 41 +- src/Common/IThrottler.h | 33 + src/Common/JSONParsers/DummyJSONParser.h | 3 +- src/Common/JSONParsers/RapidJSONParser.h | 37 +- src/Common/JSONParsers/SimdJSONParser.cpp | 11 +- src/Common/JSONParsers/SimdJSONParser.h | 12 +- src/Common/LRUCachePolicy.h | 65 +- src/Common/LatencyBuckets.cpp | 103 - src/Common/LatencyBuckets.h | 53 - src/Common/LocalTime.h | 243 + src/Common/Logger.cpp | 12 - src/Common/Logger.h | 6 +- src/Common/LoggingFormatStringHelpers.cpp | 12 +- src/Common/LoggingFormatStringHelpers.h | 16 +- src/Common/Macros.cpp | 10 +- src/Common/Macros.h | 1 + src/Common/MatchGenerator.cpp | 14 +- src/Common/MemorySpillScheduler.h | 3 + src/Common/MemoryStatisticsOS.cpp | 2 +- src/Common/MemoryTracker.cpp | 58 +- src/Common/MemoryTracker.h | 13 + src/Common/MemoryTrackerBlockerInThread.cpp | 26 +- src/Common/MemoryTrackerBlockerInThread.h | 33 +- src/Common/MemoryTrackerSwitcher.h | 3 + src/Common/MemoryWorker.cpp | 24 +- src/Common/MemoryWorker.h | 1 - src/Common/NaNUtils.h | 11 +- .../NamedCollections/NamedCollections.cpp | 2 +- .../NamedCollections/NamedCollections.h | 2 +- .../NamedCollectionsFactory.cpp | 1 + .../NamedCollectionsMetadataStorage.cpp | 2 +- .../NamedCollectionsMetadataStorage.h | 1 + .../NamedCollections/NamedCollections_fwd.h | 1 + src/Common/NetlinkMetricsProvider.cpp | 4 +- src/Common/ObjectStorageKey.cpp | 2 +- src/Common/ObjectStorageKeyGenerator.cpp | 2 +- src/Common/ObjectStorageKeyGenerator.h | 2 +- src/Common/OpenSSLHelpers.cpp | 52 +- src/Common/OpenSSLHelpers.h | 4 + src/Common/OpenTelemetryTraceContext.cpp | 2 +- src/Common/OpenTelemetryTraceContext.h | 1 + src/Common/OptimizedRegularExpression.cpp | 62 +- src/Common/OptimizedRegularExpression.h | 19 +- src/Common/OvercommitTracker.cpp | 2 +- src/Common/PODArray.h | 1 - src/Common/PageCache.cpp | 18 +- src/Common/PageCache.h | 2 +- src/Common/ProcfsMetricsProvider.cpp | 2 +- src/Common/ProfileEvents.cpp | 151 +- src/Common/ProfileEvents.h | 6 +- src/Common/ProgressIndication.cpp | 8 +- src/Common/ProgressIndication.h | 4 +- src/Common/ProxyConfiguration.h | 5 +- src/Common/QueryFuzzer.cpp | 13 +- src/Common/QueryProfiler.cpp | 2 +- src/Common/RWLock.cpp | 2 +- src/Common/ReplicasReconnector.cpp | 1 + src/Common/ReplicasReconnector.h | 2 +- src/Common/SLRUCachePolicy.h | 74 +- src/Common/Scheduler/CPULeaseAllocation.cpp | 578 +++ src/Common/Scheduler/CPULeaseAllocation.h | 312 ++ src/Common/Scheduler/CPUSlotsAllocation.cpp | 9 +- src/Common/Scheduler/CPUSlotsAllocation.h | 21 +- src/Common/Scheduler/CostUnit.h | 27 + src/Common/Scheduler/ISchedulerNode.h | 12 + src/Common/Scheduler/Nodes/FifoQueue.h | 11 + .../Scheduler/Nodes/SemaphoreConstraint.h | 2 +- .../Scheduler/Nodes/ThrottlerConstraint.h | 5 +- .../Scheduler/Nodes/UnifiedSchedulerNode.h | 10 +- .../Nodes/WorkloadResourceManager.cpp | 6 +- .../Scheduler/Nodes/WorkloadResourceManager.h | 6 +- .../Scheduler/Nodes/tests/ResourceTest.h | 4 +- .../Nodes/tests/gtest_resource_class_fair.cpp | 2 +- .../tests/gtest_resource_class_priority.cpp | 2 +- .../Nodes/tests/gtest_resource_scheduler.cpp | 4 +- .../tests/gtest_workload_resource_manager.cpp | 958 +++- src/Common/Scheduler/ResourceAccessMode.h | 32 + src/Common/Scheduler/ResourceRequest.h | 4 + .../Workload/IWorkloadEntityStorage.h | 3 + .../Workload/WorkloadEntityStorageBase.cpp | 32 +- .../Workload/WorkloadEntityStorageBase.h | 2 + src/Common/Scheduler/WorkloadSettings.cpp | 117 +- src/Common/Scheduler/WorkloadSettings.h | 26 +- src/Common/SensitiveDataMasker.cpp | 2 +- src/Common/SensitiveDataMasker.h | 2 +- src/Common/SharedLockGuard.h | 34 +- src/Common/SignalHandlers.cpp | 130 +- src/Common/SignalHandlers.h | 7 +- src/Common/SipHash.h | 43 +- src/Common/SpaceSaving.h | 2 +- src/Common/StackTrace.cpp | 11 +- src/Common/StatusFile.cpp | 7 +- src/Common/StatusFile.h | 5 +- src/Common/StringHashForHeterogeneousLookup.h | 5 + src/Common/StringSearcher.h | 16 +- src/Common/StudentTTest.cpp | 2 +- src/Common/SymbolIndex.cpp | 210 +- src/Common/SymbolIndex.h | 19 +- src/Common/SystemLogBase.cpp | 16 +- src/Common/SystemLogBase.h | 11 +- src/Common/TTLCachePolicy.h | 48 +- src/Common/ThreadFuzzer.cpp | 5 +- src/Common/ThreadFuzzer.h | 4 +- src/Common/ThreadPool.cpp | 7 +- src/Common/ThreadPoolTaskTracker.cpp | 2 +- src/Common/ThreadProfileEvents.cpp | 14 +- src/Common/ThreadStatus.cpp | 52 +- src/Common/ThreadStatus.h | 62 +- src/Common/Throttler.cpp | 85 +- src/Common/Throttler.h | 74 +- src/Common/ThrottlerArray.h | 95 + src/Common/Throttler_fwd.h | 11 - src/Common/TraceSender.cpp | 4 +- src/Common/UTF8Helpers.cpp | 25 + src/Common/UTF8Helpers.h | 29 +- src/Common/UnicodeBar.cpp | 11 +- src/Common/UniqueLock.h | 1 + src/Common/VariableContext.h | 2 + src/Common/Volnitsky.h | 26 +- src/Common/WKB.cpp | 286 ++ src/Common/WKB.h | 83 + src/Common/ZooKeeper/IKeeper.cpp | 4 +- src/Common/ZooKeeper/IKeeper.h | 5 + src/Common/ZooKeeper/KeeperException.h | 3 +- src/Common/ZooKeeper/KeeperFeatureFlags.cpp | 16 +- src/Common/ZooKeeper/KeeperFeatureFlags.h | 4 +- src/Common/ZooKeeper/TestKeeper.cpp | 31 +- src/Common/ZooKeeper/TestKeeper.h | 2 + src/Common/ZooKeeper/Types.h | 10 +- src/Common/ZooKeeper/ZooKeeper.cpp | 160 +- src/Common/ZooKeeper/ZooKeeper.h | 46 +- src/Common/ZooKeeper/ZooKeeperArgs.cpp | 59 +- src/Common/ZooKeeper/ZooKeeperArgs.h | 16 + src/Common/ZooKeeper/ZooKeeperCommon.cpp | 66 +- src/Common/ZooKeeper/ZooKeeperCommon.h | 8 + src/Common/ZooKeeper/ZooKeeperImpl.cpp | 157 +- src/Common/ZooKeeper/ZooKeeperImpl.h | 5 +- src/Common/ZooKeeper/ZooKeeperNodeCache.cpp | 2 +- src/Common/ZooKeeper/ZooKeeperNodeCache.h | 4 +- src/Common/clibssh.h | 2 +- src/Common/clickhouse_malloc.cpp | 77 - src/Common/computeMaxTableNameLength.cpp | 1 + src/Common/computeMaxTableNameLength.h | 2 +- src/Common/config.h.in | 11 +- src/Common/examples/CMakeLists.txt | 4 +- src/Common/examples/encrypt_decrypt.cpp | 33 +- src/Common/examples/symbol_index.cpp | 4 +- src/Common/filesystemHelpers.cpp | 2 +- src/Common/format.h | 3 +- src/Common/formatIPv6.cpp | 211 +- src/Common/formatIPv6.h | 78 +- src/Common/getMappedArea.cpp | 2 +- src/Common/getNumberOfCPUCoresToUse.cpp | 2 +- src/Common/hasLinuxCapability.cpp | 2 +- src/Common/logger_useful.h | 42 +- src/Common/memory.h | 119 +- src/Common/mysqlxx/CMakeLists.txt | 4 - src/Common/mysqlxx/Pool.cpp | 2 +- src/Common/mysqlxx/mysqlxx/Null.h | 96 - src/Common/mysqlxx/mysqlxx/PoolWithFailover.h | 2 +- src/Common/mysqlxx/mysqlxx/Query.h | 26 +- src/Common/mysqlxx/mysqlxx/ResultBase.h | 10 +- src/Common/mysqlxx/mysqlxx/Row.h | 38 +- src/Common/mysqlxx/mysqlxx/UseQueryResult.h | 24 +- src/Common/mysqlxx/mysqlxx/Value.h | 36 +- src/Common/mysqlxx/mysqlxx/mysqlxx.h | 58 - src/Common/mysqlxx/tests/CMakeLists.txt | 2 - .../mysqlxx/tests/mysqlxx_pool_test.cpp | 91 - src/Common/parseGlobs.cpp | 56 +- src/Common/parseGlobs.h | 2 + src/Common/parseRemoteDescription.cpp | 2 +- .../proxyConfigurationToPocoProxyConfig.cpp | 13 +- src/Common/re2.h | 11 + src/Common/remapExecutable.cpp | 2 +- src/Common/tests/gtest_aggregated_metrics.cpp | 49 + .../tests/gtest_allocation_interceptors.cpp | 100 + src/Common/tests/gtest_async_loader.cpp | 14 +- .../tests/gtest_dimensional_metrics.cpp | 137 + src/Common/tests/gtest_fst.cpp | 6 +- src/Common/tests/gtest_global_context.cpp | 18 +- src/Common/tests/gtest_global_context.h | 15 +- src/Common/tests/gtest_hash_table.cpp | 63 + src/Common/tests/gtest_helper_functions.h | 6 +- src/Common/tests/gtest_interval_tree.cpp | 2 +- src/Common/tests/gtest_log.cpp | 44 +- src/Common/tests/gtest_lru_cache.cpp | 46 +- src/Common/tests/gtest_optimize_re.cpp | 78 +- ..._proxy_configuration_resolver_provider.cpp | 14 +- .../tests/gtest_sensitive_data_masker.cpp | 2 +- src/Common/tests/gtest_slru_cache.cpp | 94 +- src/Common/tests/gtest_thread_fuzzer.cpp | 2 +- src/Common/tests/gtest_threading.cpp | 14 +- src/Common/tests/gtest_yaml_parser.cpp | 4 +- src/Common/threadPoolCallbackRunner.cpp | 274 ++ src/Common/threadPoolCallbackRunner.h | 177 +- .../CachedCompressedReadBuffer.cpp | 2 +- src/Compression/CachedCompressedReadBuffer.h | 4 +- src/Compression/CompressedReadBuffer.cpp | 4 +- src/Compression/CompressedReadBuffer.h | 14 +- src/Compression/CompressedReadBufferBase.cpp | 97 +- src/Compression/CompressedReadBufferBase.h | 3 +- .../CompressedReadBufferFromFile.cpp | 7 +- .../CompressedReadBufferFromFile.h | 4 +- src/Compression/CompressedWriteBuffer.cpp | 15 + src/Compression/CompressedWriteBuffer.h | 4 + .../CompressionCodecDeflateQpl.cpp | 2 +- src/Compression/CompressionCodecDeflateQpl.h | 6 + src/Compression/CompressionCodecDelta.cpp | 6 + .../CompressionCodecDoubleDelta.cpp | 32 +- src/Compression/CompressionCodecEncrypted.cpp | 2 +- src/Compression/CompressionCodecEncrypted.h | 17 +- src/Compression/CompressionCodecFPC.cpp | 58 +- src/Compression/CompressionCodecGCD.cpp | 4 + src/Compression/CompressionCodecGorilla.cpp | 5 + src/Compression/CompressionCodecLZ4.cpp | 6 + src/Compression/CompressionCodecMultiple.h | 2 + src/Compression/CompressionCodecNone.h | 2 + src/Compression/CompressionCodecT64.cpp | 14 + src/Compression/CompressionCodecZSTD.h | 5 + src/Compression/CompressionCodecZSTDQAT.cpp | 5 + src/Compression/CompressionFactory.cpp | 24 + src/Compression/CompressionFactory.h | 4 + .../CompressionFactoryAdditions.cpp | 6 +- src/Compression/ICompressionCodec.cpp | 2 +- src/Compression/ICompressionCodec.h | 3 + src/Compression/LZ4_decompress_faster.cpp | 2 +- .../tests/gtest_compressionCodec.cpp | 5 + src/Coordination/Changelog.cpp | 346 +- src/Coordination/Changelog.h | 42 +- src/Coordination/CoordinationSettings.cpp | 11 +- src/Coordination/CoordinationSettings.h | 3 +- src/Coordination/FourLetterCommand.cpp | 13 +- src/Coordination/FourLetterCommand.h | 13 + .../KeeperAsynchronousMetrics.cpp | 1 + src/Coordination/KeeperAsynchronousMetrics.h | 2 +- src/Coordination/KeeperCommon.cpp | 31 - src/Coordination/KeeperCommon.h | 4 - src/Coordination/KeeperContext.cpp | 54 +- src/Coordination/KeeperContext.h | 21 +- src/Coordination/KeeperDispatcher.cpp | 11 +- src/Coordination/KeeperServer.cpp | 12 +- src/Coordination/KeeperSnapshotManager.cpp | 52 +- src/Coordination/KeeperSnapshotManager.h | 8 +- src/Coordination/KeeperSnapshotManagerS3.cpp | 11 +- src/Coordination/KeeperStateMachine.cpp | 68 +- src/Coordination/KeeperStateMachine.h | 4 +- src/Coordination/KeeperStateManager.cpp | 11 +- src/Coordination/KeeperStateManager.h | 4 +- src/Coordination/KeeperStorage.cpp | 337 +- src/Coordination/KeeperStorage.h | 18 +- src/Coordination/RaftServerConfig.cpp | 3 +- src/Coordination/RocksDBContainer.h | 161 +- src/Coordination/SessionExpiryQueue.cpp | 41 +- src/Coordination/SessionExpiryQueue.h | 3 + src/Coordination/SnapshotableHashTable.h | 24 +- src/Coordination/ZooKeeperDataReader.cpp | 4 +- src/Coordination/tests/gtest_coordination.cpp | 7 +- .../tests/gtest_coordination_changelog.cpp | 1 - .../tests/gtest_coordination_common.h | 11 +- .../tests/gtest_coordination_snapshot.cpp | 82 +- .../tests/gtest_coordination_storage.cpp | 171 + src/Core/BackgroundSchedulePool.cpp | 149 +- src/Core/BackgroundSchedulePool.h | 36 +- src/Core/BaseSettings.cpp | 35 +- src/Core/BaseSettings.h | 13 +- src/Core/Block.cpp | 102 +- src/Core/Block.h | 19 +- src/Core/BlockMissingValues.cpp | 22 +- src/Core/BlockMissingValues.h | 6 +- src/Core/Block_fwd.h | 5 +- src/Core/DecimalFunctions.h | 29 +- src/Core/DistributedCacheDefines.h | 12 +- src/Core/ExternalResultDescription.cpp | 8 +- src/Core/ExternalResultDescription.h | 2 + src/Core/ExternalTable.cpp | 2 +- src/Core/Field.cpp | 34 + src/Core/Field.h | 4 + src/Core/FormatFactorySettings.h | 147 +- src/Core/LogsLevel.h | 2 + src/Core/MySQL/Authentication.h | 2 +- src/Core/MySQL/PacketEndpoint.h | 6 +- src/Core/NamesAndTypes.cpp | 83 + src/Core/NamesAndTypes.h | 11 + src/Core/PostgreSQL/Connection.cpp | 2 +- src/Core/PostgreSQL/ConnectionHolder.h | 2 +- src/Core/PostgreSQL/PoolWithFailover.cpp | 4 +- src/Core/PostgreSQL/PoolWithFailover.h | 2 +- src/Core/PostgreSQL/Utils.cpp | 2 +- src/Core/PostgreSQL/Utils.h | 2 +- src/Core/PostgreSQL/insertPostgreSQLValue.cpp | 2 +- src/Core/PostgreSQLProtocol.cpp | 2 +- src/Core/PostgreSQLProtocol.h | 180 +- src/Core/Protocol.cpp | 27 + src/Core/Protocol.h | 52 +- src/Core/ProtocolDefines.h | 14 +- src/Core/ServerSettings.cpp | 131 +- src/Core/ServerSettings.h | 1 + src/Core/Settings.cpp | 558 ++- src/Core/Settings.h | 2 + src/Core/SettingsChangesHistory.cpp | 203 +- src/Core/SettingsChangesHistory.h | 18 +- src/Core/SettingsEnums.cpp | 51 +- src/Core/SettingsEnums.h | 57 + src/Core/SettingsFields.h | 2 +- src/Core/SettingsQuirks.cpp | 4 +- src/Core/SortCursor.h | 4 +- src/Core/StreamingHandleErrorMode.h | 3 +- src/Core/TypeId.h | 3 + src/Core/YTsaurus/YTsaurusClient.cpp | 231 + src/Core/YTsaurus/YTsaurusClient.h | 88 + src/Core/YTsaurus/YTsaurusQueries.h | 124 + src/Core/callOnTypeIndex.h | 10 + src/Core/examples/CMakeLists.txt | 10 + src/Core/examples/gcloud_kms.cpp | 33 + src/Core/examples/gcloud_storage.cpp | 43 + .../tests/gtest_BackgroundSchedulePool.cpp | 104 + src/Daemon/BaseDaemon.cpp | 54 +- src/Daemon/CMakeLists.txt | 6 +- src/Daemon/CrashWriter.cpp | 203 + src/Daemon/CrashWriter.h | 61 + src/Daemon/SentryWriter.cpp | 256 -- src/Daemon/SentryWriter.h | 78 - src/DataTypes/DataTypeAggregateFunction.cpp | 14 + src/DataTypes/DataTypeAggregateFunction.h | 1 + src/DataTypes/DataTypeArray.cpp | 5 + src/DataTypes/DataTypeArray.h | 2 + .../DataTypeCustomSimpleAggregateFunction.cpp | 2 + src/DataTypes/DataTypeDateTime.cpp | 2 +- src/DataTypes/DataTypeDateTime.h | 2 +- src/DataTypes/DataTypeDateTime64.cpp | 10 +- src/DataTypes/DataTypeDateTime64.h | 5 +- src/DataTypes/DataTypeDecimalBase.cpp | 3 +- src/DataTypes/DataTypeDecimalBase.h | 9 + src/DataTypes/DataTypeDynamic.cpp | 6 + src/DataTypes/DataTypeDynamic.h | 2 + src/DataTypes/DataTypeEnum.cpp | 31 +- src/DataTypes/DataTypeEnum.h | 4 +- src/DataTypes/DataTypeFactory.cpp | 1 + src/DataTypes/DataTypeFactory.h | 1 + src/DataTypes/DataTypeFixedString.cpp | 6 + src/DataTypes/DataTypeFixedString.h | 2 + src/DataTypes/DataTypeFunction.cpp | 11 + src/DataTypes/DataTypeFunction.h | 2 + src/DataTypes/DataTypeIPv4andIPv6.h | 2 + src/DataTypes/DataTypeInterval.cpp | 6 + src/DataTypes/DataTypeInterval.h | 1 + src/DataTypes/DataTypeLowCardinality.cpp | 9 +- src/DataTypes/DataTypeLowCardinality.h | 1 + .../DataTypeLowCardinalityHelpers.cpp | 2 +- src/DataTypes/DataTypeMap.cpp | 12 +- src/DataTypes/DataTypeMap.h | 2 + src/DataTypes/DataTypeNothing.h | 2 + src/DataTypes/DataTypeNullable.cpp | 5 + src/DataTypes/DataTypeNullable.h | 1 + src/DataTypes/DataTypeNumberBase.h | 2 + src/DataTypes/DataTypeObject.cpp | 47 +- src/DataTypes/DataTypeObject.h | 3 + src/DataTypes/DataTypeObjectDeprecated.cpp | 7 + src/DataTypes/DataTypeObjectDeprecated.h | 2 + src/DataTypes/DataTypeString.h | 2 + src/DataTypes/DataTypeTime.cpp | 50 + src/DataTypes/DataTypeTime.h | 54 + src/DataTypes/DataTypeTime64.cpp | 76 + src/DataTypes/DataTypeTime64.h | 52 + src/DataTypes/DataTypeTuple.cpp | 37 +- src/DataTypes/DataTypeTuple.h | 7 +- src/DataTypes/DataTypeUUID.h | 2 + src/DataTypes/DataTypeVariant.cpp | 8 + src/DataTypes/DataTypeVariant.h | 2 + src/DataTypes/DataTypesBinaryEncoding.cpp | 103 +- src/DataTypes/DataTypesBinaryEncoding.h | 7 +- src/DataTypes/DataTypesCache.cpp | 12 + src/DataTypes/DataTypesCache.h | 56 + src/DataTypes/DataTypesDecimal.h | 10 + src/DataTypes/DataTypesNumber.cpp | 13 +- src/DataTypes/DataTypesNumber.h | 4 + src/DataTypes/FieldToDataType.h | 2 + src/DataTypes/IDataType.cpp | 34 +- src/DataTypes/IDataType.h | 26 +- src/DataTypes/IDataTypeDummy.h | 2 + src/DataTypes/Native.cpp | 6 +- src/DataTypes/NestedUtils.cpp | 6 +- src/DataTypes/ObjectUtils.cpp | 2 +- .../Serializations/ISerialization.cpp | 153 +- src/DataTypes/Serializations/ISerialization.h | 117 +- .../Serializations/SerializationArray.cpp | 158 +- .../Serializations/SerializationArray.h | 4 + .../Serializations/SerializationBool.h | 6 +- .../SerializationCustomSimpleText.h | 14 +- .../Serializations/SerializationDate.cpp | 15 +- .../Serializations/SerializationDate32.cpp | 15 +- .../Serializations/SerializationDateTime.cpp | 267 ++ .../Serializations/SerializationDateTime.h | 22 + .../SerializationDecimalBase.cpp | 3 +- .../Serializations/SerializationDetached.cpp | 82 + .../Serializations/SerializationDetached.h | 60 + .../Serializations/SerializationDynamic.cpp | 323 +- .../Serializations/SerializationDynamic.h | 25 +- .../SerializationDynamicHelpers.cpp | 270 ++ .../SerializationDynamicHelpers.h | 36 + .../SerializationFixedString.cpp | 4 +- .../Serializations/SerializationInterval.cpp | 233 +- .../Serializations/SerializationInterval.h | 80 +- .../Serializations/SerializationJSON.cpp | 21 +- .../Serializations/SerializationJSON.h | 2 +- .../SerializationLowCardinality.cpp | 14 +- .../Serializations/SerializationMap.cpp | 21 + .../Serializations/SerializationNullable.cpp | 7 +- .../Serializations/SerializationObject.cpp | 440 +- .../Serializations/SerializationObject.h | 43 +- .../SerializationObjectDeprecated.cpp | 7 +- .../SerializationObjectDynamicPath.cpp | 77 +- .../SerializationObjectDynamicPath.h | 6 +- .../SerializationObjectHelpers.cpp | 288 ++ .../SerializationObjectHelpers.h | 36 + .../SerializationObjectSharedData.cpp | 1386 ++++++ .../SerializationObjectSharedData.h | 312 ++ .../SerializationObjectSharedDataPath.cpp | 336 ++ .../SerializationObjectSharedDataPath.h | 60 + .../Serializations/SerializationSparse.cpp | 8 +- .../Serializations/SerializationString.cpp | 78 +- .../Serializations/SerializationSubObject.cpp | 105 +- .../Serializations/SerializationSubObject.h | 6 +- .../SerializationSubObjectSharedData.cpp | 336 ++ .../SerializationSubObjectSharedData.h | 78 + .../Serializations/SerializationTime64.cpp | 298 ++ .../Serializations/SerializationTime64.h | 35 + .../Serializations/SerializationTuple.cpp | 16 +- .../Serializations/SerializationTuple.h | 6 +- .../Serializations/SerializationVariant.cpp | 84 +- .../SerializationVariantElement.cpp | 72 +- .../SerializationVariantElementNullMap.cpp | 34 +- .../getSubcolumnsDeserializationOrder.cpp | 58 + .../getSubcolumnsDeserializationOrder.h | 17 + .../tests/gtest_string_serialization.cpp | 82 + src/DataTypes/TimezoneMixin.h | 9 +- src/DataTypes/Utils.cpp | 2 + src/DataTypes/convertMySQLDataType.cpp | 26 +- src/DataTypes/convertYTsaurusDataType.cpp | 398 ++ src/DataTypes/convertYTsaurusDataType.h | 23 + src/DataTypes/getLeastSupertype.cpp | 115 +- src/DataTypes/registerDataTypeDateTime.cpp | 42 + src/DataTypes/tests/gtest_yt_schema.cpp | 388 ++ src/DataTypes/transformTypesRecursively.cpp | 4 +- src/Databases/DataLake/Common.cpp | 38 +- src/Databases/DataLake/Common.h | 6 + src/Databases/DataLake/DatabaseDataLake.cpp | 300 +- src/Databases/DataLake/DatabaseDataLake.h | 33 +- .../DataLake/DatabaseDataLakeSettings.cpp | 15 +- .../DataLake/DatabaseDataLakeSettings.h | 3 +- src/Databases/DataLake/GlueCatalog.cpp | 308 +- src/Databases/DataLake/GlueCatalog.h | 26 +- src/Databases/DataLake/HiveCatalog.cpp | 31 +- src/Databases/DataLake/HiveCatalog.h | 8 +- src/Databases/DataLake/ICatalog.cpp | 87 +- src/Databases/DataLake/ICatalog.h | 31 + src/Databases/DataLake/RestCatalog.cpp | 205 +- src/Databases/DataLake/RestCatalog.h | 19 + src/Databases/DataLake/UnityCatalog.cpp | 55 +- src/Databases/DatabaseAtomic.cpp | 126 +- src/Databases/DatabaseAtomic.h | 17 +- src/Databases/DatabaseFactory.cpp | 8 +- src/Databases/DatabaseLazy.cpp | 7 +- src/Databases/DatabaseLazy.h | 2 + src/Databases/DatabaseMemory.cpp | 19 +- .../DatabaseMetadataDiskSettings.cpp | 88 + src/Databases/DatabaseMetadataDiskSettings.h | 35 + src/Databases/DatabaseOnDisk.cpp | 57 +- src/Databases/DatabaseOnDisk.h | 13 +- src/Databases/DatabaseOrdinary.cpp | 90 +- src/Databases/DatabaseOrdinary.h | 20 +- ...tabasesOverlay.cpp => DatabaseOverlay.cpp} | 84 +- .../{DatabasesOverlay.h => DatabaseOverlay.h} | 7 +- src/Databases/DatabaseReplicated.cpp | 226 +- src/Databases/DatabaseReplicated.h | 31 +- src/Databases/DatabaseReplicatedSettings.cpp | 36 +- src/Databases/DatabaseReplicatedSettings.h | 14 +- src/Databases/DatabaseReplicatedWorker.cpp | 275 +- src/Databases/DatabaseReplicatedWorker.h | 12 +- src/Databases/DatabasesCommon.cpp | 18 +- src/Databases/DatabasesCommon.h | 5 +- src/Databases/IDatabase.cpp | 6 +- src/Databases/IDatabase.h | 8 +- src/Databases/MySQL/DatabaseMySQL.cpp | 39 +- src/Databases/MySQL/DatabaseMySQL.h | 13 +- .../PostgreSQL/DatabasePostgreSQL.cpp | 49 +- src/Databases/PostgreSQL/DatabasePostgreSQL.h | 12 +- src/Databases/SQLite/DatabaseSQLite.cpp | 3 +- src/Databases/SQLite/DatabaseSQLite.h | 2 + src/Databases/SQLite/SQLiteUtils.cpp | 3 +- src/Databases/SQLite/SQLiteUtils.h | 2 +- .../SQLite/fetchSQLiteTableStructure.cpp | 2 +- src/Databases/TablesDependencyGraph.h | 2 +- .../enableAllExperimentalSettings.cpp | 17 +- src/Dictionaries/CacheDictionary.cpp | 2 +- .../CacheDictionaryUpdateQueue.cpp | 2 - src/Dictionaries/CacheDictionaryUpdateQueue.h | 3 - .../CassandraDictionarySource.cpp | 8 +- src/Dictionaries/CassandraDictionarySource.h | 12 +- src/Dictionaries/CassandraSource.cpp | 6 +- src/Dictionaries/CassandraSource.h | 2 +- .../ClickHouseDictionarySource.cpp | 21 +- src/Dictionaries/ClickHouseDictionarySource.h | 8 +- src/Dictionaries/DictionaryFactory.cpp | 8 +- src/Dictionaries/DictionaryFactory.h | 2 +- src/Dictionaries/DictionaryHelpers.cpp | 2 +- src/Dictionaries/DictionaryHelpers.h | 14 +- .../DictionaryPipelineExecutor.cpp | 2 +- src/Dictionaries/DictionarySource.cpp | 12 +- src/Dictionaries/DictionarySource.h | 6 +- src/Dictionaries/DictionarySourceFactory.cpp | 4 +- src/Dictionaries/DictionarySourceFactory.h | 2 +- src/Dictionaries/DictionarySourceHelpers.cpp | 10 +- src/Dictionaries/DictionarySourceHelpers.h | 4 +- src/Dictionaries/DirectDictionary.cpp | 7 +- .../Embedded/GeoDictionariesLoader.cpp | 6 +- .../Embedded/GeoDictionariesLoader.h | 4 +- .../Embedded/GeodataProviders/Entries.h | 2 +- .../GeodataProviders/HierarchiesProvider.cpp | 4 +- .../GeodataProviders/HierarchiesProvider.h | 2 +- .../HierarchyFormatReader.cpp | 2 +- .../GeodataProviders/HierarchyFormatReader.h | 2 +- .../GeodataProviders/IHierarchiesProvider.h | 2 +- .../GeodataProviders/INamesProvider.h | 2 +- .../GeodataProviders/NamesFormatReader.cpp | 2 +- .../GeodataProviders/NamesFormatReader.h | 2 +- .../GeodataProviders/NamesProvider.cpp | 4 +- .../Embedded/GeodataProviders/NamesProvider.h | 2 +- .../Embedded/RegionsHierarchies.cpp | 2 +- .../Embedded/RegionsHierarchies.h | 4 +- .../Embedded/RegionsHierarchy.cpp | 4 +- src/Dictionaries/Embedded/RegionsHierarchy.h | 2 +- src/Dictionaries/Embedded/RegionsNames.cpp | 4 +- src/Dictionaries/Embedded/RegionsNames.h | 2 +- .../ExecutableDictionarySource.cpp | 7 +- src/Dictionaries/ExecutableDictionarySource.h | 2 +- .../ExecutablePoolDictionarySource.cpp | 7 +- .../ExecutablePoolDictionarySource.h | 2 +- src/Dictionaries/ExternalQueryBuilder.cpp | 2 +- src/Dictionaries/FileDictionarySource.cpp | 10 +- src/Dictionaries/FileDictionarySource.h | 4 +- src/Dictionaries/FlatDictionary.cpp | 7 +- src/Dictionaries/FlatDictionary.h | 8 +- src/Dictionaries/HTTPDictionarySource.cpp | 8 +- src/Dictionaries/HTTPDictionarySource.h | 6 +- src/Dictionaries/HashedArrayDictionary.cpp | 9 +- src/Dictionaries/HashedDictionary.h | 6 +- .../HashedDictionaryCollectionType.h | 2 + .../HierarchyDictionariesUtils.cpp | 2 +- src/Dictionaries/HierarchyDictionariesUtils.h | 2 +- src/Dictionaries/IPAddressDictionary.cpp | 24 +- src/Dictionaries/IPAddressDictionary.h | 8 +- src/Dictionaries/LibraryDictionarySource.cpp | 2 +- src/Dictionaries/LibraryDictionarySource.h | 4 +- src/Dictionaries/MongoDBDictionarySource.cpp | 10 +- src/Dictionaries/MongoDBDictionarySource.h | 8 +- src/Dictionaries/MySQLDictionarySource.cpp | 10 +- src/Dictionaries/MySQLDictionarySource.h | 6 +- src/Dictionaries/NullDictionarySource.cpp | 14 +- src/Dictionaries/NullDictionarySource.h | 6 +- src/Dictionaries/PolygonDictionary.cpp | 4 +- .../PolygonDictionaryImplementations.cpp | 7 +- .../PolygonDictionaryImplementations.h | 4 +- src/Dictionaries/PolygonDictionaryUtils.cpp | 2 +- src/Dictionaries/PolygonDictionaryUtils.h | 2 +- .../PostgreSQLDictionarySource.cpp | 14 +- src/Dictionaries/PostgreSQLDictionarySource.h | 10 +- src/Dictionaries/RangeHashedDictionary.h | 12 +- src/Dictionaries/RedisDictionarySource.cpp | 12 +- src/Dictionaries/RedisDictionarySource.h | 8 +- src/Dictionaries/RedisSource.cpp | 6 +- src/Dictionaries/RedisSource.h | 2 +- src/Dictionaries/RegExpTreeDictionary.cpp | 65 +- src/Dictionaries/SSDCacheDictionaryStorage.h | 2 +- src/Dictionaries/XDBCDictionarySource.cpp | 8 +- src/Dictionaries/XDBCDictionarySource.h | 6 +- .../YAMLRegExpTreeDictionarySource.cpp | 8 +- src/Dictionaries/YTsaurusDictionarySource.cpp | 185 + src/Dictionaries/YTsaurusDictionarySource.h | 67 + src/Dictionaries/readInvalidateQuery.cpp | 5 +- .../registerCacheDictionaries.cpp | 6 +- src/Dictionaries/registerDictionaries.cpp | 6 +- .../registerRangeHashedDictionary.cpp | 1 + src/Disks/DiskBackup.cpp | 4 - src/Disks/DiskBackup.h | 2 - src/Disks/DiskCommitTransactionOptions.h | 116 + src/Disks/DiskEncrypted.cpp | 114 +- src/Disks/DiskEncrypted.h | 33 +- src/Disks/DiskEncryptedTransaction.h | 25 +- src/Disks/DiskFactory.cpp | 2 +- src/Disks/DiskFromAST.cpp | 5 +- src/Disks/DiskLocal.cpp | 14 +- src/Disks/DiskLocal.h | 2 +- src/Disks/DiskLocalCheckThread.cpp | 29 +- src/Disks/DiskSelector.cpp | 4 +- src/Disks/DiskType.cpp | 13 +- src/Disks/DiskType.h | 18 +- src/Disks/FakeDiskTransaction.h | 2 +- src/Disks/IDisk.cpp | 6 +- src/Disks/IDisk.h | 7 +- src/Disks/IDiskTransaction.h | 25 +- .../IO/AsynchronousBoundedReadBuffer.cpp | 8 +- .../IO/CachedOnDiskReadBufferFromFile.cpp | 178 +- src/Disks/IO/CachedOnDiskReadBufferFromFile.h | 2 +- .../IO/CachedOnDiskWriteBufferFromFile.cpp | 54 +- .../IO/CachedOnDiskWriteBufferFromFile.h | 5 +- src/Disks/IO/IOUringReader.cpp | 2 +- .../IO/ReadBufferFromAzureBlobStorage.cpp | 71 +- src/Disks/IO/ReadBufferFromAzureBlobStorage.h | 5 +- src/Disks/IO/ReadBufferFromRemoteFSGather.cpp | 33 +- src/Disks/IO/ReadBufferFromWebServer.cpp | 3 +- src/Disks/IO/ReadBufferFromWebServer.h | 2 +- src/Disks/IO/ThreadPoolReader.cpp | 6 +- src/Disks/IO/ThreadPoolRemoteFSReader.cpp | 12 +- .../IO/WriteBufferFromAzureBlobStorage.cpp | 77 +- .../IO/WriteBufferFromAzureBlobStorage.h | 4 +- .../IO/WriteBufferWithFinalizeCallback.cpp | 2 +- src/Disks/IO/createReadBufferFromFileBase.cpp | 15 +- src/Disks/IO/getThreadPoolReader.cpp | 19 +- src/Disks/IO/getThreadPoolReader.h | 7 +- src/Disks/IStoragePolicy.h | 26 +- src/Disks/IVolume.cpp | 6 +- src/Disks/IVolume.h | 3 + src/Disks/MetadataStorageWithPathWrapper.h | 272 ++ .../AzureBlobStorageCommon.cpp | 221 +- .../AzureBlobStorage/AzureBlobStorageCommon.h | 57 +- .../AzureBlobStorage/AzureObjectStorage.cpp | 39 +- .../AzureBlobStorage/AzureObjectStorage.h | 28 +- .../AzureObjectStorageConnectionInfo.cpp | 149 + .../AzureObjectStorageConnectionInfo.h | 78 + .../Cached/CachedObjectStorage.cpp | 11 +- .../Cached/CachedObjectStorage.h | 13 +- .../Cached/registerDiskCache.cpp | 159 +- .../ObjectStorages/DiskObjectStorage.cpp | 245 +- src/Disks/ObjectStorages/DiskObjectStorage.h | 32 +- .../DiskObjectStorageMetadata.cpp | 16 +- .../DiskObjectStorageMetadata.h | 7 + ...jectStorageRemoteMetadataRestoreHelper.cpp | 579 --- ...ObjectStorageRemoteMetadataRestoreHelper.h | 103 - .../DiskObjectStorageTransaction.cpp | 330 +- .../DiskObjectStorageTransaction.h | 24 +- .../FlatDirectoryStructureKeyGenerator.cpp | 2 +- .../ObjectStorages/HDFS/HDFSObjectStorage.cpp | 8 - .../ObjectStorages/HDFS/HDFSObjectStorage.h | 6 - src/Disks/ObjectStorages/IMetadataStorage.h | 43 +- src/Disks/ObjectStorages/IObjectStorage.cpp | 7 + src/Disks/ObjectStorages/IObjectStorage.h | 85 +- .../IObjectStorageConnectionInfo.cpp | 75 + .../IObjectStorageConnectionInfo.h | 96 + .../Local/LocalObjectStorage.cpp | 9 - .../ObjectStorages/Local/LocalObjectStorage.h | 6 - .../MetadataOperationsHolder.cpp | 7 +- .../ObjectStorages/MetadataOperationsHolder.h | 3 +- .../ObjectStorages/MetadataStorageFactory.cpp | 43 +- .../MetadataStorageFromDisk.cpp | 28 +- .../ObjectStorages/MetadataStorageFromDisk.h | 7 +- ...taStorageFromDiskTransactionOperations.cpp | 44 +- ...dataStorageFromDiskTransactionOperations.h | 58 + .../MetadataStorageFromPlainObjectStorage.cpp | 59 +- .../MetadataStorageFromPlainObjectStorage.h | 17 +- ...torageFromPlainObjectStorageOperations.cpp | 192 +- ...aStorageFromPlainObjectStorageOperations.h | 57 + ...torageFromPlainRewritableObjectStorage.cpp | 9 +- .../ObjectStorageClientsCache.h | 99 + .../ObjectStorages/ObjectStorageFactory.cpp | 55 +- .../RegisterDiskObjectStorage.cpp | 24 +- src/Disks/ObjectStorages/S3/DiskS3Utils.cpp | 25 +- .../ObjectStorages/S3/S3ObjectStorage.cpp | 50 +- src/Disks/ObjectStorages/S3/S3ObjectStorage.h | 48 +- .../S3/S3ObjectStorageConnectionInfo.cpp | 266 ++ .../S3/S3ObjectStorageConnectionInfo.h | 75 + src/Disks/ObjectStorages/S3/diskSettings.cpp | 51 +- src/Disks/ObjectStorages/S3/diskSettings.h | 14 +- ...etadataStorageFromStaticFilesWebServer.cpp | 2 +- .../MetadataStorageFromStaticFilesWebServer.h | 11 +- .../ObjectStorages/Web/WebObjectStorage.cpp | 9 +- .../ObjectStorages/Web/WebObjectStorage.h | 8 +- .../Web/WebObjectStorageConnectionInfo.cpp | 70 + .../Web/WebObjectStorageConnectionInfo.h | 11 + src/Disks/ReadOnlyDiskWrapper.h | 134 + src/Disks/StoragePolicy.cpp | 34 +- src/Disks/StoragePolicy.h | 4 +- src/Disks/VolumeJBOD.cpp | 2 +- src/Disks/createVolume.cpp | 2 +- src/Disks/registerDisks.cpp | 4 +- src/Disks/tests/gtest_disk.cpp | 2 +- src/Disks/tests/gtest_disk_encrypted.cpp | 3 +- src/Disks/tests/gtest_disk_hdfs.cpp | 2 +- src/Disks/tests/gtest_metadata_local_disk.cpp | 1255 ++++++ src/Formats/CapnProtoSerializer.cpp | 4 +- src/Formats/FormatFactory.cpp | 113 +- src/Formats/FormatFactory.h | 43 +- src/Formats/FormatFilterInfo.cpp | 126 + src/Formats/FormatFilterInfo.h | 80 + src/Formats/FormatParserSharedResources.cpp | 70 + src/Formats/FormatParserSharedResources.h | 48 + src/Formats/FormatSchemaInfo.cpp | 323 +- src/Formats/FormatSchemaInfo.h | 31 +- src/Formats/FormatSettings.h | 49 +- src/Formats/JSONExtractTree.cpp | 290 +- src/Formats/JSONExtractTree.h | 5 + src/Formats/MarkInCompressedFile.h | 2 + src/Formats/NativeReader.cpp | 36 +- src/Formats/NativeReader.h | 8 +- src/Formats/NativeWriter.cpp | 34 +- src/Formats/NativeWriter.h | 12 +- src/Formats/NumpyDataTypes.h | 23 +- src/Formats/ProtobufReader.cpp | 4 +- src/Formats/ProtobufSchemas.cpp | 9 +- src/Formats/ProtobufSerializer.cpp | 56 +- src/Formats/ProtobufWriter.cpp | 4 +- src/Formats/ReadSchemaUtils.cpp | 7 + src/Formats/SchemaInferenceUtils.cpp | 83 +- src/Formats/StructureToFormatSchemaUtils.cpp | 2 +- src/Formats/formatBlock.cpp | 2 +- src/Formats/insertNullAsDefaultIfNeeded.cpp | 2 +- src/Formats/registerFormats.cpp | 2 + src/Functions/CMakeLists.txt | 9 + src/Functions/CRC.cpp | 73 +- src/Functions/ColorConversion.h | 51 + src/Functions/CountSubstringsImpl.h | 134 +- src/Functions/DateTimeTransforms.cpp | 5 + src/Functions/DateTimeTransforms.h | 222 +- src/Functions/EmptyImpl.h | 7 +- src/Functions/FunctionBase32Conversion.h | 6 +- src/Functions/FunctionBase58Conversion.h | 3 +- src/Functions/FunctionBaseXXConversion.h | 17 +- src/Functions/FunctionBinaryArithmetic.h | 222 +- src/Functions/FunctionChar.cpp | 52 +- src/Functions/FunctionConstantBase.h | 1 - .../FunctionCustomWeekToDateOrDate32.h | 1 + .../FunctionDateOrDateTimeAddInterval.h | 332 +- .../FunctionDateOrDateTimeToSomething.h | 27 +- src/Functions/FunctionFactory.cpp | 12 + src/Functions/FunctionFile.cpp | 1 - .../FunctionGenerateRandomStructure.cpp | 1 - .../FunctionGenerateRandomStructure.h | 2 +- src/Functions/FunctionSQLJSON.h | 1 - src/Functions/FunctionStartsEndsWith.h | 6 +- src/Functions/FunctionTokens.h | 7 +- src/Functions/FunctionUnaryArithmetic.h | 6 +- src/Functions/FunctionUnixTimestamp64.cpp | 1 + src/Functions/FunctionUnixTimestamp64.h | 2 +- src/Functions/FunctionsAES.cpp | 4 +- src/Functions/FunctionsAES.h | 18 +- .../FunctionsBinaryRepresentation.cpp | 278 +- src/Functions/FunctionsBitToArray.cpp | 94 +- src/Functions/FunctionsBitmap.cpp | 608 ++- .../FunctionsCharsetClassification.cpp | 14 +- src/Functions/FunctionsCodingIP.cpp | 27 +- src/Functions/FunctionsCodingIP.h | 63 +- src/Functions/FunctionsCodingUUID.cpp | 19 +- src/Functions/FunctionsComparison.h | 34 +- src/Functions/FunctionsConversion.h | 989 +++- src/Functions/FunctionsConversion_impl0.cpp | 10 +- src/Functions/FunctionsConversion_impl1.cpp | 2 + src/Functions/FunctionsConversion_impl2.cpp | 2 + src/Functions/FunctionsConversion_impl3.cpp | 4 + src/Functions/FunctionsConversion_reg.cpp | 53 +- src/Functions/FunctionsDecimalArithmetics.h | 3 - .../FunctionsEmbeddedDictionaries.cpp | 4 +- src/Functions/FunctionsExternalDictionaries.h | 2 +- src/Functions/FunctionsHashing.h | 8 +- src/Functions/FunctionsHashingInt.cpp | 55 +- src/Functions/FunctionsHashingMisc.cpp | 635 ++- src/Functions/FunctionsHashingMurmur.cpp | 206 +- src/Functions/FunctionsJSON.cpp | 490 +- .../FunctionsLanguageClassification.cpp | 14 +- src/Functions/FunctionsMergeTreePartInfo.cpp | 310 ++ src/Functions/FunctionsMultiStringPosition.h | 2 +- .../FunctionsNumericIndexedVector.cpp | 372 ++ src/Functions/FunctionsNumericIndexedVector.h | 890 ++++ .../FunctionsNumericIndexedVectorHelper.h | 86 + src/Functions/FunctionsOpDate.cpp | 57 +- .../FunctionsProgrammingClassification.cpp | 8 +- src/Functions/FunctionsRound.cpp | 222 +- src/Functions/FunctionsRound.h | 2 +- src/Functions/FunctionsStringDistance.cpp | 214 +- src/Functions/FunctionsStringHash.cpp | 725 ++- .../FunctionsStringHashFixedString.cpp | 41 +- src/Functions/FunctionsStringSearch.h | 77 +- src/Functions/FunctionsStringSearchToString.h | 2 +- src/Functions/FunctionsStringSimilarity.cpp | 10 +- src/Functions/FunctionsTextClassification.h | 1 - .../FunctionsTonalityClassification.cpp | 2 +- src/Functions/FunctionsVisitParam.h | 9 +- src/Functions/GatherUtils/Algorithms.h | 10 +- src/Functions/GatherUtils/GatherUtils.cpp | 2 +- src/Functions/GatherUtils/GatherUtils.h | 6 +- src/Functions/GatherUtils/IArraySink.h | 2 +- src/Functions/GatherUtils/IArraySource.h | 2 +- src/Functions/GatherUtils/IValueSource.h | 2 +- src/Functions/GatherUtils/Selectors.h | 8 +- src/Functions/GatherUtils/Sinks.h | 4 +- src/Functions/GatherUtils/Sources.h | 26 +- src/Functions/GatherUtils/concat.cpp | 6 +- src/Functions/GatherUtils/createArraySink.cpp | 6 +- .../GatherUtils/createArraySource.cpp | 6 +- .../GatherUtils/createValueSource.cpp | 6 +- src/Functions/GatherUtils/ends_with.cpp | 6 +- src/Functions/GatherUtils/has_all.cpp | 6 +- src/Functions/GatherUtils/has_any.cpp | 6 +- src/Functions/GatherUtils/has_substr.cpp | 6 +- src/Functions/GatherUtils/push.cpp | 6 +- .../GatherUtils/resizeConstantSize.cpp | 6 +- .../GatherUtils/resizeDynamicSize.cpp | 6 +- .../GatherUtils/sliceDynamicOffsetBounded.cpp | 6 +- .../sliceDynamicOffsetUnbounded.cpp | 6 +- .../GatherUtils/sliceEqualElements.h | 2 +- .../sliceFromLeftConstantOffsetBounded.cpp | 6 +- .../sliceFromLeftConstantOffsetUnbounded.cpp | 6 +- .../sliceFromLeftDynamicLength.cpp | 6 +- .../sliceFromRightConstantOffsetBounded.cpp | 6 +- .../sliceFromRightConstantOffsetUnbounded.cpp | 6 +- .../sliceFromRightDynamicLength.cpp | 6 +- .../GatherUtils/sliceHasImplAnyAll.h | 6 +- src/Functions/GatherUtils/starts_with.cpp | 6 +- src/Functions/GeoHash.cpp | 9 +- src/Functions/HasSubsequenceImpl.h | 8 +- src/Functions/HasTokenImpl.h | 41 +- src/Functions/IFunction.cpp | 7 +- src/Functions/IFunction.h | 4 +- src/Functions/IFunctionCustomWeek.h | 1 - src/Functions/IFunctionDateOrDateTime.h | 26 + ...arserJSONPathMemberSquareBracketAccess.cpp | 2 +- src/Functions/LeastGreatestGeneric.h | 1 - src/Functions/LowerUpperUTF8Impl.h | 13 +- src/Functions/MatchImpl.h | 105 +- src/Functions/MultiMatchAllIndicesImpl.h | 4 +- src/Functions/MultiMatchAnyImpl.h | 8 +- src/Functions/MultiSearchAllPositionsImpl.h | 4 +- src/Functions/MultiSearchFirstIndexImpl.h | 4 +- src/Functions/MultiSearchFirstPositionImpl.h | 4 +- src/Functions/MultiSearchImpl.h | 4 +- src/Functions/PolygonUtils.h | 105 +- src/Functions/PositionImpl.h | 30 +- src/Functions/README.md | 49 +- src/Functions/ReplaceRegexpImpl.h | 118 +- src/Functions/ReplaceStringImpl.h | 70 +- src/Functions/StringHelpers.h | 10 +- src/Functions/TimeSeries/CMakeLists.txt | 4 + .../TimeSeries/timeSeriesIdToTags.cpp | 181 + .../TimeSeries/timeSeriesIdToTagsGroup.cpp | 154 + src/Functions/TimeSeries/timeSeriesRange.cpp | 345 ++ .../TimeSeries/timeSeriesStoreTags.cpp | 442 ++ .../TimeSeries/timeSeriesTagsGroupToTags.cpp | 155 + src/Functions/TransformTime64.h | 146 + ...odingULID.cpp => ULIDStringToDateTime.cpp} | 4 +- .../URL/FirstSignificantSubdomainCustomImpl.h | 8 +- src/Functions/URL/cutURLParameter.cpp | 18 +- src/Functions/URL/decodeURLComponent.cpp | 6 +- src/Functions/URL/domain.h | 2 +- src/Functions/URL/extractURLParameter.cpp | 19 +- .../URL/extractURLParameterNames.cpp | 2 +- src/Functions/URL/extractURLParameters.cpp | 25 +- src/Functions/URL/path.h | 3 +- src/Functions/URL/port.cpp | 2 +- src/Functions/UTCTimestamp.cpp | 34 +- src/Functions/UTCTimestampTransform.cpp | 91 +- src/Functions/UUIDv7Utils.cpp | 64 + src/Functions/UUIDv7Utils.h | 76 + .../UniqTheta/FunctionsUniqTheta.cpp | 2 +- ...alUserDefinedExecutableFunctionsLoader.cpp | 3 +- .../UserDefinedExecutableFunction.cpp | 3 +- .../UserDefinedExecutableFunctionFactory.cpp | 128 +- .../UserDefinedSQLFunctionFactory.cpp | 52 +- .../UserDefinedSQLFunctionFactory.h | 10 +- .../UserDefinedSQLFunctionVisitor.cpp | 6 +- .../UserDefinedSQLObjectsDiskStorage.cpp | 4 +- .../UserDefinedSQLObjectsStorageBase.cpp | 2 +- .../UserDefinedSQLObjectsZooKeeperStorage.cpp | 2 +- src/Functions/abs.cpp | 4 +- src/Functions/acos.cpp | 15 +- src/Functions/acosh.cpp | 17 +- src/Functions/addDays.cpp | 42 +- src/Functions/addHours.cpp | 42 +- src/Functions/addMicroseconds.cpp | 40 +- src/Functions/addMilliseconds.cpp | 40 +- src/Functions/addMinutes.cpp | 42 +- src/Functions/addMonths.cpp | 42 +- src/Functions/addNanoseconds.cpp | 40 +- src/Functions/addQuarters.cpp | 42 +- src/Functions/addSeconds.cpp | 42 +- src/Functions/addWeeks.cpp | 42 +- src/Functions/addYears.cpp | 42 +- src/Functions/addressToLine.cpp | 82 +- src/Functions/addressToLine.h | 5 +- src/Functions/addressToLineWithInlines.cpp | 93 +- src/Functions/addressToSymbol.cpp | 85 +- src/Functions/alphaTokens.cpp | 26 +- src/Functions/appendTrailingCharIfAbsent.cpp | 43 +- .../array/FunctionsMapMiscellaneous.cpp | 264 +- src/Functions/array/array.cpp | 63 +- src/Functions/array/arrayAUC.cpp | 75 +- src/Functions/array/arrayAggregation.cpp | 118 +- src/Functions/array/arrayAll.cpp | 20 +- src/Functions/array/arrayAll.h | 2 +- src/Functions/array/arrayCompact.cpp | 13 +- src/Functions/array/arrayConcat.cpp | 13 +- src/Functions/array/arrayCount.cpp | 14 +- src/Functions/array/arrayCumSum.cpp | 20 +- .../array/arrayCumSumNonNegative.cpp | 20 +- src/Functions/array/arrayDifference.cpp | 8 +- src/Functions/array/arrayDistinct.cpp | 4 +- src/Functions/array/arrayDotProduct.cpp | 13 +- src/Functions/array/arrayElement.cpp | 79 +- src/Functions/array/arrayEnumerate.cpp | 4 +- src/Functions/array/arrayEnumerateDense.cpp | 8 +- .../array/arrayEnumerateDenseRanked.cpp | 35 +- src/Functions/array/arrayEnumerateUniq.cpp | 66 +- .../array/arrayEnumerateUniqRanked.cpp | 56 +- src/Functions/array/arrayExists.cpp | 17 +- src/Functions/array/arrayExists.h | 2 +- src/Functions/array/arrayFill.cpp | 52 +- src/Functions/array/arrayFilter.cpp | 26 +- src/Functions/array/arrayFilter.h | 2 +- src/Functions/array/arrayFirstLast.cpp | 102 +- src/Functions/array/arrayFirstLastIndex.cpp | 45 +- src/Functions/array/arrayFlatten.cpp | 22 +- src/Functions/array/arrayFold.cpp | 55 +- src/Functions/array/arrayIndex.h | 37 +- src/Functions/array/arrayIntersect.cpp | 11 +- src/Functions/array/arrayJaccardIndex.cpp | 14 +- src/Functions/array/arrayJoin.cpp | 30 +- src/Functions/array/arrayLevenshtein.cpp | 157 +- src/Functions/array/arrayMap.cpp | 19 +- src/Functions/array/arrayMap.h | 2 +- src/Functions/array/arrayNormalizedGini.cpp | 18 +- src/Functions/array/arrayPopBack.cpp | 8 +- src/Functions/array/arrayPopFront.cpp | 8 +- src/Functions/array/arrayPushBack.cpp | 6 +- src/Functions/array/arrayPushFront.cpp | 4 +- src/Functions/array/arrayRandomSample.cpp | 17 +- src/Functions/array/arrayReduce.cpp | 35 +- src/Functions/array/arrayReduceInRanges.cpp | 28 +- src/Functions/array/arrayResize.cpp | 4 +- src/Functions/array/arrayReverse.cpp | 20 +- src/Functions/array/arrayShiftRotate.cpp | 247 +- src/Functions/array/arrayShingles.cpp | 8 +- src/Functions/array/arrayShuffle.cpp | 24 +- src/Functions/array/arraySlice.cpp | 10 +- src/Functions/array/arraySort.cpp | 42 +- src/Functions/array/arraySort.h | 2 +- src/Functions/array/arraySplit.cpp | 33 +- src/Functions/array/arrayUniq.cpp | 13 +- src/Functions/array/arrayWithConstant.cpp | 16 +- src/Functions/array/arrayZip.cpp | 36 +- src/Functions/array/countEqual.cpp | 6 +- src/Functions/array/emptyArray.cpp | 16 +- src/Functions/array/emptyArrayToSingle.cpp | 32 +- src/Functions/array/has.cpp | 22 +- src/Functions/array/hasAll.cpp | 10 +- src/Functions/array/hasAllAny.h | 5 +- src/Functions/array/hasAny.cpp | 12 +- src/Functions/array/hasSubstr.cpp | 8 +- src/Functions/array/indexOf.cpp | 8 +- src/Functions/array/indexOfAssumeSorted.cpp | 10 +- src/Functions/array/length.cpp | 96 +- src/Functions/array/length.h | 2 +- src/Functions/array/range.cpp | 28 +- src/Functions/arrayStringConcat.cpp | 38 +- src/Functions/ascii.cpp | 36 +- src/Functions/asinh.cpp | 17 +- src/Functions/assumeNotNull.cpp | 40 +- src/Functions/atan.cpp | 15 +- src/Functions/atan2.cpp | 18 +- src/Functions/atanh.cpp | 17 +- src/Functions/bar.cpp | 4 +- src/Functions/base32Decode.cpp | 38 +- src/Functions/base32Encode.cpp | 35 +- src/Functions/base58Decode.cpp | 26 +- src/Functions/base58Encode.cpp | 25 +- src/Functions/base64Decode.cpp | 29 +- src/Functions/base64Encode.cpp | 25 +- src/Functions/base64URLDecode.cpp | 30 +- src/Functions/base64URLEncode.cpp | 31 +- src/Functions/bech32.cpp | 547 +++ src/Functions/bitAnd.cpp | 38 +- src/Functions/bitCount.cpp | 26 +- src/Functions/bitHammingDistance.cpp | 24 +- src/Functions/bitNot.cpp | 25 +- src/Functions/bitOr.cpp | 38 +- src/Functions/bitRotateLeft.cpp | 23 +- src/Functions/bitRotateRight.cpp | 23 +- src/Functions/bitShiftLeft.cpp | 52 +- src/Functions/bitShiftRight.cpp | 52 +- src/Functions/bitSlice.cpp | 47 +- src/Functions/bitTest.cpp | 19 +- src/Functions/bitTestAll.cpp | 30 +- src/Functions/bitTestAny.cpp | 30 +- src/Functions/bitXor.cpp | 38 +- src/Functions/byteSwap.cpp | 6 +- src/Functions/caseWithExpression.cpp | 104 +- src/Functions/catboostEvaluate.cpp | 2 +- src/Functions/cbrt.cpp | 15 +- src/Functions/changeDate.cpp | 84 +- src/Functions/chdbVersion.cpp | 1 + src/Functions/clamp.cpp | 46 +- src/Functions/coalesce.cpp | 44 +- src/Functions/colorOKLCHToSRGB.cpp | 190 + src/Functions/colorSRGBToOKLCH.cpp | 196 + src/Functions/compareSubstrings.cpp | 67 +- src/Functions/concat.cpp | 79 +- src/Functions/concatWithSeparator.cpp | 96 +- src/Functions/convertCharset.cpp | 41 +- src/Functions/cos.cpp | 15 +- src/Functions/cosh.cpp | 17 +- src/Functions/countMatches.cpp | 4 +- src/Functions/countMatches.h | 51 +- src/Functions/countSubstrings.cpp | 6 +- .../countSubstringsCaseInsensitive.cpp | 6 +- .../countSubstringsCaseInsensitiveUTF8.cpp | 6 +- src/Functions/dateDiff.cpp | 147 +- src/Functions/dateName.cpp | 50 +- src/Functions/dateTimeToSnowflakeID.cpp | 12 +- src/Functions/dateTimeToUUIDv7.cpp | 149 + src/Functions/date_trunc.cpp | 72 +- src/Functions/decodeHTMLComponent.cpp | 25 +- src/Functions/decodeXMLComponent.cpp | 25 +- src/Functions/degrees.cpp | 17 +- src/Functions/demangle.cpp | 91 +- src/Functions/divide.cpp | 25 +- src/Functions/divide/divide.cpp | 2 +- src/Functions/divideDecimal.cpp | 6 +- src/Functions/empty.cpp | 79 +- src/Functions/encodeXMLComponent.cpp | 29 +- src/Functions/endsWith.cpp | 26 +- src/Functions/endsWithUTF8.cpp | 33 +- src/Functions/equals.cpp | 24 +- src/Functions/erf.cpp | 21 +- src/Functions/erfc.cpp | 15 +- src/Functions/exp.cpp | 25 +- src/Functions/exp10.cpp | 15 +- src/Functions/exp2.cpp | 15 +- src/Functions/extract.cpp | 9 +- src/Functions/extractAllGroupsHorizontal.cpp | 31 +- src/Functions/extractAllGroupsVertical.cpp | 31 +- src/Functions/extractGroups.cpp | 30 +- src/Functions/extractKeyValuePairs.cpp | 90 +- src/Functions/extractTextFromHTML.cpp | 50 +- src/Functions/financial.cpp | 977 ++++ src/Functions/firstLine.cpp | 35 +- src/Functions/flattenTuple.cpp | 2 +- src/Functions/format.cpp | 43 +- src/Functions/formatDateTime.cpp | 289 +- src/Functions/formatQuery.cpp | 23 +- src/Functions/formatReadable.h | 1 - src/Functions/formatReadableTimeDelta.cpp | 1 - src/Functions/formatRow.cpp | 9 +- src/Functions/formatString.h | 22 +- src/Functions/fromDaysSinceYearZero.cpp | 75 +- src/Functions/fromModifiedJulianDay.cpp | 59 +- src/Functions/fuzzBits.cpp | 85 +- src/Functions/gcd.cpp | 4 +- src/Functions/generateSerialID.cpp | 2 +- src/Functions/generateSnowflakeID.cpp | 17 +- src/Functions/generateSnowflakeID.h | 10 + src/Functions/generateUUIDv7.cpp | 120 +- src/Functions/geoToH3.cpp | 33 +- src/Functions/geoToS2.cpp | 2 +- src/Functions/geohashDecode.cpp | 27 +- src/Functions/geohashEncode.cpp | 40 +- src/Functions/geohashesInBox.cpp | 41 +- src/Functions/getClientHTTPHeader.cpp | 28 +- src/Functions/getMaxTableNameLength.cpp | 4 +- src/Functions/getMergeTreeSetting.cpp | 4 +- src/Functions/getServerSetting.cpp | 4 +- src/Functions/getSetting.cpp | 8 +- src/Functions/greatCircleDistance.cpp | 91 +- src/Functions/greater.cpp | 23 +- src/Functions/greaterOrEquals.cpp | 23 +- src/Functions/greatest.cpp | 45 +- src/Functions/h3EdgeAngle.cpp | 27 +- src/Functions/h3EdgeLengthKm.cpp | 27 +- src/Functions/h3EdgeLengthM.cpp | 27 +- src/Functions/h3GetBaseCell.cpp | 27 +- src/Functions/h3GetResolution.cpp | 27 +- src/Functions/h3HexAreaKm2.cpp | 27 +- src/Functions/h3HexAreaM2.cpp | 27 +- src/Functions/h3IsValid.cpp | 36 +- src/Functions/h3ToGeoBoundary.cpp | 27 +- src/Functions/h3ToString.cpp | 35 +- src/Functions/h3kRing.cpp | 34 +- src/Functions/h3toGeo.cpp | 32 +- .../hasSubsequenceCaseInsensitiveUTF8.cpp | 2 +- src/Functions/hilbertDecode.cpp | 116 +- src/Functions/hilbertEncode.cpp | 131 +- src/Functions/hypot.cpp | 19 +- src/Functions/icebergBucketTransform.cpp | 19 +- src/Functions/icebergTruncate.cpp | 4 +- src/Functions/idna.cpp | 137 +- src/Functions/if.cpp | 48 +- src/Functions/if.h | 2 +- src/Functions/ifNotFinite.cpp | 13 +- src/Functions/ifNull.cpp | 26 +- src/Functions/ilike.cpp | 6 +- src/Functions/initcap.cpp | 66 +- src/Functions/initcapUTF8.cpp | 42 +- src/Functions/initialQueryStartTime.cpp | 2 +- src/Functions/intDiv.cpp | 26 +- src/Functions/intDivOrZero.cpp | 18 +- src/Functions/intExp10.cpp | 15 +- src/Functions/intExp2.cpp | 15 +- src/Functions/isFinite.cpp | 8 +- src/Functions/isIPAddressContainedIn.cpp | 4 +- src/Functions/isInfinite.cpp | 8 +- src/Functions/isNaN.cpp | 10 +- src/Functions/isNotDistinctFrom.cpp | 32 +- src/Functions/isNotDistinctFrom.h | 2 +- src/Functions/isNotNull.cpp | 39 +- src/Functions/isNull.cpp | 161 +- src/Functions/isNull.h | 42 + src/Functions/isNullable.cpp | 36 +- src/Functions/isValidUTF8.cpp | 27 +- src/Functions/isZeroOrNull.cpp | 38 +- src/Functions/jsonMergePatch.cpp | 5 +- src/Functions/jumpConsistentHash.cpp | 27 +- .../keyvaluepair/ArgumentExtractor.cpp | 15 +- .../keyvaluepair/ArgumentExtractor.h | 1 + .../impl/CHKeyValuePairExtractor.h | 40 +- .../keyvaluepair/impl/Configuration.cpp | 35 +- .../keyvaluepair/impl/Configuration.h | 26 +- .../impl/KeyValuePairExtractorBuilder.cpp | 7 + .../impl/KeyValuePairExtractorBuilder.h | 11 +- .../keyvaluepair/impl/NeedleFactory.h | 30 +- .../keyvaluepair/impl/StateHandler.h | 5 + .../keyvaluepair/impl/StateHandlerImpl.h | 75 +- ...test_inline_escaping_key_state_handler.cpp | 6 +- ...st_inline_escaping_value_state_handler.cpp | 2 +- .../gtest_no_escaping_key_state_handler.cpp | 4 +- src/Functions/kostikConsistentHash.cpp | 28 +- src/Functions/lcm.cpp | 15 +- src/Functions/least.cpp | 45 +- src/Functions/left.cpp | 50 +- src/Functions/lemmatize.cpp | 8 +- src/Functions/lengthUTF8.cpp | 30 +- src/Functions/less.cpp | 23 +- src/Functions/lessOrEquals.cpp | 23 +- src/Functions/lgamma.cpp | 15 +- src/Functions/like.cpp | 4 +- src/Functions/like.h | 4 +- src/Functions/locate.cpp | 17 +- src/Functions/log.cpp | 15 +- src/Functions/log10.cpp | 15 +- src/Functions/log1p.cpp | 16 +- src/Functions/log2.cpp | 15 +- src/Functions/logTrace.cpp | 29 +- src/Functions/lowCardinalityKeys.cpp | 5 +- src/Functions/lower.cpp | 25 +- src/Functions/lowerUTF8.cpp | 4 +- src/Functions/makeDate.cpp | 306 +- src/Functions/map.cpp | 4 +- src/Functions/match.cpp | 6 +- src/Functions/mathConstants.cpp | 26 +- src/Functions/max2.cpp | 10 +- src/Functions/min2.cpp | 10 +- src/Functions/minus.cpp | 17 +- src/Functions/modulo.cpp | 21 +- src/Functions/moduloOrNull.cpp | 44 +- src/Functions/moduloOrZero.cpp | 14 +- src/Functions/monthName.cpp | 27 +- src/Functions/mortonDecode.cpp | 120 +- src/Functions/mortonEncode.cpp | 144 +- src/Functions/multiFuzzyMatchAllIndices.cpp | 6 +- src/Functions/multiFuzzyMatchAny.cpp | 6 +- src/Functions/multiFuzzyMatchAnyIndex.cpp | 6 +- src/Functions/multiIf.cpp | 66 +- src/Functions/multiIf.h | 2 +- src/Functions/multiMatchAllIndices.cpp | 6 +- src/Functions/multiMatchAnyIndex.cpp | 6 +- src/Functions/multiSearchAllPositions.cpp | 8 +- ...multiSearchAllPositionsCaseInsensitive.cpp | 8 +- ...iSearchAllPositionsCaseInsensitiveUTF8.cpp | 8 +- src/Functions/multiSearchAllPositionsUTF8.cpp | 8 +- src/Functions/multiSearchAny.cpp | 8 +- .../multiSearchAnyCaseInsensitive.cpp | 8 +- .../multiSearchAnyCaseInsensitiveUTF8.cpp | 8 +- src/Functions/multiSearchAnyUTF8.cpp | 8 +- src/Functions/multiSearchFirstIndex.cpp | 8 +- .../multiSearchFirstIndexCaseInsensitive.cpp | 8 +- ...ltiSearchFirstIndexCaseInsensitiveUTF8.cpp | 8 +- src/Functions/multiSearchFirstIndexUTF8.cpp | 8 +- src/Functions/multiSearchFirstPosition.cpp | 8 +- ...ultiSearchFirstPositionCaseInsensitive.cpp | 8 +- ...SearchFirstPositionCaseInsensitiveUTF8.cpp | 8 +- .../multiSearchFirstPositionUTF8.cpp | 8 +- src/Functions/multiply.cpp | 10 +- src/Functions/multiplyDecimal.cpp | 26 +- src/Functions/negate.cpp | 7 +- src/Functions/nested.cpp | 158 +- src/Functions/ngrams.cpp | 28 +- src/Functions/normalizeQuery.cpp | 2 +- src/Functions/normalizeString.cpp | 208 +- src/Functions/normalizedQueryHash.cpp | 35 +- src/Functions/notEquals.cpp | 24 +- src/Functions/notILike.cpp | 6 +- src/Functions/notLike.cpp | 6 +- src/Functions/now.cpp | 34 +- src/Functions/now64.cpp | 63 +- src/Functions/nowInBlock.cpp | 100 +- src/Functions/nowInBlock64.cpp | 119 + src/Functions/nowSubsecond.cpp | 37 + src/Functions/nowSubsecond.h | 10 + src/Functions/nullIf.cpp | 26 +- src/Functions/overlay.cpp | 121 +- src/Functions/padString.cpp | 89 +- src/Functions/parseDateTime.cpp | 15 +- src/Functions/parseReadableSize.cpp | 10 +- src/Functions/parseTimeDelta.cpp | 14 +- src/Functions/patchPartitionID.cpp | 109 + src/Functions/plus.cpp | 2 +- src/Functions/pointInEllipses.cpp | 30 +- src/Functions/pointInPolygon.cpp | 400 +- src/Functions/polygonsIntersect.cpp | 167 + src/Functions/position.cpp | 6 +- src/Functions/positionCaseInsensitive.cpp | 6 +- src/Functions/positionCaseInsensitiveUTF8.cpp | 6 +- src/Functions/positionUTF8.cpp | 6 +- src/Functions/pow.cpp | 16 +- src/Functions/printf.cpp | 40 +- src/Functions/punycode.cpp | 132 +- src/Functions/radians.cpp | 17 +- src/Functions/rand.cpp | 20 +- src/Functions/rand64.cpp | 20 +- src/Functions/randCanonical.cpp | 23 +- src/Functions/randConstant.cpp | 32 +- src/Functions/randDistribution.cpp | 470 +- src/Functions/randomFixedString.cpp | 22 +- src/Functions/randomPrintableASCII.cpp | 31 +- src/Functions/randomString.cpp | 30 +- src/Functions/randomStringUTF8.cpp | 30 +- src/Functions/readWkb.cpp | 243 + src/Functions/readWkt.cpp | 8 +- src/Functions/regexpExtract.cpp | 11 +- src/Functions/regexpQuoteMeta.cpp | 35 +- src/Functions/reinterpretAs.cpp | 67 +- src/Functions/repeat.cpp | 42 +- src/Functions/replaceAll.cpp | 33 +- src/Functions/replaceOne.cpp | 33 +- src/Functions/replaceRegexpAll.cpp | 45 +- src/Functions/replaceRegexpOne.cpp | 59 +- src/Functions/reverse.cpp | 69 +- src/Functions/reverse.h | 8 +- src/Functions/reverseUTF8.cpp | 36 +- src/Functions/right.cpp | 46 +- src/Functions/roundAge.cpp | 38 +- src/Functions/roundDuration.cpp | 38 +- src/Functions/roundToExp2.cpp | 30 +- src/Functions/s2CapContains.cpp | 2 +- src/Functions/s2CapUnion.cpp | 2 +- src/Functions/s2CellsIntersect.cpp | 2 +- src/Functions/s2GetNeighbors.cpp | 2 +- src/Functions/s2RectAdd.cpp | 2 +- src/Functions/s2RectContains.cpp | 2 +- src/Functions/s2RectIntersection.cpp | 2 +- src/Functions/s2RectUnion.cpp | 2 +- src/Functions/s2ToGeo.cpp | 2 +- src/Functions/searchAnyAll.cpp | 248 + src/Functions/searchAnyAll.h | 54 + src/Functions/serverConstants.cpp | 71 +- src/Functions/sign.cpp | 19 +- src/Functions/sin.cpp | 4 +- src/Functions/sinh.cpp | 17 +- src/Functions/snowflakeIDToDateTime.cpp | 10 +- src/Functions/soundex.cpp | 35 +- src/Functions/space.cpp | 36 +- src/Functions/sparseGrams.cpp | 121 +- src/Functions/splitByChar.cpp | 37 +- src/Functions/splitByNonAlpha.cpp | 28 +- src/Functions/splitByRegexp.cpp | 53 +- src/Functions/splitByString.cpp | 46 +- src/Functions/splitByWhitespace.cpp | 27 +- src/Functions/sqid.cpp | 6 +- src/Functions/sqrt.cpp | 15 +- src/Functions/startsWith.cpp | 26 +- src/Functions/startsWithUTF8.cpp | 33 +- src/Functions/stem.cpp | 15 +- src/Functions/stringBytes.h | 2 +- src/Functions/stringBytesEntropy.cpp | 35 +- src/Functions/stringBytesUniq.cpp | 35 +- src/Functions/stringToH3.cpp | 2 +- src/Functions/structureToFormatSchema.cpp | 50 +- src/Functions/substring.cpp | 63 +- src/Functions/substringIndex.cpp | 54 +- src/Functions/subtractDays.cpp | 43 +- src/Functions/subtractHours.cpp | 43 +- src/Functions/subtractMicroseconds.cpp | 41 +- src/Functions/subtractMilliseconds.cpp | 41 +- src/Functions/subtractMinutes.cpp | 43 +- src/Functions/subtractMonths.cpp | 43 +- src/Functions/subtractNanoseconds.cpp | 41 +- src/Functions/subtractQuarters.cpp | 43 +- src/Functions/subtractSeconds.cpp | 43 +- src/Functions/subtractWeeks.cpp | 43 +- src/Functions/subtractYears.cpp | 43 +- src/Functions/svg.cpp | 2 +- src/Functions/synonyms.cpp | 2 +- src/Functions/tan.cpp | 15 +- src/Functions/tanh.cpp | 15 +- .../tests/gtest_conversion_monotonic.cpp | 49 + src/Functions/tests/gtest_hilbert_curve.cpp | 6 +- src/Functions/tgamma.cpp | 15 +- src/Functions/tid.cpp | 25 +- src/Functions/timeSlot.cpp | 32 +- src/Functions/timeSlots.cpp | 40 +- src/Functions/timestamp.cpp | 57 +- src/Functions/timezoneOf.cpp | 52 +- src/Functions/timezoneOffset.cpp | 28 +- src/Functions/toCustomWeek.cpp | 171 +- src/Functions/toDayOfMonth.cpp | 25 +- src/Functions/toDayOfWeek.cpp | 40 +- src/Functions/toDayOfYear.cpp | 25 +- src/Functions/toDaysSinceYearZero.cpp | 36 +- src/Functions/toDecimalString.cpp | 4 - src/Functions/toFixedString.h | 5 +- src/Functions/toHour.cpp | 25 +- src/Functions/toISOYear.cpp | 28 +- src/Functions/toJSONString.cpp | 1 - src/Functions/toLastDayOfMonth.cpp | 30 +- src/Functions/toMillisecond.cpp | 37 +- src/Functions/toMinute.cpp | 26 +- src/Functions/toModifiedJulianDay.cpp | 64 +- src/Functions/toMonday.cpp | 33 +- src/Functions/toMonth.cpp | 26 +- src/Functions/toMonthNumSinceEpoch.cpp | 4 +- src/Functions/toNullable.cpp | 25 +- src/Functions/toQuarter.cpp | 25 +- src/Functions/toRelativeDayNum.cpp | 30 +- src/Functions/toRelativeHourNum.cpp | 28 +- src/Functions/toRelativeMinuteNum.cpp | 30 +- src/Functions/toRelativeMonthNum.cpp | 30 +- src/Functions/toRelativeQuarterNum.cpp | 30 +- src/Functions/toRelativeSecondNum.cpp | 30 +- src/Functions/toRelativeWeekNum.cpp | 30 +- src/Functions/toRelativeYearNum.cpp | 28 +- src/Functions/toSecond.cpp | 25 +- src/Functions/toStartOfDay.cpp | 30 +- src/Functions/toStartOfFifteenMinutes.cpp | 37 +- src/Functions/toStartOfFiveMinutes.cpp | 35 +- src/Functions/toStartOfHour.cpp | 31 +- src/Functions/toStartOfISOYear.cpp | 30 +- src/Functions/toStartOfInterval.cpp | 72 +- src/Functions/toStartOfMinute.cpp | 34 +- src/Functions/toStartOfMonth.cpp | 30 +- src/Functions/toStartOfQuarter.cpp | 30 +- src/Functions/toStartOfSecond.cpp | 36 +- src/Functions/toStartOfSubsecond.cpp | 105 +- src/Functions/toStartOfTenMinutes.cpp | 35 +- src/Functions/toStartOfYear.cpp | 27 +- ...ingCutToZero.cpp => toStringCutToZero.cpp} | 13 +- src/Functions/toTime.cpp | 36 +- src/Functions/toTimezone.cpp | 45 +- src/Functions/toValidUTF8.cpp | 29 +- src/Functions/toYYYYMM.cpp | 30 +- src/Functions/toYYYYMMDD.cpp | 27 +- src/Functions/toYYYYMMDDhhmmss.cpp | 28 +- src/Functions/toYear.cpp | 25 +- src/Functions/toYearNumSinceEpoch.cpp | 4 +- src/Functions/today.cpp | 23 +- src/Functions/tokens.cpp | 102 +- src/Functions/transform.cpp | 6 +- src/Functions/translate.cpp | 97 +- src/Functions/trim.cpp | 164 +- src/Functions/tryBase32Decode.cpp | 39 +- src/Functions/tryBase58Decode.cpp | 25 +- src/Functions/tryBase64Decode.cpp | 27 +- src/Functions/tryBase64URLDecode.cpp | 31 +- src/Functions/tuple.cpp | 2 +- src/Functions/tuple.h | 2 +- src/Functions/upper.cpp | 25 +- src/Functions/upperUTF8.cpp | 34 +- src/Functions/vectorFunctions.cpp | 634 ++- src/Functions/visitParamExtractBool.cpp | 58 +- src/Functions/visitParamExtractFloat.cpp | 50 +- src/Functions/visitParamExtractInt.cpp | 50 +- src/Functions/visitParamExtractRaw.cpp | 50 +- src/Functions/visitParamExtractString.cpp | 53 +- src/Functions/visitParamExtractUInt.cpp | 50 +- src/Functions/visitParamHas.cpp | 46 +- src/Functions/wkb.cpp | 107 + src/Functions/wkt.cpp | 2 +- src/Functions/yesterday.cpp | 28 +- src/IO/Archives/ArchiveUtils.cpp | 32 + src/IO/Archives/ArchiveUtils.h | 3 + src/IO/AsyncReadCounters.cpp | 7 +- src/IO/AsynchronousReadBufferFromFile.cpp | 99 - src/IO/AsynchronousReadBufferFromFile.h | 53 +- ...ynchronousReadBufferFromFileDescriptor.cpp | 56 +- ...AsynchronousReadBufferFromFileDescriptor.h | 23 +- src/IO/AsynchronousReader.h | 1 + src/IO/AzureBlobStorage/PocoHTTPClient.cpp | 550 +++ src/IO/AzureBlobStorage/PocoHTTPClient.h | 134 + .../copyAzureBlobStorageFile.cpp | 14 +- .../copyAzureBlobStorageFile.h | 1 + src/IO/BoundedReadBuffer.cpp | 2 +- src/IO/BrotliReadBuffer.cpp | 2 +- src/IO/BufferBase.h | 1 + src/IO/BufferWithOwnMemory.h | 33 +- src/IO/CachedInMemoryReadBufferFromFile.cpp | 35 +- src/IO/CachedInMemoryReadBufferFromFile.h | 5 +- src/IO/ConnectionTimeouts.cpp | 34 +- src/IO/ConnectionTimeouts.h | 1 - src/IO/DistributedCacheSettings.h | 14 +- src/IO/Expect404ResponseScope.cpp | 29 + src/IO/Expect404ResponseScope.h | 23 + src/IO/HadoopSnappyReadBuffer.cpp | 2 +- src/IO/LimitReadBuffer.h | 1 - src/IO/MMappedFileCache.cpp | 4 +- src/IO/MMappedFileCache.h | 12 +- src/IO/NullWriteBuffer.cpp | 21 +- src/IO/NullWriteBuffer.h | 15 + src/IO/Progress.cpp | 10 +- src/IO/Progress.h | 10 +- ...tobufZeroCopyOutputStreamFromWriteBuffer.h | 3 +- src/IO/ReadBuffer.cpp | 53 +- src/IO/ReadBuffer.h | 32 +- src/IO/ReadBufferFromFileDescriptor.cpp | 4 +- src/IO/ReadBufferFromFileDescriptor.h | 2 +- src/IO/ReadBufferFromMemory.cpp | 2 +- src/IO/ReadBufferFromMemory.h | 4 +- src/IO/ReadBufferFromS3.cpp | 33 +- src/IO/ReadBufferFromS3.h | 1 - src/IO/ReadHelpers.cpp | 125 +- src/IO/ReadHelpers.h | 598 ++- src/IO/ReadSettings.cpp | 19 + src/IO/ReadSettings.h | 25 +- src/IO/ReadWriteBufferFromHTTP.cpp | 9 +- src/IO/S3/AWSLogger.cpp | 49 + src/IO/S3/Client.cpp | 217 +- src/IO/S3/Client.h | 32 +- src/IO/S3/Credentials.cpp | 229 +- src/IO/S3/Credentials.h | 99 +- src/IO/S3/PocoHTTPClient.cpp | 292 +- src/IO/S3/PocoHTTPClient.h | 71 +- src/IO/S3/PocoHTTPClientFactory.cpp | 13 +- src/IO/S3/S3Capabilities.cpp | 35 + src/IO/S3/S3Capabilities.h | 6 +- src/IO/S3/URI.cpp | 32 - src/IO/S3/URI.h | 3 - src/IO/S3/deleteFileFromS3.cpp | 4 +- src/IO/S3/getObjectInfo.cpp | 8 + src/IO/S3/tests/TestPocoHTTPServer.h | 115 + src/IO/S3/tests/gtest_aws_s3_client.cpp | 198 +- src/IO/S3AuthSettings.cpp | 78 +- src/IO/S3AuthSettings.h | 3 + src/IO/S3Defines.h | 2 + src/IO/S3RequestSettings.cpp | 79 +- src/IO/S3RequestSettings.h | 5 +- src/IO/S3Settings.cpp | 46 + src/IO/S3Settings.h | 21 +- src/IO/SharedThreadPools.cpp | 30 +- src/IO/SharedThreadPools.h | 9 + src/IO/SnappyReadBuffer.cpp | 2 +- src/IO/SnappyWriteBuffer.cpp | 2 +- src/IO/UncompressedCache.cpp | 12 +- src/IO/UncompressedCache.h | 10 +- src/IO/VarInt.h | 20 +- src/IO/WithFileSize.cpp | 3 +- src/IO/WriteBuffer.cpp | 2 +- src/IO/WriteBuffer.h | 1 - src/IO/WriteBufferFromFile.h | 2 +- src/IO/WriteBufferFromFileDecorator.cpp | 2 +- src/IO/WriteBufferFromFileDescriptor.cpp | 4 +- src/IO/WriteBufferFromFileDescriptor.h | 2 +- src/IO/WriteBufferFromHTTP.cpp | 18 +- src/IO/WriteBufferFromHTTP.h | 8 +- src/IO/WriteBufferFromS3.cpp | 18 +- src/IO/WriteBufferValidUTF8.cpp | 11 +- src/IO/WriteHelpers.cpp | 6 +- src/IO/WriteHelpers.h | 173 +- src/IO/WriteSettings.h | 2 +- src/IO/ZstdDeflatingAppendableWriteBuffer.cpp | 2 +- src/IO/copyData.cpp | 4 +- src/IO/copyData.h | 5 +- src/IO/examples/read_buffer_from_hdfs.cpp | 5 +- src/IO/parseDateTimeBestEffort.cpp | 337 ++ src/IO/parseDateTimeBestEffort.h | 8 + src/IO/readIntText.h | 378 ++ .../tests/gtest_archive_reader_and_writer.cpp | 5 +- src/IO/tests/gtest_read_int_text.cpp | 51 + src/IO/tests/gtest_readbuffer_s3.cpp | 16 +- src/IO/tests/gtest_writebuffer_s3.cpp | 6 +- .../Access/InterpreterCheckGrantQuery.cpp | 2 +- .../Access/InterpreterCreateUserQuery.cpp | 13 +- .../InterpreterDropAccessEntityQuery.cpp | 19 + .../InterpreterMoveAccessEntityQuery.cpp | 1 + .../Access/InterpreterShowAccessQuery.cpp | 2 +- ...InterpreterShowCreateAccessEntityQuery.cpp | 5 +- .../Access/InterpreterShowGrantsQuery.cpp | 2 +- src/Interpreters/ActionLocksManager.cpp | 2 +- src/Interpreters/ActionsDAG.cpp | 114 +- src/Interpreters/ActionsDAG.h | 16 +- src/Interpreters/ActionsVisitor.cpp | 13 +- src/Interpreters/AddDefaultDatabaseVisitor.h | 37 +- src/Interpreters/AggregationMethod.cpp | 2 + src/Interpreters/AggregationMethod.h | 4 +- src/Interpreters/Aggregator.cpp | 507 ++- src/Interpreters/Aggregator.h | 7 + src/Interpreters/AsynchronousInsertLog.cpp | 1 - src/Interpreters/AsynchronousInsertLog.h | 6 +- src/Interpreters/AsynchronousInsertQueue.cpp | 96 +- src/Interpreters/AsynchronousInsertQueue.h | 33 +- .../AsynchronousInsertQueueDataKind.h | 14 + src/Interpreters/AsynchronousMetricLog.h | 4 - src/Interpreters/BloomFilter.cpp | 30 +- src/Interpreters/BloomFilter.h | 7 + src/Interpreters/BloomFilterHash.h | 10 +- src/Interpreters/Cache/EvictionCandidates.cpp | 4 +- src/Interpreters/Cache/FileCache.cpp | 562 ++- src/Interpreters/Cache/FileCache.h | 23 + src/Interpreters/Cache/FileCacheFactory.cpp | 47 +- src/Interpreters/Cache/FileCacheFactory.h | 6 +- src/Interpreters/Cache/FileCacheKey.cpp | 2 +- src/Interpreters/Cache/FileCacheSettings.cpp | 60 +- src/Interpreters/Cache/FileCacheSettings.h | 10 +- src/Interpreters/Cache/FileCache_fwd.h | 8 + src/Interpreters/Cache/FileSegment.cpp | 43 +- src/Interpreters/Cache/FileSegment.h | 5 +- src/Interpreters/Cache/FileSegmentInfo.h | 2 + src/Interpreters/Cache/IFileCachePriority.h | 11 + .../Cache/LRUFileCachePriority.cpp | 6 +- src/Interpreters/Cache/LRUFileCachePriority.h | 17 +- src/Interpreters/Cache/Metadata.cpp | 75 +- src/Interpreters/Cache/Metadata.h | 22 +- .../Cache/QueryConditionCache.cpp | 100 +- src/Interpreters/Cache/QueryConditionCache.h | 44 +- src/Interpreters/Cache/QueryResultCache.cpp | 25 +- src/Interpreters/Cache/QueryResultCache.h | 11 +- .../Cache/SLRUFileCachePriority.cpp | 83 +- .../Cache/SLRUFileCachePriority.h | 23 +- src/Interpreters/CancellationChecker.cpp | 145 +- src/Interpreters/CancellationChecker.h | 55 +- src/Interpreters/ClientInfo.cpp | 2 + src/Interpreters/ClientInfo.h | 1 + src/Interpreters/Cluster.cpp | 3 + src/Interpreters/ClusterFunctionReadTask.cpp | 92 + src/Interpreters/ClusterFunctionReadTask.h | 41 + .../ClusterProxy/SelectStreamFactory.cpp | 12 +- .../ClusterProxy/SelectStreamFactory.h | 9 +- .../ClusterProxy/executeQuery.cpp | 88 +- src/Interpreters/ClusterProxy/executeQuery.h | 6 +- src/Interpreters/ConcurrentHashJoin.cpp | 104 +- src/Interpreters/ConcurrentHashJoin.h | 13 +- src/Interpreters/Context.cpp | 665 ++- src/Interpreters/Context.h | 120 +- .../ContextTimeSeriesTagsCollector.cpp | 208 + .../ContextTimeSeriesTagsCollector.h | 102 + .../DDLOnClusterQueryStatusSource.cpp | 3 +- src/Interpreters/DDLTask.cpp | 2 + src/Interpreters/DDLWorker.cpp | 78 +- src/Interpreters/DDLWorker.h | 7 +- src/Interpreters/DNSCacheUpdater.cpp | 2 +- src/Interpreters/DatabaseCatalog.cpp | 243 +- src/Interpreters/DatabaseCatalog.h | 8 +- src/Interpreters/DeadLetterQueue.cpp | 137 + src/Interpreters/DeadLetterQueue.h | 60 + src/Interpreters/DirectJoin.cpp | 8 +- src/Interpreters/DirectJoin.h | 2 +- .../DistributedQueryStatusSource.cpp | 11 +- .../DistributedQueryStatusSource.h | 2 +- .../ExecuteScalarSubqueriesVisitor.cpp | 6 +- src/Interpreters/ExpressionActions.cpp | 48 +- src/Interpreters/ExpressionActions.h | 2 +- .../ExpressionActionsSettings.cpp | 13 - src/Interpreters/ExpressionActionsSettings.h | 15 +- src/Interpreters/ExpressionAnalyzer.cpp | 24 +- src/Interpreters/ExpressionJIT.cpp | 2 +- src/Interpreters/ExternalLoader.cpp | 41 +- src/Interpreters/ExternalLoader.h | 1 + ...oaderDictionaryStorageConfigRepository.cpp | 2 +- src/Interpreters/FilesystemCacheLog.cpp | 2 + src/Interpreters/FilesystemCacheLog.h | 1 + .../FilesystemReadPrefetchesLog.cpp | 6 +- src/Interpreters/FullSortingMergeJoin.h | 17 +- src/Interpreters/GetAggregatesVisitor.h | 8 + src/Interpreters/GinFilter.cpp | 172 +- src/Interpreters/GinFilter.h | 137 +- src/Interpreters/GlobalSubqueriesVisitor.cpp | 266 ++ src/Interpreters/GlobalSubqueriesVisitor.h | 269 +- src/Interpreters/GraceHashJoin.cpp | 90 +- src/Interpreters/GraceHashJoin.h | 8 +- src/Interpreters/HashJoin/AddedColumns.cpp | 111 +- src/Interpreters/HashJoin/AddedColumns.h | 171 +- src/Interpreters/HashJoin/FullHashJoin.cpp | 11 - src/Interpreters/HashJoin/FullHashJoinAll.cpp | 6 + .../HashJoin/FullHashJoinAnti.cpp | 6 + src/Interpreters/HashJoin/FullHashJoinAny.cpp | 7 + .../HashJoin/FullHashJoinAsof.cpp | 6 + .../HashJoin/FullHashJoinSemi.cpp | 6 + src/Interpreters/HashJoin/HashJoin.cpp | 587 ++- src/Interpreters/HashJoin/HashJoin.h | 65 +- src/Interpreters/HashJoin/HashJoinMethods.h | 114 +- .../HashJoin/HashJoinMethodsImpl.h | 837 ++-- src/Interpreters/HashJoin/HashJoinResult.cpp | 376 ++ src/Interpreters/HashJoin/HashJoinResult.h | 55 + src/Interpreters/HashJoin/InnerHashJoin.cpp | 13 - .../HashJoin/InnerHashJoinAll.cpp | 7 + .../HashJoin/InnerHashJoinAnti.cpp | 7 + .../HashJoin/InnerHashJoinAny.cpp | 7 + .../HashJoin/InnerHashJoinAsof.cpp | 7 + .../HashJoin/InnerHashJoinRightAny.cpp | 7 + .../HashJoin/InnerHashJoinSemi.cpp | 7 + src/Interpreters/HashJoin/JoinUsedFlags.h | 74 +- src/Interpreters/HashJoin/KnownRowsHolder.h | 28 +- src/Interpreters/HashJoin/LeftHashJoin.cpp | 14 - src/Interpreters/HashJoin/LeftHashJoinAll.cpp | 6 + .../HashJoin/LeftHashJoinAnti.cpp | 7 + src/Interpreters/HashJoin/LeftHashJoinAny.cpp | 7 + .../HashJoin/LeftHashJoinAsof.cpp | 6 + .../HashJoin/LeftHashJoinRightAny.cpp | 7 + .../HashJoin/LeftHashJoinSemi.cpp | 7 + src/Interpreters/HashJoin/RightHashJoin.cpp | 11 - .../HashJoin/RightHashJoinAll.cpp | 6 + .../HashJoin/RightHashJoinAnti.cpp | 6 + .../HashJoin/RightHashJoinAny.cpp | 7 + .../HashJoin/RightHashJoinAsof.cpp | 6 + .../HashJoin/RightHashJoinSemi.cpp | 6 + src/Interpreters/HashJoin/ScatteredBlock.h | 41 +- src/Interpreters/HashTablesStatistics.cpp | 2 +- .../IInterpreterUnionOrSelectQuery.cpp | 9 +- .../IInterpreterUnionOrSelectQuery.h | 15 +- src/Interpreters/IJoin.cpp | 25 + src/Interpreters/IJoin.h | 45 +- src/Interpreters/ITokenExtractor.cpp | 110 +- src/Interpreters/ITokenExtractor.h | 86 +- src/Interpreters/IcebergMetadataLog.cpp | 109 + src/Interpreters/IcebergMetadataLog.h | 39 + .../InsertDependenciesBuilder.cpp | 1586 +++++++ src/Interpreters/InsertDependenciesBuilder.h | 159 + src/Interpreters/InternalTextLogsQueue.cpp | 2 +- src/Interpreters/InterpreterAlterQuery.cpp | 78 +- src/Interpreters/InterpreterAlterQuery.h | 4 +- src/Interpreters/InterpreterBackupQuery.cpp | 2 +- src/Interpreters/InterpreterCheckQuery.cpp | 16 +- src/Interpreters/InterpreterCreateQuery.cpp | 102 +- src/Interpreters/InterpreterCreateQuery.h | 2 +- src/Interpreters/InterpreterDeleteQuery.cpp | 111 +- .../InterpreterDescribeCacheQuery.cpp | 2 +- src/Interpreters/InterpreterDescribeQuery.cpp | 45 +- src/Interpreters/InterpreterDropQuery.cpp | 6 +- src/Interpreters/InterpreterExistsQuery.cpp | 4 +- src/Interpreters/InterpreterExplainQuery.cpp | 158 +- .../InterpreterExternalDDLQuery.cpp | 80 - .../InterpreterExternalDDLQuery.h | 21 - src/Interpreters/InterpreterFactory.cpp | 13 +- src/Interpreters/InterpreterInsertQuery.cpp | 621 ++- src/Interpreters/InterpreterInsertQuery.h | 56 +- .../InterpreterKillQueryQuery.cpp | 34 +- src/Interpreters/InterpreterRenameQuery.cpp | 2 + .../InterpreterSelectIntersectExceptQuery.cpp | 30 +- .../InterpreterSelectIntersectExceptQuery.h | 2 +- src/Interpreters/InterpreterSelectQuery.cpp | 63 +- src/Interpreters/InterpreterSelectQuery.h | 3 +- .../InterpreterSelectQueryAnalyzer.cpp | 10 +- .../InterpreterSelectQueryAnalyzer.h | 11 +- .../InterpreterSelectWithUnionQuery.cpp | 42 +- .../InterpreterSelectWithUnionQuery.h | 8 +- .../InterpreterShowCreateQuery.cpp | 4 +- .../InterpreterShowTablesQuery.cpp | 2 +- src/Interpreters/InterpreterSystemQuery.cpp | 247 +- src/Interpreters/InterpreterSystemQuery.h | 2 + src/Interpreters/InterpreterUpdateQuery.cpp | 123 + src/Interpreters/InterpreterUpdateQuery.h | 21 + src/Interpreters/JIT/CHJIT.cpp | 2 +- src/Interpreters/JIT/CompileDAG.cpp | 2 +- .../JIT/CompiledExpressionCache.cpp | 16 +- src/Interpreters/JIT/compileFunction.cpp | 2 +- src/Interpreters/JoinInfo.cpp | 11 + src/Interpreters/JoinInfo.h | 10 +- src/Interpreters/JoinSwitcher.cpp | 8 +- src/Interpreters/JoinSwitcher.h | 6 +- src/Interpreters/JoinUtils.cpp | 4 +- src/Interpreters/JoinUtils.h | 36 +- src/Interpreters/JoinedTables.h | 2 +- src/Interpreters/LatencyLog.cpp | 73 - src/Interpreters/LatencyLog.h | 34 - src/Interpreters/Lemmatizers.h | 2 +- src/Interpreters/MergeJoin.cpp | 75 +- src/Interpreters/MergeJoin.h | 33 +- src/Interpreters/MergeTreeTransaction.cpp | 2 + src/Interpreters/MutationsInterpreter.cpp | 297 +- src/Interpreters/MutationsInterpreter.h | 26 +- .../MySQL/InterpretersMySQLDDLQuery.cpp | 777 ---- .../MySQL/InterpretersMySQLDDLQuery.h | 97 - .../MySQL/tests/gtest_create_rewritten.cpp | 256 -- src/Interpreters/ObjectStorageQueueLog.cpp | 9 + src/Interpreters/ObjectStorageQueueLog.h | 4 + src/Interpreters/PasteJoin.h | 12 +- src/Interpreters/PeriodicLog.cpp | 1 - src/Interpreters/PeriodicLog.h | 1 - src/Interpreters/PredicateRewriteVisitor.cpp | 5 +- src/Interpreters/PreparedSets.cpp | 9 +- src/Interpreters/PreparedSets.h | 4 + src/Interpreters/ProcessList.cpp | 27 +- src/Interpreters/ProcessList.h | 12 +- src/Interpreters/ProfileEventsExt.cpp | 6 +- src/Interpreters/QueryLog.cpp | 134 +- src/Interpreters/QueryLogElement.h | 2 + src/Interpreters/QueryMetricLog.cpp | 52 +- src/Interpreters/QueryMetricLog.h | 20 +- src/Interpreters/QueryNormalizer.cpp | 18 +- src/Interpreters/QueryNormalizer.h | 19 +- src/Interpreters/QuerySlot.cpp | 63 + src/Interpreters/QuerySlot.h | 51 + src/Interpreters/QueryThreadLog.cpp | 2 +- src/Interpreters/QueryViewsLog.cpp | 2 +- src/Interpreters/QueryViewsLog.h | 16 - .../ReplaceQueryParameterVisitor.cpp | 7 + .../ReplicatedDatabaseQueryStatusSource.cpp | 3 +- .../RewriteCountDistinctVisitor.cpp | 14 +- src/Interpreters/RewriteUniqToCountVisitor.h | 1 - src/Interpreters/RowRefs.cpp | 4 +- src/Interpreters/RowRefs.h | 12 +- .../SelectIntersectExceptQueryVisitor.cpp | 8 +- .../ServerAsynchronousMetrics.cpp | 107 +- src/Interpreters/Session.cpp | 13 +- src/Interpreters/SessionLog.cpp | 5 +- src/Interpreters/SessionTracker.cpp | 2 +- src/Interpreters/Set.cpp | 33 +- src/Interpreters/SortedBlocksWriter.cpp | 25 +- src/Interpreters/Squashing.cpp | 9 +- src/Interpreters/Squashing.h | 12 +- src/Interpreters/SystemLog.cpp | 64 +- src/Interpreters/SystemLog.h | 20 +- src/Interpreters/TableJoin.cpp | 11 +- src/Interpreters/TableJoin.h | 10 +- src/Interpreters/TemporaryDataOnDisk.cpp | 29 +- src/Interpreters/TemporaryDataOnDisk.h | 2 +- .../TemporaryReplaceTableName.cpp | 9 +- src/Interpreters/TemporaryReplaceTableName.h | 2 + src/Interpreters/ThreadStatusExt.cpp | 207 +- src/Interpreters/TraceCollector.cpp | 15 +- src/Interpreters/TraceLog.cpp | 6 +- src/Interpreters/TransactionLog.cpp | 24 + src/Interpreters/TransactionLog.h | 16 +- .../TranslateQualifiedNamesVisitor.cpp | 2 +- src/Interpreters/TransposedMetricLog.cpp | 6 +- src/Interpreters/TreeRewriter.cpp | 8 +- src/Interpreters/ZooKeeperConnectionLog.cpp | 146 + src/Interpreters/ZooKeeperConnectionLog.h | 57 + src/Interpreters/addTypeConversionToAST.cpp | 2 +- src/Interpreters/convertFieldToType.cpp | 83 +- src/Interpreters/executeDDLQueryOnCluster.cpp | 3 +- src/Interpreters/executeQuery.cpp | 249 +- src/Interpreters/executeQuery.h | 13 + .../fuzzers/execute_query_fuzzer.cpp | 2 +- .../getHeaderForProcessingStage.cpp | 9 +- .../getHeaderForProcessingStage.h | 4 +- src/Interpreters/getTableExpressions.cpp | 2 +- src/Interpreters/getTableOverride.cpp | 2 +- src/Interpreters/inplaceBlockConversions.cpp | 98 +- src/Interpreters/joinDispatch.h | 7 +- src/Interpreters/loadMetadata.cpp | 75 +- .../parseColumnsListForTableFunction.cpp | 39 +- .../parseColumnsListForTableFunction.h | 4 +- src/Interpreters/registerInterpreters.cpp | 5 +- src/Interpreters/sortBlock.cpp | 20 +- src/Interpreters/sortBlock.h | 3 +- .../tests/gtest_async_insert_key.cpp | 49 + .../tests/gtest_convertFieldToType.cpp | 36 +- .../tests/gtest_cycle_aliases.cpp | 4 +- src/Interpreters/tests/gtest_filecache.cpp | 39 +- ...dLogChannel.cpp => ExtendedLogMessage.cpp} | 6 +- ...endedLogChannel.h => ExtendedLogMessage.h} | 16 +- src/Loggers/Loggers.cpp | 240 +- src/Loggers/Loggers.h | 23 +- src/Loggers/OwnFormattingChannel.cpp | 57 +- src/Loggers/OwnFormattingChannel.h | 46 +- src/Loggers/OwnJSONPatternFormatter.cpp | 53 +- src/Loggers/OwnJSONPatternFormatter.h | 6 +- src/Loggers/OwnPatternFormatter.cpp | 4 +- src/Loggers/OwnPatternFormatter.h | 2 +- src/Loggers/OwnSplitChannel.cpp | 607 ++- src/Loggers/OwnSplitChannel.h | 215 +- src/Parsers/ASTAlterNamedCollectionQuery.cpp | 8 +- src/Parsers/ASTAlterNamedCollectionQuery.h | 2 + src/Parsers/ASTAlterQuery.cpp | 235 +- src/Parsers/ASTAssignment.h | 6 +- src/Parsers/ASTBackupQuery.cpp | 33 +- src/Parsers/ASTCheckQuery.h | 8 +- src/Parsers/ASTColumnDeclaration.cpp | 14 +- src/Parsers/ASTColumnsMatcher.cpp | 15 +- src/Parsers/ASTColumnsTransformers.cpp | 10 +- src/Parsers/ASTConstraintDeclaration.cpp | 2 +- src/Parsers/ASTCopyQuery.cpp | 33 + src/Parsers/ASTCopyQuery.h | 47 + src/Parsers/ASTCreateFunctionQuery.cpp | 8 +- src/Parsers/ASTCreateIndexQuery.cpp | 4 +- src/Parsers/ASTCreateNamedCollectionQuery.cpp | 6 +- src/Parsers/ASTCreateNamedCollectionQuery.h | 2 + src/Parsers/ASTCreateQuery.cpp | 95 +- src/Parsers/ASTCreateResourceQuery.cpp | 32 +- src/Parsers/ASTCreateResourceQuery.h | 43 +- src/Parsers/ASTCreateWorkloadQuery.cpp | 16 +- src/Parsers/ASTDataType.cpp | 8 +- src/Parsers/ASTDatabaseOrNone.cpp | 4 +- src/Parsers/ASTDeleteQuery.cpp | 6 +- src/Parsers/ASTDescribeCacheQuery.cpp | 5 +- src/Parsers/ASTDictionary.cpp | 57 +- .../ASTDictionaryAttributeDeclaration.cpp | 12 +- src/Parsers/ASTDropFunctionQuery.cpp | 5 +- src/Parsers/ASTDropIndexQuery.cpp | 4 +- src/Parsers/ASTDropNamedCollectionQuery.cpp | 4 +- src/Parsers/ASTDropQuery.cpp | 17 +- src/Parsers/ASTDropResourceQuery.cpp | 5 +- src/Parsers/ASTDropWorkloadQuery.cpp | 5 +- src/Parsers/ASTExplainQuery.h | 2 +- src/Parsers/ASTExternalDDLQuery.h | 52 - src/Parsers/ASTFunction.cpp | 126 +- src/Parsers/ASTFunction.h | 2 +- .../ASTFunctionWithKeyValueArguments.cpp | 11 +- src/Parsers/ASTIdentifier.cpp | 2 - src/Parsers/ASTIdentifierTypePair.cpp | 37 + src/Parsers/ASTIdentifierTypePair.h | 27 + src/Parsers/ASTIndexDeclaration.cpp | 4 +- src/Parsers/ASTIndexDeclaration.h | 5 +- src/Parsers/ASTInsertQuery.cpp | 33 +- src/Parsers/ASTInsertQuery.h | 3 +- src/Parsers/ASTInterpolateElement.cpp | 14 +- src/Parsers/ASTInterpolateElement.h | 10 +- src/Parsers/ASTKillQueryQuery.cpp | 8 +- src/Parsers/ASTLiteral.cpp | 1 + src/Parsers/ASTOptimizeQuery.cpp | 12 +- src/Parsers/ASTOrderByElement.cpp | 22 +- src/Parsers/ASTParallelWithQuery.cpp | 2 +- src/Parsers/ASTPartition.cpp | 2 +- src/Parsers/ASTProjectionSelectQuery.cpp | 8 +- src/Parsers/ASTQueryParameter.cpp | 10 +- src/Parsers/ASTQueryWithOnCluster.cpp | 5 +- src/Parsers/ASTQueryWithOutput.cpp | 12 +- src/Parsers/ASTQueryWithOutput.h | 9 +- src/Parsers/ASTQueryWithTableAndOutput.h | 4 +- src/Parsers/ASTRefreshStrategy.cpp | 17 +- src/Parsers/ASTRenameQuery.h | 13 +- src/Parsers/ASTSQLSecurity.cpp | 4 +- src/Parsers/ASTSelectIntersectExceptQuery.cpp | 4 +- src/Parsers/ASTSelectIntersectExceptQuery.h | 2 +- src/Parsers/ASTSelectQuery.cpp | 70 +- src/Parsers/ASTSelectWithUnionQuery.cpp | 4 +- src/Parsers/ASTSetQuery.cpp | 60 +- src/Parsers/ASTShowColumnsQuery.cpp | 25 +- src/Parsers/ASTShowFunctionsQuery.cpp | 10 +- src/Parsers/ASTShowIndexesQuery.cpp | 11 +- src/Parsers/ASTShowSettingQuery.cpp | 5 +- src/Parsers/ASTShowTablesQuery.cpp | 35 +- src/Parsers/ASTStatisticsDeclaration.cpp | 4 +- src/Parsers/ASTSubquery.cpp | 3 - src/Parsers/ASTSystemQuery.cpp | 52 +- src/Parsers/ASTSystemQuery.h | 5 +- src/Parsers/ASTTableOverrides.cpp | 10 +- src/Parsers/ASTTablesInSelectQuery.cpp | 25 +- src/Parsers/ASTTimeInterval.cpp | 4 +- src/Parsers/ASTTransactionControl.cpp | 10 +- src/Parsers/ASTUndropQuery.cpp | 6 +- src/Parsers/ASTUpdateQuery.cpp | 8 +- src/Parsers/ASTUpdateQuery.h | 2 +- src/Parsers/ASTUseQuery.h | 2 +- src/Parsers/ASTViewTargets.cpp | 10 +- src/Parsers/ASTWatchQuery.h | 6 +- src/Parsers/ASTWithAlias.cpp | 5 +- src/Parsers/ASTWithElement.cpp | 4 +- src/Parsers/Access/ASTAuthenticationData.cpp | 12 +- src/Parsers/Access/ASTCheckGrantQuery.cpp | 9 +- src/Parsers/Access/ASTCreateQuotaQuery.cpp | 48 +- src/Parsers/Access/ASTCreateRoleQuery.cpp | 23 +- .../Access/ASTCreateRowPolicyQuery.cpp | 40 +- .../Access/ASTCreateSettingsProfileQuery.cpp | 25 +- src/Parsers/Access/ASTCreateUserQuery.cpp | 75 +- .../Access/ASTDropAccessEntityQuery.cpp | 8 +- src/Parsers/Access/ASTGrantQuery.cpp | 28 +- .../Access/ASTMoveAccessEntityQuery.cpp | 8 +- src/Parsers/Access/ASTRolesOrUsersSet.cpp | 21 +- src/Parsers/Access/ASTRowPolicyName.cpp | 14 +- src/Parsers/Access/ASTSetRoleQuery.cpp | 4 +- .../Access/ASTSettingsProfileElement.cpp | 43 +- .../Access/ASTSettingsProfileElement.h | 1 + .../Access/ASTShowAccessEntitiesQuery.cpp | 6 +- .../Access/ASTShowCreateAccessEntityQuery.cpp | 4 +- src/Parsers/Access/ASTShowGrantsQuery.cpp | 16 +- src/Parsers/Access/ASTUserNameWithHost.cpp | 158 +- src/Parsers/Access/ASTUserNameWithHost.h | 40 +- src/Parsers/Access/ParserCreateUserQuery.cpp | 23 +- .../Access/ParserDropAccessEntityQuery.cpp | 2 +- .../Access/ParserMoveAccessEntityQuery.cpp | 2 +- .../ParserShowCreateAccessEntityQuery.cpp | 2 +- src/Parsers/Access/ParserUserNameWithHost.cpp | 93 +- src/Parsers/Access/ParserUserNameWithHost.h | 12 + .../Access/parseAccessRightsElements.cpp | 46 + src/Parsers/Access/parseUserName.cpp | 8 +- src/Parsers/Access/parseUserName.h | 9 +- src/Parsers/CMakeLists.txt | 33 +- src/Parsers/CommonParsers.h | 9 +- src/Parsers/ExpressionElementParsers.cpp | 21 +- src/Parsers/ExpressionElementParsers.h | 5 +- src/Parsers/ExpressionListParsers.cpp | 70 +- src/Parsers/FunctionSecretArgumentsFinder.h | 28 +- src/Parsers/HiliteComparator/CMakeLists.txt | 7 - .../HiliteComparator/HiliteComparator.cpp | 98 - .../HiliteComparator/HiliteComparator.h | 47 - .../tests/gtest_hilite_comparator.cpp | 98 - src/Parsers/IAST.cpp | 9 - src/Parsers/IAST.h | 13 +- src/Parsers/IParser.h | 3 + src/Parsers/Kusto/Formatters.cpp | 2 +- .../KustoFunctions/IParserKQLFunction.cpp | 2 +- .../KustoFunctions/KQLDataTypeFunctions.cpp | 2 +- .../KustoFunctions/KQLDateTimeFunctions.cpp | 16 +- .../KQLMathematicalFunctions.cpp | 2 +- .../KustoFunctions/KQLMathematicalFunctions.h | 2 +- src/Parsers/Kusto/ParserKQLSummarize.cpp | 11 - src/Parsers/Kusto/Utilities.cpp | 4 +- src/Parsers/Lexer.cpp | 88 +- src/Parsers/Lexer.h | 8 +- src/Parsers/LexerStandalone.h | 176 + src/Parsers/PRQL/ParserPRQLQuery.cpp | 2 +- src/Parsers/ParserAlterNamedCollectionQuery.h | 2 +- src/Parsers/ParserAlterQuery.cpp | 12 +- src/Parsers/ParserCopyQuery.cpp | 159 + src/Parsers/ParserCopyQuery.h | 30 + src/Parsers/ParserCreateFunctionQuery.cpp | 2 - src/Parsers/ParserCreateFunctionQuery.h | 2 +- src/Parsers/ParserCreateIndexQuery.cpp | 16 +- src/Parsers/ParserCreateQuery.cpp | 25 +- src/Parsers/ParserCreateResourceQuery.cpp | 16 +- src/Parsers/ParserCreateResourceQuery.h | 2 +- src/Parsers/ParserCreateWorkloadQuery.h | 2 +- src/Parsers/ParserDeleteQuery.cpp | 12 + src/Parsers/ParserDropFunctionQuery.h | 2 +- src/Parsers/ParserDropNamedCollectionQuery.h | 2 +- src/Parsers/ParserDropQuery.cpp | 2 +- src/Parsers/ParserDropResourceQuery.h | 2 +- src/Parsers/ParserDropWorkloadQuery.h | 2 +- src/Parsers/ParserExternalDDLQuery.cpp | 83 - src/Parsers/ParserExternalDDLQuery.h | 21 - src/Parsers/ParserInsertQuery.cpp | 17 +- src/Parsers/ParserPreparedStatement.cpp | 6 +- src/Parsers/ParserQuery.cpp | 8 +- src/Parsers/ParserSelectQuery.cpp | 5 +- src/Parsers/ParserShowTablesQuery.cpp | 2 +- src/Parsers/ParserSystemQuery.cpp | 28 +- src/Parsers/ParserUndropQuery.cpp | 2 +- src/Parsers/ParserUseQuery.cpp | 27 +- .../Prometheus/ParserPrometheusQuery.cpp | 92 + .../Prometheus/ParserPrometheusQuery.h | 28 + .../PrometheusQueryParsingUtil-antlr.cpp | 1032 +++++ .../Prometheus/PrometheusQueryParsingUtil.cpp | 648 +++ .../Prometheus/PrometheusQueryParsingUtil.h | 49 + .../Prometheus/PrometheusQueryResultType.h | 15 + .../Prometheus/PrometheusQueryTree.cpp | 279 ++ src/Parsers/Prometheus/PrometheusQueryTree.h | 280 ++ src/Parsers/TablePropertiesQueriesASTs.h | 12 +- src/Parsers/clickhouse_lexer.h | 16 + .../fuzzers/codegen_fuzzer/CMakeLists.txt | 2 +- src/Parsers/getInsertQuery.cpp | 1 - src/Parsers/parseDatabaseAndTableName.cpp | 2 +- .../parseIdentifierOrStringLiteral.cpp | 2 +- src/Parsers/queryNormalization.cpp | 9 +- .../tests/KQL/gtest_KQL_dateTimeFunctions.cpp | 2 +- src/Parsers/tests/gtest_Parser.cpp | 2 +- src/Parsers/tests/gtest_common.cpp | 2 +- src/Parsers/tests/gtest_format_hiliting.cpp | 135 - src/Planner/CollectSets.cpp | 2 +- src/Planner/CollectTableExpressionData.cpp | 70 +- src/Planner/Planner.cpp | 79 +- src/Planner/PlannerActionsVisitor.cpp | 2 +- src/Planner/PlannerContext.h | 2 +- src/Planner/PlannerCorrelatedSubqueries.cpp | 308 +- src/Planner/PlannerExpressionAnalysis.cpp | 6 +- src/Planner/PlannerJoinTree.cpp | 207 +- src/Planner/PlannerJoinTree.h | 2 +- src/Planner/PlannerJoins.cpp | 24 +- src/Planner/PlannerJoins.h | 4 +- src/Planner/PlannerJoinsLogical.cpp | 8 +- src/Planner/PlannerJoinsLogical.h | 4 +- src/Planner/PlannerWindowFunctions.cpp | 14 +- src/Planner/Utils.cpp | 129 +- src/Planner/Utils.h | 15 +- src/Planner/findParallelReplicasQuery.cpp | 26 +- src/Processors/ConcatProcessor.cpp | 2 +- src/Processors/ConcatProcessor.h | 5 +- src/Processors/DelayedPortsProcessor.cpp | 4 +- src/Processors/DelayedPortsProcessor.h | 3 +- src/Processors/Executors/ExecutingGraph.cpp | 2 +- .../Executors/ExecutionThreadContext.cpp | 2 +- .../Executors/ExecutionThreadContext.h | 1 + src/Processors/Executors/ExecutorTasks.cpp | 97 +- src/Processors/Executors/ExecutorTasks.h | 31 +- src/Processors/Executors/PipelineExecutor.cpp | 268 +- src/Processors/Executors/PipelineExecutor.h | 9 +- src/Processors/Executors/PollingQueue.h | 1 + .../PullingAsyncPipelineExecutor.cpp | 2 +- .../Executors/PullingPipelineExecutor.cpp | 7 +- .../Executors/PullingPipelineExecutor.h | 5 +- .../PushingAsyncPipelineExecutor.cpp | 11 +- .../Executors/PushingPipelineExecutor.cpp | 4 +- .../Executors/StreamingFormatExecutor.cpp | 1 - src/Processors/Executors/TasksQueue.h | 14 +- src/Processors/Formats/IInputFormat.cpp | 20 +- src/Processors/Formats/IInputFormat.h | 26 +- src/Processors/Formats/IOutputFormat.cpp | 18 +- src/Processors/Formats/IOutputFormat.h | 7 +- src/Processors/Formats/IRowInputFormat.cpp | 2 +- src/Processors/Formats/IRowInputFormat.h | 2 +- src/Processors/Formats/IRowOutputFormat.cpp | 8 +- src/Processors/Formats/IRowOutputFormat.h | 2 +- src/Processors/Formats/ISchemaReader.h | 2 +- .../Formats/Impl/ArrowBlockInputFormat.cpp | 26 +- .../Formats/Impl/ArrowBlockInputFormat.h | 2 +- .../Formats/Impl/ArrowBlockOutputFormat.cpp | 20 +- .../Formats/Impl/ArrowBlockOutputFormat.h | 8 +- .../Formats/Impl/ArrowBufferedStreams.cpp | 2 +- .../Formats/Impl/ArrowColumnToCHColumn.cpp | 259 +- .../Formats/Impl/ArrowColumnToCHColumn.h | 19 +- .../Formats/Impl/ArrowFieldIndexUtil.h | 38 +- src/Processors/Formats/Impl/ArrowGeoTypes.cpp | 476 +- src/Processors/Formats/Impl/ArrowGeoTypes.h | 161 +- .../Formats/Impl/AvroRowInputFormat.cpp | 34 +- .../Formats/Impl/AvroRowInputFormat.h | 4 +- .../Formats/Impl/AvroRowOutputFormat.cpp | 41 +- .../Formats/Impl/AvroRowOutputFormat.h | 20 +- .../Impl/BSONEachRowRowInputFormat.cpp | 13 +- .../Formats/Impl/BSONEachRowRowInputFormat.h | 2 +- .../Impl/BSONEachRowRowOutputFormat.cpp | 9 +- .../Formats/Impl/BSONEachRowRowOutputFormat.h | 2 +- .../Formats/Impl/BinaryRowInputFormat.cpp | 7 +- .../Formats/Impl/BinaryRowInputFormat.h | 2 +- .../Formats/Impl/BinaryRowOutputFormat.cpp | 10 +- .../Formats/Impl/BinaryRowOutputFormat.h | 4 +- .../Formats/Impl/CHColumnToArrowColumn.cpp | 15 +- .../Formats/Impl/CHColumnToArrowColumn.h | 6 +- .../Formats/Impl/CSVRowInputFormat.cpp | 8 +- .../Formats/Impl/CSVRowInputFormat.h | 6 +- .../Formats/Impl/CSVRowOutputFormat.cpp | 9 +- .../Formats/Impl/CSVRowOutputFormat.h | 10 +- .../Formats/Impl/CapnProtoRowInputFormat.cpp | 18 +- .../Formats/Impl/CapnProtoRowInputFormat.h | 3 +- .../Formats/Impl/CapnProtoRowOutputFormat.cpp | 12 +- .../Formats/Impl/CapnProtoRowOutputFormat.h | 2 +- .../Impl/ConstantExpressionTemplate.cpp | 3 +- .../Formats/Impl/ConstantExpressionTemplate.h | 4 +- .../Impl/CustomSeparatedRowInputFormat.cpp | 6 +- .../Impl/CustomSeparatedRowInputFormat.h | 4 +- .../Impl/CustomSeparatedRowOutputFormat.cpp | 7 +- .../Impl/CustomSeparatedRowOutputFormat.h | 2 +- .../Formats/Impl/DWARFBlockInputFormat.cpp | 82 +- .../Formats/Impl/DWARFBlockInputFormat.h | 6 +- .../Formats/Impl/FormRowInputFormat.cpp | 6 +- .../Formats/Impl/FormRowInputFormat.h | 2 +- .../Formats/Impl/HashOutputFormat.cpp | 50 + .../Formats/Impl/HashOutputFormat.h | 27 + .../Formats/Impl/HiveTextRowInputFormat.cpp | 8 +- .../Formats/Impl/HiveTextRowInputFormat.h | 4 +- .../Impl/JSONAsStringRowInputFormat.cpp | 32 +- .../Formats/Impl/JSONAsStringRowInputFormat.h | 12 +- .../Impl/JSONColumnsBlockInputFormat.cpp | 2 +- .../Impl/JSONColumnsBlockInputFormatBase.cpp | 6 +- .../Impl/JSONColumnsBlockInputFormatBase.h | 2 +- .../Impl/JSONColumnsBlockOutputFormat.cpp | 13 +- .../Impl/JSONColumnsBlockOutputFormat.h | 4 +- .../Impl/JSONColumnsBlockOutputFormatBase.cpp | 4 +- .../Impl/JSONColumnsBlockOutputFormatBase.h | 2 +- ...SONColumnsWithMetadataBlockInputFormat.cpp | 2 +- ...ONColumnsWithMetadataBlockOutputFormat.cpp | 10 +- ...JSONColumnsWithMetadataBlockOutputFormat.h | 2 +- .../JSONCompactColumnsBlockInputFormat.cpp | 2 +- .../JSONCompactColumnsBlockOutputFormat.cpp | 10 +- .../JSONCompactColumnsBlockOutputFormat.h | 2 +- .../Impl/JSONCompactEachRowRowInputFormat.cpp | 4 +- .../Impl/JSONCompactEachRowRowInputFormat.h | 2 +- .../JSONCompactEachRowRowOutputFormat.cpp | 7 +- .../Impl/JSONCompactEachRowRowOutputFormat.h | 2 +- ...pactEachRowWithProgressRowOutputFormat.cpp | 16 +- .../Impl/JSONCompactRowInputFormat.cpp | 4 +- .../Formats/Impl/JSONCompactRowInputFormat.h | 2 +- .../Impl/JSONCompactRowOutputFormat.cpp | 14 +- .../Formats/Impl/JSONCompactRowOutputFormat.h | 2 +- .../Impl/JSONEachRowRowInputFormat.cpp | 6 +- .../Formats/Impl/JSONEachRowRowInputFormat.h | 2 +- .../Impl/JSONEachRowRowOutputFormat.cpp | 11 +- .../Formats/Impl/JSONEachRowRowOutputFormat.h | 8 +- ...JSONEachRowWithProgressRowOutputFormat.cpp | 14 +- .../Impl/JSONObjectEachRowRowInputFormat.cpp | 6 +- .../Impl/JSONObjectEachRowRowInputFormat.h | 2 +- .../Impl/JSONObjectEachRowRowOutputFormat.cpp | 10 +- .../Impl/JSONObjectEachRowRowOutputFormat.h | 2 +- .../Formats/Impl/JSONRowInputFormat.cpp | 6 +- .../Formats/Impl/JSONRowInputFormat.h | 4 +- .../Formats/Impl/JSONRowOutputFormat.cpp | 16 +- .../Formats/Impl/JSONRowOutputFormat.h | 4 +- .../Impl/LineAsStringRowInputFormat.cpp | 9 +- .../Formats/Impl/LineAsStringRowInputFormat.h | 2 +- .../Formats/Impl/MarkdownRowOutputFormat.cpp | 7 +- .../Formats/Impl/MarkdownRowOutputFormat.h | 2 +- .../Formats/Impl/MsgPackRowInputFormat.cpp | 8 +- .../Formats/Impl/MsgPackRowInputFormat.h | 4 +- .../Formats/Impl/MsgPackRowOutputFormat.cpp | 8 +- .../Formats/Impl/MsgPackRowOutputFormat.h | 2 +- .../Formats/Impl/MySQLDumpRowInputFormat.cpp | 98 +- .../Formats/Impl/MySQLDumpRowInputFormat.h | 2 +- .../Formats/Impl/MySQLOutputFormat.cpp | 6 +- .../Formats/Impl/MySQLOutputFormat.h | 2 +- src/Processors/Formats/Impl/NativeFormat.cpp | 27 +- .../Impl/NativeORCBlockInputFormat.cpp | 378 +- .../Formats/Impl/NativeORCBlockInputFormat.h | 30 +- .../Formats/Impl/NpyOutputFormat.cpp | 12 +- src/Processors/Formats/Impl/NpyOutputFormat.h | 4 +- .../Formats/Impl/NpyRowInputFormat.cpp | 4 +- .../Formats/Impl/NpyRowInputFormat.h | 2 +- src/Processors/Formats/Impl/NullFormat.cpp | 7 +- src/Processors/Formats/Impl/NullFormat.h | 2 +- .../Impl/ODBCDriver2BlockOutputFormat.cpp | 9 +- .../Impl/ODBCDriver2BlockOutputFormat.h | 9 +- .../Formats/Impl/ORCBlockInputFormat.cpp | 28 +- .../Formats/Impl/ORCBlockInputFormat.h | 2 +- .../Formats/Impl/ORCBlockOutputFormat.cpp | 15 +- .../Formats/Impl/ORCBlockOutputFormat.h | 2 +- src/Processors/Formats/Impl/OneFormat.cpp | 12 +- src/Processors/Formats/Impl/OneFormat.h | 2 +- .../Impl/ParallelFormattingOutputFormat.cpp | 3 +- .../Impl/ParallelFormattingOutputFormat.h | 11 +- .../Impl/ParallelParsingInputFormat.cpp | 10 +- .../Formats/Impl/ParallelParsingInputFormat.h | 38 +- .../Formats/Impl/Parquet/Decoding.cpp | 1440 ++++++ .../Formats/Impl/Parquet/Decoding.h | 319 ++ .../Formats/Impl/Parquet/ParquetDataBuffer.h | 3 +- .../Impl/Parquet/ParquetDataValuesReader.cpp | 12 +- .../Impl/Parquet/ParquetDataValuesReader.h | 2 +- .../Impl/Parquet/ParquetLeafColReader.cpp | 5 +- .../Impl/Parquet/ParquetLeafColReader.h | 4 +- .../Impl/Parquet/ParquetRecordReader.cpp | 31 +- .../Impl/Parquet/ParquetRecordReader.h | 3 +- .../Formats/Impl/Parquet/Prefetcher.cpp | 513 +++ .../Formats/Impl/Parquet/Prefetcher.h | 224 + .../Formats/Impl/Parquet/PrepareForWrite.cpp | 124 +- .../Formats/Impl/Parquet/ReadCommon.cpp | 80 + .../Formats/Impl/Parquet/ReadCommon.h | 241 + .../Formats/Impl/Parquet/ReadManager.cpp | 923 ++++ .../Formats/Impl/Parquet/ReadManager.h | 114 + .../Formats/Impl/Parquet/Reader.cpp | 1995 ++++++++ src/Processors/Formats/Impl/Parquet/Reader.h | 534 +++ .../Formats/Impl/Parquet/SchemaConverter.cpp | 1193 +++++ .../Formats/Impl/Parquet/SchemaConverter.h | 71 + .../Formats/Impl/Parquet/ThriftUtil.cpp | 70 +- .../Formats/Impl/Parquet/ThriftUtil.h | 47 +- src/Processors/Formats/Impl/Parquet/Write.cpp | 241 +- src/Processors/Formats/Impl/Parquet/Write.h | 38 +- .../Impl/Parquet/parquetBloomFilterHash.cpp | 10 +- .../Formats/Impl/ParquetBlockInputFormat.cpp | 289 +- .../Formats/Impl/ParquetBlockInputFormat.h | 28 +- .../Formats/Impl/ParquetBlockOutputFormat.cpp | 38 +- .../Formats/Impl/ParquetBlockOutputFormat.h | 6 +- .../Impl/ParquetMetadataInputFormat.cpp | 22 +- .../Formats/Impl/ParquetMetadataInputFormat.h | 2 +- .../Impl/ParquetV3BlockInputFormat.cpp | 162 + .../Formats/Impl/ParquetV3BlockInputFormat.h | 72 + .../Formats/Impl/PostgreSQLOutputFormat.cpp | 8 +- .../Formats/Impl/PostgreSQLOutputFormat.h | 2 +- .../Formats/Impl/PrettyBlockOutputFormat.cpp | 25 +- .../Formats/Impl/PrettyBlockOutputFormat.h | 2 +- .../Impl/PrometheusTextOutputFormat.cpp | 10 +- .../Formats/Impl/PrometheusTextOutputFormat.h | 5 +- .../Formats/Impl/ProtobufListInputFormat.cpp | 18 +- .../Formats/Impl/ProtobufListInputFormat.h | 2 +- .../Formats/Impl/ProtobufListOutputFormat.cpp | 13 +- .../Formats/Impl/ProtobufListOutputFormat.h | 6 +- .../Formats/Impl/ProtobufRowInputFormat.cpp | 39 +- .../Formats/Impl/ProtobufRowInputFormat.h | 4 +- .../Formats/Impl/ProtobufRowOutputFormat.cpp | 14 +- .../Formats/Impl/ProtobufRowOutputFormat.h | 4 +- .../Formats/Impl/RawBLOBRowInputFormat.cpp | 12 +- .../Formats/Impl/RawBLOBRowInputFormat.h | 2 +- .../Formats/Impl/RawBLOBRowOutputFormat.cpp | 7 +- .../Formats/Impl/RawBLOBRowOutputFormat.h | 2 +- .../Formats/Impl/RegexpRowInputFormat.cpp | 6 +- .../Formats/Impl/RegexpRowInputFormat.h | 4 +- .../Formats/Impl/SQLInsertRowOutputFormat.cpp | 11 +- .../Formats/Impl/SQLInsertRowOutputFormat.h | 5 +- .../Formats/Impl/TSKVRowInputFormat.cpp | 4 +- .../Formats/Impl/TSKVRowInputFormat.h | 2 +- .../Formats/Impl/TSKVRowOutputFormat.cpp | 10 +- .../Formats/Impl/TSKVRowOutputFormat.h | 2 +- .../Impl/TabSeparatedRowInputFormat.cpp | 9 +- .../Formats/Impl/TabSeparatedRowInputFormat.h | 4 +- .../Impl/TabSeparatedRowOutputFormat.cpp | 9 +- .../Impl/TabSeparatedRowOutputFormat.h | 5 +- .../Impl/TemplateBlockOutputFormat.cpp | 59 +- .../Formats/Impl/TemplateBlockOutputFormat.h | 2 +- .../Formats/Impl/TemplateRowInputFormat.cpp | 37 +- .../Formats/Impl/TemplateRowInputFormat.h | 5 +- .../Formats/Impl/ValuesBlockInputFormat.cpp | 16 +- .../Formats/Impl/ValuesBlockInputFormat.h | 8 +- .../Formats/Impl/ValuesRowOutputFormat.cpp | 7 +- .../Formats/Impl/ValuesRowOutputFormat.h | 2 +- .../Formats/Impl/VerticalRowOutputFormat.cpp | 9 +- .../Formats/Impl/VerticalRowOutputFormat.h | 2 +- .../Formats/Impl/XMLRowOutputFormat.cpp | 10 +- .../Formats/Impl/XMLRowOutputFormat.h | 4 +- .../Formats/InputFormatErrorsLogger.cpp | 1 + .../Formats/InputFormatErrorsLogger.h | 5 +- src/Processors/Formats/LazyOutputFormat.cpp | 4 +- src/Processors/Formats/LazyOutputFormat.h | 2 +- .../OutputFormatWithUTF8ValidationAdaptor.h | 2 +- .../Formats/PullingOutputFormat.cpp | 2 +- src/Processors/Formats/PullingOutputFormat.h | 2 +- .../RowInputFormatWithDiagnosticInfo.cpp | 3 +- .../RowInputFormatWithDiagnosticInfo.h | 2 +- .../RowInputFormatWithNamesAndTypes.cpp | 4 +- .../Formats/RowInputFormatWithNamesAndTypes.h | 2 +- ...wOutputFormatWithExceptionHandlerAdaptor.h | 2 +- src/Processors/IAccumulatingTransform.cpp | 2 +- src/Processors/IAccumulatingTransform.h | 4 +- src/Processors/IInflatingTransform.cpp | 2 +- src/Processors/IInflatingTransform.h | 4 +- src/Processors/ISimpleTransform.cpp | 14 +- src/Processors/ISimpleTransform.h | 2 + src/Processors/ISink.cpp | 2 +- src/Processors/ISink.h | 4 +- src/Processors/ISource.cpp | 16 +- src/Processors/ISource.h | 5 +- src/Processors/LimitTransform.cpp | 4 +- src/Processors/LimitTransform.h | 3 +- .../Merges/AggregatingSortedTransform.h | 2 +- .../Algorithms/AggregatingSortedAlgorithm.cpp | 6 +- .../Algorithms/AggregatingSortedAlgorithm.h | 2 +- .../Algorithms/CollapsingSortedAlgorithm.cpp | 5 +- .../Algorithms/CollapsingSortedAlgorithm.h | 2 +- .../FinishAggregatingInOrderAlgorithm.cpp | 6 +- .../FinishAggregatingInOrderAlgorithm.h | 5 +- .../GraphiteRollupSortedAlgorithm.cpp | 6 +- .../GraphiteRollupSortedAlgorithm.h | 2 +- .../IMergingAlgorithmWithDelayedChunk.cpp | 6 +- .../IMergingAlgorithmWithDelayedChunk.h | 6 +- .../IMergingAlgorithmWithSharedChunks.cpp | 8 +- .../IMergingAlgorithmWithSharedChunks.h | 6 +- .../Algorithms/MergingSortedAlgorithm.cpp | 12 +- .../Algorithms/MergingSortedAlgorithm.h | 6 +- .../Algorithms/ReplacingSortedAlgorithm.cpp | 7 +- .../Algorithms/ReplacingSortedAlgorithm.h | 2 +- .../Algorithms/SummingSortedAlgorithm.cpp | 111 +- .../Algorithms/SummingSortedAlgorithm.h | 13 +- .../VersionedCollapsingAlgorithm.cpp | 5 +- .../Algorithms/VersionedCollapsingAlgorithm.h | 2 +- .../Merges/CoalescingSortedTransform.h | 50 + .../Merges/CollapsingSortedTransform.h | 2 +- .../FinishAggregatingInOrderTransform.h | 5 +- .../Merges/GraphiteRollupSortedTransform.h | 2 +- src/Processors/Merges/IMergingTransform.cpp | 10 +- src/Processors/Merges/IMergingTransform.h | 16 +- .../Merges/MergingSortedTransform.cpp | 2 +- .../Merges/MergingSortedTransform.h | 2 +- .../Merges/ReplacingSortedTransform.h | 2 +- .../Merges/SummingSortedTransform.h | 8 +- .../Merges/VersionedCollapsingTransform.h | 2 +- src/Processors/Port.cpp | 4 +- src/Processors/Port.h | 29 +- src/Processors/QueryPlan/AggregatingStep.cpp | 169 +- src/Processors/QueryPlan/AggregatingStep.h | 13 +- src/Processors/QueryPlan/ArrayJoinStep.cpp | 8 +- src/Processors/QueryPlan/ArrayJoinStep.h | 2 +- .../QueryPlan/BlocksMarshallingStep.cpp | 78 + .../QueryPlan/BlocksMarshallingStep.h | 27 + .../QueryPlan/BufferChunksTransform.cpp | 2 +- .../QueryPlan/BufferChunksTransform.h | 3 +- .../QueryPlan/BuildQueryPipelineSettings.cpp | 1 + .../QueryPlan/BuildQueryPipelineSettings.h | 3 + .../QueryPlan/ConvertingActions.cpp | 4 +- .../CreateSetAndFilterOnTheFlyStep.cpp | 10 +- .../CreateSetAndFilterOnTheFlyStep.h | 2 +- src/Processors/QueryPlan/CreatingSetsStep.cpp | 20 +- src/Processors/QueryPlan/CreatingSetsStep.h | 6 +- src/Processors/QueryPlan/CubeStep.cpp | 14 +- src/Processors/QueryPlan/CubeStep.h | 2 +- .../QueryPlan/CustomMetricLogViewStep.cpp | 10 +- .../QueryPlan/CustomMetricLogViewStep.h | 2 +- src/Processors/QueryPlan/DistinctStep.cpp | 10 +- src/Processors/QueryPlan/DistinctStep.h | 2 +- .../QueryPlan/DistributedCreateLocalPlan.cpp | 1 + src/Processors/QueryPlan/ExpressionStep.cpp | 10 +- src/Processors/QueryPlan/ExpressionStep.h | 2 +- .../QueryPlan/ExtractColumnsStep.cpp | 8 +- src/Processors/QueryPlan/ExtractColumnsStep.h | 2 +- src/Processors/QueryPlan/ExtremesStep.cpp | 2 +- src/Processors/QueryPlan/ExtremesStep.h | 2 +- src/Processors/QueryPlan/FillingStep.cpp | 8 +- src/Processors/QueryPlan/FillingStep.h | 2 +- src/Processors/QueryPlan/FilterStep.cpp | 18 +- src/Processors/QueryPlan/FilterStep.h | 6 +- src/Processors/QueryPlan/IQueryPlanStep.cpp | 10 +- src/Processors/QueryPlan/IQueryPlanStep.h | 24 +- src/Processors/QueryPlan/ISourceStep.cpp | 2 +- src/Processors/QueryPlan/ISourceStep.h | 2 +- .../QueryPlan/ITransformingStep.cpp | 2 +- src/Processors/QueryPlan/ITransformingStep.h | 2 +- .../QueryPlan/IntersectOrExceptStep.cpp | 16 +- .../QueryPlan/IntersectOrExceptStep.h | 2 +- src/Processors/QueryPlan/JoinStep.cpp | 49 +- src/Processors/QueryPlan/JoinStep.h | 10 +- src/Processors/QueryPlan/JoinStepLogical.cpp | 41 +- src/Processors/QueryPlan/JoinStepLogical.h | 4 +- src/Processors/QueryPlan/LazilyReadStep.cpp | 8 +- src/Processors/QueryPlan/LazilyReadStep.h | 2 +- src/Processors/QueryPlan/LimitByStep.cpp | 4 +- src/Processors/QueryPlan/LimitByStep.h | 2 +- src/Processors/QueryPlan/LimitStep.cpp | 4 +- src/Processors/QueryPlan/LimitStep.h | 4 +- .../QueryPlan/MergingAggregatedStep.cpp | 190 +- .../QueryPlan/MergingAggregatedStep.h | 7 +- src/Processors/QueryPlan/OffsetStep.cpp | 2 +- src/Processors/QueryPlan/OffsetStep.h | 2 +- .../QueryPlan/Optimizations/Optimizations.h | 21 +- .../QueryPlanOptimizationSettings.cpp | 47 +- .../QueryPlanOptimizationSettings.h | 21 +- .../Optimizations/actionsDAGUtils.cpp | 124 + .../QueryPlan/Optimizations/actionsDAGUtils.h | 20 + .../Optimizations/addPlansForSets.cpp | 2 +- .../Optimizations/convertJoinToIn.cpp | 14 +- .../convertOuterJoinToInnerJoin.cpp | 8 +- .../Optimizations/filterPushDown.cpp | 145 +- .../Optimizations/liftUpFunctions.cpp | 2 +- .../QueryPlan/Optimizations/liftUpUnion.cpp | 2 + .../mergeFilterIntoJoinCondition.cpp | 52 +- .../QueryPlan/Optimizations/optimizeJoin.cpp | 39 +- .../Optimizations/optimizeJoinByShards.cpp | 5 +- .../optimizeLazyMaterialization.cpp | 40 +- .../Optimizations/optimizePrewhere.cpp | 169 +- .../Optimizations/optimizePrewhere.h | 35 + .../Optimizations/optimizeReadInOrder.cpp | 11 +- .../QueryPlan/Optimizations/optimizeTree.cpp | 122 +- .../optimizeUseAggregateProjection.cpp | 371 +- .../optimizeUseNormalProjection.cpp | 206 +- .../Optimizations/projectionsCommon.cpp | 211 +- .../Optimizations/projectionsCommon.h | 45 +- .../Optimizations/removeRedundantDistinct.cpp | 2 +- .../Optimizations/removeRedundantSorting.cpp | 2 +- .../updateQueryConditionCache.cpp | 5 +- .../useDataParallelAggregation.cpp | 130 - .../Optimizations/useVectorSearch.cpp | 279 +- .../QueryPlan/ParallelReplicasLocalPlan.cpp | 29 +- src/Processors/QueryPlan/PartsSplitter.cpp | 85 +- src/Processors/QueryPlan/PartsSplitter.h | 3 - src/Processors/QueryPlan/QueryPlan.cpp | 57 +- src/Processors/QueryPlan/QueryPlan.h | 11 +- .../QueryPlanSerializationSettings.cpp | 5 +- .../QueryPlan/QueryPlanStepRegistry.cpp | 2 + .../QueryPlan/ReadFromLocalReplica.cpp | 26 + .../QueryPlan/ReadFromLocalReplica.h | 24 + src/Processors/QueryPlan/ReadFromLoopStep.cpp | 29 +- .../QueryPlan/ReadFromMemoryStorageStep.cpp | 9 +- .../QueryPlan/ReadFromMergeTree.cpp | 519 ++- src/Processors/QueryPlan/ReadFromMergeTree.h | 53 +- .../QueryPlan/ReadFromObjectStorageStep.cpp | 134 + .../QueryPlan/ReadFromObjectStorageStep.h | 53 + .../QueryPlan/ReadFromPreparedSource.cpp | 2 +- .../QueryPlan/ReadFromPreparedSource.h | 5 +- .../QueryPlan/ReadFromRecursiveCTEStep.cpp | 2 +- .../QueryPlan/ReadFromRecursiveCTEStep.h | 6 +- src/Processors/QueryPlan/ReadFromRemote.cpp | 141 +- src/Processors/QueryPlan/ReadFromRemote.h | 31 +- .../QueryPlan/ReadFromStreamLikeEngine.cpp | 3 +- .../QueryPlan/ReadFromSystemNumbersStep.cpp | 11 +- .../QueryPlan/ReadFromTableFunctionStep.cpp | 4 +- .../QueryPlan/ReadFromTableFunctionStep.h | 2 +- .../QueryPlan/ReadFromTableStep.cpp | 4 +- src/Processors/QueryPlan/ReadFromTableStep.h | 2 +- src/Processors/QueryPlan/ReadNothingStep.cpp | 2 +- src/Processors/QueryPlan/ReadNothingStep.h | 2 +- src/Processors/QueryPlan/RollupStep.cpp | 10 +- src/Processors/QueryPlan/RollupStep.h | 2 +- src/Processors/QueryPlan/Serialization.cpp | 16 +- src/Processors/QueryPlan/Serialization.h | 4 +- src/Processors/QueryPlan/SortingStep.cpp | 38 +- src/Processors/QueryPlan/SortingStep.h | 8 +- .../QueryPlan/SourceStepWithFilter.cpp | 8 +- .../QueryPlan/SourceStepWithFilter.h | 12 +- src/Processors/QueryPlan/TotalsHavingStep.cpp | 17 +- src/Processors/QueryPlan/TotalsHavingStep.h | 2 +- src/Processors/QueryPlan/UnionStep.cpp | 18 +- src/Processors/QueryPlan/UnionStep.h | 2 +- src/Processors/QueryPlan/WindowStep.cpp | 10 +- src/Processors/QueryPlan/WindowStep.h | 2 +- src/Processors/QueryPlan/resolveStorages.cpp | 9 +- src/Processors/ResizeProcessor.cpp | 2 +- src/Processors/ResizeProcessor.h | 4 +- src/Processors/Sinks/EmptySink.h | 2 +- src/Processors/Sinks/NullSink.h | 2 +- src/Processors/Sinks/RemoteSink.h | 2 +- src/Processors/Sinks/SinkToStorage.cpp | 2 +- src/Processors/Sinks/SinkToStorage.h | 3 +- src/Processors/SourceWithKeyCondition.cpp | 19 - src/Processors/SourceWithKeyCondition.h | 31 - src/Processors/Sources/ArrowFlightSource.cpp | 125 + src/Processors/Sources/ArrowFlightSource.h | 47 + src/Processors/Sources/BlocksListSource.h | 4 +- src/Processors/Sources/BlocksSource.h | 2 +- src/Processors/Sources/ConstChunkGenerator.h | 2 +- src/Processors/Sources/DelayedSource.cpp | 8 +- src/Processors/Sources/DelayedSource.h | 4 +- src/Processors/Sources/MongoDBSource.cpp | 36 +- src/Processors/Sources/MongoDBSource.h | 3 +- src/Processors/Sources/MySQLSource.cpp | 4 +- src/Processors/Sources/NullSource.h | 2 +- src/Processors/Sources/PostgreSQLSource.cpp | 38 +- src/Processors/Sources/PostgreSQLSource.h | 8 +- src/Processors/Sources/RecursiveCTESource.cpp | 12 +- src/Processors/Sources/RecursiveCTESource.h | 2 +- src/Processors/Sources/RemoteSource.cpp | 48 +- src/Processors/Sources/RemoteSource.h | 22 +- src/Processors/Sources/SQLiteSource.cpp | 4 +- src/Processors/Sources/ShellCommandSource.cpp | 34 +- src/Processors/Sources/SourceFromChunks.cpp | 2 +- src/Processors/Sources/SourceFromChunks.h | 2 +- .../Sources/SourceFromSingleChunk.cpp | 8 +- .../Sources/SourceFromSingleChunk.h | 4 +- .../Sources/ThrowingExceptionSource.h | 2 +- .../Sources/WaitForAsyncInsertSource.h | 2 +- src/Processors/Sources/YTsaurusSource.cpp | 80 + src/Processors/Sources/YTsaurusSource.h | 73 + src/Processors/TTL/ITTLAlgorithm.cpp | 16 +- src/Processors/TTL/ITTLAlgorithm.h | 2 +- .../TTL/TTLAggregationAlgorithm.cpp | 38 +- src/Processors/TTL/TTLColumnAlgorithm.cpp | 15 +- src/Processors/TTL/TTLDeleteAlgorithm.cpp | 4 +- src/Processors/TTL/TTLUpdateInfoAlgorithm.cpp | 4 +- .../Transforms/AddingDefaultsTransform.cpp | 5 +- .../Transforms/AddingDefaultsTransform.h | 2 +- .../AggregatingInOrderTransform.cpp | 10 +- .../Transforms/AggregatingInOrderTransform.h | 6 +- .../Transforms/AggregatingTransform.cpp | 28 +- .../Transforms/AggregatingTransform.h | 11 +- .../Transforms/ApplySquashingTransform.cpp | 36 + .../Transforms/ApplySquashingTransform.h | 34 +- .../Transforms/ArrayJoinTransform.cpp | 12 +- .../Transforms/ArrayJoinTransform.h | 4 +- .../Transforms/CheckConstraintsTransform.cpp | 4 +- .../Transforms/CheckConstraintsTransform.h | 2 +- .../Transforms/CheckSortedTransform.cpp | 4 +- .../Transforms/CheckSortedTransform.h | 2 +- .../Transforms/ColumnGathererTransform.cpp | 6 +- .../Transforms/ColumnGathererTransform.h | 2 +- .../Transforms/ColumnLazyTransform.cpp | 4 +- .../Transforms/ColumnLazyTransform.h | 2 +- .../Transforms/ColumnPermuteTransform.cpp | 4 +- .../Transforms/ColumnPermuteTransform.h | 2 +- src/Processors/Transforms/CopyTransform.cpp | 36 +- src/Processors/Transforms/CopyTransform.h | 6 +- .../Transforms/CountingTransform.cpp | 24 +- src/Processors/Transforms/CountingTransform.h | 12 +- .../CreateSetAndFilterOnTheFlyTransform.cpp | 4 +- .../CreateSetAndFilterOnTheFlyTransform.h | 4 +- .../Transforms/CreatingSetsTransform.cpp | 4 +- .../Transforms/CreatingSetsTransform.h | 4 +- src/Processors/Transforms/CubeTransform.cpp | 4 +- src/Processors/Transforms/CubeTransform.h | 2 +- .../DeduplicationTokenTransforms.cpp | 8 +- .../Transforms/DeduplicationTokenTransforms.h | 18 +- .../DistinctSortedStreamTransform.cpp | 8 +- .../DistinctSortedStreamTransform.h | 2 +- .../Transforms/DistinctSortedTransform.cpp | 6 +- .../Transforms/DistinctSortedTransform.h | 2 +- .../Transforms/DistinctTransform.cpp | 8 +- src/Processors/Transforms/DistinctTransform.h | 2 +- .../Transforms/ExceptionKeepingTransform.cpp | 43 +- .../Transforms/ExceptionKeepingTransform.h | 12 +- .../Transforms/ExpressionTransform.cpp | 11 +- .../Transforms/ExpressionTransform.h | 11 +- .../Transforms/ExtractColumnsTransform.cpp | 4 +- .../Transforms/ExtractColumnsTransform.h | 2 +- .../Transforms/ExtremesTransform.cpp | 2 +- src/Processors/Transforms/ExtremesTransform.h | 2 +- .../Transforms/FillingTransform.cpp | 22 +- src/Processors/Transforms/FillingTransform.h | 6 +- .../Transforms/FilterSortedStreamByRange.h | 6 +- src/Processors/Transforms/FilterTransform.cpp | 43 +- src/Processors/Transforms/FilterTransform.h | 9 +- .../Transforms/FinishSortingTransform.cpp | 6 +- .../Transforms/FinishSortingTransform.h | 2 +- .../Transforms/IntersectOrExceptTransform.cpp | 8 +- .../Transforms/IntersectOrExceptTransform.h | 2 +- .../Transforms/JoiningTransform.cpp | 103 +- src/Processors/Transforms/JoiningTransform.h | 22 +- .../Transforms/LimitByTransform.cpp | 9 +- src/Processors/Transforms/LimitByTransform.h | 7 +- .../Transforms/LimitsCheckingTransform.cpp | 2 +- .../Transforms/LimitsCheckingTransform.h | 2 +- .../Transforms/MaterializingTransform.cpp | 4 +- .../Transforms/MaterializingTransform.h | 2 +- .../Transforms/MergeJoinTransform.cpp | 20 +- .../Transforms/MergeJoinTransform.h | 12 +- .../Transforms/MergeSortingTransform.cpp | 31 +- .../Transforms/MergeSortingTransform.h | 2 +- ...gingAggregatedMemoryEfficientTransform.cpp | 4 +- .../Transforms/MergingAggregatedTransform.cpp | 16 +- .../Transforms/MergingAggregatedTransform.h | 2 +- .../NestedElementsValidationTransform.cpp | 2 +- .../NestedElementsValidationTransform.h | 2 +- .../Transforms/PartialSortingTransform.cpp | 4 +- .../Transforms/PartialSortingTransform.h | 2 +- .../Transforms/PasteJoinTransform.cpp | 9 +- .../Transforms/PasteJoinTransform.h | 11 +- .../Transforms/PlanSquashingTransform.cpp | 2 +- .../Transforms/PlanSquashingTransform.h | 3 +- .../Transforms/RemovingSparseTransform.cpp | 24 + .../Transforms/RemovingSparseTransform.h | 18 + src/Processors/Transforms/ReverseTransform.h | 2 +- src/Processors/Transforms/RollupTransform.cpp | 6 +- src/Processors/Transforms/RollupTransform.h | 4 +- .../ScatterByPartitionTransform.cpp | 26 +- .../Transforms/ScatterByPartitionTransform.h | 2 +- .../Transforms/SelectByIndicesTransform.h | 2 +- .../Transforms/SortChunksBySequenceNumber.cpp | 163 + .../Transforms/SortChunksBySequenceNumber.h | 47 + .../Transforms/SortingTransform.cpp | 10 +- src/Processors/Transforms/SortingTransform.h | 6 +- .../Transforms/SquashingTransform.cpp | 6 +- .../Transforms/SquashingTransform.h | 4 +- .../Transforms/TTLCalcTransform.cpp | 6 +- src/Processors/Transforms/TTLCalcTransform.h | 2 +- src/Processors/Transforms/TTLTransform.cpp | 6 +- src/Processors/Transforms/TTLTransform.h | 2 +- .../Transforms/VirtualRowTransform.cpp | 2 +- .../Transforms/VirtualRowTransform.h | 3 +- .../Transforms/WatermarkTransform.cpp | 6 +- .../Transforms/WatermarkTransform.h | 4 +- src/Processors/Transforms/WindowTransform.cpp | 20 +- src/Processors/Transforms/WindowTransform.h | 4 +- .../Transforms/buildPushingToViewsChain.cpp | 1032 ----- .../Transforms/buildPushingToViewsChain.h | 81 - .../getSourceFromASTInsertQuery.cpp | 30 +- .../gtest_exception_on_incorrect_pipeline.cpp | 8 +- .../tests/gtest_full_sorting_join.cpp | 18 +- .../tests/gtest_write_parquet_page_index.cpp | 4 +- src/QueryPipeline/Chain.cpp | 28 +- src/QueryPipeline/Chain.h | 15 +- src/QueryPipeline/Pipe.cpp | 103 +- src/QueryPipeline/Pipe.h | 19 +- src/QueryPipeline/QueryPipeline.cpp | 44 +- src/QueryPipeline/QueryPipeline.h | 4 + src/QueryPipeline/QueryPipelineBuilder.cpp | 73 +- src/QueryPipeline/QueryPipelineBuilder.h | 18 +- src/QueryPipeline/QueryPlanResourceHolder.cpp | 2 +- src/QueryPipeline/QueryPlanResourceHolder.h | 5 +- src/QueryPipeline/RemoteInserter.cpp | 14 +- src/QueryPipeline/RemoteInserter.h | 13 + src/QueryPipeline/RemoteQueryExecutor.cpp | 112 +- src/QueryPipeline/RemoteQueryExecutor.h | 46 +- src/QueryPipeline/narrowPipe.cpp | 2 +- src/QueryPipeline/printPipeline.h | 35 +- .../gtest_blocks_size_merging_streams.cpp | 4 +- .../tests/gtest_check_sorted_stream.cpp | 12 +- .../tests/gtest_resize_transform.cpp | 123 + src/Server/ArrowFlightHandler.cpp | 577 +++ src/Server/ArrowFlightHandler.h | 108 + src/Server/ClientEmbedded/ClientEmbedded.cpp | 30 +- src/Server/ClientEmbedded/ClientEmbedded.h | 15 +- .../ClientEmbedded/ClientEmbeddedRunner.cpp | 2 +- src/Server/GRPCServer.cpp | 91 +- src/Server/GRPCServer.h | 15 +- src/Server/HTTP/HTMLForm.h | 7 + src/Server/HTTP/HTTPServerConnection.cpp | 66 +- src/Server/HTTP/HTTPServerRequest.cpp | 15 +- src/Server/HTTP/HTTPServerRequest.h | 42 +- src/Server/HTTP/HTTPServerResponse.cpp | 102 +- src/Server/HTTP/HTTPServerResponse.h | 25 +- .../WriteBufferFromHTTPServerResponse.cpp | 83 +- .../HTTP/WriteBufferFromHTTPServerResponse.h | 4 +- src/Server/HTTP/sendExceptionToHTTPClient.cpp | 16 +- src/Server/HTTPHandler.cpp | 344 +- src/Server/HTTPHandler.h | 39 +- src/Server/HTTPHandlerFactory.cpp | 157 +- src/Server/HTTPHandlerFactory.h | 12 +- src/Server/HTTPResponseHeaderWriter.cpp | 23 +- src/Server/HTTPResponseHeaderWriter.h | 12 + src/Server/IGRPCServer.h | 31 + src/Server/IndexRequestHandler.cpp | 42 + src/Server/IndexRequestHandler.h | 25 + src/Server/InterserverIOHTTPHandler.cpp | 6 +- src/Server/KeeperTCPHandler.cpp | 33 +- src/Server/KeeperTCPHandler.h | 4 +- src/Server/MySQLHandler.cpp | 32 +- src/Server/MySQLHandler.h | 9 +- src/Server/MySQLHandlerFactory.cpp | 8 +- src/Server/MySQLHandlerFactory.h | 4 +- src/Server/PostgreSQLHandler.cpp | 219 +- src/Server/PostgreSQLHandler.h | 10 +- src/Server/PostgreSQLHandlerFactory.cpp | 10 +- src/Server/PostgreSQLHandlerFactory.h | 3 + src/Server/PrometheusMetricsWriter.cpp | 2 +- src/Server/PrometheusRequestHandler.cpp | 32 +- src/Server/PrometheusRequestHandler.h | 4 +- .../PrometheusRequestHandlerFactory.cpp | 14 +- src/Server/PrometheusRequestHandlerFactory.h | 3 +- src/Server/ProtocolServerAdapter.cpp | 8 +- src/Server/ProtocolServerAdapter.h | 4 +- src/Server/ReplicasStatusHandler.cpp | 14 +- src/Server/ReplicasStatusHandler.h | 10 + src/Server/ServerType.cpp | 4 + src/Server/ServerType.h | 1 + src/Server/StaticRequestHandler.cpp | 18 +- src/Server/StaticRequestHandler.h | 6 +- src/Server/TCPHandler.cpp | 267 +- src/Server/TCPHandler.h | 53 +- src/Server/TCPHandlerFactory.h | 2 +- src/Server/WebUIRequestHandler.cpp | 23 +- src/Server/WebUIRequestHandler.h | 40 + src/Storages/AlterCommands.cpp | 60 +- src/Storages/AlterCommands.h | 9 +- src/Storages/ColumnsDescription.cpp | 30 +- src/Storages/ColumnsDescription.h | 2 +- .../DistributedAsyncInsertBatch.cpp | 7 +- .../DistributedAsyncInsertDirectoryQueue.cpp | 15 +- .../DistributedAsyncInsertHeader.cpp | 13 +- .../DistributedAsyncInsertHeader.h | 6 +- .../DistributedAsyncInsertHelpers.cpp | 6 +- .../DistributedAsyncInsertSource.cpp | 7 +- src/Storages/Distributed/DistributedSink.cpp | 7 +- src/Storages/FileLog/FileLogSource.cpp | 20 +- src/Storages/FileLog/FileLogSource.h | 2 +- src/Storages/FileLog/StorageFileLog.cpp | 19 +- src/Storages/FileLog/StorageFileLog.h | 2 +- src/Storages/Freeze.cpp | 19 +- src/Storages/Freeze.h | 2 +- src/Storages/Hive/HiveCommon.h | 13 +- src/Storages/Hive/HiveFile.cpp | 1 + src/Storages/Hive/StorageHive.cpp | 28 +- src/Storages/Hive/StorageHive.h | 2 +- src/Storages/HivePartitioningUtils.cpp | 273 ++ src/Storages/HivePartitioningUtils.h | 43 + src/Storages/IMessageProducer.cpp | 1 + src/Storages/IMessageProducer.h | 4 +- src/Storages/IPartitionStrategy.cpp | 377 ++ src/Storages/IPartitionStrategy.h | 128 + src/Storages/IStorage.cpp | 30 +- src/Storages/IStorage.h | 33 +- src/Storages/IStorageCluster.cpp | 30 +- src/Storages/IStorageCluster.h | 7 +- src/Storages/IndicesDescription.cpp | 64 +- src/Storages/IndicesDescription.h | 3 + src/Storages/KVStorageUtils.cpp | 245 +- src/Storages/KVStorageUtils.h | 6 +- .../Kafka/IKafkaExceptionInfoSink.cpp | 22 + src/Storages/Kafka/IKafkaExceptionInfoSink.h | 23 +- src/Storages/Kafka/KafkaConfigLoader.cpp | 5 +- src/Storages/Kafka/KafkaConsumer.cpp | 64 +- src/Storages/Kafka/KafkaConsumer.h | 48 +- src/Storages/Kafka/KafkaConsumer2.cpp | 302 +- src/Storages/Kafka/KafkaConsumer2.h | 89 +- src/Storages/Kafka/KafkaProducer.cpp | 8 +- src/Storages/Kafka/KafkaSettings.cpp | 2 +- src/Storages/Kafka/KafkaSettings.h | 1 - src/Storages/Kafka/KafkaSource.cpp | 128 +- src/Storages/Kafka/KeeperHandlingConsumer.cpp | 658 +++ src/Storages/Kafka/KeeperHandlingConsumer.h | 201 + src/Storages/Kafka/StorageKafka.cpp | 16 +- src/Storages/Kafka/StorageKafka.h | 3 +- src/Storages/Kafka/StorageKafka2.cpp | 606 ++- src/Storages/Kafka/StorageKafka2.h | 111 +- src/Storages/Kafka/StorageKafkaUtils.cpp | 94 +- src/Storages/Kafka/StorageKafkaUtils.h | 40 + src/Storages/LiveView/LiveViewEventsSource.h | 2 +- src/Storages/LiveView/LiveViewSink.h | 2 +- src/Storages/LiveView/LiveViewSource.h | 2 +- src/Storages/LiveView/StorageLiveView.cpp | 32 +- src/Storages/LiveView/StorageLiveView.h | 2 + src/Storages/MarkCache.cpp | 11 +- src/Storages/MarkCache.h | 34 +- src/Storages/MaterializedView/RefreshTask.cpp | 201 +- src/Storages/MaterializedView/RefreshTask.h | 1 + src/Storages/MergeTree/ActiveDataPartSet.cpp | 21 + src/Storages/MergeTree/ActiveDataPartSet.h | 7 +- src/Storages/MergeTree/AlterConversions.cpp | 110 +- src/Storages/MergeTree/AlterConversions.h | 22 +- src/Storages/MergeTree/AsyncBlockIDsCache.cpp | 1 + src/Storages/MergeTree/Backup.cpp | 2 +- src/Storages/MergeTree/BoolMask.cpp | 2 +- src/Storages/MergeTree/ColumnsSubstreams.cpp | 67 + src/Storages/MergeTree/ColumnsSubstreams.h | 11 + .../Compaction/CompactionStatistics.cpp | 15 +- .../Compaction/CompactionStatistics.h | 2 +- .../Compaction/ConstructFuturePart.cpp | 15 +- .../Compaction/ConstructFuturePart.h | 2 +- .../DistributedMergePredicate.cpp | 54 +- .../DistributedMergePredicate.h | 59 +- .../MergePredicates/IMergePredicate.h | 5 + .../MergeTreeMergePredicate.cpp | 64 +- .../MergePredicates/MergeTreeMergePredicate.h | 5 + .../ReplicatedMergeTreeMergePredicate.cpp | 53 +- .../ReplicatedMergeTreeMergePredicate.h | 4 +- .../Compaction/MergeSelectorApplier.cpp | 156 +- .../Compaction/MergeSelectorApplier.h | 25 +- .../MergeSelectors/AllMergeSelector.cpp | 11 +- .../MergeSelectors/AllMergeSelector.h | 6 +- .../MergeSelectors/DisjointPartsRangesSet.cpp | 127 + .../MergeSelectors/DisjointPartsRangesSet.h | 52 + .../MergeSelectors/IMergeSelector.h | 12 +- .../MergeSelectors/SimpleMergeSelector.cpp | 103 +- .../MergeSelectors/SimpleMergeSelector.h | 6 +- .../MergeSelectors/TTLMergeSelector.cpp | 129 +- .../MergeSelectors/TTLMergeSelector.h | 20 +- .../MergeSelectors/TrivialMergeSelector.cpp | 13 +- .../MergeSelectors/TrivialMergeSelector.h | 6 +- .../MergeTree/Compaction/PartProperties.cpp | 1 + .../MergeTree/Compaction/PartProperties.h | 10 +- .../Compaction/PartsCollectors/Common.h | 2 +- .../MergeTreePartsCollector.cpp | 8 +- .../ReplicatedMergeTreePartsCollector.cpp | 4 +- .../MergeTree/DataPartStorageOnDiskBase.cpp | 12 +- .../MergeTree/DataPartStorageOnDiskBase.h | 2 - .../MergeTree/DataPartStorageOnDiskFull.h | 2 +- src/Storages/MergeTree/DataPartsExchange.cpp | 33 +- .../MergeTree/EphemeralLockInZooKeeper.cpp | 14 +- .../MergeTree/EphemeralLockInZooKeeper.h | 14 +- .../MergeTree/FutureMergedMutatedPart.cpp | 19 +- .../MergeTree/FutureMergedMutatedPart.h | 17 +- src/Storages/MergeTree/GinIndexStore.cpp | 798 +++- src/Storages/MergeTree/GinIndexStore.h | 258 +- src/Storages/MergeTree/IDataPartStorage.h | 4 - src/Storages/MergeTree/IMergeTreeDataPart.cpp | 278 +- src/Storages/MergeTree/IMergeTreeDataPart.h | 56 +- .../IMergeTreeDataPartInfoForReader.h | 40 +- src/Storages/MergeTree/IMergeTreeReader.cpp | 9 +- src/Storages/MergeTree/IMergeTreeReader.h | 1 + src/Storages/MergeTree/InsertBlockInfo.cpp | 15 +- src/Storages/MergeTree/InsertBlockInfo.h | 1 + src/Storages/MergeTree/KeyCondition.cpp | 456 +- src/Storages/MergeTree/KeyCondition.h | 75 +- .../LoadedMergeTreeDataPartInfoForReader.h | 31 + src/Storages/MergeTree/MarkRange.cpp | 13 +- src/Storages/MergeTree/MarkRange.h | 16 +- .../MergeTree/MergeFromLogEntryTask.cpp | 40 +- .../MergeTree/MergeFromLogEntryTask.h | 4 + src/Storages/MergeTree/MergeList.cpp | 2 +- .../MergeTree/MergePlainMergeTreeTask.cpp | 4 + .../MergeTree/MergeProjectionPartsTask.cpp | 2 +- src/Storages/MergeTree/MergeTask.cpp | 332 +- src/Storages/MergeTree/MergeTask.h | 6 +- .../MergeTree/MergeTreeBackgroundExecutor.cpp | 72 +- .../MergeTree/MergeTreeBackgroundExecutor.h | 16 +- .../MergeTree/MergeTreeBlockReadUtils.cpp | 81 +- .../MergeTree/MergeTreeBlockReadUtils.h | 16 + .../MergeTree/MergeTreeCommittingBlock.cpp | 85 + .../MergeTree/MergeTreeCommittingBlock.h | 52 + src/Storages/MergeTree/MergeTreeData.cpp | 974 +++- src/Storages/MergeTree/MergeTreeData.h | 267 +- .../MergeTree/MergeTreeDataMergerMutator.cpp | 132 +- .../MergeTree/MergeTreeDataMergerMutator.h | 6 +- .../MergeTree/MergeTreeDataPartChecksum.cpp | 8 +- .../MergeTree/MergeTreeDataPartChecksum.h | 2 +- .../MergeTree/MergeTreeDataPartCompact.cpp | 5 +- .../MergeTree/MergeTreeDataPartCompact.h | 2 +- .../MergeTree/MergeTreeDataPartWide.cpp | 58 +- .../MergeTree/MergeTreeDataPartWide.h | 6 +- .../MergeTreeDataPartWriterCompact.cpp | 53 +- .../MergeTreeDataPartWriterCompact.h | 2 +- .../MergeTreeDataPartWriterOnDisk.cpp | 28 +- .../MergeTree/MergeTreeDataPartWriterOnDisk.h | 3 +- .../MergeTree/MergeTreeDataPartWriterWide.cpp | 145 +- .../MergeTree/MergeTreeDataPartWriterWide.h | 8 +- .../MergeTree/MergeTreeDataSelectExecutor.cpp | 306 +- .../MergeTree/MergeTreeDataSelectExecutor.h | 10 +- .../MergeTree/MergeTreeDataWriter.cpp | 89 +- src/Storages/MergeTree/MergeTreeDataWriter.h | 15 + .../MergeTree/MergeTreeIOSettings.cpp | 51 +- src/Storages/MergeTree/MergeTreeIOSettings.h | 15 +- .../MergeTree/MergeTreeIndexBloomFilter.cpp | 100 +- .../MergeTreeIndexBloomFilterText.cpp | 103 +- src/Storages/MergeTree/MergeTreeIndexGin.cpp | 656 +-- src/Storages/MergeTree/MergeTreeIndexGin.h | 47 +- .../MergeTree/MergeTreeIndexMinMax.cpp | 13 +- src/Storages/MergeTree/MergeTreeIndexReader.h | 2 + src/Storages/MergeTree/MergeTreeIndexSet.cpp | 29 +- .../MergeTreeIndexVectorSimilarity.cpp | 68 +- .../MergeTreeIndexVectorSimilarity.h | 5 +- src/Storages/MergeTree/MergeTreeIndices.cpp | 18 +- src/Storages/MergeTree/MergeTreeIndices.h | 21 +- .../MergeTree/MergeTreeLazilyReader.cpp | 9 +- .../MergeTree/MergeTreeLazilyReader.h | 2 +- .../MergeTree/MergeTreeMarksLoader.cpp | 1 + src/Storages/MergeTree/MergeTreePartInfo.cpp | 5 + src/Storages/MergeTree/MergeTreePartInfo.h | 17 +- src/Storages/MergeTree/MergeTreePartition.cpp | 23 +- .../MergeTree/MergeTreePartsMover.cpp | 2 +- .../MergeTree/MergeTreePrefetchedReadPool.cpp | 37 +- .../MergeTree/MergeTreePrefetchedReadPool.h | 6 +- .../MergeTree/MergeTreeRangeReader.cpp | 340 +- src/Storages/MergeTree/MergeTreeRangeReader.h | 89 +- src/Storages/MergeTree/MergeTreeReadPool.cpp | 6 +- .../MergeTree/MergeTreeReadPoolBase.cpp | 98 +- .../MergeTree/MergeTreeReadPoolBase.h | 15 +- .../MergeTreeReadPoolParallelReplicas.cpp | 35 +- ...rgeTreeReadPoolParallelReplicasInOrder.cpp | 44 +- ...MergeTreeReadPoolParallelReplicasInOrder.h | 1 + src/Storages/MergeTree/MergeTreeReadTask.cpp | 78 +- src/Storages/MergeTree/MergeTreeReadTask.h | 26 +- .../MergeTree/MergeTreeReaderCompact.cpp | 203 +- .../MergeTree/MergeTreeReaderCompact.h | 24 +- .../MergeTreeReaderCompactSingleBuffer.cpp | 42 +- .../MergeTreeReaderCompactSingleBuffer.h | 1 + .../MergeTree/MergeTreeReaderStream.cpp | 4 + .../MergeTree/MergeTreeReaderStream.h | 2 + .../MergeTree/MergeTreeReaderWide.cpp | 18 +- .../MergeTree/MergeTreeReadersChain.cpp | 294 +- .../MergeTree/MergeTreeReadersChain.h | 37 +- .../MergeTree/MergeTreeSelectProcessor.cpp | 21 +- .../MergeTree/MergeTreeSelectProcessor.h | 5 +- .../MergeTree/MergeTreeSequentialSource.cpp | 92 +- src/Storages/MergeTree/MergeTreeSettings.cpp | 145 +- src/Storages/MergeTree/MergeTreeSettings.h | 8 +- src/Storages/MergeTree/MergeTreeSink.cpp | 8 +- src/Storages/MergeTree/MergeTreeSink.h | 1 - src/Storages/MergeTree/MergeTreeSinkPatch.cpp | 65 + src/Storages/MergeTree/MergeTreeSinkPatch.h | 28 + src/Storages/MergeTree/MergeTreeSource.cpp | 2 +- .../MergeTreeSplitPrewhereIntoReadSteps.cpp | 1 + .../MergeTree/MergeTreeVirtualColumns.cpp | 8 +- .../MergeTree/MergeTreeVirtualColumns.h | 6 + .../MergeTree/MergeTreeWhereOptimizer.cpp | 29 +- .../MergeTree/MergedBlockOutputStream.cpp | 45 +- .../MergeTree/MergedBlockOutputStream.h | 7 +- .../MergedColumnOnlyOutputStream.cpp | 1 + .../MergeTree/MergedColumnOnlyOutputStream.h | 2 + src/Storages/MergeTree/MergedPartOffsets.h | 37 +- .../MergeTree/MutateFromLogEntryTask.cpp | 7 + .../MergeTree/MutateFromLogEntryTask.h | 3 + .../MergeTree/MutatePlainMergeTreeTask.cpp | 4 + src/Storages/MergeTree/MutateTask.cpp | 278 +- src/Storages/MergeTree/MutateTask.h | 2 + .../ParallelReplicasReadingCoordinator.cpp | 245 +- .../ParallelReplicasReadingCoordinator.h | 6 + .../PartMovesBetweenShardsOrchestrator.cpp | 1 + .../PatchParts/MergeTreePatchReader.cpp | 255 ++ .../PatchParts/MergeTreePatchReader.h | 91 + .../MergeTree/PatchParts/PatchJoinCache.cpp | 319 ++ .../MergeTree/PatchParts/PatchJoinCache.h | 91 + .../MergeTree/PatchParts/PatchPartInfo.cpp | 29 + .../MergeTree/PatchParts/PatchPartInfo.h | 96 + .../MergeTree/PatchParts/PatchPartsLock.cpp | 344 ++ .../MergeTree/PatchParts/PatchPartsLock.h | 99 + .../MergeTree/PatchParts/PatchPartsUtils.cpp | 388 ++ .../MergeTree/PatchParts/PatchPartsUtils.h | 75 + .../PatchParts/RangesInPatchParts.cpp | 342 ++ .../MergeTree/PatchParts/RangesInPatchParts.h | 49 + .../PatchParts/SourcePartsSetForPatch.cpp | 201 + .../PatchParts/SourcePartsSetForPatch.h | 58 + .../MergeTree/PatchParts/applyPatches.cpp | 539 +++ .../MergeTree/PatchParts/applyPatches.h | 71 + src/Storages/MergeTree/PinnedPartUUIDs.cpp | 2 +- src/Storages/MergeTree/PrimaryIndexCache.cpp | 12 + src/Storages/MergeTree/PrimaryIndexCache.h | 5 +- src/Storages/MergeTree/RPNBuilder.h | 12 +- src/Storages/MergeTree/RangesInDataPart.cpp | 50 +- src/Storages/MergeTree/RangesInDataPart.h | 28 +- .../MergeTree/ReplicatedMergeTreeAddress.cpp | 2 +- .../ReplicatedMergeTreeAttachThread.cpp | 16 + .../ReplicatedMergeTreeCleanupThread.cpp | 1 + .../MergeTree/ReplicatedMergeTreeLogEntry.cpp | 29 +- .../MergeTree/ReplicatedMergeTreeLogEntry.h | 1 + .../MergeTree/ReplicatedMergeTreeQueue.cpp | 233 +- .../MergeTree/ReplicatedMergeTreeQueue.h | 30 +- .../ReplicatedMergeTreeRestartingThread.cpp | 2 +- .../MergeTree/ReplicatedMergeTreeSink.cpp | 10 +- .../ReplicatedMergeTreeSinkPatch.cpp | 90 + .../MergeTree/ReplicatedMergeTreeSinkPatch.h | 27 + src/Storages/MergeTree/RequestResponse.cpp | 16 +- src/Storages/MergeTree/RequestResponse.h | 4 +- .../StorageFromMergeTreeProjection.cpp | 16 +- .../MergeTree/VectorSimilarityIndexCache.h | 21 +- src/Storages/MergeTree/ZeroCopyLock.cpp | 2 +- src/Storages/MergeTree/checkDataPart.cpp | 2 +- .../MergeTree/registerStorageMergeTree.cpp | 25 +- .../MergeTree/tests/gtest_async_inserts.cpp | 2 +- .../MergeTree/tests/gtest_executor.cpp | 6 +- src/Storages/MessageQueueSink.cpp | 2 +- src/Storages/MessageQueueSink.h | 4 +- src/Storages/MutationCommands.cpp | 26 +- src/Storages/MutationCommands.h | 15 +- src/Storages/MySQL/MySQLHelpers.cpp | 2 +- src/Storages/NATS/NATSConnection.cpp | 2 +- src/Storages/NATS/NATSConsumer.cpp | 2 +- src/Storages/NATS/NATSHandler.cpp | 1 - src/Storages/NATS/NATSSource.cpp | 10 +- src/Storages/NATS/StorageNATS.cpp | 21 +- src/Storages/NATS/StorageNATS.h | 2 +- src/Storages/NamedCollectionsHelpers.cpp | 3 +- src/Storages/NamedCollectionsHelpers.h | 1 + .../ObjectStorage/Azure/Configuration.cpp | 318 +- .../ObjectStorage/Azure/Configuration.h | 37 +- .../ObjectStorage/DataLakes/Common.cpp | 6 +- src/Storages/ObjectStorage/DataLakes/Common.h | 2 +- .../DataLakes/DataLakeConfiguration.h | 301 +- .../DataLakes/DataLakeObjectMetadata.h | 13 + .../DataLakes/DataLakeStorageSettings.cpp | 88 + .../DataLakes/DataLakeStorageSettings.h | 119 + .../DeltaLake/DeltaLakePartitionedSink.cpp | 212 + .../DeltaLake/DeltaLakePartitionedSink.h | 76 + .../DataLakes/DeltaLake/DeltaLakeSink.cpp | 69 + .../DataLakes/DeltaLake/DeltaLakeSink.h | 50 + .../DataLakes/DeltaLake/EnginePredicate.cpp | 447 ++ .../DataLakes/DeltaLake/EnginePredicate.h | 62 + .../DataLakes/DeltaLake/ExpressionVisitor.cpp | 847 ++++ .../DataLakes/DeltaLake/ExpressionVisitor.h | 43 + .../DataLakes/DeltaLake/KernelHelper.cpp | 63 +- .../DataLakes/DeltaLake/KernelHelper.h | 2 +- .../DeltaLake/KernelPointerWrapper.h | 7 + .../DataLakes/DeltaLake/KernelUtils.cpp | 142 +- .../DataLakes/DeltaLake/KernelUtils.h | 5 + .../ObjectInfoWithPartitionColumns.h | 35 - .../DataLakes/DeltaLake/PartitionPruner.cpp | 34 +- .../DataLakes/DeltaLake/PartitionPruner.h | 10 +- .../DataLakes/DeltaLake/TableSnapshot.cpp | 431 +- .../DataLakes/DeltaLake/TableSnapshot.h | 39 +- .../DataLakes/DeltaLake/WriteTransaction.cpp | 258 ++ .../DataLakes/DeltaLake/WriteTransaction.h | 58 + .../DeltaLake/getSchemaFromSnapshot.cpp | 41 +- .../DeltaLake/getSchemaFromSnapshot.h | 5 +- .../DataLakes/DeltaLakeMetadata.cpp | 78 +- .../DataLakes/DeltaLakeMetadata.h | 57 +- .../DeltaLakeMetadataDeltaKernel.cpp | 176 +- .../DataLakes/DeltaLakeMetadataDeltaKernel.h | 49 +- .../ObjectStorage/DataLakes/HudiMetadata.cpp | 5 +- .../ObjectStorage/DataLakes/HudiMetadata.h | 23 +- .../DataLakes/IDataLakeMetadata.cpp | 30 +- .../DataLakes/IDataLakeMetadata.h | 83 +- .../Iceberg/AvroForIcebergDeserializer.cpp | 57 +- .../Iceberg/AvroForIcebergDeserializer.h | 5 +- .../DataLakes/Iceberg/AvroSchema.h | 556 +++ .../DataLakes/Iceberg/Compaction.cpp | 530 +++ .../DataLakes/Iceberg/Compaction.h | 25 + .../ComplexTypeSchemaProcessorFunctions.cpp | 871 ++++ .../ComplexTypeSchemaProcessorFunctions.h | 176 + .../DataLakes/Iceberg/Constant.h | 99 +- .../Iceberg/IcebergDataObjectInfo.cpp | 73 + .../DataLakes/Iceberg/IcebergDataObjectInfo.h | 52 + .../DataLakes/Iceberg/IcebergIterator.cpp | 339 ++ .../DataLakes/Iceberg/IcebergIterator.h | 116 + .../DataLakes/Iceberg/IcebergMetadata.cpp | 1097 ++--- .../DataLakes/Iceberg/IcebergMetadata.h | 155 +- .../Iceberg/IcebergMetadataFilesCache.h | 23 +- .../DataLakes/Iceberg/IcebergWrites.cpp | 1450 ++++++ .../DataLakes/Iceberg/IcebergWrites.h | 254 ++ .../DataLakes/Iceberg/ManifestFile.cpp | 352 +- .../DataLakes/Iceberg/ManifestFile.h | 81 +- .../Iceberg/ManifestFilesPruning.cpp | 124 +- .../DataLakes/Iceberg/ManifestFilesPruning.h | 17 +- .../DataLakes/Iceberg/Mutations.cpp | 487 ++ .../DataLakes/Iceberg/Mutations.h | 39 + .../Iceberg/PersistentTableComponents.h | 21 + .../DataLakes/Iceberg/PositionDeleteObject.h | 20 + .../Iceberg/PositionDeleteTransform.cpp | 275 ++ .../Iceberg/PositionDeleteTransform.h | 124 + .../DataLakes/Iceberg/SchemaProcessor.cpp | 303 +- .../DataLakes/Iceberg/SchemaProcessor.h | 28 +- .../DataLakes/Iceberg/Snapshot.h | 38 +- .../Iceberg/StatelessMetadataFileGetter.cpp | 256 ++ .../Iceberg/StatelessMetadataFileGetter.h | 49 + .../ObjectStorage/DataLakes/Iceberg/Utils.cpp | 695 ++- .../ObjectStorage/DataLakes/Iceberg/Utils.h | 63 +- .../HDFS/AsynchronousReadBufferFromHDFS.cpp | 5 +- .../HDFS/AsynchronousReadBufferFromHDFS.h | 3 +- .../ObjectStorage/HDFS/Configuration.cpp | 33 +- .../ObjectStorage/HDFS/Configuration.h | 28 +- .../ObjectStorage/HDFS/HDFSCommon.cpp | 2 +- src/Storages/ObjectStorage/HDFS/HDFSCommon.h | 1 - .../ObjectStorage/HDFS/HDFSErrorWrapper.cpp | 2 +- .../ObjectStorage/HDFS/HDFSErrorWrapper.h | 2 +- .../ObjectStorage/HDFS/ReadBufferFromHDFS.cpp | 19 +- .../ObjectStorage/HDFS/ReadBufferFromHDFS.h | 12 +- .../HDFS/WriteBufferFromHDFS.cpp | 14 +- .../ObjectStorage/IObjectIterator.cpp | 66 + src/Storages/ObjectStorage/IObjectIterator.h | 26 + .../ObjectStorage/Local/Configuration.cpp | 6 +- .../ObjectStorage/Local/Configuration.h | 14 +- .../ObjectStorage/ReadBufferIterator.cpp | 14 +- .../ObjectStorage/ReadBufferIterator.h | 7 +- .../ObjectStorage/S3/Configuration.cpp | 506 ++- src/Storages/ObjectStorage/S3/Configuration.h | 35 +- .../ObjectStorage/StorageObjectStorage.cpp | 593 ++- .../ObjectStorage/StorageObjectStorage.h | 226 +- .../StorageObjectStorageCluster.cpp | 109 +- .../StorageObjectStorageCluster.h | 20 +- .../StorageObjectStorageConfiguration.cpp | 215 + .../StorageObjectStorageConfiguration.h | 260 ++ .../StorageObjectStorageDefinitions.h | 165 + .../StorageObjectStorageSettings.h | 30 - .../StorageObjectStorageSink.cpp | 98 +- .../ObjectStorage/StorageObjectStorageSink.h | 34 +- .../StorageObjectStorageSource.cpp | 509 ++- .../StorageObjectStorageSource.h | 75 +- ...rageObjectStorageStableTaskDistributor.cpp | 105 +- ...torageObjectStorageStableTaskDistributor.h | 20 +- src/Storages/ObjectStorage/Utils.cpp | 69 +- src/Storages/ObjectStorage/Utils.h | 18 +- .../registerStorageObjectStorage.cpp | 163 +- .../tests/gtest_rendezvous_hashing.cpp | 233 + .../ObjectStorageQueueIFileMetadata.cpp | 17 +- .../ObjectStorageQueueIFileMetadata.h | 7 + .../ObjectStorageQueueMetadata.cpp | 167 +- .../ObjectStorageQueueMetadata.h | 31 +- .../ObjectStorageQueueMetadataFactory.cpp | 155 +- .../ObjectStorageQueueMetadataFactory.h | 52 +- .../ObjectStorageQueueOrderedFileMetadata.cpp | 56 +- .../ObjectStorageQueueOrderedFileMetadata.h | 1 + .../ObjectStorageQueueSettings.cpp | 42 +- .../ObjectStorageQueueSettings.h | 1 - .../ObjectStorageQueueSource.cpp | 109 +- .../ObjectStorageQueueSource.h | 27 +- .../ObjectStorageQueueTableMetadata.cpp | 10 +- ...bjectStorageQueueUnorderedFileMetadata.cpp | 22 +- .../ObjectStorageQueueUnorderedFileMetadata.h | 3 +- .../StorageObjectStorageQueue.cpp | 480 +- .../StorageObjectStorageQueue.h | 36 +- .../registerQueueStorage.cpp | 53 +- src/Storages/PartitionCommands.cpp | 2 +- src/Storages/PartitionedSink.cpp | 44 +- src/Storages/PartitionedSink.h | 14 +- .../MaterializedPostgreSQLConsumer.cpp | 6 +- .../PostgreSQLReplicationHandler.cpp | 2 +- .../PostgreSQL/PostgreSQLReplicationHandler.h | 2 +- .../StorageMaterializedPostgreSQL.cpp | 3 +- .../StorageMaterializedPostgreSQL.h | 2 +- src/Storages/ProjectionsDescription.cpp | 67 +- src/Storages/ProjectionsDescription.h | 4 +- src/Storages/RabbitMQ/RabbitMQConnection.cpp | 2 +- src/Storages/RabbitMQ/RabbitMQConsumer.cpp | 2 +- src/Storages/RabbitMQ/RabbitMQSettings.cpp | 2 +- src/Storages/RabbitMQ/RabbitMQSource.cpp | 109 +- src/Storages/RabbitMQ/StorageRabbitMQ.cpp | 8 +- src/Storages/RabbitMQ/StorageRabbitMQ.h | 2 +- .../ReadFinalForExternalReplicaStorage.cpp | 2 +- src/Storages/RedisCommon.cpp | 2 +- .../RocksDB/EmbeddedRocksDBBulkSink.cpp | 5 +- src/Storages/RocksDB/EmbeddedRocksDBSink.cpp | 2 +- .../RocksDB/StorageEmbeddedRocksDB.cpp | 49 +- src/Storages/RocksDB/StorageSystemRocksDB.cpp | 3 + src/Storages/SelectQueryInfo.cpp | 47 + src/Storages/SelectQueryInfo.h | 27 +- .../ConditionSelectivityEstimator.cpp | 445 +- .../ConditionSelectivityEstimator.h | 85 +- src/Storages/Statistics/Statistics.cpp | 97 +- src/Storages/Statistics/Statistics.h | 22 +- .../Statistics/StatisticsCountMinSketch.cpp | 6 + .../Statistics/StatisticsCountMinSketch.h | 1 + src/Storages/Statistics/StatisticsMinMax.cpp | 28 +- src/Storages/Statistics/StatisticsMinMax.h | 1 + src/Storages/Statistics/StatisticsTDigest.cpp | 6 + src/Storages/Statistics/StatisticsTDigest.h | 1 + src/Storages/Statistics/StatisticsUniq.cpp | 31 +- src/Storages/Statistics/StatisticsUniq.h | 1 + src/Storages/Statistics/tests/gtest_stats.cpp | 105 +- src/Storages/StorageArrowFlight.cpp | 294 ++ src/Storages/StorageArrowFlight.h | 64 + src/Storages/StorageBuffer.cpp | 28 +- src/Storages/StorageDistributed.cpp | 207 +- src/Storages/StorageDistributed.h | 3 + src/Storages/StorageDummy.cpp | 4 +- src/Storages/StorageExecutable.cpp | 2 +- src/Storages/StorageFactory.cpp | 4 +- src/Storages/StorageFactory.h | 6 +- src/Storages/StorageFile.cpp | 201 +- src/Storages/StorageFile.h | 35 +- src/Storages/StorageFileCluster.cpp | 39 +- src/Storages/StorageFileCluster.h | 8 +- src/Storages/StorageFuzzJSON.cpp | 16 +- src/Storages/StorageFuzzQuery.cpp | 5 +- src/Storages/StorageFuzzQuery.h | 10 +- src/Storages/StorageGenerateRandom.cpp | 10 +- src/Storages/StorageInMemoryMetadata.cpp | 19 +- src/Storages/StorageInMemoryMetadata.h | 10 + src/Storages/StorageInput.cpp | 14 +- src/Storages/StorageInput.h | 1 + src/Storages/StorageJoin.cpp | 32 +- src/Storages/StorageKeeperMap.cpp | 304 +- src/Storages/StorageKeeperMap.h | 15 +- src/Storages/StorageLog.cpp | 10 +- src/Storages/StorageLogSettings.cpp | 2 +- src/Storages/StorageLoop.cpp | 8 +- src/Storages/StorageLoop.h | 3 + src/Storages/StorageMaterializedView.cpp | 38 +- src/Storages/StorageMaterializedView.h | 8 + src/Storages/StorageMemory.cpp | 53 +- src/Storages/StorageMerge.cpp | 103 +- src/Storages/StorageMerge.h | 9 +- src/Storages/StorageMergeTree.cpp | 280 +- src/Storages/StorageMergeTree.h | 42 +- src/Storages/StorageMergeTreeIndex.cpp | 78 +- src/Storages/StorageMergeTreeIndex.h | 7 +- src/Storages/StorageMongoDB.cpp | 69 +- src/Storages/StorageMongoDB.h | 9 +- src/Storages/StorageMySQL.cpp | 7 +- src/Storages/StorageNull.h | 4 +- src/Storages/StoragePostgreSQL.cpp | 10 +- src/Storages/StoragePostgreSQL.h | 2 +- src/Storages/StoragePrometheusQuery.cpp | 76 + src/Storages/StoragePrometheusQuery.h | 45 + src/Storages/StorageProxy.h | 2 +- src/Storages/StorageRedis.cpp | 168 +- src/Storages/StorageRedis.h | 7 +- src/Storages/StorageReplicatedMergeTree.cpp | 728 +-- src/Storages/StorageReplicatedMergeTree.h | 49 +- src/Storages/StorageSQLite.cpp | 7 +- src/Storages/StorageSet.cpp | 6 +- src/Storages/StorageSnapshot.cpp | 40 +- src/Storages/StorageStripeLog.cpp | 14 +- src/Storages/StorageTableFunction.h | 6 +- src/Storages/StorageTimeSeriesSelector.cpp | 332 ++ src/Storages/StorageTimeSeriesSelector.h | 41 + src/Storages/StorageURL.cpp | 227 +- src/Storages/StorageURL.h | 50 +- src/Storages/StorageURLCluster.cpp | 35 +- src/Storages/StorageURLCluster.h | 8 +- src/Storages/StorageValues.cpp | 9 +- src/Storages/StorageValues.h | 2 +- src/Storages/StorageView.cpp | 41 +- src/Storages/StorageView.h | 3 + src/Storages/StorageXDBC.cpp | 69 +- src/Storages/System/CMakeLists.txt | 4 +- .../System/IStorageSystemOneBlock.cpp | 8 +- .../System/StorageSystemAsyncLoader.cpp | 2 +- .../StorageSystemAsynchronousInserts.cpp | 2 +- src/Storages/System/StorageSystemBackups.cpp | 2 +- .../System/StorageSystemBuildOptions.cpp.in | 3 - src/Storages/System/StorageSystemClusters.cpp | 18 +- src/Storages/System/StorageSystemCodecs.cpp | 33 + src/Storages/System/StorageSystemCodecs.h | 22 + src/Storages/System/StorageSystemColumns.cpp | 35 +- .../System/StorageSystemCompletions.cpp | 317 ++ .../System/StorageSystemCompletions.h | 27 + .../StorageSystemContributors.generated.cpp | 111 + .../System/StorageSystemDDLWorkerQueue.cpp | 30 +- src/Storages/System/StorageSystemDNSCache.cpp | 2 +- .../System/StorageSystemDashboards.cpp | 1074 ++++- .../StorageSystemDataSkippingIndices.cpp | 4 +- .../System/StorageSystemDetachedParts.cpp | 4 +- .../System/StorageSystemDetachedTables.cpp | 6 +- .../System/StorageSystemDictionaries.cpp | 17 +- .../StorageSystemDimensionalMetrics.cpp | 52 + ...ts.h => StorageSystemDimensionalMetrics.h} | 24 +- src/Storages/System/StorageSystemDisks.cpp | 2 +- src/Storages/System/StorageSystemErrors.cpp | 18 +- .../System/StorageSystemFilesystemCache.cpp | 3 + src/Storages/System/StorageSystemFormats.cpp | 25 +- .../System/StorageSystemFunctions.cpp | 25 +- src/Storages/System/StorageSystemGrants.cpp | 13 +- .../System/StorageSystemIcebergHistory.cpp | 57 +- src/Storages/System/StorageSystemJemalloc.cpp | 2 +- .../System/StorageSystemKafkaConsumers.cpp | 94 +- .../System/StorageSystemLatencyBuckets.cpp | 34 - src/Storages/System/StorageSystemLicenses.sh | 2 +- .../System/StorageSystemMergeTreeSettings.cpp | 6 +- .../System/StorageSystemNamedCollections.cpp | 2 +- .../StorageSystemObjectStorageQueue.cpp | 2 +- src/Storages/System/StorageSystemOne.cpp | 2 +- .../StorageSystemPartMovesBetweenShards.cpp | 1 + .../System/StorageSystemPartsBase.cpp | 16 +- .../System/StorageSystemPartsColumns.cpp | 28 +- .../System/StorageSystemPrivileges.cpp | 2 + .../System/StorageSystemProjectionParts.cpp | 2 +- .../StorageSystemProjectionPartsColumns.cpp | 2 +- .../System/StorageSystemProjections.cpp | 4 +- .../StorageSystemQueryConditionCache.cpp | 2 +- .../System/StorageSystemQueryResultCache.cpp | 4 +- .../System/StorageSystemRemoteDataPaths.cpp | 12 +- src/Storages/System/StorageSystemReplicas.cpp | 92 +- .../System/StorageSystemReplicationQueue.cpp | 1 + .../System/StorageSystemResources.cpp | 6 +- src/Storages/System/StorageSystemSettings.cpp | 15 +- .../System/StorageSystemStackTrace.cpp | 27 +- .../System/StorageSystemStoragePolicies.cpp | 2 +- src/Storages/System/StorageSystemSymbols.cpp | 6 +- src/Storages/System/StorageSystemTables.cpp | 28 +- src/Storages/System/StorageSystemWarnings.cpp | 6 + src/Storages/System/StorageSystemWarnings.h | 2 + src/Storages/System/StorageSystemZeros.cpp | 4 +- .../System/StorageSystemZooKeeper.cpp | 126 +- .../StorageSystemZooKeeperConnection.cpp | 26 +- src/Storages/System/attachSystemTables.cpp | 14 +- src/Storages/TTLDescription.cpp | 20 +- .../PrometheusQueryEvaluationRange.h | 19 + .../TimeSeries/PrometheusQueryToSQL.cpp | 1062 +++++ .../TimeSeries/PrometheusQueryToSQL.h | 56 + .../PrometheusRemoteReadProtocol.cpp | 30 +- .../PrometheusRemoteWriteProtocol.cpp | 10 +- .../TimeSeries/TimeSeriesColumnNames.h | 6 + src/Storages/VirtualColumnUtils.cpp | 157 +- src/Storages/VirtualColumnUtils.h | 21 +- src/Storages/WindowView/StorageWindowView.cpp | 62 +- src/Storages/WindowView/StorageWindowView.h | 2 +- src/Storages/WindowView/WindowViewSource.h | 8 +- src/Storages/YTsaurus/StorageYTsaurus.cpp | 119 + src/Storages/YTsaurus/StorageYTsaurus.h | 60 + src/Storages/YTsaurus/YTsaurusSettings.cpp | 120 + src/Storages/YTsaurus/YTsaurusSettings.h | 48 + src/Storages/buildQueryTreeForShard.cpp | 69 +- src/Storages/checkAndGetLiteralArgument.cpp | 27 + src/Storages/checkAndGetLiteralArgument.h | 3 + src/Storages/examples/merge_selector.cpp | 8 +- src/Storages/examples/merge_selector2.cpp | 6 +- src/Storages/getStructureOfRemoteTable.cpp | 36 +- src/Storages/prepareReadingFromFormat.cpp | 281 +- src/Storages/prepareReadingFromFormat.h | 49 +- src/Storages/registerStorages.cpp | 12 + ...or.cpp => gtest_DefaultTokenExtractor.cpp} | 30 +- .../tests/gtest_azure_configuration.cpp | 260 ++ src/Storages/tests/gtest_delta_kernel.cpp | 71 + ....cpp => gtest_hive_partitioning_utils.cpp} | 26 +- ..._transform_query_for_external_database.cpp | 1 + .../transformQueryForExternalDatabase.cpp | 1 - ...nsformQueryForExternalDatabaseAnalyzer.cpp | 11 +- src/TableFunctions/Hive/TableFunctionHive.cpp | 6 +- src/TableFunctions/ITableFunction.cpp | 31 +- src/TableFunctions/ITableFunction.h | 23 +- src/TableFunctions/ITableFunctionCluster.h | 1 + src/TableFunctions/ITableFunctionXDBC.cpp | 81 +- .../TableFunctionArrowFlight.cpp | 120 + src/TableFunctions/TableFunctionArrowFlight.h | 37 + src/TableFunctions/TableFunctionDictionary.h | 2 +- .../TableFunctionExecutable.cpp | 5 +- src/TableFunctions/TableFunctionExplain.cpp | 5 +- src/TableFunctions/TableFunctionFile.cpp | 20 +- src/TableFunctions/TableFunctionFile.h | 2 +- .../TableFunctionFileCluster.cpp | 2 +- src/TableFunctions/TableFunctionFileCluster.h | 3 +- src/TableFunctions/TableFunctionFormat.cpp | 7 +- src/TableFunctions/TableFunctionFuzzJSON.cpp | 2 +- src/TableFunctions/TableFunctionFuzzJSON.h | 2 +- src/TableFunctions/TableFunctionFuzzQuery.cpp | 2 +- src/TableFunctions/TableFunctionFuzzQuery.h | 2 +- .../TableFunctionGenerateRandom.cpp | 4 +- .../TableFunctionGenerateSeries.cpp | 4 +- src/TableFunctions/TableFunctionInput.cpp | 4 +- src/TableFunctions/TableFunctionLoop.cpp | 4 +- src/TableFunctions/TableFunctionMerge.cpp | 13 +- .../TableFunctionMergeTreeIndex.cpp | 56 +- src/TableFunctions/TableFunctionMongoDB.cpp | 2 +- src/TableFunctions/TableFunctionMySQL.cpp | 4 +- src/TableFunctions/TableFunctionNull.cpp | 4 +- src/TableFunctions/TableFunctionNumbers.cpp | 6 +- .../TableFunctionObjectStorage.cpp | 141 +- .../TableFunctionObjectStorage.h | 158 +- .../TableFunctionObjectStorageCluster.cpp | 37 +- .../TableFunctionObjectStorageCluster.h | 72 +- .../TableFunctionPostgreSQL.cpp | 5 +- .../TableFunctionProjection.cpp | 2 +- .../TableFunctionPrometheusQuery.cpp | 145 + .../TableFunctionPrometheusQuery.h | 47 + src/TableFunctions/TableFunctionRedis.cpp | 2 +- src/TableFunctions/TableFunctionRemote.cpp | 13 +- src/TableFunctions/TableFunctionRemote.h | 2 +- src/TableFunctions/TableFunctionSQLite.cpp | 4 +- .../TableFunctionTimeSeries.cpp | 22 +- src/TableFunctions/TableFunctionTimeSeries.h | 2 +- .../TableFunctionTimeSeriesSelector.cpp | 115 + .../TableFunctionTimeSeriesSelector.h | 42 + src/TableFunctions/TableFunctionURL.cpp | 47 +- src/TableFunctions/TableFunctionURL.h | 3 +- .../TableFunctionURLCluster.cpp | 4 +- src/TableFunctions/TableFunctionURLCluster.h | 3 +- src/TableFunctions/TableFunctionValues.cpp | 4 +- src/TableFunctions/TableFunctionView.cpp | 7 +- src/TableFunctions/TableFunctionView.h | 2 +- .../TableFunctionViewIfPermitted.cpp | 9 +- src/TableFunctions/TableFunctionYtsaurus.cpp | 140 + src/TableFunctions/TableFunctionZeros.cpp | 4 +- src/TableFunctions/registerTableFunctions.cpp | 12 +- src/TableFunctions/registerTableFunctions.h | 8 + src/configure_config.cmake | 30 +- sync_submodules.sh | 48 + utils/CMakeLists.txt | 3 - utils/antlr/ClickHouseParser.g4 | 17 +- utils/c++expr | 101 +- utils/check-style/check-black | 36 - utils/check-style/check-include-stat | 27 - utils/check-style/check-ungrouped-includes.sh | 8 - utils/check-style/fix-style | 3 - utils/check-style/format.sh | 15 - utils/clickhouse-diagnostics/README.md | 5 - utils/list-licenses/Apache-2.0.txt | 202 + utils/list-licenses/BSD-3-Clause.txt | 11 + utils/list-licenses/MIT.txt | 7 + utils/list-licenses/MPL-2.0.txt | 373 ++ utils/list-licenses/list-licenses.sh | 2 + utils/memcpy-bench/FastMemcpy.cpp | 2 +- utils/memcpy-bench/FastMemcpy_Avx.cpp | 2 +- utils/merge-selector-lab/Chart.js | 285 ++ utils/merge-selector-lab/EventSimulator.js | 178 + utils/merge-selector-lab/MergeTree.js | 216 + utils/merge-selector-lab/MergeTreeInserter.js | 48 + utils/merge-selector-lab/MergeTreeMerger.js | 80 + utils/merge-selector-lab/MergeTreeRewinder.js | 248 + .../merge-selector-lab/MergeTreeVisualizer.js | 582 +++ utils/merge-selector-lab/ModelSolver.js | 263 ++ utils/merge-selector-lab/Scenarios.js | 198 + .../merge-selector-lab/SimulationContainer.js | 64 + utils/merge-selector-lab/WorkerPool.js | 48 + .../clickHousePartsInserter.js | 27 + utils/merge-selector-lab/customScenario.js | 36 + utils/merge-selector-lab/floatLayerMerges.js | 185 + .../float_layer_merges.html | 75 + utils/merge-selector-lab/gradientDescent.js | 235 + utils/merge-selector-lab/index.html | 39 + utils/merge-selector-lab/infoButton.js | 38 + utils/merge-selector-lab/layers_model.html | 270 ++ utils/merge-selector-lab/main.js | 311 ++ utils/merge-selector-lab/maxEntropyMerges.js | 34 + utils/merge-selector-lab/mergeModel.js | 77 + utils/merge-selector-lab/pack.py | 103 + utils/merge-selector-lab/queryClickHouse.js | 62 + utils/merge-selector-lab/renderMath.js | 71 + utils/merge-selector-lab/sequenceInserter.js | 9 + utils/merge-selector-lab/simpleMerges.js | 168 + utils/merge-selector-lab/solution_chart.html | 465 ++ .../solvers/solver-64KB_256GB_32768.json | 1 + .../solver-64KB_256GB_32768_x4_x4.json | 1 + utils/merge-selector-lab/tests/all_tests.html | 24 + .../tests/testEventSimulator.js | 130 + .../tests/testMergeTreeInserter.js | 49 + .../tests/testMergeTreeMerger.js | 74 + .../tests/testWorkerPool.js | 112 + utils/merge-selector-lab/train_solver.html | 148 + utils/merge-selector-lab/util.js | 32 + utils/merge-selector-lab/visualizeHelpers.js | 55 + .../self-extracting-executable/CMakeLists.txt | 2 + .../self-extracting-executable/compressor.cpp | 2 +- .../decompressor.cpp | 2 +- utils/trace-visualizer/index.html | 306 ++ 4166 files changed, 192266 insertions(+), 52079 deletions(-) create mode 100644 .github/workflows/vectorsearchstress.yml delete mode 100644 .snyk delete mode 100644 base/base/map.h create mode 100644 base/poco/Net/include/Poco/Net/Throttler.h create mode 100644 ci/.gitignore create mode 100755 ci/docker/binary-builder/clang-tidy-cache.sh create mode 100644 ci/docker/cctools/Dockerfile delete mode 100644 ci/docker/clickhouse-server/docker_related_config.xml delete mode 100755 ci/docker/clickhouse-server/entrypoint.sh delete mode 100644 ci/docker/clickhouse-server/from_binary/Dockerfile.ubuntu delete mode 100644 ci/docker/clickhouse-server/from_deb/Dockerfile.ubuntu rename {docker/test => ci/docker}/fuzzer/Dockerfile (62%) rename {docker/test => ci/docker}/install/deb/Dockerfile (100%) rename {docker/test => ci/docker}/install/rpm/Dockerfile (100%) rename {docker/test => ci/docker}/integration/README.md (100%) create mode 100644 ci/docker/integration/arrowflight/Dockerfile create mode 100644 ci/docker/integration/arrowflight/flight_server.py rename {docker/test => ci/docker}/integration/base/Dockerfile (100%) rename ci/docker/integration/{integration-test => base}/requirements.txt (74%) rename {docker/test => ci/docker}/integration/dotnet_client/.gitignore (100%) rename {docker/test => ci/docker}/integration/dotnet_client/Dockerfile (100%) rename {docker/test => ci/docker}/integration/dotnet_client/Program.cs (100%) rename {docker/test => ci/docker}/integration/dotnet_client/clickhouse.test.csproj (100%) rename {docker/test => ci/docker}/integration/helper_container/Dockerfile (100%) rename {docker/test => ci/docker}/integration/hive_server/Dockerfile (100%) rename {docker/test => ci/docker}/integration/hive_server/core-site.xml.template (100%) rename {docker/test => ci/docker}/integration/hive_server/demo_data.txt (100%) rename {docker/test => ci/docker}/integration/hive_server/hadoop-env.sh (100%) rename {docker/test => ci/docker}/integration/hive_server/hdfs-site.xml (100%) rename {docker/test => ci/docker}/integration/hive_server/hive-site.xml (100%) rename {docker/test => ci/docker}/integration/hive_server/http_api_server.py (100%) rename {docker/test => ci/docker}/integration/hive_server/mapred-site.xml (100%) rename {docker/test => ci/docker}/integration/hive_server/start.sh (100%) rename {docker/test => ci/docker}/integration/hive_server/yarn-site.xml (100%) delete mode 100644 ci/docker/integration/integration-test/Dockerfile rename {docker/test => ci/docker}/integration/kerberos_kdc/Dockerfile (100%) create mode 100644 ci/docker/integration/mysql_dotnet_client/Dockerfile create mode 100644 ci/docker/integration/mysql_dotnet_client/Program.cs create mode 100644 ci/docker/integration/mysql_dotnet_client/testapp.csproj rename {docker/test => ci/docker}/integration/mysql_golang_client/Dockerfile (100%) rename {docker/test => ci/docker}/integration/mysql_golang_client/main.go (100%) rename {docker/test => ci/docker}/integration/mysql_java_client/Dockerfile (100%) rename {docker/test => ci/docker}/integration/mysql_java_client/MySQLJavaClientTest.java (100%) rename {docker/test => ci/docker}/integration/mysql_js_client/Dockerfile (100%) rename {docker/test => ci/docker}/integration/mysql_js_client/test.js (100%) rename {docker/test => ci/docker}/integration/mysql_php_client/Dockerfile (100%) rename {docker/test => ci/docker}/integration/mysql_php_client/client.crt (100%) rename {docker/test => ci/docker}/integration/mysql_php_client/client.key (100%) rename {docker/test => ci/docker}/integration/mysql_php_client/test.php (100%) rename {docker/test => ci/docker}/integration/mysql_php_client/test_ssl.php (100%) rename {docker/test => ci/docker}/integration/nginx_dav/Dockerfile (100%) rename {docker/test => ci/docker}/integration/nginx_dav/default.conf (100%) rename {docker/test => ci/docker}/integration/postgresql_java_client/Dockerfile (100%) rename {docker/test => ci/docker}/integration/postgresql_java_client/Test.java (100%) rename {docker/test => ci/docker}/integration/resolver/Dockerfile (100%) rename {docker/test => ci/docker}/integration/runner/Dockerfile (100%) rename {docker/test => ci/docker}/integration/runner/dockerd-entrypoint.sh (95%) rename {docker/test => ci/docker}/integration/runner/misc/client.crt (100%) rename {docker/test => ci/docker}/integration/runner/misc/zookeeper-ssl-entrypoint.sh (100%) rename {docker/test => ci/docker}/integration/runner/modprobe.sh (100%) rename {docker/test => ci/docker}/integration/s3_proxy/Dockerfile (100%) rename {docker/test => ci/docker}/integration/s3_proxy/nginx.conf (100%) rename {docker/test => ci/docker}/integration/s3_proxy/run.sh (100%) rename {docker/test => ci/docker}/integration/s3_proxy/server.crt (100%) rename {docker/test => ci/docker}/integration/s3_proxy/server.key (100%) rename {docker/test/keeper-jepsen => ci/docker/keeper-jepsen-test}/Dockerfile (100%) rename {docker/test/keeper-jepsen => ci/docker/keeper-jepsen-test}/run.sh (77%) rename {docker/test => ci/docker}/libfuzzer/Dockerfile (77%) rename {docker/test => ci/docker}/performance-comparison/Dockerfile (100%) rename {docker/test/server-jepsen => ci/docker/server-jepsen-test}/Dockerfile (100%) rename {docker/test/server-jepsen => ci/docker/server-jepsen-test}/run.sh (100%) delete mode 100644 ci/docker/stateful-test/Dockerfile rename {docker/test/stress => ci/docker/stress-test}/Dockerfile (100%) rename {docker/test/stress => ci/docker/stress-test}/README.md (100%) create mode 100644 ci/docker/test-base/Dockerfile create mode 100755 ci/docker/test-base/jeprof delete mode 100644 ci/jobs/functional_stateful_tests.py delete mode 100644 ci/jobs/functional_stateless_tests.py create mode 100644 ci/jobs/functional_tests.py create mode 100644 ci/jobs/integration_test_check.py rename {utils/check-style => ci/jobs/scripts/check_style}/codespell-ignore-lines.list (100%) rename {utils/check-style => ci/jobs/scripts/check_style}/codespell-ignore-words.list (100%) create mode 100644 ci/jobs/scripts/docker_image.py rename {docker/test => ci/jobs/scripts}/fuzzer/run-fuzzer.sh (95%) delete mode 100755 ci/jobs/scripts/fuzzer/runner.sh create mode 100644 ci/jobs/scripts/workflow_hooks/new_tests_check.py create mode 100644 ci/jobs/scripts/workflow_hooks/team_notifications.py create mode 100644 ci/jobs/vector_search_stress_job.py create mode 100644 ci/workflows/VectorSearchStress.py create mode 100644 contrib/FastPFOR-cmake/CMakeLists.txt create mode 100644 contrib/ai-sdk-cpp-cmake/CMakeLists.txt create mode 100644 contrib/antlr4-cpp-runtime-cmake/CMakeLists.txt create mode 100644 contrib/antlr4-grammars-cmake/CMakeLists.txt create mode 100755 contrib/antlr4-grammars-cmake/generate.sh create mode 100644 contrib/antlr4-grammars-cmake/generated/antlr4_grammars/PromQLLexer.cpp create mode 100644 contrib/antlr4-grammars-cmake/generated/antlr4_grammars/PromQLLexer.h create mode 100644 contrib/antlr4-grammars-cmake/generated/antlr4_grammars/PromQLLexer.interp create mode 100644 contrib/antlr4-grammars-cmake/generated/antlr4_grammars/PromQLLexer.tokens create mode 100644 contrib/antlr4-grammars-cmake/generated/antlr4_grammars/PromQLParser.cpp create mode 100644 contrib/antlr4-grammars-cmake/generated/antlr4_grammars/PromQLParser.h create mode 100644 contrib/antlr4-grammars-cmake/generated/antlr4_grammars/PromQLParser.interp create mode 100644 contrib/antlr4-grammars-cmake/generated/antlr4_grammars/PromQLParser.tokens create mode 100644 contrib/antlr4-grammars-cmake/generated/antlr4_grammars/PromQLParserBaseListener.cpp create mode 100644 contrib/antlr4-grammars-cmake/generated/antlr4_grammars/PromQLParserBaseListener.h create mode 100644 contrib/antlr4-grammars-cmake/generated/antlr4_grammars/PromQLParserBaseVisitor.cpp create mode 100644 contrib/antlr4-grammars-cmake/generated/antlr4_grammars/PromQLParserBaseVisitor.h create mode 100644 contrib/antlr4-grammars-cmake/generated/antlr4_grammars/PromQLParserListener.cpp create mode 100644 contrib/antlr4-grammars-cmake/generated/antlr4_grammars/PromQLParserListener.h create mode 100644 contrib/antlr4-grammars-cmake/generated/antlr4_grammars/PromQLParserVisitor.cpp create mode 100644 contrib/antlr4-grammars-cmake/generated/antlr4_grammars/PromQLParserVisitor.h create mode 100644 contrib/antlr4-grammars/README create mode 100644 contrib/antlr4-grammars/promql/PromQLLexer.g4 create mode 100644 contrib/antlr4-grammars/promql/PromQLParser.g4 create mode 100755 contrib/antlr4-grammars/promql/README.md create mode 100644 contrib/antlr4-grammars/promql/desc.xml create mode 100644 contrib/arrow-cmake/flight.cmake create mode 100644 contrib/aws-cmake/aws_stubs.cpp delete mode 160000 contrib/aws-s2n-tls create mode 100644 contrib/bech32/CMakeLists.txt create mode 100644 contrib/bech32/LICENSE-MIT create mode 100644 contrib/bech32/README.md create mode 100644 contrib/bech32/include/bech32.h create mode 100644 contrib/bech32/src/bech32.cpp create mode 100644 contrib/chdig-cmake/CMakeLists.txt create mode 100644 contrib/crc32c-cmake/CMakeLists.txt create mode 100644 contrib/crc32c-cmake/aarch64/crc32c/crc32c_config.h create mode 100644 contrib/crc32c-cmake/x86_64/no_sse42/crc32c/crc32c_config.h create mode 100644 contrib/crc32c-cmake/x86_64/sse42/crc32c/crc32c_config.h create mode 100644 contrib/google-cloud-cpp-cmake/cmake/CompileProtos.cmake rename contrib/google-cloud-cpp-cmake/{ => cmake}/GoogleApis.cmake (79%) create mode 100644 contrib/google-cloud-cpp-cmake/cmake/GoogleCloudCppLibrary.cmake create mode 100644 contrib/google-cloud-cpp-cmake/cmake/GoogleapisConfig.cmake rename contrib/google-cloud-cpp-cmake/{ => cmake}/google_cloud_cpp_common.cmake (52%) create mode 100644 contrib/google-cloud-cpp-cmake/cmake/google_cloud_cpp_grpc_utils.cmake create mode 100644 contrib/google-cloud-cpp-cmake/cmake/google_cloud_cpp_rest_internal.cmake create mode 100644 contrib/google-cloud-cpp-cmake/cmake/google_cloud_cpp_storage.cmake delete mode 100644 contrib/google-cloud-cpp-cmake/google_cloud_cpp_grpc_utils.cmake create mode 100644 contrib/google-cloud-cpp-cmake/storage/google_cloud_cpp_storage.cmake delete mode 100644 contrib/gwpasan-cmake/CMakeLists.txt create mode 100644 contrib/libxml2-cmake/README.MD create mode 100644 contrib/nlohmann-json-cmake/CMakeLists.txt delete mode 160000 contrib/sentry-native delete mode 100644 contrib/sentry-native-cmake/CMakeLists.txt create mode 100644 contrib/simde-cmake/CMakeLists.txt create mode 100755 contrib/sparse-checkout/update-antlr4-cpp-runtime.sh create mode 100755 contrib/sparse-checkout/update-crc32c.sh create mode 100755 contrib/sparse-checkout/update-nlohmann-json.sh delete mode 100644 docker/test/README.md delete mode 100644 docker/test/fuzzer/allow-nullable-key.xml create mode 100644 docs/changelogs/v25.3.4.190-lts.md create mode 100644 docs/changelogs/v25.3.5.42-lts.md create mode 100644 docs/changelogs/v25.3.6.56-lts.md create mode 100644 docs/changelogs/v25.4.10.45-stable.md create mode 100644 docs/changelogs/v25.4.11.15-stable.md create mode 100644 docs/changelogs/v25.4.12.9-stable.md create mode 100644 docs/changelogs/v25.4.13.22-stable.md create mode 100644 docs/changelogs/v25.4.5.24-stable.md create mode 100644 docs/changelogs/v25.4.6.67-stable.md create mode 100644 docs/changelogs/v25.4.7.66-stable.md create mode 100644 docs/changelogs/v25.4.8.56-stable.md create mode 100644 docs/changelogs/v25.4.9.14-stable.md create mode 100644 docs/changelogs/v25.5.1.2782-stable.md create mode 100644 docs/changelogs/v25.5.2.47-stable.md create mode 100644 docs/changelogs/v25.5.3.75-stable.md create mode 100644 docs/changelogs/v25.5.4.38-stable.md create mode 100644 docs/changelogs/v25.5.5.19-stable.md create mode 100644 docs/changelogs/v25.5.6.14-stable.md create mode 100644 docs/changelogs/v25.5.7.52-stable.md create mode 100644 docs/changelogs/v25.5.8.13-stable.md create mode 100644 docs/changelogs/v25.5.9.14-stable.md create mode 100644 docs/changelogs/v25.6.1.3206-stable.md create mode 100644 docs/changelogs/v25.6.2.5-stable.md create mode 100644 docs/changelogs/v25.6.3.116-stable.md create mode 100644 docs/changelogs/v25.6.4.12-stable.md create mode 100644 docs/changelogs/v25.6.5.41-stable.md create mode 100644 docs/changelogs/v25.6.6.29-stable.md create mode 100644 docs/changelogs/v25.6.7.23-stable.md create mode 100644 docs/changelogs/v25.6.8.10-stable.md create mode 100644 docs/changelogs/v25.7.1.3997-stable.md create mode 100644 docs/changelogs/v25.7.2.54-stable.md create mode 100644 docs/changelogs/v25.7.3.13-stable.md create mode 100644 docs/changelogs/v25.7.4.11-stable.md create mode 100644 docs/en/engines/database-engines/datalake.md create mode 100644 docs/en/engines/table-engines/integrations/arrowflight.md create mode 100644 docs/en/engines/table-engines/integrations/ytsaurus.md create mode 100644 docs/en/engines/table-engines/mergetree-family/coalescingmergetree.md create mode 100644 docs/en/interfaces/arrowflight.md create mode 100644 docs/en/interfaces/formats/Hash.md create mode 100644 docs/en/operations/settings/server-overload.md create mode 100644 docs/en/operations/settings/tcp-connection-limits.md create mode 100644 docs/en/operations/system-tables/codecs.md create mode 100644 docs/en/operations/system-tables/dead_letter_queue.md create mode 100644 docs/en/operations/system-tables/iceberg_metadata_log.md create mode 100644 docs/en/operations/system-tables/zookeeper_connection_log.md create mode 100644 docs/en/sql-reference/aggregate-functions/reference/timeSeriesDeltaToGrid.md create mode 100644 docs/en/sql-reference/aggregate-functions/reference/timeSeriesDerivToGrid.md create mode 100644 docs/en/sql-reference/aggregate-functions/reference/timeSeriesGroupArray.md create mode 100644 docs/en/sql-reference/aggregate-functions/reference/timeSeriesInstantDeltaToGrid.md create mode 100644 docs/en/sql-reference/aggregate-functions/reference/timeSeriesInstantRateToGrid.md create mode 100644 docs/en/sql-reference/aggregate-functions/reference/timeSeriesLastTwoSamples.md create mode 100644 docs/en/sql-reference/aggregate-functions/reference/timeSeriesPredictLinearToGrid.md create mode 100644 docs/en/sql-reference/aggregate-functions/reference/timeSeriesRateToGrid.md create mode 100644 docs/en/sql-reference/aggregate-functions/reference/timeSeriesResampleToGridWithStaleness.md create mode 100644 docs/en/sql-reference/data-types/time.md create mode 100644 docs/en/sql-reference/data-types/time64.md create mode 100644 docs/en/sql-reference/functions/financial-functions.md create mode 100644 docs/en/sql-reference/functions/numeric-indexed-vector-functions.md create mode 100644 docs/en/sql-reference/functions/time-series-analysis-functions.md create mode 100644 docs/en/sql-reference/statements/update.md create mode 100644 docs/en/sql-reference/table-functions/arrowflight.md create mode 100644 docs/en/sql-reference/table-functions/prometheusQuery.md create mode 100644 docs/en/sql-reference/table-functions/prometheusQueryRange.md create mode 100644 docs/en/sql-reference/table-functions/timeSeriesSelector.md create mode 100644 docs/en/sql-reference/table-functions/ytsaurus.md create mode 100644 docs/en/sql-reference/window-functions/lag.md create mode 100644 docs/en/sql-reference/window-functions/lead.md create mode 100644 programs/fst-dump-tree/CMakeLists.txt create mode 100644 programs/fst-dump-tree/FstDumpTree.cpp create mode 100644 programs/fst-dump-tree/README.md create mode 100644 programs/fst-dump-tree/fst-dump-tree.cpp create mode 100644 programs/keeper-utils/CMakeLists.txt create mode 100644 programs/keeper-utils/KeeperUtils.cpp create mode 100644 programs/keeper-utils/README.md create mode 100644 programs/keeper-utils/keeper-utils.cpp create mode 100644 programs/server/config.d/zookeeper_connection_log.xml create mode 100644 programs/server/index.html create mode 100755 rust/vendor.sh create mode 100644 src/Access/ViewDefinerDependencies.cpp create mode 100644 src/Access/ViewDefinerDependencies.h create mode 100644 src/Access/ZooKeeperReplicator.cpp create mode 100644 src/Access/ZooKeeperReplicator.h create mode 100644 src/AggregateFunctions/AggregateFunctionGroupNumericIndexedVector.cpp create mode 100644 src/AggregateFunctions/AggregateFunctionGroupNumericIndexedVector.h create mode 100644 src/AggregateFunctions/AggregateFunctionGroupNumericIndexedVectorData.h create mode 100644 src/AggregateFunctions/AggregateFunctionGroupNumericIndexedVectorDataBSI.h create mode 100644 src/AggregateFunctions/TimeSeries/AggregateFunctionLast2Samples.cpp create mode 100644 src/AggregateFunctions/TimeSeries/AggregateFunctionLast2Samples.h create mode 100644 src/AggregateFunctions/TimeSeries/AggregateFunctionTimeSeriesGroupArray.cpp create mode 100644 src/AggregateFunctions/TimeSeries/AggregateFunctionTimeSeriesGroupArray.h create mode 100644 src/AggregateFunctions/TimeSeries/AggregateFunctionTimeseriesBase.h create mode 100644 src/AggregateFunctions/TimeSeries/AggregateFunctionTimeseriesExtrapolatedValue.h create mode 100644 src/AggregateFunctions/TimeSeries/AggregateFunctionTimeseriesHelpers.cpp create mode 100644 src/AggregateFunctions/TimeSeries/AggregateFunctionTimeseriesInstantValue.h create mode 100644 src/AggregateFunctions/TimeSeries/AggregateFunctionTimeseriesLinearRegression.h create mode 100644 src/AggregateFunctions/TimeSeries/AggregateFunctionTimeseriesToGridSparse.h create mode 100644 src/AggregateFunctions/TimeSeries/CMakeLists.txt create mode 100644 src/Analyzer/Passes/RegexpFunctionRewritePass.cpp create mode 100644 src/Analyzer/Passes/RegexpFunctionRewritePass.h create mode 100644 src/Analyzer/Resolve/CorrelatedColumnsCollector.h create mode 100644 src/Client/AI/AIClientFactory.cpp create mode 100644 src/Client/AI/AIClientFactory.h create mode 100644 src/Client/AI/AIConfiguration.h create mode 100644 src/Client/AI/AIPrompts.h create mode 100644 src/Client/AI/AISQLGenerator.cpp create mode 100644 src/Client/AI/AISQLGenerator.h create mode 100644 src/Client/AI/AIToolExecutionDisplay.h create mode 100644 src/Client/AI/SchemaExplorationTools.cpp create mode 100644 src/Client/AI/SchemaExplorationTools.h create mode 100644 src/Client/AI/tests/gtest_ai_client_factory.cpp create mode 100644 src/Client/AI/tests/gtest_ai_sql_generator.cpp create mode 100644 src/Client/BuzzHouse/Generator/SQLCatalog.cpp create mode 100644 src/Columns/ColumnBLOB.h create mode 100644 src/Common/AggregatedMetrics.cpp create mode 100644 src/Common/AggregatedMetrics.h rename src/Common/{new_delete.cpp => AllocationInterceptors.cpp} (65%) create mode 100644 src/Common/AllocationInterceptors.h create mode 100644 src/Common/ClickHouseVersion.cpp create mode 100644 src/Common/ClickHouseVersion.h create mode 100644 src/Common/DimensionalMetrics.cpp create mode 100644 src/Common/DimensionalMetrics.h delete mode 100644 src/Common/GWPAsan.cpp delete mode 100644 src/Common/GWPAsan.h create mode 100644 src/Common/IThrottler.h delete mode 100644 src/Common/LatencyBuckets.cpp delete mode 100644 src/Common/LatencyBuckets.h create mode 100644 src/Common/LocalTime.h create mode 100644 src/Common/Scheduler/CPULeaseAllocation.cpp create mode 100644 src/Common/Scheduler/CPULeaseAllocation.h create mode 100644 src/Common/Scheduler/CostUnit.h create mode 100644 src/Common/Scheduler/ResourceAccessMode.h create mode 100644 src/Common/ThrottlerArray.h delete mode 100644 src/Common/Throttler_fwd.h create mode 100644 src/Common/WKB.cpp create mode 100644 src/Common/WKB.h delete mode 100644 src/Common/clickhouse_malloc.cpp delete mode 100644 src/Common/mysqlxx/mysqlxx/Null.h delete mode 100644 src/Common/mysqlxx/mysqlxx/mysqlxx.h delete mode 100644 src/Common/mysqlxx/tests/CMakeLists.txt delete mode 100644 src/Common/mysqlxx/tests/mysqlxx_pool_test.cpp create mode 100644 src/Common/tests/gtest_aggregated_metrics.cpp create mode 100644 src/Common/tests/gtest_allocation_interceptors.cpp create mode 100644 src/Common/tests/gtest_dimensional_metrics.cpp create mode 100644 src/Common/threadPoolCallbackRunner.cpp create mode 100644 src/Core/Protocol.cpp create mode 100644 src/Core/YTsaurus/YTsaurusClient.cpp create mode 100644 src/Core/YTsaurus/YTsaurusClient.h create mode 100644 src/Core/YTsaurus/YTsaurusQueries.h create mode 100644 src/Core/examples/gcloud_kms.cpp create mode 100644 src/Core/examples/gcloud_storage.cpp create mode 100644 src/Core/tests/gtest_BackgroundSchedulePool.cpp create mode 100644 src/Daemon/CrashWriter.cpp create mode 100644 src/Daemon/CrashWriter.h delete mode 100644 src/Daemon/SentryWriter.cpp delete mode 100644 src/Daemon/SentryWriter.h create mode 100644 src/DataTypes/DataTypeTime.cpp create mode 100644 src/DataTypes/DataTypeTime.h create mode 100644 src/DataTypes/DataTypeTime64.cpp create mode 100644 src/DataTypes/DataTypeTime64.h create mode 100644 src/DataTypes/DataTypesCache.cpp create mode 100644 src/DataTypes/DataTypesCache.h create mode 100644 src/DataTypes/Serializations/SerializationDetached.cpp create mode 100644 src/DataTypes/Serializations/SerializationDetached.h create mode 100644 src/DataTypes/Serializations/SerializationDynamicHelpers.cpp create mode 100644 src/DataTypes/Serializations/SerializationDynamicHelpers.h create mode 100644 src/DataTypes/Serializations/SerializationObjectHelpers.cpp create mode 100644 src/DataTypes/Serializations/SerializationObjectHelpers.h create mode 100644 src/DataTypes/Serializations/SerializationObjectSharedData.cpp create mode 100644 src/DataTypes/Serializations/SerializationObjectSharedData.h create mode 100644 src/DataTypes/Serializations/SerializationObjectSharedDataPath.cpp create mode 100644 src/DataTypes/Serializations/SerializationObjectSharedDataPath.h create mode 100644 src/DataTypes/Serializations/SerializationSubObjectSharedData.cpp create mode 100644 src/DataTypes/Serializations/SerializationSubObjectSharedData.h create mode 100644 src/DataTypes/Serializations/SerializationTime64.cpp create mode 100644 src/DataTypes/Serializations/SerializationTime64.h create mode 100644 src/DataTypes/Serializations/getSubcolumnsDeserializationOrder.cpp create mode 100644 src/DataTypes/Serializations/getSubcolumnsDeserializationOrder.h create mode 100644 src/DataTypes/Serializations/tests/gtest_string_serialization.cpp create mode 100644 src/DataTypes/convertYTsaurusDataType.cpp create mode 100644 src/DataTypes/convertYTsaurusDataType.h create mode 100644 src/DataTypes/tests/gtest_yt_schema.cpp create mode 100644 src/Databases/DatabaseMetadataDiskSettings.cpp create mode 100644 src/Databases/DatabaseMetadataDiskSettings.h rename src/Databases/{DatabasesOverlay.cpp => DatabaseOverlay.cpp} (80%) rename src/Databases/{DatabasesOverlay.h => DatabaseOverlay.h} (94%) create mode 100644 src/Dictionaries/YTsaurusDictionarySource.cpp create mode 100644 src/Dictionaries/YTsaurusDictionarySource.h create mode 100644 src/Disks/DiskCommitTransactionOptions.h create mode 100644 src/Disks/MetadataStorageWithPathWrapper.h create mode 100644 src/Disks/ObjectStorages/AzureBlobStorage/AzureObjectStorageConnectionInfo.cpp create mode 100644 src/Disks/ObjectStorages/AzureBlobStorage/AzureObjectStorageConnectionInfo.h delete mode 100644 src/Disks/ObjectStorages/DiskObjectStorageRemoteMetadataRestoreHelper.cpp delete mode 100644 src/Disks/ObjectStorages/DiskObjectStorageRemoteMetadataRestoreHelper.h create mode 100644 src/Disks/ObjectStorages/IObjectStorageConnectionInfo.cpp create mode 100644 src/Disks/ObjectStorages/IObjectStorageConnectionInfo.h create mode 100644 src/Disks/ObjectStorages/ObjectStorageClientsCache.h create mode 100644 src/Disks/ObjectStorages/S3/S3ObjectStorageConnectionInfo.cpp create mode 100644 src/Disks/ObjectStorages/S3/S3ObjectStorageConnectionInfo.h create mode 100644 src/Disks/ObjectStorages/Web/WebObjectStorageConnectionInfo.cpp create mode 100644 src/Disks/ObjectStorages/Web/WebObjectStorageConnectionInfo.h create mode 100644 src/Disks/ReadOnlyDiskWrapper.h create mode 100644 src/Disks/tests/gtest_metadata_local_disk.cpp create mode 100644 src/Formats/FormatFilterInfo.cpp create mode 100644 src/Formats/FormatFilterInfo.h create mode 100644 src/Formats/FormatParserSharedResources.cpp create mode 100644 src/Formats/FormatParserSharedResources.h create mode 100644 src/Functions/ColorConversion.h create mode 100644 src/Functions/FunctionsMergeTreePartInfo.cpp create mode 100644 src/Functions/FunctionsNumericIndexedVector.cpp create mode 100644 src/Functions/FunctionsNumericIndexedVector.h create mode 100644 src/Functions/FunctionsNumericIndexedVectorHelper.h create mode 100644 src/Functions/TimeSeries/CMakeLists.txt create mode 100644 src/Functions/TimeSeries/timeSeriesIdToTags.cpp create mode 100644 src/Functions/TimeSeries/timeSeriesIdToTagsGroup.cpp create mode 100644 src/Functions/TimeSeries/timeSeriesRange.cpp create mode 100644 src/Functions/TimeSeries/timeSeriesStoreTags.cpp create mode 100644 src/Functions/TimeSeries/timeSeriesTagsGroupToTags.cpp create mode 100644 src/Functions/TransformTime64.h rename src/Functions/{FunctionsCodingULID.cpp => ULIDStringToDateTime.cpp} (97%) create mode 100644 src/Functions/UUIDv7Utils.cpp create mode 100644 src/Functions/UUIDv7Utils.h create mode 100644 src/Functions/bech32.cpp create mode 100644 src/Functions/colorOKLCHToSRGB.cpp create mode 100644 src/Functions/colorSRGBToOKLCH.cpp create mode 100644 src/Functions/dateTimeToUUIDv7.cpp create mode 100644 src/Functions/financial.cpp create mode 100644 src/Functions/generateSnowflakeID.h create mode 100644 src/Functions/isNull.h create mode 100644 src/Functions/nowInBlock64.cpp create mode 100644 src/Functions/nowSubsecond.cpp create mode 100644 src/Functions/nowSubsecond.h create mode 100644 src/Functions/patchPartitionID.cpp create mode 100644 src/Functions/polygonsIntersect.cpp create mode 100644 src/Functions/readWkb.cpp create mode 100644 src/Functions/searchAnyAll.cpp create mode 100644 src/Functions/searchAnyAll.h create mode 100644 src/Functions/tests/gtest_conversion_monotonic.cpp rename src/Functions/{stringCutToZero.cpp => toStringCutToZero.cpp} (94%) create mode 100644 src/Functions/wkb.cpp create mode 100644 src/IO/AzureBlobStorage/PocoHTTPClient.cpp create mode 100644 src/IO/AzureBlobStorage/PocoHTTPClient.h create mode 100644 src/IO/Expect404ResponseScope.cpp create mode 100644 src/IO/Expect404ResponseScope.h create mode 100644 src/IO/readIntText.h create mode 100644 src/IO/tests/gtest_read_int_text.cpp create mode 100644 src/Interpreters/AsynchronousInsertQueueDataKind.h create mode 100644 src/Interpreters/ClusterFunctionReadTask.cpp create mode 100644 src/Interpreters/ClusterFunctionReadTask.h create mode 100644 src/Interpreters/ContextTimeSeriesTagsCollector.cpp create mode 100644 src/Interpreters/ContextTimeSeriesTagsCollector.h create mode 100644 src/Interpreters/DeadLetterQueue.cpp create mode 100644 src/Interpreters/DeadLetterQueue.h create mode 100644 src/Interpreters/GlobalSubqueriesVisitor.cpp delete mode 100644 src/Interpreters/HashJoin/FullHashJoin.cpp create mode 100644 src/Interpreters/HashJoin/FullHashJoinAll.cpp create mode 100644 src/Interpreters/HashJoin/FullHashJoinAnti.cpp create mode 100644 src/Interpreters/HashJoin/FullHashJoinAny.cpp create mode 100644 src/Interpreters/HashJoin/FullHashJoinAsof.cpp create mode 100644 src/Interpreters/HashJoin/FullHashJoinSemi.cpp create mode 100644 src/Interpreters/HashJoin/HashJoinResult.cpp create mode 100644 src/Interpreters/HashJoin/HashJoinResult.h delete mode 100644 src/Interpreters/HashJoin/InnerHashJoin.cpp create mode 100644 src/Interpreters/HashJoin/InnerHashJoinAll.cpp create mode 100644 src/Interpreters/HashJoin/InnerHashJoinAnti.cpp create mode 100644 src/Interpreters/HashJoin/InnerHashJoinAny.cpp create mode 100644 src/Interpreters/HashJoin/InnerHashJoinAsof.cpp create mode 100644 src/Interpreters/HashJoin/InnerHashJoinRightAny.cpp create mode 100644 src/Interpreters/HashJoin/InnerHashJoinSemi.cpp delete mode 100644 src/Interpreters/HashJoin/LeftHashJoin.cpp create mode 100644 src/Interpreters/HashJoin/LeftHashJoinAll.cpp create mode 100644 src/Interpreters/HashJoin/LeftHashJoinAnti.cpp create mode 100644 src/Interpreters/HashJoin/LeftHashJoinAny.cpp create mode 100644 src/Interpreters/HashJoin/LeftHashJoinAsof.cpp create mode 100644 src/Interpreters/HashJoin/LeftHashJoinRightAny.cpp create mode 100644 src/Interpreters/HashJoin/LeftHashJoinSemi.cpp delete mode 100644 src/Interpreters/HashJoin/RightHashJoin.cpp create mode 100644 src/Interpreters/HashJoin/RightHashJoinAll.cpp create mode 100644 src/Interpreters/HashJoin/RightHashJoinAnti.cpp create mode 100644 src/Interpreters/HashJoin/RightHashJoinAny.cpp create mode 100644 src/Interpreters/HashJoin/RightHashJoinAsof.cpp create mode 100644 src/Interpreters/HashJoin/RightHashJoinSemi.cpp create mode 100644 src/Interpreters/IJoin.cpp create mode 100644 src/Interpreters/IcebergMetadataLog.cpp create mode 100644 src/Interpreters/IcebergMetadataLog.h create mode 100644 src/Interpreters/InsertDependenciesBuilder.cpp create mode 100644 src/Interpreters/InsertDependenciesBuilder.h delete mode 100644 src/Interpreters/InterpreterExternalDDLQuery.cpp delete mode 100644 src/Interpreters/InterpreterExternalDDLQuery.h create mode 100644 src/Interpreters/InterpreterUpdateQuery.cpp create mode 100644 src/Interpreters/InterpreterUpdateQuery.h delete mode 100644 src/Interpreters/LatencyLog.cpp delete mode 100644 src/Interpreters/LatencyLog.h delete mode 100644 src/Interpreters/MySQL/InterpretersMySQLDDLQuery.cpp delete mode 100644 src/Interpreters/MySQL/InterpretersMySQLDDLQuery.h delete mode 100644 src/Interpreters/MySQL/tests/gtest_create_rewritten.cpp create mode 100644 src/Interpreters/QuerySlot.cpp create mode 100644 src/Interpreters/QuerySlot.h create mode 100644 src/Interpreters/ZooKeeperConnectionLog.cpp create mode 100644 src/Interpreters/ZooKeeperConnectionLog.h create mode 100644 src/Interpreters/tests/gtest_async_insert_key.cpp rename src/Loggers/{ExtendedLogChannel.cpp => ExtendedLogMessage.cpp} (92%) rename src/Loggers/{ExtendedLogChannel.h => ExtendedLogMessage.h} (66%) create mode 100644 src/Parsers/ASTCopyQuery.cpp create mode 100644 src/Parsers/ASTCopyQuery.h delete mode 100644 src/Parsers/ASTExternalDDLQuery.h create mode 100644 src/Parsers/ASTIdentifierTypePair.cpp create mode 100644 src/Parsers/ASTIdentifierTypePair.h delete mode 100644 src/Parsers/HiliteComparator/CMakeLists.txt delete mode 100644 src/Parsers/HiliteComparator/HiliteComparator.cpp delete mode 100644 src/Parsers/HiliteComparator/HiliteComparator.h delete mode 100644 src/Parsers/HiliteComparator/tests/gtest_hilite_comparator.cpp create mode 100644 src/Parsers/LexerStandalone.h create mode 100644 src/Parsers/ParserCopyQuery.cpp create mode 100644 src/Parsers/ParserCopyQuery.h delete mode 100644 src/Parsers/ParserExternalDDLQuery.cpp delete mode 100644 src/Parsers/ParserExternalDDLQuery.h create mode 100644 src/Parsers/Prometheus/ParserPrometheusQuery.cpp create mode 100644 src/Parsers/Prometheus/ParserPrometheusQuery.h create mode 100644 src/Parsers/Prometheus/PrometheusQueryParsingUtil-antlr.cpp create mode 100644 src/Parsers/Prometheus/PrometheusQueryParsingUtil.cpp create mode 100644 src/Parsers/Prometheus/PrometheusQueryParsingUtil.h create mode 100644 src/Parsers/Prometheus/PrometheusQueryResultType.h create mode 100644 src/Parsers/Prometheus/PrometheusQueryTree.cpp create mode 100644 src/Parsers/Prometheus/PrometheusQueryTree.h create mode 100644 src/Parsers/clickhouse_lexer.h delete mode 100644 src/Parsers/tests/gtest_format_hiliting.cpp create mode 100644 src/Processors/Formats/Impl/HashOutputFormat.cpp create mode 100644 src/Processors/Formats/Impl/HashOutputFormat.h create mode 100644 src/Processors/Formats/Impl/Parquet/Decoding.cpp create mode 100644 src/Processors/Formats/Impl/Parquet/Decoding.h create mode 100644 src/Processors/Formats/Impl/Parquet/Prefetcher.cpp create mode 100644 src/Processors/Formats/Impl/Parquet/Prefetcher.h create mode 100644 src/Processors/Formats/Impl/Parquet/ReadCommon.cpp create mode 100644 src/Processors/Formats/Impl/Parquet/ReadCommon.h create mode 100644 src/Processors/Formats/Impl/Parquet/ReadManager.cpp create mode 100644 src/Processors/Formats/Impl/Parquet/ReadManager.h create mode 100644 src/Processors/Formats/Impl/Parquet/Reader.cpp create mode 100644 src/Processors/Formats/Impl/Parquet/Reader.h create mode 100644 src/Processors/Formats/Impl/Parquet/SchemaConverter.cpp create mode 100644 src/Processors/Formats/Impl/Parquet/SchemaConverter.h create mode 100644 src/Processors/Formats/Impl/ParquetV3BlockInputFormat.cpp create mode 100644 src/Processors/Formats/Impl/ParquetV3BlockInputFormat.h create mode 100644 src/Processors/Merges/CoalescingSortedTransform.h create mode 100644 src/Processors/QueryPlan/BlocksMarshallingStep.cpp create mode 100644 src/Processors/QueryPlan/BlocksMarshallingStep.h create mode 100644 src/Processors/QueryPlan/Optimizations/optimizePrewhere.h create mode 100644 src/Processors/QueryPlan/ReadFromLocalReplica.cpp create mode 100644 src/Processors/QueryPlan/ReadFromLocalReplica.h create mode 100644 src/Processors/QueryPlan/ReadFromObjectStorageStep.cpp create mode 100644 src/Processors/QueryPlan/ReadFromObjectStorageStep.h delete mode 100644 src/Processors/SourceWithKeyCondition.cpp delete mode 100644 src/Processors/SourceWithKeyCondition.h create mode 100644 src/Processors/Sources/ArrowFlightSource.cpp create mode 100644 src/Processors/Sources/ArrowFlightSource.h create mode 100644 src/Processors/Sources/YTsaurusSource.cpp create mode 100644 src/Processors/Sources/YTsaurusSource.h create mode 100644 src/Processors/Transforms/ApplySquashingTransform.cpp create mode 100644 src/Processors/Transforms/RemovingSparseTransform.cpp create mode 100644 src/Processors/Transforms/RemovingSparseTransform.h create mode 100644 src/Processors/Transforms/SortChunksBySequenceNumber.cpp create mode 100644 src/Processors/Transforms/SortChunksBySequenceNumber.h delete mode 100644 src/Processors/Transforms/buildPushingToViewsChain.cpp delete mode 100644 src/Processors/Transforms/buildPushingToViewsChain.h create mode 100644 src/QueryPipeline/tests/gtest_resize_transform.cpp create mode 100644 src/Server/ArrowFlightHandler.cpp create mode 100644 src/Server/ArrowFlightHandler.h create mode 100644 src/Server/IGRPCServer.h create mode 100644 src/Server/IndexRequestHandler.cpp create mode 100644 src/Server/IndexRequestHandler.h create mode 100644 src/Storages/HivePartitioningUtils.cpp create mode 100644 src/Storages/HivePartitioningUtils.h create mode 100644 src/Storages/IPartitionStrategy.cpp create mode 100644 src/Storages/IPartitionStrategy.h create mode 100644 src/Storages/Kafka/IKafkaExceptionInfoSink.cpp create mode 100644 src/Storages/Kafka/KeeperHandlingConsumer.cpp create mode 100644 src/Storages/Kafka/KeeperHandlingConsumer.h create mode 100644 src/Storages/MergeTree/Compaction/MergeSelectors/DisjointPartsRangesSet.cpp create mode 100644 src/Storages/MergeTree/Compaction/MergeSelectors/DisjointPartsRangesSet.h create mode 100644 src/Storages/MergeTree/MergeTreeCommittingBlock.cpp create mode 100644 src/Storages/MergeTree/MergeTreeCommittingBlock.h create mode 100644 src/Storages/MergeTree/MergeTreeSinkPatch.cpp create mode 100644 src/Storages/MergeTree/MergeTreeSinkPatch.h create mode 100644 src/Storages/MergeTree/PatchParts/MergeTreePatchReader.cpp create mode 100644 src/Storages/MergeTree/PatchParts/MergeTreePatchReader.h create mode 100644 src/Storages/MergeTree/PatchParts/PatchJoinCache.cpp create mode 100644 src/Storages/MergeTree/PatchParts/PatchJoinCache.h create mode 100644 src/Storages/MergeTree/PatchParts/PatchPartInfo.cpp create mode 100644 src/Storages/MergeTree/PatchParts/PatchPartInfo.h create mode 100644 src/Storages/MergeTree/PatchParts/PatchPartsLock.cpp create mode 100644 src/Storages/MergeTree/PatchParts/PatchPartsLock.h create mode 100644 src/Storages/MergeTree/PatchParts/PatchPartsUtils.cpp create mode 100644 src/Storages/MergeTree/PatchParts/PatchPartsUtils.h create mode 100644 src/Storages/MergeTree/PatchParts/RangesInPatchParts.cpp create mode 100644 src/Storages/MergeTree/PatchParts/RangesInPatchParts.h create mode 100644 src/Storages/MergeTree/PatchParts/SourcePartsSetForPatch.cpp create mode 100644 src/Storages/MergeTree/PatchParts/SourcePartsSetForPatch.h create mode 100644 src/Storages/MergeTree/PatchParts/applyPatches.cpp create mode 100644 src/Storages/MergeTree/PatchParts/applyPatches.h create mode 100644 src/Storages/MergeTree/ReplicatedMergeTreeSinkPatch.cpp create mode 100644 src/Storages/MergeTree/ReplicatedMergeTreeSinkPatch.h create mode 100644 src/Storages/ObjectStorage/DataLakes/DataLakeObjectMetadata.h create mode 100644 src/Storages/ObjectStorage/DataLakes/DataLakeStorageSettings.cpp create mode 100644 src/Storages/ObjectStorage/DataLakes/DataLakeStorageSettings.h create mode 100644 src/Storages/ObjectStorage/DataLakes/DeltaLake/DeltaLakePartitionedSink.cpp create mode 100644 src/Storages/ObjectStorage/DataLakes/DeltaLake/DeltaLakePartitionedSink.h create mode 100644 src/Storages/ObjectStorage/DataLakes/DeltaLake/DeltaLakeSink.cpp create mode 100644 src/Storages/ObjectStorage/DataLakes/DeltaLake/DeltaLakeSink.h create mode 100644 src/Storages/ObjectStorage/DataLakes/DeltaLake/EnginePredicate.cpp create mode 100644 src/Storages/ObjectStorage/DataLakes/DeltaLake/EnginePredicate.h create mode 100644 src/Storages/ObjectStorage/DataLakes/DeltaLake/ExpressionVisitor.cpp create mode 100644 src/Storages/ObjectStorage/DataLakes/DeltaLake/ExpressionVisitor.h delete mode 100644 src/Storages/ObjectStorage/DataLakes/DeltaLake/ObjectInfoWithPartitionColumns.h create mode 100644 src/Storages/ObjectStorage/DataLakes/DeltaLake/WriteTransaction.cpp create mode 100644 src/Storages/ObjectStorage/DataLakes/DeltaLake/WriteTransaction.h create mode 100644 src/Storages/ObjectStorage/DataLakes/Iceberg/AvroSchema.h create mode 100644 src/Storages/ObjectStorage/DataLakes/Iceberg/Compaction.cpp create mode 100644 src/Storages/ObjectStorage/DataLakes/Iceberg/Compaction.h create mode 100644 src/Storages/ObjectStorage/DataLakes/Iceberg/ComplexTypeSchemaProcessorFunctions.cpp create mode 100644 src/Storages/ObjectStorage/DataLakes/Iceberg/ComplexTypeSchemaProcessorFunctions.h create mode 100644 src/Storages/ObjectStorage/DataLakes/Iceberg/IcebergDataObjectInfo.cpp create mode 100644 src/Storages/ObjectStorage/DataLakes/Iceberg/IcebergDataObjectInfo.h create mode 100644 src/Storages/ObjectStorage/DataLakes/Iceberg/IcebergIterator.cpp create mode 100644 src/Storages/ObjectStorage/DataLakes/Iceberg/IcebergIterator.h create mode 100644 src/Storages/ObjectStorage/DataLakes/Iceberg/IcebergWrites.cpp create mode 100644 src/Storages/ObjectStorage/DataLakes/Iceberg/IcebergWrites.h create mode 100644 src/Storages/ObjectStorage/DataLakes/Iceberg/Mutations.cpp create mode 100644 src/Storages/ObjectStorage/DataLakes/Iceberg/Mutations.h create mode 100644 src/Storages/ObjectStorage/DataLakes/Iceberg/PersistentTableComponents.h create mode 100644 src/Storages/ObjectStorage/DataLakes/Iceberg/PositionDeleteObject.h create mode 100644 src/Storages/ObjectStorage/DataLakes/Iceberg/PositionDeleteTransform.cpp create mode 100644 src/Storages/ObjectStorage/DataLakes/Iceberg/PositionDeleteTransform.h create mode 100644 src/Storages/ObjectStorage/DataLakes/Iceberg/StatelessMetadataFileGetter.cpp create mode 100644 src/Storages/ObjectStorage/DataLakes/Iceberg/StatelessMetadataFileGetter.h create mode 100644 src/Storages/ObjectStorage/IObjectIterator.cpp create mode 100644 src/Storages/ObjectStorage/StorageObjectStorageConfiguration.cpp create mode 100644 src/Storages/ObjectStorage/StorageObjectStorageConfiguration.h create mode 100644 src/Storages/ObjectStorage/StorageObjectStorageDefinitions.h create mode 100644 src/Storages/ObjectStorage/tests/gtest_rendezvous_hashing.cpp create mode 100644 src/Storages/StorageArrowFlight.cpp create mode 100644 src/Storages/StorageArrowFlight.h create mode 100644 src/Storages/StoragePrometheusQuery.cpp create mode 100644 src/Storages/StoragePrometheusQuery.h create mode 100644 src/Storages/StorageTimeSeriesSelector.cpp create mode 100644 src/Storages/StorageTimeSeriesSelector.h create mode 100644 src/Storages/System/StorageSystemCodecs.cpp create mode 100644 src/Storages/System/StorageSystemCodecs.h create mode 100644 src/Storages/System/StorageSystemCompletions.cpp create mode 100644 src/Storages/System/StorageSystemCompletions.h create mode 100644 src/Storages/System/StorageSystemDimensionalMetrics.cpp rename src/Storages/System/{StorageSystemLatencyBuckets.h => StorageSystemDimensionalMetrics.h} (62%) delete mode 100644 src/Storages/System/StorageSystemLatencyBuckets.cpp create mode 100644 src/Storages/TimeSeries/PrometheusQueryEvaluationRange.h create mode 100644 src/Storages/TimeSeries/PrometheusQueryToSQL.cpp create mode 100644 src/Storages/TimeSeries/PrometheusQueryToSQL.h create mode 100644 src/Storages/YTsaurus/StorageYTsaurus.cpp create mode 100644 src/Storages/YTsaurus/StorageYTsaurus.h create mode 100644 src/Storages/YTsaurus/YTsaurusSettings.cpp create mode 100644 src/Storages/YTsaurus/YTsaurusSettings.h rename src/Storages/tests/{gtest_SplitTokenExtractor.cpp => gtest_DefaultTokenExtractor.cpp} (87%) create mode 100644 src/Storages/tests/gtest_azure_configuration.cpp create mode 100644 src/Storages/tests/gtest_delta_kernel.cpp rename src/Storages/tests/{gtest_virtual_column_utils.cpp => gtest_hive_partitioning_utils.cpp} (66%) create mode 100644 src/TableFunctions/TableFunctionArrowFlight.cpp create mode 100644 src/TableFunctions/TableFunctionArrowFlight.h create mode 100644 src/TableFunctions/TableFunctionPrometheusQuery.cpp create mode 100644 src/TableFunctions/TableFunctionPrometheusQuery.h create mode 100644 src/TableFunctions/TableFunctionTimeSeriesSelector.cpp create mode 100644 src/TableFunctions/TableFunctionTimeSeriesSelector.h create mode 100644 src/TableFunctions/TableFunctionYtsaurus.cpp create mode 100755 sync_submodules.sh delete mode 100755 utils/check-style/check-black delete mode 100755 utils/check-style/check-include-stat delete mode 100755 utils/check-style/check-ungrouped-includes.sh delete mode 100755 utils/check-style/fix-style delete mode 100755 utils/check-style/format.sh create mode 100644 utils/list-licenses/Apache-2.0.txt create mode 100644 utils/list-licenses/BSD-3-Clause.txt create mode 100644 utils/list-licenses/MIT.txt create mode 100644 utils/list-licenses/MPL-2.0.txt create mode 100644 utils/merge-selector-lab/Chart.js create mode 100644 utils/merge-selector-lab/EventSimulator.js create mode 100644 utils/merge-selector-lab/MergeTree.js create mode 100644 utils/merge-selector-lab/MergeTreeInserter.js create mode 100644 utils/merge-selector-lab/MergeTreeMerger.js create mode 100644 utils/merge-selector-lab/MergeTreeRewinder.js create mode 100644 utils/merge-selector-lab/MergeTreeVisualizer.js create mode 100644 utils/merge-selector-lab/ModelSolver.js create mode 100644 utils/merge-selector-lab/Scenarios.js create mode 100644 utils/merge-selector-lab/SimulationContainer.js create mode 100644 utils/merge-selector-lab/WorkerPool.js create mode 100644 utils/merge-selector-lab/clickHousePartsInserter.js create mode 100644 utils/merge-selector-lab/customScenario.js create mode 100644 utils/merge-selector-lab/floatLayerMerges.js create mode 100644 utils/merge-selector-lab/float_layer_merges.html create mode 100644 utils/merge-selector-lab/gradientDescent.js create mode 100644 utils/merge-selector-lab/index.html create mode 100644 utils/merge-selector-lab/infoButton.js create mode 100644 utils/merge-selector-lab/layers_model.html create mode 100644 utils/merge-selector-lab/main.js create mode 100644 utils/merge-selector-lab/maxEntropyMerges.js create mode 100644 utils/merge-selector-lab/mergeModel.js create mode 100755 utils/merge-selector-lab/pack.py create mode 100644 utils/merge-selector-lab/queryClickHouse.js create mode 100644 utils/merge-selector-lab/renderMath.js create mode 100644 utils/merge-selector-lab/sequenceInserter.js create mode 100644 utils/merge-selector-lab/simpleMerges.js create mode 100644 utils/merge-selector-lab/solution_chart.html create mode 100644 utils/merge-selector-lab/solvers/solver-64KB_256GB_32768.json create mode 100644 utils/merge-selector-lab/solvers/solver-64KB_256GB_32768_x4_x4.json create mode 100644 utils/merge-selector-lab/tests/all_tests.html create mode 100644 utils/merge-selector-lab/tests/testEventSimulator.js create mode 100644 utils/merge-selector-lab/tests/testMergeTreeInserter.js create mode 100644 utils/merge-selector-lab/tests/testMergeTreeMerger.js create mode 100644 utils/merge-selector-lab/tests/testWorkerPool.js create mode 100644 utils/merge-selector-lab/train_solver.html create mode 100644 utils/merge-selector-lab/util.js create mode 100644 utils/merge-selector-lab/visualizeHelpers.js diff --git a/.clang-tidy b/.clang-tidy index 4824fc2f2ed..c14023d04d0 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -7,6 +7,9 @@ HeaderFilterRegex: '^.*/(base|src|programs|utils)/.*(h|hpp)$' +# We don't want to use clang-tidy diagnostics in the "contrib" folder. +ExcludeHeaderFilterRegex: '^.*/contrib/.*' + Checks: [ '*', @@ -28,6 +31,7 @@ Checks: [ '-bugprone-unchecked-optional-access', '-bugprone-crtp-constructor-accessibility', '-bugprone-not-null-terminated-result', + '-bugprone-forward-declaration-namespace', '-cert-dcl16-c', '-cert-err58-cpp', diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index c2ff2e056b1..d3b4dc74a29 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -17,7 +17,7 @@ tests/ci/cancel_and_rerun_workflow_lambda/app.py - Not for changelog (changelog entry is not required) -### Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md): +### Changelog entry (a [user-readable short description](https://github.com/ClickHouse/ClickHouse/blob/master/docs/changelog_entry_guidelines.md) of the changes that goes into CHANGELOG.md): ... ### Documentation entry for user-facing changes diff --git a/.github/workflows/vectorsearchstress.yml b/.github/workflows/vectorsearchstress.yml new file mode 100644 index 00000000000..38ed3f42369 --- /dev/null +++ b/.github/workflows/vectorsearchstress.yml @@ -0,0 +1,128 @@ +# generated by praktika + +name: VectorSearchStress +on: + schedule: + - cron: 47 15 * * 0 + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }} + +env: + PYTHONUNBUFFERED: 1 + CHECKOUT_REF: "" + +jobs: + + config_workflow: + runs-on: [self-hosted, style-checker-aarch64] + needs: [] + name: "Config Workflow" + outputs: + data: ${{ steps.run.outputs.DATA }} + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: ${{ env.CHECKOUT_REF }} + + - name: Prepare env script + run: | + rm -rf ./ci/tmp ./ci/tmp ./ci/tmp + mkdir -p ./ci/tmp ./ci/tmp ./ci/tmp + cat > ./ci/tmp/praktika_setup_env.sh << 'ENV_SETUP_SCRIPT_EOF' + export PYTHONPATH=./ci:.: + cat > ./ci/tmp/workflow_config_vectorsearchstress.json << 'EOF' + ${{ needs.config_workflow.outputs.data }} + EOF + cat > ./ci/tmp/workflow_status.json << 'EOF' + ${{ toJson(needs) }} + EOF + ENV_SETUP_SCRIPT_EOF + + - name: Run + id: run + run: | + . ./ci/tmp/praktika_setup_env.sh + set -o pipefail + if command -v ts &> /dev/null; then + python3 -m praktika run 'Config Workflow' --workflow "VectorSearchStress" --ci |& ts '[%Y-%m-%d %H:%M:%S]' | tee ./ci/tmp/job.log + else + python3 -m praktika run 'Config Workflow' --workflow "VectorSearchStress" --ci |& tee ./ci/tmp/job.log + fi + + vector_search_stress: + runs-on: [self-hosted, arm-small] + needs: [config_workflow] + name: "Vector Search Stress" + outputs: + data: ${{ steps.run.outputs.DATA }} + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: ${{ env.CHECKOUT_REF }} + + - name: Prepare env script + run: | + rm -rf ./ci/tmp ./ci/tmp ./ci/tmp + mkdir -p ./ci/tmp ./ci/tmp ./ci/tmp + cat > ./ci/tmp/praktika_setup_env.sh << 'ENV_SETUP_SCRIPT_EOF' + export PYTHONPATH=./ci:.: + cat > ./ci/tmp/workflow_config_vectorsearchstress.json << 'EOF' + ${{ needs.config_workflow.outputs.data }} + EOF + cat > ./ci/tmp/workflow_status.json << 'EOF' + ${{ toJson(needs) }} + EOF + ENV_SETUP_SCRIPT_EOF + + - name: Run + id: run + run: | + . ./ci/tmp/praktika_setup_env.sh + set -o pipefail + if command -v ts &> /dev/null; then + python3 -m praktika run 'Vector Search Stress' --workflow "VectorSearchStress" --ci |& ts '[%Y-%m-%d %H:%M:%S]' | tee ./ci/tmp/job.log + else + python3 -m praktika run 'Vector Search Stress' --workflow "VectorSearchStress" --ci |& tee ./ci/tmp/job.log + fi + + finish_workflow: + runs-on: [self-hosted, style-checker-aarch64] + needs: [config_workflow, vector_search_stress] + if: ${{ !cancelled() }} + name: "Finish Workflow" + outputs: + data: ${{ steps.run.outputs.DATA }} + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: ${{ env.CHECKOUT_REF }} + + - name: Prepare env script + run: | + rm -rf ./ci/tmp ./ci/tmp ./ci/tmp + mkdir -p ./ci/tmp ./ci/tmp ./ci/tmp + cat > ./ci/tmp/praktika_setup_env.sh << 'ENV_SETUP_SCRIPT_EOF' + export PYTHONPATH=./ci:.: + cat > ./ci/tmp/workflow_config_vectorsearchstress.json << 'EOF' + ${{ needs.config_workflow.outputs.data }} + EOF + cat > ./ci/tmp/workflow_status.json << 'EOF' + ${{ toJson(needs) }} + EOF + ENV_SETUP_SCRIPT_EOF + + - name: Run + id: run + run: | + . ./ci/tmp/praktika_setup_env.sh + set -o pipefail + if command -v ts &> /dev/null; then + python3 -m praktika run 'Finish Workflow' --workflow "VectorSearchStress" --ci |& ts '[%Y-%m-%d %H:%M:%S]' | tee ./ci/tmp/job.log + else + python3 -m praktika run 'Finish Workflow' --workflow "VectorSearchStress" --ci |& tee ./ci/tmp/job.log + fi diff --git a/.gitignore b/.gitignore index 35776ee9036..e63ce4ea900 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,7 @@ *.log *.debuglog *.stderr +*.stderr-fatal* *.stdout # llvm-xray logs @@ -167,6 +168,7 @@ tests/queries/0_stateless/*.binary tests/queries/0_stateless/*.generated-expect tests/queries/0_stateless/*.expect.history tests/integration/**/_gen +tests/casa_del_dolor/_instances* # pytest --pdb history .pdb_history diff --git a/.gitmodules b/.gitmodules index a8902cdab9a..acbf082b401 100644 --- a/.gitmodules +++ b/.gitmodules @@ -40,6 +40,9 @@ [submodule "contrib/boost"] path = contrib/boost url = https://github.com/ClickHouse/boost +[submodule "contrib/arrow"] + path = contrib/arrow + url = https://github.com/ClickHouse/arrow [submodule "contrib/thrift"] path = contrib/thrift url = https://github.com/apache/thrift @@ -134,9 +137,6 @@ [submodule "contrib/fmtlib"] path = contrib/fmtlib url = https://github.com/fmtlib/fmt -[submodule "contrib/sentry-native"] - path = contrib/sentry-native - url = https://github.com/ClickHouse/sentry-native [submodule "contrib/krb5"] path = contrib/krb5 url = https://github.com/ClickHouse/krb5 @@ -296,9 +296,6 @@ [submodule "contrib/aws-c-compression"] path = contrib/aws-c-compression url = https://github.com/awslabs/aws-c-compression -[submodule "contrib/aws-s2n-tls"] - path = contrib/aws-s2n-tls - url = https://github.com/ClickHouse/s2n-tls [submodule "contrib/crc32-vpmsum"] path = contrib/crc32-vpmsum url = https://github.com/antonblanchard/crc32-vpmsum.git @@ -372,9 +369,27 @@ [submodule "contrib/SHA3IUF"] path = contrib/SHA3IUF url = https://github.com/brainhub/SHA3IUF.git -[submodule "contrib/arrow"] - path = contrib/arrow - url = https://github.com/chdb-io/arrow.git +[submodule "contrib/chdig"] + path = contrib/chdig + url = https://github.com/azat/chdig.git +[submodule "contrib/ai-sdk-cpp"] + path = contrib/ai-sdk-cpp + url = https://github.com/ClickHouse/ai-sdk-cpp +[submodule "contrib/nlohmann-json"] + path = contrib/nlohmann-json + url = https://github.com/nlohmann/json.git +[submodule "contrib/crc32c"] + path = contrib/crc32c + url = https://github.com/google/crc32c.git +[submodule "contrib/simde"] + path = contrib/simde + url = https://github.com/simd-everywhere/simde +[submodule "contrib/FastPFOR"] + path = contrib/FastPFOR + url = https://github.com/fast-pack/FastPFOR +[submodule "contrib/antlr4-cpp-runtime"] + path = contrib/antlr4-cpp-runtime + url = https://github.com/antlr/antlr4.git [submodule "contrib/utf8proc"] path = contrib/utf8proc url = https://github.com/JuliaStrings/utf8proc.git diff --git a/.snyk b/.snyk deleted file mode 100644 index 7acc6b9fbf5..00000000000 --- a/.snyk +++ /dev/null @@ -1,4 +0,0 @@ -# Snyk (https://snyk.io) policy file -exclude: - global: - - tests/** diff --git a/CMakeLists.txt b/CMakeLists.txt index 7406ad6008a..099ff907e9a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -234,6 +234,8 @@ if (SPLIT_DEBUG_SYMBOLS) set(SPLIT_DEBUG_SYMBOLS_DIR "stripped" CACHE STRING "A separate directory for stripped information") endif() +option(BUILD_STRIPPED_BINARY "Build stripped binary (clickhouse-stripped)" OFF) + cmake_host_system_information(RESULT AVAILABLE_PHYSICAL_MEMORY QUERY AVAILABLE_PHYSICAL_MEMORY) # Not available under freebsd @@ -302,9 +304,8 @@ set (CMAKE_C_STANDARD_REQUIRED ON) # See https://reviews.llvm.org/D112921 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsized-deallocation") -# falign-functions=32 prevents from random performance regressions with the code change. Thus, providing more stable -# benchmarks. -set(COMPILER_FLAGS "${COMPILER_FLAGS} -falign-functions=32") +# falign-functions=64 prevents from random performance regressions with the code change. Thus, providing more stable benchmarks. +set(COMPILER_FLAGS "${COMPILER_FLAGS} -falign-functions=64") if (ARCH_AMD64) # align branches within a 32-Byte boundary to avoid the potential performance loss when code layout change, @@ -381,6 +382,15 @@ elseif (ENABLE_THINLTO) message (${RECONFIGURE_MESSAGE_LEVEL} "Cannot enable ThinLTO") endif () +if(COMPILER_PIPE) + set(MAX_COMPILER_MEMORY 2500) +else() + set(MAX_COMPILER_MEMORY 1500) +endif() +set(MAX_LINKER_MEMORY 5000) +include(cmake/limit_jobs.cmake) + + # Turns on all external libs like s3, kafka, ODBC, ... option(ENABLE_LIBRARIES "Enable all external libraries by default" ON) @@ -402,15 +412,6 @@ endif () link_libraries(global-group) target_link_libraries(global-group INTERFACE $) -option (ENABLE_GWP_ASAN "Enable Gwp-Asan" OFF) -# We use mmap for allocations more heavily in debug builds, -# but GWP-ASan also wants to use mmap frequently, -# and due to a large number of memory mappings, -# it does not work together well. -# if ((NOT OS_LINUX AND NOT OS_ANDROID) OR (CMAKE_BUILD_TYPE_UC STREQUAL "DEBUG")) -# set(ENABLE_GWP_ASAN OFF) -# endif () - option (ENABLE_FIU "Enable Fiu" ON) option(WERROR "Enable -Werror compiler option" ON) @@ -517,13 +518,32 @@ macro (clickhouse_add_executable target) add_executable (${ARGV} $) endif () + # Wrap the malloc/free and other C-style functions with our own ones + # to inject memory tracking mechanism into them. + # Sanitizers have their own way of intercepting the + # allocations and deallocations, so we skip this step for them. + if (NOT (SANITIZE OR SANITIZE_COVERAGE OR OS_DARWIN OR OS_FREEBSD)) + target_link_options(${target} PRIVATE + "LINKER:--wrap=malloc" + "LINKER:--wrap=free" + "LINKER:--wrap=calloc" + "LINKER:--wrap=realloc" + "LINKER:--wrap=aligned_alloc" + "LINKER:--wrap=posix_memalign" + "LINKER:--wrap=valloc" + "LINKER:--wrap=memalign" + "LINKER:--wrap=reallocarray" + ) + if (NOT USE_MUSL) + target_link_options(${target} PRIVATE + "LINKER:--wrap=pvalloc" + ) + endif() + endif() + get_target_property (type ${target} TYPE) if (${type} STREQUAL EXECUTABLE) - # Disabled if memory tracking is disabled - if (TARGET clickhouse_new_delete) - # operator::new/delete for executables (MemoryTracker stuff) - target_link_libraries (${target} PRIVATE clickhouse_new_delete) - endif() + target_link_libraries (${target} PUBLIC clickhouse_new_delete) # In case of static jemalloc, because zone_register() is located in zone.c and # is never used outside (it is declared as constructor) it is omitted @@ -595,6 +615,9 @@ option(CHECK_LARGE_OBJECT_SIZES "Check that there are no large object files afte add_subdirectory (base) add_subdirectory (src) +if (LEXER_STANDALONE_BUILD) + add_subdirectory(tests/lexer) +endif () add_subdirectory (programs) add_subdirectory (utils) diff --git a/SECURITY.md b/SECURITY.md index c3a45802fb3..c5eafb5d086 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -14,9 +14,12 @@ The following versions of ClickHouse server are currently supported with securit | Version | Supported | |:-|:-| -| 25.4 | ✔️ | +| 25.7 | ✔️ | +| 25.6 | ✔️ | +| 25.5 | ✔️ | +| 25.4 | ❌ | | 25.3 | ✔️ | -| 25.2 | ✔️ | +| 25.2 | ❌ | | 25.1 | ❌ | | 24.12 | ❌ | | 24.11 | ❌ | diff --git a/base/base/Decimal.cpp b/base/base/Decimal.cpp index 7e65c0eb8d1..2e026c33ca0 100644 --- a/base/base/Decimal.cpp +++ b/base/base/Decimal.cpp @@ -1,4 +1,5 @@ #include +#include #include namespace DB @@ -72,13 +73,15 @@ template Decimal operator- (const Decimal & x, const Decimal< template Decimal operator* (const Decimal & x, const Decimal & y) { return x.value * y.value; } template Decimal operator/ (const Decimal & x, const Decimal & y) { return x.value / y.value; } template Decimal operator- (const Decimal & x) { return -x.value; } +template Decimal NO_SANITIZE_UNDEFINED negateOverflow (const Decimal & x) { return -x.value; } #define DISPATCH(TYPE) \ template Decimal operator+ (const Decimal & x, const Decimal & y); \ template Decimal operator- (const Decimal & x, const Decimal & y); \ template Decimal operator* (const Decimal & x, const Decimal & y); \ template Decimal operator/ (const Decimal & x, const Decimal & y); \ -template Decimal operator- (const Decimal & x); +template Decimal operator- (const Decimal & x); \ +template Decimal NO_SANITIZE_UNDEFINED negateOverflow (const Decimal & x); FOR_EACH_UNDERLYING_DECIMAL_TYPE(DISPATCH) #undef DISPATCH diff --git a/base/base/Decimal.h b/base/base/Decimal.h index 42f9e67c49d..fd7e74b8222 100644 --- a/base/base/Decimal.h +++ b/base/base/Decimal.h @@ -10,6 +10,7 @@ namespace DB { template struct Decimal; class DateTime64; +class Time64; #define FOR_EACH_UNDERLYING_DECIMAL_TYPE(M) \ M(Int32) \ @@ -118,13 +119,15 @@ template Decimal operator- (const Decimal & x, const Decimal< template Decimal operator* (const Decimal & x, const Decimal & y); template Decimal operator/ (const Decimal & x, const Decimal & y); template Decimal operator- (const Decimal & x); +template Decimal NO_SANITIZE_UNDEFINED negateOverflow (const Decimal & x); #define DISPATCH(TYPE) \ extern template Decimal operator+ (const Decimal & x, const Decimal & y); \ extern template Decimal operator- (const Decimal & x, const Decimal & y); \ extern template Decimal operator* (const Decimal & x, const Decimal & y); \ extern template Decimal operator/ (const Decimal & x, const Decimal & y); \ -extern template Decimal operator- (const Decimal & x); +extern template Decimal operator- (const Decimal & x); \ +extern template Decimal NO_SANITIZE_UNDEFINED negateOverflow (const Decimal & x); FOR_EACH_UNDERLYING_DECIMAL_TYPE(DISPATCH) #undef DISPATCH @@ -142,6 +145,16 @@ class DateTime64 : public Decimal64 constexpr DateTime64(const Base & v): Base(v) {} // NOLINT(google-explicit-constructor) }; + +class Time64 : public Decimal64 +{ +public: + using Base = Decimal64; + using Base::Base; + using NativeType = Base::NativeType; + + constexpr Time64(const Base & v): Base(v) {} // NOLINT(google-explicit-constructor) +}; } constexpr UInt64 max_uint_mask = std::numeric_limits::max(); @@ -173,6 +186,15 @@ namespace std } }; + template <> + struct hash + { + size_t operator()(const DB::Time64 & x) const + { + return std::hash()(x); + } + }; + template <> struct hash { diff --git a/base/base/Decimal_fwd.h b/base/base/Decimal_fwd.h index a11e13a479b..6983551c862 100644 --- a/base/base/Decimal_fwd.h +++ b/base/base/Decimal_fwd.h @@ -27,6 +27,7 @@ using Decimal128 = Decimal; using Decimal256 = Decimal; class DateTime64; +class Time64; template concept is_decimal = @@ -34,7 +35,8 @@ concept is_decimal = || std::is_same_v || std::is_same_v || std::is_same_v - || std::is_same_v; + || std::is_same_v + || std::is_same_v; template concept is_over_big_int = diff --git a/base/base/JSON.h b/base/base/JSON.h index 03dd62d639d..44d65abb4a9 100644 --- a/base/base/JSON.h +++ b/base/base/JSON.h @@ -6,35 +6,35 @@ #include -/** Очень простой класс для чтения JSON (или его кусочков). - * Представляет собой ссылку на кусок памяти, в котором содержится JSON (или его кусочек). - * Не создаёт никаких структур данных в оперативке. Не выделяет память (кроме std::string). - * Не парсит JSON до конца (парсит только часть, необходимую для выполнения вызванного метода). - * Парсинг необходимой части запускается каждый раз при вызове методов. - * Может работать с обрезанным JSON-ом. - * При этом, (в отличие от SAX-подобных парсеров), предоставляет удобные методы для работы. +/** A very simple class for reading JSON (or its fragments). + * Represents a reference to a piece of memory that contains JSON (or its fragment). + * Does not create any data structures in memory. Does not allocate memory (except for std::string). + * Does not parse JSON to the end (parses only the part needed to execute the called method). + * Parsing of the necessary part is started each time methods are called. + * Can work with truncated JSON. + * At the same time, (unlike SAX-like parsers), provides convenient methods for working. * - * Эта структура данных более оптимальна, если нужно доставать несколько элементов из большого количества маленьких JSON-ов. - * То есть, подходит для обработки "параметров визитов" и "параметров интернет магазинов" в Яндекс.Метрике. - * Если нужно много работать с одним большим JSON-ом, то этот класс может быть менее оптимальным. + * This data structure is more optimal if you need to extract several elements from a large number of small JSONs. + * That is, it is suitable for processing "visit parameters" and "online store parameters" in Yandex.Metrica. + * If you need to do a lot of work with one large JSON, then this class may be less optimal. * - * Имеются следующие соглашения: - * 1. Предполагается, что в JSON-е нет пробельных символов. - * 2. Предполагается, что строки в JSON в кодировке UTF-8; также могут использоваться \u-последовательности. - * Строки возвращаются в кодировке UTF-8, \u-последовательности переводятся в UTF-8. - * 3. Но суррогатная пара из двух \uXXXX\uYYYY переводится не в UTF-8, а в CESU-8. - * 4. Корректный JSON парсится корректно. - * При работе с некорректным JSON-ом, кидается исключение или возвращаются неверные результаты. - * (пример: считается, что если встретился символ 'n', то после него идёт 'ull' (null); - * если после него идёт ',1,', то исключение не кидается, и, таким образом, возвращается неверный результат) - * 5. Глубина вложенности JSON ограничена (см. MAX_JSON_DEPTH в cpp файле). - * При необходимости спуститься на большую глубину, кидается исключение. - * 6. В отличие от JSON, пользоволяет парсить значения вида 64-битное число, со знаком, или без. - * При этом, если число дробное - то дробная часть тихо отбрасывается. - * 7. Числа с плавающей запятой парсятся не с максимальной точностью. + * The following conventions are available: + * 1. It is assumed that there are no whitespace characters in JSON. + * 2. It is assumed that strings in JSON are in UTF-8 encoding; \u-sequences can also be used. + * Strings are returned in UTF-8 encoding, \u-sequences are converted to UTF-8. + * 3. But a surrogate pair of two \uXXXX\uYYYY is converted not to UTF-8, but to CESU-8. + * 4. Correct JSON is parsed correctly. + * When working with incorrect JSON, an exception is thrown or incorrect results are returned. + * (example: it is considered that if the symbol 'n' is encountered, then 'ull' (null) follows it; + * if ',1,' follows it, then no exception is thrown, and thus an incorrect result is returned) + * 5. The nesting depth of JSON is limited (see MAX_JSON_DEPTH in cpp file). + * When it is necessary to go to a greater depth, an exception is thrown. + * 6. Unlike JSON, allows parsing values like 64-bit number, signed or unsigned. + * At the same time, if the number is fractional - then the fractional part is silently discarded. + * 7. Floating point numbers are parsed with not maximum precision. * - * Подходит только для чтения JSON, модификация не предусмотрена. - * Все методы immutable, кроме operator++. + * Suitable only for reading JSON, modification is not provided. + * All methods are immutable, except operator++. */ @@ -96,52 +96,52 @@ class JSON bool isNull() const { return getType() == TYPE_NULL; } bool isNameValuePair() const { return getType() == TYPE_NAME_VALUE_PAIR; } - /// Количество элементов в массиве или объекте; если элемент - не массив или объект, то исключение. + /// Number of elements in array or object; if element is not array or object, then exception. size_t size() const; - /// Является ли массив или объект пустыми; если элемент - не массив или объект, то исключение. + /// Whether array or object is empty; if element is not array or object, then exception. bool empty() const; - /// Получить элемент массива по индексу; если элемент - не массив, то исключение. + /// Get array element by index; if element is not array, then exception. JSON operator[] (size_t n) const; - /// Получить элемент объекта по имени; если элемент - не объект, то исключение. + /// Get object element by name; if element is not object, then exception. JSON operator[] (const std::string & name) const; - /// Есть ли в объекте элемент с заданным именем; если элемент - не объект, то исключение. + /// Whether object has element with given name; if element is not object, then exception. bool has(const std::string & name) const { return has(name.data(), name.size()); } bool has(const char * data, size_t size) const; - /// Получить значение элемента; исключение, если элемент имеет неправильный тип. + /// Get element value; exception if element has wrong type. template T get() const; - /// если значения нет, или тип неверный, то возвращает дефолтное значение + /// if value is missing or type is wrong, then returns default value template T getWithDefault(const std::string & key, const T & default_ = T()) const; double getDouble() const; - Int64 getInt() const; /// Отбросить дробную часть. - UInt64 getUInt() const; /// Отбросить дробную часть. Если число отрицательное - исключение. + Int64 getInt() const; /// Discard fractional part. + UInt64 getUInt() const; /// Discard fractional part. If number is negative - exception. std::string getString() const; bool getBool() const; - std::string getName() const; /// Получить имя name-value пары. - JSON getValue() const; /// Получить значение name-value пары. + std::string getName() const; /// Get name of name-value pair. + JSON getValue() const; /// Get value of name-value pair. std::string_view getRawString() const; std::string_view getRawName() const; - /// Получить значение элемента; если элемент - строка, то распарсить значение из строки; если не строка или число - то исключение. + /// Get element value; if element is string, then parse value from string; if not string or number - then exception. double toDouble() const; Int64 toInt() const; UInt64 toUInt() const; - /** Преобразовать любой элемент в строку. - * Для строки возвращается её значение, для всех остальных элементов - сериализованное представление. + /** Convert any element to string. + * For string returns its value, for all other elements - serialized representation. */ std::string toString() const; - /// Класс JSON одновременно является итератором по самому себе. + /// JSON class is simultaneously an iterator over itself. using iterator = JSON; using const_iterator = JSON; @@ -150,32 +150,32 @@ class JSON bool operator== (const JSON & rhs) const { return ptr_begin == rhs.ptr_begin; } bool operator!= (const JSON & rhs) const { return ptr_begin != rhs.ptr_begin; } - /** Если элемент - массив или объект, то begin() возвращает iterator, - * который указывает на первый элемент массива или первую name-value пару объекта. + /** If element is array or object, then begin() returns iterator, + * which points to the first element of array or first name-value pair of object. */ iterator begin() const; - /** end() - значение, которое нельзя использовать; сигнализирует о том, что элементы закончились. + /** end() - value that cannot be used; signals that elements are finished. */ iterator end() const; - /// Перейти к следующему элементу массива или следующей name-value паре объекта. + /// Move to next array element or next name-value pair of object. iterator & operator++(); iterator operator++(int); // NOLINT(cert-dcl21-cpp) - /// Есть ли в строке escape-последовательности + /// Whether string has escape sequences bool hasEscapes() const; - /// Есть ли в строке спец-символы из набора \, ', \0, \b, \f, \r, \n, \t, возможно, заэскейпленные. + /// Whether string has special characters from the set \, ', \0, \b, \f, \r, \n, \t, possibly escaped. bool hasSpecialChars() const; private: - /// Проверить глубину рекурсии, а также корректность диапазона памяти. + /// Check recursion depth and memory range correctness. void checkInit() const; - /// Проверить, что pos лежит внутри диапазона памяти. + /// Check that pos lies within memory range. void checkPos(Pos pos) const; - /// Вернуть позицию после заданного элемента. + /// Return position after given element. Pos skipString() const; Pos skipNumber() const; Pos skipBool() const; @@ -186,7 +186,7 @@ class JSON Pos skipElement() const; - /// Найти name-value пару с заданным именем в объекте. + /// Find name-value pair with given name in object. Pos searchField(const std::string & name) const { return searchField(name.data(), name.size()); } Pos searchField(const char * data, size_t size) const; diff --git a/base/base/TypeName.h b/base/base/TypeName.h index 1f4b475d653..a00af5db503 100644 --- a/base/base/TypeName.h +++ b/base/base/TypeName.h @@ -44,6 +44,7 @@ TN_MAP(Decimal64) TN_MAP(Decimal128) TN_MAP(Decimal256) TN_MAP(DateTime64) +TN_MAP(Time64) TN_MAP(Array) TN_MAP(Tuple) TN_MAP(Map) diff --git a/base/base/extended_types.h b/base/base/extended_types.h index ef36a5385a0..5a7b3e718ae 100644 --- a/base/base/extended_types.h +++ b/base/base/extended_types.h @@ -74,6 +74,7 @@ template concept is_floating_point = M(DataTypeDate) \ M(DataTypeDate32) \ M(DataTypeDateTime) \ + M(DataTypeTime) \ M(DataTypeInt8) \ M(DataTypeUInt8) \ M(DataTypeInt16) \ @@ -94,6 +95,7 @@ template concept is_floating_point = M(DataTypeDate, X) \ M(DataTypeDate32, X) \ M(DataTypeDateTime, X) \ + M(DataTypeTime, X) \ M(DataTypeInt8, X) \ M(DataTypeUInt8, X) \ M(DataTypeInt16, X) \ diff --git a/base/base/map.h b/base/base/map.h deleted file mode 100644 index 0de42ebfdf6..00000000000 --- a/base/base/map.h +++ /dev/null @@ -1,52 +0,0 @@ -#pragma once - -#include -#include - -namespace collections -{ - -/// \brief Strip type off top level reference and cv-qualifiers thus allowing storage in containers -template -using unqualified_t = std::remove_cv_t>; - -/** \brief Returns collection of the same container-type as the input collection, - * with each element transformed by the application of `mapper`. - */ -template