> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-detect-table-modification.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 2022 更新日志

> 2022 年更新日志

### <a id="2212" /> ClickHouse 发行版 22.12，2022-12-15。 [演示文稿](https://presentations.clickhouse.com/2022-release-22.12/), [视频](https://www.youtube.com/watch?v=sREupr6uc2k)

<Frame>
  <iframe src="https://www.youtube.com/embed/sREupr6uc2k" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen />
</Frame>

<Warning>
  此版本包含一条有问题的 systemd 服务注释，在某些 Linux 发行版上可能会导致升级时 ClickHouse 安装损坏。该 systemd 服务会更改 `/run/systemd` 目录的所有者权限，导致后续所有 systemd 操作失败。建议跳过升级到此版本，改为升级到更新的 ClickHouse 版本。

  更多详情请参阅 GitHub 上的这个 issue：[https://github.com/ClickHouse/ClickHouse/issues/48285](https://github.com/ClickHouse/ClickHouse/issues/48285)
</Warning>

<div id="upgrade-notes">
  #### 升级说明
</div>

* 修复了 `min`、`max`、`any*`、`argMin`、`argMax` 这些带有 `String` argument 的 aggregate functions 在状态 (反) serialization 上的向后不兼容问题。该不兼容性影响 22.9、22.10 和 22.11 分支 (分别自 22.9.6、22.10.4 和 22.11.2 起已修复) 。22.3、22.7 和 22.8 分支的部分次要版本也受影响：22.3.13...22.3.14 (自 22.3.15 起修复) 、22.8.6...22.8.9 (自 22.8.10 起修复) ，以及 22.7.6 及更高版本 (22.7 分支中不会修复，建议从 22.7.\* 升级到 22.8.10 或更高版本) 。本发布说明不涉及从未使用过受影响版本的用户。不兼容版本在读取上述 aggregate functions 的状态时，会在字符串末尾额外追加一个 `'\0'`。例如，如果旧版本将 `anyState('foobar')` 的状态保存到 `state_column`，那么不兼容版本在执行 `anyMerge(state_column)` 时会输出 `'foobar\0'`。此外，不兼容版本在写入这些 aggregate functions 的状态时，不会写入末尾的 `'\0'`。较新版本 (即已包含修复的版本) 可以正确读取所有版本写入的数据，包括不兼容版本，只有一种边界情况例外：如果不兼容版本保存的状态中，字符串本身确实以空字符结尾，那么较新版本在读取受影响 aggregate function 的状态时，会截去末尾的 `'\0'`。例如，如果不兼容版本将 `anyState('abrac\0dabra\0')` 的状态保存到 `state_column`，那么较新版本在执行 `anyMerge(state_column)` 时会输出 `'abrac\0dabra'`。当不兼容版本与旧版本或较新版本在同一个 cluster 中共同运行时，该问题也会影响分布式查询。[#43038](https://github.com/ClickHouse/ClickHouse/pull/43038) ([Alexander Tokmakov](https://github.com/tavplubix)、[Raúl Marín](https://github.com/Algunenano)) 。注意：所有官方 ClickHouse 构建均已包含这些补丁；但非官方第三方构建则未必如此，因此应避免使用。

<div id="new-feature">
  #### 新特性
</div>

* 新增 `BSONEachRow` 输入/输出格式。在这种格式下，ClickHouse 会将每一行格式化/解析为单独的 BSON 文档，并将每一列格式化/解析为单个 BSON 字段，以列名作为键。[#42033](https://github.com/ClickHouse/ClickHouse/pull/42033) ([mark-polokhov](https://github.com/mark-polokhov)) 。
* 新增 `grace_hash` JOIN 算法，可使用 `SET join_algorithm = 'grace_hash'` 启用。[#38191](https://github.com/ClickHouse/ClickHouse/pull/38191) ([BigRedEye](https://github.com/BigRedEye)、[Vladimir C](https://github.com/vdimir)) 。
* 支持为创建和修改用户配置密码复杂度规则和校验。[#43719](https://github.com/ClickHouse/ClickHouse/pull/43719) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 对日志中的敏感信息进行脱敏；对查询 `SHOW CREATE TABLE` 和 `SELECT FROM system.tables` 输出中的敏感部分进行脱敏。同时还修复了 [#41418](https://github.com/ClickHouse/ClickHouse/issues/41418)。[#43227](https://github.com/ClickHouse/ClickHouse/pull/43227) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 新增 `GROUP BY ALL` 语法：[#37631](https://github.com/ClickHouse/ClickHouse/issues/37631)。[#42265](https://github.com/ClickHouse/ClickHouse/pull/42265) ([刘陶峰](https://github.com/taofengliu)) 。
* 新增 `FROM table SELECT column` 语法。 [#41095](https://github.com/ClickHouse/ClickHouse/pull/41095) ([Nikolay Degterinsky](https://github.com/evillique)).
* 新增了函数 `concatWithSeparator`，以及作为别名用于兼容 Spark SQL 的 `concat_ws`。还新增了函数 `concatWithSeparatorAssumeInjective` 这一变体，用于启用 GROUP BY 优化，类似于 `concatAssumeInjective`。[#43749](https://github.com/ClickHouse/ClickHouse/pull/43749) ([李扬](https://github.com/taiyang-li)).
* 新增了用于固定精度十进制运算的 `multiplyDecimal` 和 `divideDecimal` 函数。[#42438](https://github.com/ClickHouse/ClickHouse/pull/42438) ([Andrey Zvonov](https://github.com/zvonand)) 。
* 新增了 `system.moves` 表，用于列出当前正在移动的 parts。[#42660](https://github.com/ClickHouse/ClickHouse/pull/42660) ([Sergei Trifonov](https://github.com/serxa)) 。
* 新增了对 ClickHouse Keeper 内置 Prometheus 端点的支持。[#43087](https://github.com/ClickHouse/ClickHouse/pull/43087) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 支持在数字字面量中使用 `_` 作为分隔符，例如 `1_000_000`。[#43925](https://github.com/ClickHouse/ClickHouse/pull/43925) ([jh0x](https://github.com/jh0x)).
* 新增了将数组用作 `cutURLParameter` 函数第二个参数的功能，可一次截取多个参数。关闭 [#6827](https://github.com/ClickHouse/ClickHouse/issues/6827)。[#43788](https://github.com/ClickHouse/ClickHouse/pull/43788) ([Roman Vasin](https://github.com/rvasin)) 。
* 在 `system.data_skipping_indices` 表中新增一列，用于存储索引表达式。[#43308](https://github.com/ClickHouse/ClickHouse/pull/43308) ([Guillaume Tassery](https://github.com/YiuRULE)) 。
* 向系统表 `databases` 添加列 `engine_full`，以便通过系统表访问数据库的完整引擎定义。[#43468](https://github.com/ClickHouse/ClickHouse/pull/43468) ([凌涛](https://github.com/lingtaolf)).
* 新增了新的哈希函数 [xxh3](https://github.com/Cyan4973/xxHash)。此外，得益于库更新，`xxHash32` 和 `xxHash64` 在 ARM 平台上的性能也有所提升。[#43411](https://github.com/ClickHouse/ClickHouse/pull/43411) ([Nikita Taranov](https://github.com/nickitat)) 。
* 新增了为 MergeTree 设置定义约束的支持。例如，你可以禁止用户覆盖 `storage_policy`。[#43903](https://github.com/ClickHouse/ClickHouse/pull/43903) ([Sergei Trifonov](https://github.com/serxa)) 。
* 新增设置 `input_format_json_read_objects_as_strings`，允许在所有 JSON 输入格式中将嵌套的 JSON 对象解析为 String。该设置默认处于禁用状态。[#44052](https://github.com/ClickHouse/ClickHouse/pull/44052) ([Kruglov Pavel](https://github.com/Avogar)) 。

<div id="experimental-feature">
  #### Experimental 功能
</div>

* 为异步插入增加去重支持。在此变更之前，异步插入不支持去重，因为多个小型插入会同时存在于一个插入批次中。关闭 [#38075](https://github.com/ClickHouse/ClickHouse/issues/38075)。[#43304](https://github.com/ClickHouse/ClickHouse/pull/43304) ([Han Fei](https://github.com/hanfei1991)).
* 为 Experimental 的 Annoy (向量相似度搜索) 索引增加对余弦距离的支持。[#42778](https://github.com/ClickHouse/ClickHouse/pull/42778) ([Filatenkov Artur](https://github.com/FArthur-cmd)).
* 新增 `CREATE / ALTER / DROP NAMED COLLECTION` 查询。[#43252](https://github.com/ClickHouse/ClickHouse/pull/43252) ([Kseniia Sumarokova](https://github.com/kssenii)). 该功能仍在开发中，截至 22.12 版本这些查询尚未生效。添加这条更新日志仅为避免混淆。将对命名集合的默认访问权限限制为 config 中定义的用户。这要求设置 `show_named_collections = 1` 才能查看它们。[#43325](https://github.com/ClickHouse/ClickHouse/pull/43325) ([Kseniia Sumarokova](https://github.com/kssenii)). 引入了 `system.named_collections` 表 [#43147](https://github.com/ClickHouse/ClickHouse/pull/43147) ([Kseniia Sumarokova](https://github.com/kssenii)).

<div id="performance-improvement">
  #### 性能改进
</div>

* 新增设置 `max_streams_for_merge_tree_reading` 和 `allow_asynchronous_read_from_io_pool_for_merge_tree`。`max_streams_for_merge_tree_reading` 用于限制 MergeTree 表的读取流数量。`allow_asynchronous_read_from_io_pool_for_merge_tree` 可启用后台 I/O 池从 `MergeTree` 表读取数据。若与 `max_streams_to_max_threads_ratio` 或 `max_streams_for_merge_tree_reading` 搭配使用，对于受 I/O 限制的查询，可能会提升性能。[#43260](https://github.com/ClickHouse/ClickHouse/pull/43260) ([Nikolai Kochetov](https://github.com/KochetovNicolai))。在高延迟存储、CPU 数量较少且数据分区片段较多的情况下，性能最高可提升 100 倍。
* 设置 `merge_tree_min_rows_for_concurrent_read_for_remote_filesystem/merge_tree_min_bytes_for_concurrent_read_for_remote_filesystem` 此前未考虑自适应粒度。较大的行不会减少读取行数 (而 `merge_tree_min_rows_for_concurrent_read/merge_tree_min_bytes_for_concurrent_read` 会这样处理) ，这在使用远程文件系统时可能导致较高的内存使用量。[#43965](https://github.com/ClickHouse/ClickHouse/pull/43965) ([Nikolai Kochetov](https://github.com/KochetovNicolai))。
* 在选择要合并的数据分区片段时，优化了发送到 ZooKeeper 或 ClickHouse Keeper 的列表请求数量。此前在某些情况下可能会产生成千上万的请求。修复了 [#43647](https://github.com/ClickHouse/ClickHouse/issues/43647)。[#43675](https://github.com/ClickHouse/ClickHouse/pull/43675) ([Alexander Tokmakov](https://github.com/tavplubix))。
* 如果 `max_size_to_preallocate_for_aggregation` 的值过小，现在会跳过该优化。该设置的默认值已提升至 `10^8`。[#43945](https://github.com/ClickHouse/ClickHouse/pull/43945) ([Nikita Taranov](https://github.com/nickitat))。
* 通过避免清理旧的数据分区片段，加快了服务器关闭速度。因为在 [https://github.com/ClickHouse/ClickHouse/pull/41145](https://github.com/ClickHouse/ClickHouse/pull/41145) 之后，这项清理已无必要。[#43760](https://github.com/ClickHouse/ClickHouse/pull/43760) ([Sema Checherinda](https://github.com/CheSema))。
* 如果设置了 `enable_memory_bound_merging_of_aggregation_results`，发起端上的合并现在会采用与本地 aggregation 结果合并相同的内存受限方案。[#40879](https://github.com/ClickHouse/ClickHouse/pull/40879) ([Nikita Taranov](https://github.com/nickitat))。
* Keeper 改进：尝试在复制的同时并行将日志同步到磁盘。[#43450](https://github.com/ClickHouse/ClickHouse/pull/43450) ([Antonio Andelic](https://github.com/antonio2368))。
* Keeper 改进：现在会更频繁地对请求进行批处理。可通过新设置 `max_requests_quick_batch_size` 控制批处理。[#43686](https://github.com/ClickHouse/ClickHouse/pull/43686) ([Antonio Andelic](https://github.com/antonio2368))。

<div id="improvement">
  #### 改进
</div>

* 实现引用依赖，并在从备份恢复时利用这些依赖按正确顺序创建表。[#43834](https://github.com/ClickHouse/ClickHouse/pull/43834) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 在 `CREATE` 查询中替换 UDFs，以避免启动时加载过程中失败。此外，UDFs 现在也可用作列的 `DEFAULT` 表达式。[#43539](https://github.com/ClickHouse/ClickHouse/pull/43539) ([Antonio Andelic](https://github.com/antonio2368)).
* 更改以下查询删除 parts 的方式：TRUNCATE TABLE、ALTER TABLE DROP PART、ALTER TABLE DROP PARTITION。现在，这些查询会创建覆盖旧 parts 的空 parts。这样，TRUNCATE 查询无需再获取后续的独占锁即可执行，这意味着并发读取不会被锁定。此外，这些查询也具备了持久性。如果请求成功，后续就不会再出现“复活”的 parts。请注意，只有在事务作用域内才能实现原子性。[#41145](https://github.com/ClickHouse/ClickHouse/pull/41145) ([Sema Checherinda](https://github.com/CheSema)) 。
* `SET param_x` 查询不再需要对参数值进行手动的字符串序列化。例如，`SET param_a = '[\'a\', \'b\']'` 查询现在可以写成 `SET param_a = ['a', 'b']`。[#41874](https://github.com/ClickHouse/ClickHouse/pull/41874) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 客户端从 STDIN 读取数据时，在进度指示中显示已读取的行数。关闭了 [#43423](https://github.com/ClickHouse/ClickHouse/issues/43423)。[#43442](https://github.com/ClickHouse/ClickHouse/pull/43442) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 从 S3 表函数 / 引擎读取时显示进度条。[#43454](https://github.com/ClickHouse/ClickHouse/pull/43454) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 进度条将同时显示已读取和已写入的行数。[#43496](https://github.com/ClickHouse/ClickHouse/pull/43496) ([Ilya Yatsishin](https://github.com/qoega)) 。
* `filesystemAvailable` 及相关函数现支持一个可选参数，用于指定 disk 名称，并将 `filesystemFree` 更名为 `filesystemUnreserved`。关闭了 [#35076](https://github.com/ClickHouse/ClickHouse/issues/35076)。[#42064](https://github.com/ClickHouse/ClickHouse/pull/42064) ([flynn](https://github.com/ucasfl)).
* LDAP 集成：将 search\_limit 的默认值提高到 256，并新增了 LDAP 服务器配置选项，可将其修改为任意值。关闭：[ #42276](https://github.com/ClickHouse/ClickHouse/issues/42276)。[#42461](https://github.com/ClickHouse/ClickHouse/pull/42461) ([Vasily Nemkov](https://github.com/Enmk)) 。
* 还允许从异常消息中删除敏感信息 (另见配置文件中的 `query_masking_rules`) 。解决了 [#41418](https://github.com/ClickHouse/ClickHouse/issues/41418)。[#42940](https://github.com/ClickHouse/ClickHouse/pull/42940) ([filimonov](https://github.com/filimonov)) 。
* 支持 `SHOW FULL TABLES ...` 这类查询，以兼容 MySQL。[#43910](https://github.com/ClickHouse/ClickHouse/pull/43910) ([Filatenkov Artur](https://github.com/FArthur-cmd)) 。
* Keeper 改进：新增 4lw 命令 `rqld`，可用于手动将某个节点设为 leader。[#43026](https://github.com/ClickHouse/ClickHouse/pull/43026) ([JackyWoo](https://github.com/JackyWoo)) 。
* 支持从查询中为 Distributed 异步 INSERT 应用连接超时设置。 [#43156](https://github.com/ClickHouse/ClickHouse/pull/43156) ([Azat Khuzhin](https://github.com/azat)).
* `unhex` 函数现在支持 `FixedString` 参数。[issue42369](https://github.com/ClickHouse/ClickHouse/issues/42369)。[#43207](https://github.com/ClickHouse/ClickHouse/pull/43207) ([DR](https://github.com/freedomDR)) 。
* 根据生存时间 (TTL) 规则，优先删除已完全过期的 parts，参见 [#42869](https://github.com/ClickHouse/ClickHouse/issues/42869)。[#43222](https://github.com/ClickHouse/ClickHouse/pull/43222) ([zhongyuankai](https://github.com/zhongyuankai)) 。
* clickhouse-client 中的 CPU 负载显示更精确、响应更及时。[#43307](https://github.com/ClickHouse/ClickHouse/pull/43307) ([Sergei Trifonov](https://github.com/serxa)).
* 支持从 `S3` 存储和表函数 `s3` 读取 `Parquet`、`Arrow` 和 `ORC` 格式中嵌套类型的子列。[#43329](https://github.com/ClickHouse/ClickHouse/pull/43329) ([chen](https://github.com/xiedeyantu)) 。
* 向 `system.parts` 表中添加 `table_uuid` 列。[#43404](https://github.com/ClickHouse/ClickHouse/pull/43404) ([Azat Khuzhin](https://github.com/azat)) 。
* 新增了一个客户端选项，可在非交互模式下显示本地处理的行数 (`--print-num-processed-rows`) 。[#43407](https://github.com/ClickHouse/ClickHouse/pull/43407) ([jh0x](https://github.com/jh0x)).
* 在查询计划层实现 `aggregation-in-order` 优化。该优化默认启用 (但只有在同时启用默认关闭的 `optimize_aggregation_in_order` 时才会生效) 。将 `query_plan_aggregation_in_order = 0` 设为使用之前基于 AST 的版本。[#43592](https://github.com/ClickHouse/ClickHouse/pull/43592) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 允许在每次递增时，将 `trace_type = 'ProfileEvent'` 的 profile events 连同当前调用栈、profile event 名称以及递增值一起收集到 `system.trace_log` 中。可通过设置 `trace_profile_events` 启用，并可用于分析 queries 的性能。[#43639](https://github.com/ClickHouse/ClickHouse/pull/43639) ([Anton Popov](https://github.com/CurtizJ)).
* 新增设置 `input_format_max_binary_string_size`，用于限制 RowBinary 格式中的字符串大小。[#43842](https://github.com/ClickHouse/ClickHouse/pull/43842) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 当 ClickHouse 请求远程 HTTP 服务器且其返回错误时，异常消息中的 HTTP 数字状态码未能正确显示。关闭 [#43919](https://github.com/ClickHouse/ClickHouse/issues/43919)。[#43920](https://github.com/ClickHouse/ClickHouse/pull/43920) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 即使在对多个 JOIN 进行优化时，也能正确报告查询中的错误。[#43583](https://github.com/ClickHouse/ClickHouse/pull/43583) ([Salvatore](https://github.com/tbsal)).

<div id="buildtestingpackaging-improvement">
  #### 构建/测试/打包改进
</div>

* Systemd 集成现在会正确通知 systemd：服务已真正启动并可开始处理请求。[#43400](https://github.com/ClickHouse/ClickHouse/pull/43400) ([Коренберг Марк](https://github.com/socketpair)).
* 新增了结合 [OpenSSL FIPS Module](https://www.openssl.org/docs/man3.0/man7/fips_module.html) 使用 OpenSSL 构建 ClickHouse 的选项。此构建类型尚未经过安全性验证测试，因此不受支持。[#43991](https://github.com/ClickHouse/ClickHouse/pull/43991) ([Boris Kuschel](https://github.com/bkuschel)).
* 升级到此前某个 PR 中实现的新 `DeflateQpl` 压缩 codec (详见：[https://github.com/ClickHouse/ClickHouse/pull/39494](https://github.com/ClickHouse/ClickHouse/pull/39494)) 。此补丁在以下几个方面改进了该 codec：1. 将 QPL 从 v0.2.0 升级到 v0.3.0 [Intel® Query Processing Library (QPL)](https://github.com/intel/qpl) 2. 改进了 CMake 文件，以修复 QPL v0.3.0 的构建问题。3. 在构建时将 QPL 库与 libaccel-config 链接，而不是像 QPL v0.2.0 那样在运行时加载 (dlopen) 。4. 修复了 CompressionCodecDeflateQpl.cpp 中的日志打印问题。[#44024](https://github.com/ClickHouse/ClickHouse/pull/44024) ([jasperzhu](https://github.com/jinjunzh)).

<div id="bug-fix-user-visible-misbehavior-in-official-stable-or-prestable-release">
  #### 缺陷修复 (官方稳定版本或预稳定版本中用户可感知的异常行为)
</div>

* 修复了一个在使用异步插入时可能引发死锁的问题。 [#43233](https://github.com/ClickHouse/ClickHouse/pull/43233) ([Anton Popov](https://github.com/CurtizJ)).
* 修复 AST 级优化 `optimize_normalize_count_variants` 中的部分错误逻辑。[#43873](https://github.com/ClickHouse/ClickHouse/pull/43873) ([Duc Canh Le](https://github.com/canhld94)) 。
* 修复了一种情况：当副本之间的校验和不一致时，变更不会推进 (例如，升级时数据格式发生变化导致这种情况) 。[#36877](https://github.com/ClickHouse/ClickHouse/pull/36877) ([nvartolomei](https://github.com/nvartolomei)) 。
* 修复了 `skip_unavailable_shards` 优化在与 `hdfsCluster` 表函数一起使用时不生效的问题。[#43236](https://github.com/ClickHouse/ClickHouse/pull/43236) ([chen](https://github.com/xiedeyantu)) 。
* 修复 `s3` 对 `?` 通配符的支持问题。关闭 [#42731](https://github.com/ClickHouse/ClickHouse/issues/42731)。[#43253](https://github.com/ClickHouse/ClickHouse/pull/43253) ([chen](https://github.com/xiedeyantu)).
* 修复了当数组包含 `Nullable` 元素时，函数 `arrayFirstOrNull` 和 `arrayLastOrNull` 返回 null 的问题。[#43274](https://github.com/ClickHouse/ClickHouse/pull/43274) ([Duc Canh Le](https://github.com/canhld94)) 。
* 修复与 Kafka 表相关的 `UserTimeMicroseconds`/`SystemTimeMicroseconds` 统计不正确的问题。[#42791](https://github.com/ClickHouse/ClickHouse/pull/42791) ([Azat Khuzhin](https://github.com/azat)) 。
* 不要屏蔽 `web` 磁盘中的异常。修复 `web` 磁盘的重试问题。[#42800](https://github.com/ClickHouse/ClickHouse/pull/42800) ([Azat Khuzhin](https://github.com/azat)).
* 修复了 insert 与删除 materialized view 之间的 (逻辑) 竞态条件。当某个 materialized view 在 `INSERT` 执行的同时被删除时，就会出现竞态条件：在执行开始时，这些 MV 还是 insert 的依赖项，但等到插入事件链尝试访问它们对应的表时，该表已经被删除，从而触发 `UNKNOWN_TABLE` 或 `TABLE_IS_DROPPED` 异常，并导致插入中断。此次更改后，如果依赖项已不存在，将不再抛出这些异常，而是继续执行 insert。 [#43161](https://github.com/ClickHouse/ClickHouse/pull/43161) ([AlfVII](https://github.com/AlfVII)).
* 修复了 `quantiles` 函数中的未定义行为，该行为可能导致使用未初始化的内存。由 fuzzer 发现。此修复关闭了 [#44066](https://github.com/ClickHouse/ClickHouse/issues/44066)。[#44067](https://github.com/ClickHouse/ClickHouse/pull/44067) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 为 `CompressionCodecDelta` 新增了对未压缩大小为零的额外检查。[#43255](https://github.com/ClickHouse/ClickHouse/pull/43255) ([Nikita Taranov](https://github.com/nickitat)) 。
* 将来自 Parquet 的数组扁平化，以避免数组内数据不一致的问题。这类错误文件可能由 Apache Iceberg 生成。[#43297](https://github.com/ClickHouse/ClickHouse/pull/43297) ([Arthur Passos](https://github.com/arthurpassos)).
* 修复使用短路函数执行时对 `LowCardinality` 列进行错误类型转换的问题。[#43311](https://github.com/ClickHouse/ClickHouse/pull/43311) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了在使用 `Merge` engine 的表上启用 prewhere 优化时，`SAMPLE BY` 查询的问题。[#43315](https://github.com/ClickHouse/ClickHouse/pull/43315) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 检查并比对 `MergeTreeData` 中 `format_version` 文件的内容，以便即使存储策略发生变化，表也能正常加载。[#43328](https://github.com/ClickHouse/ClickHouse/pull/43328) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 修复向 `Buffer` 表执行 INSERT 时可能出现的 (极不可能发生的) “No column to rollback”逻辑错误。[#43336](https://github.com/ClickHouse/ClickHouse/pull/43336) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了一个 bug：当设置 `allow_function_parameters` 时，解析器可能会将数量不限的圆括号解析为同一个函数的一部分。[#43350](https://github.com/ClickHouse/ClickHouse/pull/43350) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* `MaterializeMySQL` (Experimental 功能) 现已支持 DDL： `drop table t1, t2`，并兼容大多数 MySQL 的 DROP DDL。 [#43366](https://github.com/ClickHouse/ClickHouse/pull/43366) ([zzsmdfj](https://github.com/zzsmdfj)).
* `session_log` (Experimental 功能) ：修复了在极少数 profile 配置混乱的情况下无法登录的问题 (原因是无法创建 `session_log` 条目) 。[#42641](https://github.com/ClickHouse/ClickHouse/pull/42641) ([Vasily Nemkov](https://github.com/Enmk)) 。
* 修复了函数 `if`/`multiIf` 中可能出现的 `Cannot create non-empty column with type Nothing` 问题。关闭 [#43356](https://github.com/ClickHouse/ClickHouse/issues/43356)。[#43368](https://github.com/ClickHouse/ClickHouse/pull/43368) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了一个问题：当行级过滤器使用列的默认值时，会触发一个 bug。[#43387](https://github.com/ClickHouse/ClickHouse/pull/43387) ([Alexander Gololobov](https://github.com/davenger)).
* 使用 `DISTINCT` + `LIMIT BY` + `LIMIT` 的查询返回的行数可能会少于预期。修复了 [#43377](https://github.com/ClickHouse/ClickHouse/issues/43377)。[#43410](https://github.com/ClickHouse/ClickHouse/pull/43410) ([Igor Nikonov](https://github.com/devcrafter)) 。
* 修复 `sumMap` 在 `Nullable(Decimal(...))` 上的问题。[#43414](https://github.com/ClickHouse/ClickHouse/pull/43414) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复 macOS 上 `date_diff` 在按小时/分钟计算时的问题。关闭 [#42742](https://github.com/ClickHouse/ClickHouse/issues/42742)。[#43466](https://github.com/ClickHouse/ClickHouse/pull/43466) ([zzsmdfj](https://github.com/zzsmdfj)) 。
* 修复由合并/变更操作导致的内存统计错误。[#43516](https://github.com/ClickHouse/ClickHouse/pull/43516) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了涉及 `toString(enum)` 条件时的主键分析问题。[#43596](https://github.com/ClickHouse/ClickHouse/pull/43596) ([Nikita Taranov](https://github.com/nickitat)) 。该错误由 @tisonkun 发现。
* 确保 `clickhouse-copier` 在分区附加完成后更新 Keeper 中的状态和 `attach_is_done` 时的一致性。[#43602](https://github.com/ClickHouse/ClickHouse/pull/43602) ([lzydmxy](https://github.com/lzydmxy)).
* 在恢复 `Replicated` 数据库 (Experimental 功能) 的丢失副本时，可能会出现需要以原子方式交换两个表名的情况 (使用 EXCHANGE) 。此前我们尝试使用两条 RENAME 查询，但这显然会失败，而且还会导致数据库副本的整个恢复过程失败。[#43628](https://github.com/ClickHouse/ClickHouse/pull/43628) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 修复了 `s3Cluster` 函数抛出 `NOT_FOUND_COLUMN_IN_BLOCK` 错误时的情况。关闭 [#43534](https://github.com/ClickHouse/ClickHouse/issues/43534)。[#43629](https://github.com/ClickHouse/ClickHouse/pull/43629) ([chen](https://github.com/xiedeyantu)).
* 修复了解析包含数组的 JSON 对象时可能出现的逻辑错误 `Array sizes mismatched`，该问题发生在键名相同但嵌套层级不同的情况下。关闭 [#43569](https://github.com/ClickHouse/ClickHouse/issues/43569)。[#43693](https://github.com/ClickHouse/ClickHouse/pull/43693) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了在分布式 `GROUP BY` 场景下，当聚合键中包含 `ALIAS` 列时可能发生的异常。[#43709](https://github.com/ClickHouse/ClickHouse/pull/43709) ([Nikita Taranov](https://github.com/nickitat)) 。
* 修复了一个缺陷：如果启用并使用零拷贝复制 (Experimental 功能) ，可能导致投影损坏。[#43764](https://github.com/ClickHouse/ClickHouse/pull/43764) ([alesapin](https://github.com/alesapin)) 。
* 修复了在 AWS S3 中对超大 S3 对象使用分段上传的问题。[#43824](https://github.com/ClickHouse/ClickHouse/pull/43824) ([ianton-ru](https://github.com/ianton-ru)) 。
* 修复了带 `ON CLUSTER` 的 `ALTER ... RESET SETTING` 问题。此前该操作可能只会应用到单个副本。修复 [#43843](https://github.com/ClickHouse/ClickHouse/issues/43843)。[#43848](https://github.com/ClickHouse/ClickHouse/pull/43848) ([Elena Torró](https://github.com/elenatorro)) 。
* 修复了在右侧使用 `Join` table engine 且使用 `USING` 时，JOIN 中的逻辑错误。[#43963](https://github.com/ClickHouse/ClickHouse/pull/43963) ([Vladimir C](https://github.com/vdimir)). 修复了 `Join` table engine 中键顺序错误的问题。[#44012](https://github.com/ClickHouse/ClickHouse/pull/44012) ([Vladimir C](https://github.com/vdimir)).
* Keeper 修复：如果 Raft 的 interserver 端口已被占用，则会抛出异常。 [#43984](https://github.com/ClickHouse/ClickHouse/pull/43984) ([Antonio Andelic](https://github.com/antonio2368)).
* 修复了在对子查询进行不必要的列裁剪时，`ORDER BY` 位置参数 (例如：`ORDER BY 1, 2`) 的问题。关闭 [#43964](https://github.com/ClickHouse/ClickHouse/issues/43964)。[#43987](https://github.com/ClickHouse/ClickHouse/pull/43987) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复了子查询包含 HAVING 但实际并未进行聚合操作时出现的异常。[#44051](https://github.com/ClickHouse/ClickHouse/pull/44051) ([Nikita Taranov](https://github.com/nickitat)) 。
* 修复 S3 分段上传中的竞态条件。该问题可能会在从备份恢复时导致出现错误 `Part number must be an integer between 1 and 10000, inclusive. (S3_ERROR)`。 [#44065](https://github.com/ClickHouse/ClickHouse/pull/44065) ([Vitaly Baranov](https://github.com/vitlibar)).

### <a id="2211" /> ClickHouse 发行版 22.11，2022-11-17。 [演示文稿](https://presentations.clickhouse.com/2022-release-22.11/), [视频](https://www.youtube.com/watch?v=LR-fckOOaFo)

<Frame>
  <iframe src="https://www.youtube.com/embed/LR-fckOOaFo" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen />
</Frame>

<div id="backward-incompatible-change">
  #### 向后不兼容的变更
</div>

* `JSONExtract` 家族函数现在会尝试将结果强制转换为所请求的类型。[#41502](https://github.com/ClickHouse/ClickHouse/pull/41502) ([Márcio Martins](https://github.com/marcioapm)).

<div id="new-feature">
  #### 新特性
</div>

* 增加了对以下场景中重试的支持：向 ReplicatedMergeTree 执行 INSERT 时，如果与 ClickHouse Keeper 的会话丢失，可自动重试。除提升容错能力外，该功能还旨在改善用户体验——如果 Keeper 重启 (例如因升级) ，可避免在 insert 时向用户返回错误。[#42607](https://github.com/ClickHouse/ClickHouse/pull/42607) ([Igor Nikonov](https://github.com/devcrafter)).
* 新增 `Hudi` 和 `DeltaLake` 表引擎，仅支持对 S3 上的表进行只读访问。[#41054](https://github.com/ClickHouse/ClickHouse/pull/41054) ([Daniil Rubin](https://github.com/rubin-do)、[Kseniia Sumarokova](https://github.com/kssenii)) 。
* 新增了表函数 `hudi` 和 `deltaLake`。[#43080](https://github.com/ClickHouse/ClickHouse/pull/43080) ([flynn](https://github.com/ucasfl)) 。
* 支持复合时间间隔。1. 现在 Intervals 支持加法、减法和取负运算。当 Intervals 的类型不同时，会将其转换为由这些类型组成的 Tuple。2. 由多个时间间隔组成的 tuple 可以加到 Date/DateTime 字段上，或从中减去。3. 新增了对不同类型 Intervals 的解析支持，例如：`INTERVAL '1 HOUR 1 MINUTE 1 SECOND'`。[#42195](https://github.com/ClickHouse/ClickHouse/pull/42195) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 新增了对 `**` glob 的支持，可用于递归遍历 filesystem 和 S3 中的目录。解决了 [#36316](https://github.com/ClickHouse/ClickHouse/issues/36316)。[#42376](https://github.com/ClickHouse/ClickHouse/pull/42376) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)) 。
* 引入适用于一次写入、多次读取操作的 `s3_plain` disk 类型。为 `s3_plain` disk 实现 `MergeTree` 表的 `ATTACH` 操作。[#42628](https://github.com/ClickHouse/ClickHouse/pull/42628) ([Azat Khuzhin](https://github.com/azat)) 。
* 向 `system.query_log` 新增了已应用的行级策略。[#39819](https://github.com/ClickHouse/ClickHouse/pull/39819) ([Vladimir Chebotaryov](https://github.com/quickhouse)) 。
* 新增了四字母命令 `csnp`，可用于在 ClickHouse Keeper 中手动创建快照。此外，还新增了 `lgif`，用于获取特定节点的 Raft 信息 (例如，最近创建的快照索引、最近提交的日志索引) 。[#41766](https://github.com/ClickHouse/ClickHouse/pull/41766) ([JackyWoo](https://github.com/JackyWoo)) 。
* 新增 `ascii` 函数，与 Apache Spark 中的用法一致：[https://spark.apache.org/docs/latest/api/sql/#ascii。](https://spark.apache.org/docs/latest/api/sql/#ascii。) [#42670](https://github.com/ClickHouse/ClickHouse/pull/42670) ([李扬](https://github.com/taiyang-li)).
* 添加函数 `pmod`，用于基于取模运算返回非负结果。[#42755](https://github.com/ClickHouse/ClickHouse/pull/42755) ([李扬](https://github.com/taiyang-li)).
* 新增函数 `formatReadableDecimalSize`。[#42774](https://github.com/ClickHouse/ClickHouse/pull/42774) ([Alejandro](https://github.com/alexon1234)) 。
* 新增函数 `randCanonical`，其行为类似于 Apache Spark 或 Impala 中的 `rand` 函数。该函数会生成伪随机结果，取值在 \[0, 1) 区间内，且相互独立并服从相同的均匀分布。[#43124](https://github.com/ClickHouse/ClickHouse/pull/43124) ([李扬](https://github.com/taiyang-li)).
* 新增函数 `displayName`，修复了 [#36770](https://github.com/ClickHouse/ClickHouse/issues/36770)。[#37681](https://github.com/ClickHouse/ClickHouse/pull/37681) ([hongbin](https://github.com/xlwh)) 。
* 新增 `min_age_to_force_merge_on_partition_only` 设置，仅在整个分区范围内对旧 parts 执行优化。[#42659](https://github.com/ClickHouse/ClickHouse/pull/42659) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 为任意结构的命名集合、访问类型和 `system.named_collections` 提供通用实现。[#43147](https://github.com/ClickHouse/ClickHouse/pull/43147) ([Kseniia Sumarokova](https://github.com/kssenii)).

<div id="performance-improvement">
  #### 性能改进
</div>

* 当 `match` 函数的条件为字符串前缀时，可以使用索引。这解决了 [#37333](https://github.com/ClickHouse/ClickHouse/issues/37333)。[#42458](https://github.com/ClickHouse/ClickHouse/pull/42458) ([clarkcaoliu](https://github.com/Clark0)).
* 连续使用 AND 和 OR 运算符时可提升速度。[#42214](https://github.com/ClickHouse/ClickHouse/pull/42214) ([Zhiguo Zhou](https://github.com/ZhiguoZh)).
* `LineAsString` input format 支持并行 parsing。不过，这仅带来轻微的性能提升。这解决了 [#42502](https://github.com/ClickHouse/ClickHouse/issues/42502)。[#42780](https://github.com/ClickHouse/ClickHouse/pull/42780) ([Kruglov Pavel](https://github.com/Avogar)).
* ClickHouse Keeper 性能改进：在许多不同节点存在未提交状态时，提升了提交性能。这有助于缓解 follower 节点同步速度不够快的情况。[#42926](https://github.com/ClickHouse/ClickHouse/pull/42926) ([Antonio Andelic](https://github.com/antonio2368)).
* `NOT LIKE 'prefix%'` 这样的条件可以使用主索引。[#42209](https://github.com/ClickHouse/ClickHouse/pull/42209) ([Duc Canh Le](https://github.com/canhld94)).

<div id="experimental-feature">
  #### Experimental 功能
</div>

* 支持在其他类型中嵌套 `Object` 类型，例如 `Array(JSON)`。[#36969](https://github.com/ClickHouse/ClickHouse/pull/36969) ([Anton Popov](https://github.com/CurtizJ)).
* 对于 MaterializedMySQL，忽略 MySQL binlog 中的 SAVEPOINT 事件。[#42931](https://github.com/ClickHouse/ClickHouse/pull/42931) ([zzsmdfj](https://github.com/zzsmdfj)). 在 MaterializedMySQL 中处理 (忽略) SAVEPOINT 查询。[#43086](https://github.com/ClickHouse/ClickHouse/pull/43086) ([Stig Bakken](https://github.com/stigsb)).

<div id="improvement">
  #### 改进
</div>

* 带有较小 `LIMIT` 的简单查询将能够正确确定预估需要读取的行数，从而正确检查阈值。关闭 [#7071](https://github.com/ClickHouse/ClickHouse/issues/7071)。[#42580](https://github.com/ClickHouse/ClickHouse/pull/42580) ([Han Fei](https://github.com/hanfei1991)) 。
* 为 INSERT VALUES 查询添加交互式参数支持。[#43077](https://github.com/ClickHouse/ClickHouse/pull/43077) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 在 `system.table_functions` 中新增了字段 `allow_readonly`，允许在只读模式下使用表函数。解决了 [#42414](https://github.com/ClickHouse/ClickHouse/issues/42414)。实现：\* 在系统表 system.table\_functions 中新增了字段 allow\_readonly。\* 更新为使用新字段 allow\_readonly，从而允许在只读模式下使用表函数。测试：\* 为 filesystem 测试 tests/queries/0\_stateless/02473\_functions\_in\_readonly\_mode.sh 新增了测试。文档：\* 更新了 Table Functions 的英文文档。[#42708](https://github.com/ClickHouse/ClickHouse/pull/42708) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)) 。
* `system.asynchronous_metrics` 现已内置文档，这些文档也会导出到 Prometheus。修复了一个与 `cache` 磁盘指标相关的错误——此前这些指标只会为某一个任意的 `cache` 磁盘计算，而不是为所有此类磁盘计算。此修复关闭了 [#7644](https://github.com/ClickHouse/ClickHouse/issues/7644)。[#43194](https://github.com/ClickHouse/ClickHouse/pull/43194) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 限流算法已改为使用令牌桶。[#42665](https://github.com/ClickHouse/ClickHouse/pull/42665) ([Sergei Trifonov](https://github.com/serxa)) 。
* 在 `system.query_log`、`/var/log/clickhouse-server/*.log` 以及错误消息中统一屏蔽密码和 secret key。[#42484](https://github.com/ClickHouse/ClickHouse/pull/42484) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 移除被已拉取 part 覆盖的 parts (以避免复制延迟可能进一步增加) 。[#39737](https://github.com/ClickHouse/ClickHouse/pull/39737) ([Azat Khuzhin](https://github.com/azat)) 。
* 如果 `/dev/tty` 可用，clickhouse-client 和 clickhouse-local 的进度信息将直接显示在终端中，而不会写入 STDERR。这样即使 STDERR 被重定向到文件，也仍然可以查看进度，并且文件不会被终端转义序列污染。可通过 `--progress false` 禁用进度显示。此更改修复了 [#32238](https://github.com/ClickHouse/ClickHouse/issues/32238)。[#42003](https://github.com/ClickHouse/ClickHouse/pull/42003) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 为 base64 编码函数新增对 `FixedString` 输入的支持。[#42285](https://github.com/ClickHouse/ClickHouse/pull/42285) ([ltrk2](https://github.com/ltrk2)) 。
* 在 `system.detached_parts` 中添加 `bytes_on_disk` 和 `path` 列。修复 [#42264](https://github.com/ClickHouse/ClickHouse/issues/42264)。[#42303](https://github.com/ClickHouse/ClickHouse/pull/42303) ([chen](https://github.com/xiedeyantu)) 。
* 改进了在表函数中使用插入表结构的方式，设置 `use_structure_from_insertion_table_in_table_functions` 现新增可选值 `2`，表示 ClickHouse 将尝试自动判断是否可以使用插入表的结构。关闭 [#40028](https://github.com/ClickHouse/ClickHouse/issues/40028)。[#42320](https://github.com/ClickHouse/ClickHouse/pull/42320) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了 INSERT FROM INFILE 缺少进度指示的问题。关闭 [#42548](https://github.com/ClickHouse/ClickHouse/issues/42548)。[#42634](https://github.com/ClickHouse/ClickHouse/pull/42634) ([chen](https://github.com/xiedeyantu)) 。
* 重构函数 `tokens`，使相关函数可返回最大标记数 (默认禁用) 。[#42673](https://github.com/ClickHouse/ClickHouse/pull/42673) ([李扬](https://github.com/taiyang-li)) 。
* 支持在 `formatDateTime` 和 `FROM_UNIXTIME` 函数中使用 `Date32` 参数。[#42737](https://github.com/ClickHouse/ClickHouse/pull/42737) ([Roman Vasin](https://github.com/rvasin)) 。
* 将 tzdata 更新至 2022f。除靠近美国边境的地区外，墨西哥将不再实行夏令时：[https://www.timeanddate.com/news/time/mexico-abolishes-dst-2022.html。Chihuahua](https://www.timeanddate.com/news/time/mexico-abolishes-dst-2022.html。Chihuahua) 自 2022-10-30 起改为全年采用 UTC-6。Fiji 不再实行夏令时。参见 [https://github.com/google/cctz/pull/235](https://github.com/google/cctz/pull/235) 和 [https://bugs.launchpad.net/ubuntu/+source/tzdata/+bug/1995209。\[#42796](https://bugs.launchpad.net/ubuntu/+source/tzdata/+bug/1995209。\[#42796)]\([https://github.com/ClickHouse/ClickHouse/pull/42796](https://github.com/ClickHouse/ClickHouse/pull/42796)) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 为异步插入新增 `FailedAsyncInsertQuery` 事件指标。[#42814](https://github.com/ClickHouse/ClickHouse/pull/42814) ([Krzysztof Góralski](https://github.com/kgoralski)) 。
* 在查询计划基础上实现了 `read-in-order` 优化。该优化默认启用。将 `query_plan_read_in_order = 0` 设为使用先前基于 AST 的版本。[#42829](https://github.com/ClickHouse/ClickHouse/pull/42829) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 以指数级增大备份到 S3 时上传分片的大小，以避免因 S3 分段上传最多只能有 10,000 个分片而报错。[#42833](https://github.com/ClickHouse/ClickHouse/pull/42833) ([Vitaly Baranov](https://github.com/vitlibar)).
* 当合并任务持续繁忙且磁盘空间不足时，完全过期的 parts 将无法被选中并删除，从而导致磁盘空间不足。我的想法是，当整个 Part 都已过期时，无需额外预留磁盘空间，从而确保生存时间 (TTL) 能正常执行。 [#42869](https://github.com/ClickHouse/ClickHouse/pull/42869) ([zhongyuankai](https://github.com/zhongyuankai)).
* 新增 `oss` 函数和 `OSS` 表引擎 (这为用户提供了便利) 。oss 与 s3 完全兼容。[#43155](https://github.com/ClickHouse/ClickHouse/pull/43155) ([zzsmdfj](https://github.com/zzsmdfj)) 。
* 改进 `system.asynchronous_metrics` 表在收集操作系统相关信息时的错误报告。[#43192](https://github.com/ClickHouse/ClickHouse/pull/43192) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 调整 `INFORMATION_SCHEMA` 表，使 ClickHouse 能够通过 MySQL 兼容协议连接自身。添加列而非别名 (与 [#9769](https://github.com/ClickHouse/ClickHouse/issues/9769) 相关) 。这将提升与各种 MySQL 客户端的兼容性。[#43198](https://github.com/ClickHouse/ClickHouse/pull/43198) ([Filatenkov Artur](https://github.com/FArthur-cmd)) 。
* 新增了一些函数，以兼容 PowerBI 通过 MySQL 协议连接时的需求 [#42612](https://github.com/ClickHouse/ClickHouse/pull/42612) ([Filatenkov Artur](https://github.com/FArthur-cmd)).
* 改进 Dashboard 在变更时的易用性 [#42872](https://github.com/ClickHouse/ClickHouse/pull/42872) ([Vladimir C](https://github.com/vdimir)).

<div id="buildtestingpackaging-improvement">
  #### 构建/测试/打包改进
</div>

* 为每个拉取请求以及提交到 master 的每次提交运行 SQLancer。[SQLancer](https://github.com/sqlancer/sqlancer) 是一个专注于自动检测逻辑错误的开源模糊测试工具。[#42397](https://github.com/ClickHouse/ClickHouse/pull/42397) ([Ilya Yatsishin](https://github.com/qoega)).
* 更新到最新版本的 zlib-ng。[#42463](https://github.com/ClickHouse/ClickHouse/pull/42463) ([Boris Kuschel](https://github.com/bkuschel)).
* 新增了使用 Jepsen 测试 ClickHouse server 的支持。顺带一提，我们已经支持使用 Jepsen 测试 ClickHouse Keeper。此拉取请求将该支持扩展到了复制表。[#42619](https://github.com/ClickHouse/ClickHouse/pull/42619) ([Antonio Andelic](https://github.com/antonio2368)).
* 使用 [https://github.com/matus-chochlik/ctcache](https://github.com/matus-chochlik/ctcache) 对 clang-tidy 结果进行缓存。[#42913](https://github.com/ClickHouse/ClickHouse/pull/42913) ([Mikhail f. Shiryaev](https://github.com/Felixoid)).
* 修复前，RPM 会将用户自定义配置保存为 `$file.rpmsave`。该拉取请求修复了这一问题，不再用软件包中的文件替换用户文件。[#42936](https://github.com/ClickHouse/ClickHouse/pull/42936) ([Mikhail f. Shiryaev](https://github.com/Felixoid)).
* 从 Ubuntu Docker image 中移除了一些库。[#42622](https://github.com/ClickHouse/ClickHouse/pull/42622) ([Alexey Milovidov](https://github.com/alexey-milovidov)).

<div id="bug-fix-user-visible-misbehavior-in-official-stable-or-prestable-release-1">
  #### 缺陷修复 (官方稳定版本或预稳定版本中用户可见的问题)
</div>

* 已更新 normaliser，使其克隆 alias AST。修复了 [#42452](https://github.com/ClickHouse/ClickHouse/issues/42452)。实现方式：\* 更新了 QueryNormalizer，在替换 alias AST 时会对其进行克隆。此前只是简单地赋用同一个对象，这会导致 LogicalExpressinsOptimizer 中出现异常，因为同一个 parent 会被再次插入。\* 这个 bug 在新的 analyzer (allow\_experimental\_analyzer) 中不会出现，因此未对其作任何修改。我还为此添加了一个测试。[#42827](https://github.com/ClickHouse/ClickHouse/pull/42827) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)) 。
* 修复了 `Lazy` 数据库中表备份时的竞态问题。[#43104](https://github.com/ClickHouse/ClickHouse/pull/43104) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复了 `skip_unavailable_shards` 的问题：该设置此前无法与 `s3Cluster` 表函数配合使用。 [#43131](https://github.com/ClickHouse/ClickHouse/pull/43131) ([chen](https://github.com/xiedeyantu)).
* 修复 `s3Cluster` 中的 schema 推断问题，并改进了 `hdfsCluster`。[#41979](https://github.com/ClickHouse/ClickHouse/pull/41979) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复从 URL 表引擎 / 表函数读取时的重试问题。 (对于可重试错误，重试次数可能超过实际所需；对于不可重试错误，则会导致代码中的断言失败) 。[#42224](https://github.com/ClickHouse/ClickHouse/pull/42224) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 已报告并修复了一个与 DNS & c-ares 相关的段错误。[#42234](https://github.com/ClickHouse/ClickHouse/pull/42234) ([Arthur Passos](https://github.com/arthurpassos)) 。
* 修复了在 PK 分析 (单调性检查) 中可能出现的 `LOGICAL_ERROR` `Arguments of 'plus' have incorrect data types`。修复了首个参数为常量时，单调二元函数的 PK 分析失效问题。[#42410](https://github.com/ClickHouse/ClickHouse/pull/42410) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 修复了当键类型不能置于 Nullable 内部时，键分析错误的问题。此修复解决了 [#42456](https://github.com/ClickHouse/ClickHouse/issues/42456)。[#42469](https://github.com/ClickHouse/ClickHouse/pull/42469) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了一个设置名称中的拼写错误，该错误导致在使用设置 `input_format_csv_use_best_effort_in_schema_inference` 时，schema 推断缓存被错误使用。关闭 [#41735](https://github.com/ClickHouse/ClickHouse/issues/41735)。[#42536](https://github.com/ClickHouse/ClickHouse/pull/42536) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了在数据类型为 LowCardinality 时因请求头错误而创建 Set 的问题。关闭了 [#42460](https://github.com/ClickHouse/ClickHouse/issues/42460)。[#42579](https://github.com/ClickHouse/ClickHouse/pull/42579) ([flynn](https://github.com/ucasfl)).
* `(U)Int128` 和 `(U)Int256` 值现在可以在 `PREWHERE` 中被正确检查。[#42605](https://github.com/ClickHouse/ClickHouse/pull/42605) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 修复了函数解析器中的一个 bug，该问题原本可能导致段错误。[#42724](https://github.com/ClickHouse/ClickHouse/pull/42724) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 修复了 `truncate table` 中的加锁问题。[#42728](https://github.com/ClickHouse/ClickHouse/pull/42728) ([flynn](https://github.com/ucasfl)) 。
* 修复 `web` 磁盘在文件不存在时可能发生的崩溃问题 (执行 `OPTIMIZE TABLE FINAL` 时最终也可能触发同样的错误) 。[#42767](https://github.com/ClickHouse/ClickHouse/pull/42767) ([Azat Khuzhin](https://github.com/azat)).
* 修复 `system.session_log` 中 `auth_type` 的映射问题，将 `SSL_CERTIFICATE` 纳入枚举值。[#42782](https://github.com/ClickHouse/ClickHouse/pull/42782) ([Miel Donkers](https://github.com/mdonkers)) 。
* 修复了 ASAN build 下 CREATE USER 查询解析器中的 stack-use-after-return 问题。[#42804](https://github.com/ClickHouse/ClickHouse/pull/42804) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 修复了 `lowerUTF8`/`upperUTF8` 在符号恰好位于 16 字节边界之间时的问题 (如果字符串长度 > 16 字节，这种情况非常常见) 。[#42812](https://github.com/ClickHouse/ClickHouse/pull/42812) ([Azat Khuzhin](https://github.com/azat)) 。
* 在 LZ4 解压缩例程中增加了额外的边界检查，以修复输入畸形时的异常行为。[#42868](https://github.com/ClickHouse/ClickHouse/pull/42868) ([Nikita Taranov](https://github.com/nickitat)) 。
* 修复了取消查询时极少数情况下可能卡住的问题。[#42874](https://github.com/ClickHouse/ClickHouse/pull/42874) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复哈希连接中存在多个析取条件时的错误行为，关闭 [#42832](https://github.com/ClickHouse/ClickHouse/issues/42832)。[#42876](https://github.com/ClickHouse/ClickHouse/pull/42876) ([Vladimir C](https://github.com/vdimir))。
* 当在 'three table join' 中使用 select if as from 时，会产生空指针。例如，这个 SQL 查询：[#42883](https://github.com/ClickHouse/ClickHouse/pull/42883) ([zzsmdfj](https://github.com/zzsmdfj)).
* 修复 Cluster Discovery 中的 MemorySanitizer 报告问题，关闭 [#42763](https://github.com/ClickHouse/ClickHouse/issues/42763)。[#42905](https://github.com/ClickHouse/ClickHouse/pull/42905) ([Vladimir C](https://github.com/vdimir)).
* 改进空字符串情况下的 DateTime schema inference。[#42911](https://github.com/ClickHouse/ClickHouse/pull/42911) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了一种罕见的 NOT\_FOUND\_COLUMN\_IN\_BLOCK 错误：在可以使用 projection、但实际上没有可用 projection 时会触发该错误。此修复对应 [#42771](https://github.com/ClickHouse/ClickHouse/issues/42771) 。该缺陷是在 [https://github.com/ClickHouse/ClickHouse/pull/25563](https://github.com/ClickHouse/ClickHouse/pull/25563) 中引入的。[#42938](https://github.com/ClickHouse/ClickHouse/pull/42938) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了 `PostgreSQL` 数据库引擎中对包含 DATETIME 数据类型的表执行 ATTACH TABLE 时的问题。关闭了 [#42817](https://github.com/ClickHouse/ClickHouse/issues/42817)。[#42960](https://github.com/ClickHouse/ClickHouse/pull/42960) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复 lambda 的解析问题。关闭 [#41848](https://github.com/ClickHouse/ClickHouse/issues/41848)。[#42979](https://github.com/ClickHouse/ClickHouse/pull/42979) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 修复了当 Nullable 键出现在超矩形中间时键分析不正确的问题。此修复解决了 [#43111](https://github.com/ClickHouse/ClickHouse/issues/43111)。[#43133](https://github.com/ClickHouse/ClickHouse/pull/43133) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了在对精心构造的聚合函数状态进行反序列化时出现的多处缓冲区越界读取问题。[#43159](https://github.com/ClickHouse/ClickHouse/pull/43159) ([Raúl Marín](https://github.com/Algunenano)).
* 修复了函数 `if` 在 NULL 和 const Nullable 参数情况下的问题。关闭 [#43069](https://github.com/ClickHouse/ClickHouse/issues/43069)。[#43178](https://github.com/ClickHouse/ClickHouse/pull/43178) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复使用 'best effort' 算法解析 DateTime 时的小数计算溢出问题。关闭 [#43061](https://github.com/ClickHouse/ClickHouse/issues/43061)。[#43180](https://github.com/ClickHouse/ClickHouse/pull/43180) ([Kruglov Pavel](https://github.com/Avogar)).
* 由 `git-import` 工具生成的 `indent` field 计算不正确。参见 [https://clickhouse.com/docs/getting-started/example-datasets/github/。](https://clickhouse.com/docs/getting-started/example-datasets/github/。) [#43191](https://github.com/ClickHouse/ClickHouse/pull/43191) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 修复了 `Interval` 类型在子查询和类型转换时的异常行为。[#43193](https://github.com/ClickHouse/ClickHouse/pull/43193) ([jh0x](https://github.com/jh0x)).

### <a id="2210" /> ClickHouse 发行版 22.10，2022-10-25。[演示文稿](https://presentations.clickhouse.com/2022-release-22.10/), [视频](https://www.youtube.com/watch?v=sz9SES5-mdc)

<Frame>
  <iframe src="https://www.youtube.com/embed/sz9SES5-mdc" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen />
</Frame>

<div id="backward-incompatible-change">
  #### 向后不兼容的变更
</div>

* 重命名缓存相关命令：`show caches` -> `show filesystem caches`，`describe cache` -> `describe filesystem cache`。[#41508](https://github.com/ClickHouse/ClickHouse/pull/41508) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 移除对 `LIVE VIEW` 中 `WITH TIMEOUT` 部分的支持。此更改关闭了 [#40557](https://github.com/ClickHouse/ClickHouse/issues/40557)。[#42173](https://github.com/ClickHouse/ClickHouse/pull/42173) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 从客户端提示符中移除对 `{database}` 宏的支持。如果未指定数据库，它会显示错误，而且在执行 `USE` 语句时也不会更新。此更改关闭了 [#25891](https://github.com/ClickHouse/ClickHouse/issues/25891)。[#42508](https://github.com/ClickHouse/ClickHouse/pull/42508) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。

<div id="new-feature-2">
  #### 新功能
</div>

* 新增了可组合的协议配置。现在可以为不同协议设置不同的监听主机。诸如 PROXYv1 之类的协议包装器现在可以叠加在任何其他协议 (TCP、TCP secure、MySQL、Postgres) 之上进行配置。[#41198](https://github.com/ClickHouse/ClickHouse/pull/41198) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* 新增 `S3` 作为一种新的备份目标端类型。支持按原有的路径/数据结构将 BACKUP 到 S3。[#42333](https://github.com/ClickHouse/ClickHouse/pull/42333) ([Vitaly Baranov](https://github.com/vitlibar)), [#42232](https://github.com/ClickHouse/ClickHouse/pull/42232) ([Azat Khuzhin](https://github.com/azat)).
* 新增了用于按指定分布生成随机值的函数 (`randUniform`, `randNormal`, `randLogNormal`, `randExponential`, `randChiSquared`, `randStudentT`, `randFisherF`, `randBernoulli`, `randBinomial`, `randNegativeBinomial`, `randPoisson`) 。此改动修复了 [#21834](https://github.com/ClickHouse/ClickHouse/issues/21834)。[#42411](https://github.com/ClickHouse/ClickHouse/pull/42411) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 改进 ClickHouse Keeper：新增支持将快照上传到 S3。可在 `keeper_server.s3_snapshot` 中定义 S3 信息。[#41342](https://github.com/ClickHouse/ClickHouse/pull/41342) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 新增了聚合函数 `analysisOfVariance` (`anova`) ，用于对若干组服从正态分布的观测值进行统计检验，以判断各组的均值是否相同。原始 PR [#37872](https://github.com/ClickHouse/ClickHouse/issues/37872)。[#42131](https://github.com/ClickHouse/ClickHouse/pull/42131) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 支持通过设置 `max_temporary_data_on_disk_size_for_user`/`max_temporary_data_on_disk_size_for_query` 来限制存储在磁盘上的临时数据。 [#40893](https://github.com/ClickHouse/ClickHouse/pull/40893) ([Vladimir C](https://github.com/vdimir)).
* 新增设置 `format_json_object_each_row_column_for_object_name`，用于在 JSONObjectEachRow 格式中将对象名称写入为列值或将其解析为列值。[#41703](https://github.com/ClickHouse/ClickHouse/pull/41703) ([Kruglov Pavel](https://github.com/Avogar)).
* 为 SQL 新增 BLAKE3 哈希函数。[#33435](https://github.com/ClickHouse/ClickHouse/pull/33435) ([BoloniniD](https://github.com/BoloniniD)) 。
* 函数 `javaHash` 现已扩展至支持整数。[#41131](https://github.com/ClickHouse/ClickHouse/pull/41131) ([JackyWoo](https://github.com/JackyWoo)) 。
* 为 ON CLUSTER DDL 增加 OpenTelemetry 支持 (要求将 `distributed_ddl_entry_format_version` 设为 4) 。[#41484](https://github.com/ClickHouse/ClickHouse/pull/41484) ([Frank Chen](https://github.com/FrankChen021)) 。
* 新增了系统表 `asynchronous_insert_log`。该表包含有关异步插入的信息 (包括发出即忘模式下的查询结果 (使用 `wait_for_async_insert=0`) ) ，以便更好地查看内部信息。[#42040](https://github.com/ClickHouse/ClickHouse/pull/42040) ([Anton Popov](https://github.com/CurtizJ)).
* 为 HTTP 的 `Accept-Encoding` 新增对 `lz4`、`bz2`、`snappy` 编码方式的支持，这是对 HTTP 协议的一种非标准扩展。[#42071](https://github.com/ClickHouse/ClickHouse/pull/42071) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 新增了 Morton Coding (ZCurve) 编码/解码函数。[#41753](https://github.com/ClickHouse/ClickHouse/pull/41753) ([Constantine Peresypkin](https://github.com/pkit)) 。
* 支持 `SET setting_name = DEFAULT`。[#42187](https://github.com/ClickHouse/ClickHouse/pull/42187) ([Filatenkov Artur](https://github.com/FArthur-cmd)) 。

<div id="experimental-feature">
  #### Experimental 功能
</div>

* 在 `allow_experimental_analyzer` 设置下，新增了用于查询分析和规划的新基础设施。[#31796](https://github.com/ClickHouse/ClickHouse/pull/31796) ([Maksim Kita](https://github.com/kitaisreal)).
* Kusto 查询语言的初始实现。请勿使用。[#37961](https://github.com/ClickHouse/ClickHouse/pull/37961) ([Yong Wang](https://github.com/kashwy)).

<div id="performance-improvement">
  #### 性能改进
</div>

* 放宽“parts 过多”阈值。此更改关闭了 [#6551](https://github.com/ClickHouse/ClickHouse/issues/6551)。现在，如果平均 part 大小足够大 (至少 10 GiB) ，ClickHouse 将允许单个分区包含更多 parts。这使得在单台服务器上的单个表的单个分区中容纳最高达 PB 级的数据成为可能，可通过磁盘柜或对象存储实现。[#42002](https://github.com/ClickHouse/ClickHouse/pull/42002) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 实现了运算符优先级元素解析器，以减小所需的栈大小。[#34892](https://github.com/ClickHouse/ClickHouse/pull/34892) ([Nikolay Degterinsky](https://github.com/evillique)).
* 对 DISTINCT 的按顺序优化可利用数据流的排序特性。此改进会在适用时为 DISTINCT 启用按顺序读取 (此前必须为 DISTINCT 中的列提供 ORDER BY) 。[#41014](https://github.com/ClickHouse/ClickHouse/pull/41014) ([Igor Nikonov](https://github.com/devcrafter)).
* ColumnVector：使用 AVX512VBMI 优化 UInt8 索引。[#41247](https://github.com/ClickHouse/ClickHouse/pull/41247) ([Guo Wangyang](https://github.com/guowangy)).
* 优化 `ThreadGroupStatus::mutex` 的锁竞争。ICX 设备 (Intel Xeon Platinum 8380 CPU，80 核，160 线程) 上 **SSB** (Star Schema Benchmark) 的性能实验表明，此更改可将所有子场景 QPS 的几何均值提升 **2.95x**。[#41675](https://github.com/ClickHouse/ClickHouse/pull/41675) ([Zhiguo Zhou](https://github.com/ZhiguoZh)).
* 为 AArch64 构建添加 `ldapr` 能力。Graviton 2+、Azure 和 GCP 实例均支持此功能。这一特性直到不久前才在 clang-15 中出现，[见此](https://github.com/llvm/llvm-project/commit/9609b5daffe9fd28d83d83da895abc5113f76c24)。[#41778](https://github.com/ClickHouse/ClickHouse/pull/41778) ([Daniel Kutenin](https://github.com/danlark1)).
* 提升字符串比较时的性能，适用于其中一个参数是空常量字符串的情况。[#41870](https://github.com/ClickHouse/ClickHouse/pull/41870) ([Jiebin Sun](https://github.com/jiebinn)).
* 优化 ColumnAggregateFunction 的 `insertFrom`，以便在某些情况下共享聚合状态。[#41960](https://github.com/ClickHouse/ClickHouse/pull/41960) ([flynn](https://github.com/ucasfl)).
* 提高向 `azure_blob_storage` disk 写入的速度 (遵循 `max_single_part_upload_size`，而不是按每个缓冲区大小写入一个块) 。相关低效问题见 [#41754](https://github.com/ClickHouse/ClickHouse/issues/41754)。[#42041](https://github.com/ClickHouse/ClickHouse/pull/42041) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 使进程列表和 query\_log 中的线程 ID 保持唯一，以避免浪费。[#42180](https://github.com/ClickHouse/ClickHouse/pull/42180) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 支持在请求的读取范围超过缓存设置 `bypass_cache_threashold` 定义的阈值时完全绕过缓存 (既不下载到缓存，也不读取已缓存的数据) ，需通过 `enable_bypass_cache_with_threshold` 启用。[#42418](https://github.com/ClickHouse/ClickHouse/pull/42418) ([Han Shukai](https://github.com/KinderRiven)). 这对较慢的本地磁盘有帮助。

<div id="improvement">
  #### 改进
</div>

* 新增设置 `allow_implicit_no_password`：与 `allow_no_password` 配合使用时，除非显式指定 `IDENTIFIED WITH no_password`，否则禁止创建无密码用户。[#41341](https://github.com/ClickHouse/ClickHouse/pull/41341) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 内置 Keeper 现在总会在后台启动，因此 ClickHouse 即使未达到 quorum 也能启动。[#40991](https://github.com/ClickHouse/ClickHouse/pull/40991) ([Antonio Andelic](https://github.com/antonio2368)).
* 在先前的连接过期时，重新建立到 ZooKeeper 的新 connection 的响应速度更快了。此前默认有一个 task 每分钟才会触发一次，因此表可能会在这段时间内处于 readonly 状态。[#41092](https://github.com/ClickHouse/ClickHouse/pull/41092) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* 现在，投影已可与零拷贝复制配合使用 (零拷贝复制是一项尚不适用于生产环境的功能) 。[#41147](https://github.com/ClickHouse/ClickHouse/pull/41147) ([alesapin](https://github.com/alesapin)).
* 支持在子查询中使用表达式 `(EXPLAIN SELECT ...)`。现在，诸如 `SELECT * FROM (EXPLAIN PIPELINE SELECT col FROM TABLE ORDER BY col)` 之类的查询已变为合法。[#40630](https://github.com/ClickHouse/ClickHouse/pull/40630) ([Vladimir C](https://github.com/vdimir)).
* 允许在查询作用域内更改 `async_insert_max_data_size` 或 `async_insert_busy_timeout_ms`。例如，用户很少执行 `insert` 操作，而且她无法访问服务器配置来调整默认设置。[#40668](https://github.com/ClickHouse/ClickHouse/pull/40668) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* 改进了从远程 filesystem 读取的能力，并支持配置读/写线程池大小。关闭 [#41070](https://github.com/ClickHouse/ClickHouse/issues/41070)。[#41011](https://github.com/ClickHouse/ClickHouse/pull/41011) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 支持在 WindowTransform/arratReduce\*/initializeAggregation/aggregate functions versioning 中使用所有组合器的组合。此前，`ForEach/Resample/Map` 这类组合器在这些位置无法使用，使用它们会导致类似 `State function ... inserts results into non-state column` 的异常。[#41107](https://github.com/ClickHouse/ClickHouse/pull/41107) ([Kruglov Pavel](https://github.com/Avogar)).
* 新增函数 `tryDecrypt`：解密失败时 (例如使用错误的密钥解密) 返回 NULL，而不是抛出异常。[#41206](https://github.com/ClickHouse/ClickHouse/pull/41206) ([Duc Canh Le](https://github.com/canhld94)).
* 向 `system.disks` 表添加 `unreserved_space` 列，以查看每个磁盘上有多少空间未被预留占用。[#41254](https://github.com/ClickHouse/ClickHouse/pull/41254) ([filimonov](https://github.com/filimonov)).
* 支持在表函数参数中使用 S3 授权请求头。[#41261](https://github.com/ClickHouse/ClickHouse/pull/41261) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 为 Keeper 和内部 ZooKeeper 客户端添加了对 MultiRead 的支持 (这是对 ZooKeeper 协议的一项扩展，仅在 ClickHouse Keeper 中可用) 。[#41410](https://github.com/ClickHouse/ClickHouse/pull/41410) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 新增了对在 `IN` 运算符中将 decimal 类型与浮点数字面量进行比较的支持。[#41544](https://github.com/ClickHouse/ClickHouse/pull/41544) ([liang.huang](https://github.com/lhuang09287750)).
* 允许在 cache 配置中使用易读的大小值 (如 `1TB`) 。[#41688](https://github.com/ClickHouse/ClickHouse/pull/41688) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* ClickHouse 可能会在一段时间内缓存已过期的 DNS 记录 (默认 15 秒) ，直到缓存完成异步更新。在此期间，ClickHouse 仍可能尝试建立连接并报错。此问题已修复。[#41707](https://github.com/ClickHouse/ClickHouse/pull/41707) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* 为 `clickhouse-client`/`clickhouse-local` 增加了基于类似 fzf 的工具 (fzf/sk) 的交互式历史记录搜索功能 (注意，还可以使用 `FZF_DEFAULT_OPTS`/`SKIM_DEFAULT_OPTIONS` 进一步配置其行为) 。[#41730](https://github.com/ClickHouse/ClickHouse/pull/41730) ([Azat Khuzhin](https://github.com/azat)) 。
* 仅允许连接到使用无效证书的安全服务器的客户端在指定 '--accept-certificate' 标志时继续。 [#41743](https://github.com/ClickHouse/ClickHouse/pull/41743) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)).
* 新增函数 `tryBase58Decode`，类似于现有的 `tryBase64Decode` 函数。[#41824](https://github.com/ClickHouse/ClickHouse/pull/41824) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 改进了在使用不同主键替换分区时的反馈信息。修复了 [#34798](https://github.com/ClickHouse/ClickHouse/issues/34798)。[#41838](https://github.com/ClickHouse/ClickHouse/pull/41838) ([Salvatore](https://github.com/tbsal)) 。
* 修复并行解析：segmentator 现在会检查 `max_block_size`。这修复了在并行解析且 LIMIT 较小时的内存过度分配问题。[#41852](https://github.com/ClickHouse/ClickHouse/pull/41852) ([Vitaly Baranov](https://github.com/vitlibar)).
* 如果在从系统表执行 SELECT 时发生了 "TABLE\_IS\_DROPPED" 异常，且该异常已被忽略，则不要将其添加到 `system.errors` 中。[#41908](https://github.com/ClickHouse/ClickHouse/pull/41908) ([AlfVII](https://github.com/AlfVII)).
* 改进了选项 `enable_extended_results_for_datetime_functions`，使函数 `toStartOfDay`、`toStartOfHour`、`toStartOfFifteenMinutes`、`toStartOfTenMinutes`、`toStartOfFiveMinutes`、`toStartOfMinute` 和 `timeSlot` 返回 `DateTime64` 类型的结果。[#41910](https://github.com/ClickHouse/ClickHouse/pull/41910) ([Roman Vasin](https://github.com/rvasin)) 。
* 改进了文本格式中 `DateTime` 类型的推断。现在会遵循设置 `date_time_input_format`，且不再尝试将数值作为时间戳推断为日期时间。关闭 [#41389](https://github.com/ClickHouse/ClickHouse/issues/41389) 关闭 [#42206](https://github.com/ClickHouse/ClickHouse/issues/42206)。[#41912](https://github.com/ClickHouse/ClickHouse/pull/41912) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 在使用 `perform_ttl_move_on_insert` = false 执行插入时，移除了一条令人困惑的警告。[#41980](https://github.com/ClickHouse/ClickHouse/pull/41980) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 允许用户像写 `count(*)` 一样写 `countState(*)`。此更改修复了 [#9338](https://github.com/ClickHouse/ClickHouse/issues/9338)。[#41983](https://github.com/ClickHouse/ClickHouse/pull/41983) ([Amos Bird](https://github.com/amosbird)) 。
* 修复 `rankCorr` 的大小溢出问题。[#42020](https://github.com/ClickHouse/ClickHouse/pull/42020) ([Duc Canh Le](https://github.com/canhld94)) 。
* 新增了一个选项，可在 Sentry 的配置中将任意字符串指定为环境名称，以便生成更易用的报告。[#42037](https://github.com/ClickHouse/ClickHouse/pull/42037) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 修复从 CSV 解析超出范围的 Date 值时的问题。[#42044](https://github.com/ClickHouse/ClickHouse/pull/42044) ([Andrey Zvonov](https://github.com/zvonand)).
* `parseDataTimeBestEffort` 现已支持在日期和时间之间使用逗号。修复了 [#42038](https://github.com/ClickHouse/ClickHouse/issues/42038)。[#42049](https://github.com/ClickHouse/ClickHouse/pull/42049) ([flynn](https://github.com/ucasfl)).
* 改进了 `ReplicatedMergeTree` 中陈旧副本的恢复流程。如果某个丢失的副本包含一些健康副本中没有的 parts，但根据健康副本的复制队列，这些 parts 之后应该会出现，那么该丢失副本将保留这些 parts，而不是将其分离出去。[#42134](https://github.com/ClickHouse/ClickHouse/pull/42134) ([Alexander Tokmakov](https://github.com/tavplubix)).
* 新增了在 date\_diff 函数中使用 `Date32` 参数的支持。修复了在 date\_diff 函数中使用 DateTime64 参数时，若起始日期早于 Unix 纪元而结束日期晚于 Unix 纪元所出现的问题。[#42308](https://github.com/ClickHouse/ClickHouse/pull/42308) ([Roman Vasin](https://github.com/rvasin)).
* 向 Minio 上传较大的 parts 时，'Complete Multipart Upload' 可能会耗费较长时间。Minio 每 10 秒发送一次心跳 (参见 [https://github.com/minio/minio/pull/7198](https://github.com/minio/minio/pull/7198)) 。但 ClickHouse 会更早发生超时，因为默认的发送/接收超时时间被[设置](https://github.com/ClickHouse/ClickHouse/blob/cc24fcd6d5dfb67f5f66f5483e986bd1010ad9cf/src/IO/S3/PocoHTTPClient.cpp#L123)为 5 秒。[#42321](https://github.com/ClickHouse/ClickHouse/pull/42321) ([filimonov](https://github.com/filimonov)) 。
* 修复了对 Decimal 等复杂类型的聚合状态类型进行 `cast` 时偶发的无效转换问题。此修复解决了 [#42408](https://github.com/ClickHouse/ClickHouse/issues/42408)。[#42417](https://github.com/ClickHouse/ClickHouse/pull/42417) ([Amos Bird](https://github.com/amosbird)) 。
* 允许 `dateName` 函数使用 `Date32` 类型的参数。[#42554](https://github.com/ClickHouse/ClickHouse/pull/42554) ([Roman Vasin](https://github.com/rvasin)).
* 现在，在进行索引分析时，将会使用包含 NULL 字面量的过滤器。[#34063](https://github.com/ClickHouse/ClickHouse/issues/34063)。[#41842](https://github.com/ClickHouse/ClickHouse/pull/41842) ([Amos Bird](https://github.com/amosbird)) 。
* 如果范围内的每个 part 都超过某个阈值时长，就合并这些 parts。该阈值可通过 `min_age_to_force_merge_seconds` 设置。此更改关闭了 [#35836](https://github.com/ClickHouse/ClickHouse/issues/35836)。[#42423](https://github.com/ClickHouse/ClickHouse/pull/42423) ([Antonio Andelic](https://github.com/antonio2368)) 。这是对 [@fastio](https://github.com/fastio) 在 [#39550i](https://github.com/ClickHouse/ClickHouse/pull/39550) 中实现的大部分逻辑的延续。
* 在 `allow_experimental_analyzer` 设置下，新增了用于查询分析和规划的新基础设施。[#31796](https://github.com/ClickHouse/ClickHouse/pull/31796) ([Maksim Kita](https://github.com/kitaisreal)).
* 缩短了恢复丢失的 Keeper 连接所需的时间。[#42541](https://github.com/ClickHouse/ClickHouse/pull/42541) ([Raúl Marín](https://github.com/Algunenano)) 。

<div id="buildtestingpackaging-improvement">
  #### 构建/测试/打包改进
</div>

* 为表定义添加了 fuzzer [#40096](https://github.com/ClickHouse/ClickHouse/pull/40096) ([Anton Popov](https://github.com/CurtizJ)) 。这是迄今为止 ClickHouse 今年在测试方面最大的进展。
* ClickHouse Cloud 服务的 Beta 版本已发布：[https://console.clickhouse.cloud/](https://console.clickhouse.cloud/)。这是使用 ClickHouse 最简单的方式 (甚至比单命令安装还略微简单一些) 。
* 为 AST Fuzzer 增加了 WHERE 子句生成功能，并支持添加或移除 ORDER BY 和 WHERE 子句。[#38519](https://github.com/ClickHouse/ClickHouse/pull/38519) ([Ilya Yatsishin](https://github.com/qoega)) 。
* Aarch64 二进制文件现在至少要求 ARMv8.2 (于 2016 年发布) 。最值得注意的是，这使得可以使用 ARM LSE，即原生 atomic 操作。另外，还新增了 CMake 构建选项 "NO\_ARMV81\_OR\_HIGHER"，以支持为较旧的 ARMv8.0 硬件编译二进制文件，例如 Raspberry Pi 4。[#41610](https://github.com/ClickHouse/ClickHouse/pull/41610) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 现已允许使用 Musl 构建 ClickHouse (在此前虽已支持但存在问题的基础上做了一些小修改) 。[#41987](https://github.com/ClickHouse/ClickHouse/pull/41987) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 增加了对 `$CLICKHOUSE_CRONFILE` 文件的检查，以避免安装时运行 `sed` 命令后出现“找不到文件”错误。[#42081](https://github.com/ClickHouse/ClickHouse/pull/42081) ([Chun-Sheng, Li](https://github.com/peter279k)) 。
* 将 cctz 更新到 `2022e` 以支持新的 timezone 变更。Palestine 的切换时间现改为周六 02:00。将 Ukraine 的三个时区合并为一个。Jordan 和 Syria 从带 DST 的 +02/+03 切换为全年 +03。 ([https://data.iana.org/time-zones/tzdb/NEWS](https://data.iana.org/time-zones/tzdb/NEWS)) 。此更改关闭了 [#42252](https://github.com/ClickHouse/ClickHouse/issues/42252)。[#42327](https://github.com/ClickHouse/ClickHouse/pull/42327) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。[#42273](https://github.com/ClickHouse/ClickHouse/pull/42273) ([Dom Del Nano](https://github.com/ddelnano)) 。
* 为 ClickHouse 增加了对 Rust 代码的支持，并以 BLAKE3 哈希函数库为示例。[#33435](https://github.com/ClickHouse/ClickHouse/pull/33435) ([BoloniniD](https://github.com/BoloniniD)) 。

<div id="bug-fix-user-visible-misbehavior-in-official-stable-or-prestable-release-2">
  #### 缺陷修复 (官方稳定版本或预稳定版本中用户可见的异常行为)
</div>

* 为 `LowCardinality` 和大整数类型采用正确的聚合方法。[#42342](https://github.com/ClickHouse/ClickHouse/pull/42342) ([Duc Canh Le](https://github.com/canhld94)).
* 修复了 `web` 磁盘中的若干问题。[#41652](https://github.com/ClickHouse/ClickHouse/pull/41652) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 修复了一个问题：如果配置中没有 `https_port`，`docker run` 会失败。[#41693](https://github.com/ClickHouse/ClickHouse/pull/41693) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* 在服务器关闭或执行 `SYSTEM STOP MERGES` 查询时，变更未能被正确取消，而且取消过程可能耗时很长；此问题已修复。 [#41699](https://github.com/ClickHouse/ClickHouse/pull/41699) ([Alexander Tokmakov](https://github.com/tavplubix)).
* 修复了在启用“按顺序读取”优化 (设置 `optimize_read_in_order` 和 `optimize_aggregation_in_order`) 时，`ORDER BY` 或 `GROUP BY` 使用排序键前缀中的列，且这些列经单调函数包裹后，查询结果错误的问题。[#41701](https://github.com/ClickHouse/ClickHouse/pull/41701) ([Anton Popov](https://github.com/CurtizJ)).
* 修复了在从 `Merge` 表执行 `SELECT` 查询且启用了 `optimize_monotonous_functions_in_order_by` 设置时可能发生的崩溃。修复 [#41269](https://github.com/ClickHouse/ClickHouse/issues/41269)。[#41740](https://github.com/ClickHouse/ClickHouse/pull/41740) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了在极少数情况下可能发生的 "Part ... intersects part ..." 错误：如果在将某个损坏的数据分片分离后立即重启副本，可能会出现该错误。[#41741](https://github.com/ClickHouse/ClickHouse/pull/41741) ([Alexander Tokmakov](https://github.com/tavplubix)) 。
* 不再允许创建或修改列名为 `_row_exists` 的 merge tree 表，因为该名称保留用于轻量级删除。已修复 [#41716](https://github.com/ClickHouse/ClickHouse/issues/41716)。[#41763](https://github.com/ClickHouse/ClickHouse/pull/41763) ([Jianmei Zhang](https://github.com/zhangjmruc)) 。
* 修复了某些 HTTP 响应缺少 CORS 请求头的问题。[#41792](https://github.com/ClickHouse/ClickHouse/pull/41792) ([Frank Chen](https://github.com/FrankChen021)) 。
* 22.9 在启动 `ReplicatedMergeTree` 表时可能会失败：如果该表由 20.3 或更早版本创建，且此后从未修改过，就会出现此问题；现已修复。修复了 [#41742](https://github.com/ClickHouse/ClickHouse/issues/41742)。[#41796](https://github.com/ClickHouse/ClickHouse/pull/41796) ([Alexander Tokmakov](https://github.com/tavplubix)) 。
* 当批次发送因某种原因失败时，将无法自动恢复；如果不及时处理，就会造成积压，而且打印出的错误信息会越来越长，进而导致 http 线程阻塞。[#41813](https://github.com/ClickHouse/ClickHouse/pull/41813) ([zhongyuankai](https://github.com/zhongyuankai)).
* 修复启用 compressed marks 设置时 compact parts 的问题。修复了 [#41783](https://github.com/ClickHouse/ClickHouse/issues/41783) 和 [#41746](https://github.com/ClickHouse/ClickHouse/issues/41746)。[#41823](https://github.com/ClickHouse/ClickHouse/pull/41823) ([alesapin](https://github.com/alesapin)).
* 旧版本的 Replicated database 在 \[Zoo]Keeper 中没有特殊标记。我们只需检查该节点是否包含某些不明数据，而不是检查特殊标记。[#41875](https://github.com/ClickHouse/ClickHouse/pull/41875) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 修复 fs cache 中可能发生的异常。[#41884](https://github.com/ClickHouse/ClickHouse/pull/41884) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复 S3 表函数中 `use_environment_credentials` 的问题。[#41970](https://github.com/ClickHouse/ClickHouse/pull/41970) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复了在分离损坏的数据分片时出现的“Directory already exists and is not empty”错误；该错误可能会导致 `ReplicatedMergeTree` 表无法启动复制。修复了 [#40957](https://github.com/ClickHouse/ClickHouse/issues/40957)。[#41981](https://github.com/ClickHouse/ClickHouse/pull/41981) ([Alexander Tokmakov](https://github.com/tavplubix)).
* `toDateTime64` 现在对于负整数和浮点参数会返回相同的结果。[#42025](https://github.com/ClickHouse/ClickHouse/pull/42025) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 修复了写入 `azure_blob_storage` 时的问题。部分解决 [#41754](https://github.com/ClickHouse/ClickHouse/issues/41754)。[#42034](https://github.com/ClickHouse/ClickHouse/pull/42034) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复了特定 `bzip2` 文件的 `bzip2` 解码问题。[#42046](https://github.com/ClickHouse/ClickHouse/pull/42046) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 修复了 SQL 函数 `toLastDayOfMonth` 在扩展范围起点 (1900 年 1 月) 启用设置 "enable\_extended\_results\_for\_datetime\_functions = 1" 时的问题。 - 修复了 SQL 函数 "toRelativeWeekNum()" 在扩展范围终点 (2299 年 12 月) 启用设置 "enable\_extended\_results\_for\_datetime\_functions = 1" 时的问题。 - 通过避免不必要的索引算术运算，提升了 SQL 函数 "toISOYear()"、"toFirstDayNumOfISOYearIndex()" 和 "toYearWeekOfNewyearMode()" 的性能。[#42084](https://github.com/ClickHouse/ClickHouse/pull/42084) ([Roman Vasin](https://github.com/rvasin)).
* 每个表的拉取任务最大数量此前被误设为 8，而线程池大小可能更大。现在，表的拉取任务最大数量与线程池大小相同。[#42090](https://github.com/ClickHouse/ClickHouse/pull/42090) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 修复了以下问题：在检查是否可在不破坏表之间依赖关系的情况下删除时，某个表可能已关闭，某个字典可能已分离。修复 [#41982](https://github.com/ClickHouse/ClickHouse/issues/41982)。[#42106](https://github.com/ClickHouse/ClickHouse/pull/42106) ([Alexander Tokmakov](https://github.com/tavplubix)) 。
* 修复了在使用文件系统缓存时，`remote_filesystem_read_method=read` 效率低下的问题。关闭了 [#42125](https://github.com/ClickHouse/ClickHouse/issues/42125)。[#42129](https://github.com/ClickHouse/ClickHouse/pull/42129) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复在 use\_hedged\_requests = 0 时，Distributed 查询可能发生的超时异常。[#42130](https://github.com/ClickHouse/ClickHouse/pull/42130) ([Azat Khuzhin](https://github.com/azat)).
* 修复了函数 `runningDifference` 在与 `Date32` 类型配合使用时的一个小缺陷。此前使用的是 `Date`，可能会导致一些逻辑错误，例如 `Bad cast from type DB::ColumnVector<int> to DB::ColumnVector<unsigned short>'`。[#42143](https://github.com/ClickHouse/ClickHouse/pull/42143) ([Alfred Xu](https://github.com/sperlingxx)) 。
* 修复了重复使用基准备份中 > 4GB 文件时的问题。[#42146](https://github.com/ClickHouse/ClickHouse/pull/42146) ([Azat Khuzhin](https://github.com/azat)) 。
* 如果排序键中的第一列包含函数，`DISTINCT in order` 会因 LOGICAL\_ERROR 失败。[#42186](https://github.com/ClickHouse/ClickHouse/pull/42186) ([Igor Nikonov](https://github.com/devcrafter)) 。
* 修复了 projections 与 `aggregate_functions_null_for_empty` 设置相关的一个问题。这个问题非常罕见，只有在服务器配置中启用 `aggregate_functions_null_for_empty` 设置时才会出现。此修复关闭了 [#41647](https://github.com/ClickHouse/ClickHouse/issues/41647)。[#42198](https://github.com/ClickHouse/ClickHouse/pull/42198) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 修复从 `Buffer` 表按降序读取时的问题。[#42236](https://github.com/ClickHouse/ClickHouse/pull/42236) ([Duc Canh Le](https://github.com/canhld94)) 。
* 修复了一个 bug：当默认 profile 中设置了 `background_pool_size setting`，但未设置 `background_merges_mutations_concurrency_ratio` 时，ClickHouse 将无法启动。[#42315](https://github.com/ClickHouse/ClickHouse/pull/42315) ([nvartolomei](https://github.com/nvartolomei)) 。
* 对已附加分片执行 `ALTER UPDATE` 时，如果其列与表 schema 不一致，可能会在磁盘上生成无效的 `columns.txt` 元数据。读取此类分片时可能会失败并报错，或返回无效数据。修复了 [#42161](https://github.com/ClickHouse/ClickHouse/issues/42161)。[#42319](https://github.com/ClickHouse/ClickHouse/pull/42319) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 设置 `additional_table_filters` 未应用于 `Distributed` 存储。修复了 [#41692](https://github.com/ClickHouse/ClickHouse/issues/41692)。[#42322](https://github.com/ClickHouse/ClickHouse/pull/42322) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了查询完成/取消过程中的数据竞争问题。此项修复关闭了 [#42346](https://github.com/ClickHouse/ClickHouse/issues/42346)。[#42362](https://github.com/ClickHouse/ClickHouse/pull/42362) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 此更改回退了 [#40217](https://github.com/ClickHouse/ClickHouse/issues/40217) 中的修改，该修改在日期/时间函数中引入了一个回归问题。[#42367](https://github.com/ClickHouse/ClickHouse/pull/42367) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 修复在 join 条件为假值时的 assert cast 问题，关闭 [#42380](https://github.com/ClickHouse/ClickHouse/issues/42380)。[#42407](https://github.com/ClickHouse/ClickHouse/pull/42407) ([Vladimir C](https://github.com/vdimir))。
* 修复 Decimal 数据类型处理过程中的缓冲区溢出问题。此修复已关闭 [#42451](https://github.com/ClickHouse/ClickHouse/issues/42451)。[#42465](https://github.com/ClickHouse/ClickHouse/pull/42465) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* `AggregateFunctionQuantile` 现在已可正确处理 UInt128 列。此前，quantile 状态会将 `UInt128` 列解释为 `Int128`，从而可能导致结果错误。[#42473](https://github.com/ClickHouse/ClickHouse/pull/42473) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 修复了向非 Float32 列上的 `Annoy` 索引执行 INSERT 时触发 `bad&#95;cast` 断言的问题。`Annoy` 索引是一项 Experimental 功能。[#42485](https://github.com/ClickHouse/ClickHouse/pull/42485) ([Robert Schulze](https://github.com/rschu1ze)).
* 涉及 Date 或 DateTime 与 128 位或 256 位整数的算术运算符会引用未初始化的内存。[#42453](https://github.com/ClickHouse/ClickHouse/issues/42453)。[#42573](https://github.com/ClickHouse/ClickHouse/pull/42573) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 修复服务器升级期间，因分区键包含别名函数名而导致的意外表加载错误。 [#36379](https://github.com/ClickHouse/ClickHouse/pull/36379) ([Amos Bird](https://github.com/amosbird)).

### <a id="229" /> ClickHouse 发行版 22.9，2022-09-22。 [演示](https://presentations.clickhouse.com/2022-release-22.9/), [视频](https://www.youtube.com/watch?v=rK2BsaaaOCA)

<Frame>
  <iframe src="https://www.youtube.com/embed/rK2BsaaaOCA" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen />
</Frame>

<div id="backward-incompatible-change-2">
  #### 不兼容变更
</div>

* 如果存在任何 `ReplicatedMergeTree` 表，从 20.3 及更早版本升级到 22.9 及更高版本时，必须先经过一个中间版本，否则新版本的 server 将无法启动。[#40641](https://github.com/ClickHouse/ClickHouse/pull/40641) ([Alexander Tokmakov](https://github.com/tavplubix)).
* 移除函数 `accurate_Cast` 和 `accurate_CastOrNull` (它们与 `accurateCast` 和 `accurateCastOrNull` 的区别仅在于名称中带有下划线，且不受 `cast_keep_nullable` 设置值的影响) 。这些函数既没有文档，也没有测试、无人使用，也没有存在的必要。它们之所以一直“存活”，是代码泛化的副作用。[#40682](https://github.com/ClickHouse/ClickHouse/pull/40682) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 添加测试，确保每个新的 table function 都有文档。参见 [#40649](https://github.com/ClickHouse/ClickHouse/issues/40649)。将 table function `MeiliSearch` 重命名为 `meilisearch`。[#40709](https://github.com/ClickHouse/ClickHouse/pull/40709) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 添加测试，确保每个新函数都有文档。参见 [#40649](https://github.com/ClickHouse/ClickHouse/pull/40649)。函数 `lemmatize`、`synonyms`、`stem` 之前误被实现为不区分大小写；现在改为区分大小写。[#40711](https://github.com/ClickHouse/ClickHouse/pull/40711) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 出于安全性和稳定性考虑，catboost 模型不再在 ClickHouse server 内部执行评估。现在，评估
  改为在 clickhouse-library-bridge 中完成；它是一个独立进程，负责加载 catboost 库，并通过
  HTTP 与 server 进程通信。[#40897](https://github.com/ClickHouse/ClickHouse/pull/40897) ([Robert Schulze](https://github.com/rschu1ze)).
* 使 YAML 配置的解释方式更符合常规习惯。[#41044](https://github.com/ClickHouse/ClickHouse/pull/41044) ([Vitaly Baranov](https://github.com/vitlibar)).

<div id="new-feature-2">
  #### 新功能
</div>

* 支持 `insert_quorum = 'auto'`，以使用多数派数量。[#39970](https://github.com/ClickHouse/ClickHouse/pull/39970) ([Sachin](https://github.com/SachinSetiya)) 。
* 为 ClickHouse server 添加嵌入式仪表盘。这是一个演示项目，展示如何利用 ClickHouse 的功能，以 1% 的投入达到 90% 的效果。[#40461](https://github.com/ClickHouse/ClickHouse/pull/40461) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 新增 settings 约束可写性类型 `changeable_in_readonly`。[#40631](https://github.com/ClickHouse/ClickHouse/pull/40631) ([Sergei Trifonov](https://github.com/serxa)) 。
* 新增对 `INTERSECT DISTINCT` 和 `EXCEPT DISTINCT` 的支持。[#40792](https://github.com/ClickHouse/ClickHouse/pull/40792) ([Duc Canh Le](https://github.com/canhld94)) 。
* 新增输入/输出 format `JSONObjectEachRow` —— 支持导入 `JSON/JSONCompact/JSONColumnsWithMetadata` format。新增 setting `input_format_json_validate_types_from_metadata`，用于控制是否检查 metadata 中的数据类型是否与请求头中的数据类型匹配。—— 新增 setting `input_format_json_validate_utf8`，启用后，所有 `JSON` format 都会验证 UTF-8 序列。默认禁用。注意，该 setting 不会影响输出 format `JSON/JSONCompact/JSONColumnsWithMetadata`，它们始终会验证 UTF-8 序列 (这一特例是出于兼容性原因) 。—— 新增 setting `input_format_json_read_numbers_as_strings `，允许在 String 列中解析数值，默认禁用。—— 新增 setting `output_format_json_quote_decimals`，允许将小数输出为双引号包裹的形式，默认禁用。—— 允许在导入数据时解析双引号中的小数。[#40910](https://github.com/ClickHouse/ClickHouse/pull/40910) ([Kruglov Pavel](https://github.com/Avogar)) 。
* DESCRIBE TABLE 查询支持 query parameters。[#40952](https://github.com/ClickHouse/ClickHouse/pull/40952) ([Nikita Taranov](https://github.com/nickitat)) 。
* 新增对 Parquet Time32/64 的支持，方法是将其转换为 DateTime64。Parquet time32/64 表示自午夜起经过的时间，而 DateTime32/64 表示实际的 Unix timestamp。转换只是基于 `0` 进行偏移。[#41333](https://github.com/ClickHouse/ClickHouse/pull/41333) ([Arthur Passos](https://github.com/arthurpassos)) 。
* 在 Apache Datasketches 上实现集合运算。[#39919](https://github.com/ClickHouse/ClickHouse/pull/39919) ([Fangyuan Deng](https://github.com/pzhdfy)) 。注意：Apache Datasketches 实际上没有使用价值，它们不如 ClickHouse，只有在与其他系统集成时才有意义。
* 允许在读取 text formats (`CSV`、`TSV`) 时将 error 记录到指定文件。[#40516](https://github.com/ClickHouse/ClickHouse/pull/40516) ([zjial](https://github.com/zjial)) 。

<div id="experimental-feature">
  #### Experimental 功能
</div>

* 新增基于 `Annoy` 的 ANN (近似最近邻) 索引。[#40818](https://github.com/ClickHouse/ClickHouse/pull/40818) ([Filatenkov Artur](https://github.com/FArthur-cmd)). [#37215](https://github.com/ClickHouse/ClickHouse/pull/37215) ([VVMak](https://github.com/VVMak)).
* 新增存储引擎 `KeeperMap`，使用 ClickHouse Keeper 或 ZooKeeper 作为键值存储。[#39976](https://github.com/ClickHouse/ClickHouse/pull/39976) ([Antonio Andelic](https://github.com/antonio2368)). 该存储引擎旨在存储少量元数据。
* 改进内存中的数据分区片段：删除已被完全处理的 WAL 文件。[#40592](https://github.com/ClickHouse/ClickHouse/pull/40592) ([Azat Khuzhin](https://github.com/azat)).

<div id="performance-improvement-3">
  #### 性能提升
</div>

* 支持标记和主键压缩。关闭 [#34437](https://github.com/ClickHouse/ClickHouse/issues/34437)。[#37693](https://github.com/ClickHouse/ClickHouse/pull/37693) ([zhongyuankai](https://github.com/zhongyuankai)) 。
* 允许通过线程池预先加载标记。由设置 `load_marks_asynchronously` 控制 (默认值：0) 。[#40821](https://github.com/ClickHouse/ClickHouse/pull/40821) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* S3 上的虚拟文件系统将使用随机对象名，并将其分散到多个路径前缀中，以提升 AWS 上的性能。[#40968](https://github.com/ClickHouse/ClickHouse/pull/40968) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 在生成单层聚合结果时将 `max_block_size` 的值考虑在内。这样可以让后续的查询计划步骤使用更多线程执行。[#39138](https://github.com/ClickHouse/ClickHouse/pull/39138) ([Nikita Taranov](https://github.com/nickitat)) 。
* 软件预取可用于聚合中，以加快哈希表操作。由设置 `enable_software_prefetch_in_aggregation` 控制，默认启用。[#39304](https://github.com/ClickHouse/ClickHouse/pull/39304) ([Nikita Taranov](https://github.com/nickitat)) 。
* 在应用 `WHERE` 子句后，如果某些排序键列始终为常量，则对 `optimize_read_in_order` 的支持更好了。例如，对于 `SELECT ... FROM table WHERE a = 'x' ORDER BY a, b` 这样的查询，`table` 的存储定义为：`MergeTree ORDER BY (a, b)`。[#38715](https://github.com/ClickHouse/ClickHouse/pull/38715) ([Anton Popov](https://github.com/CurtizJ)) 。
* 在排序前，先让 `full_sorting_join` 中参与连接的流相互过滤。[#39418](https://github.com/ClickHouse/ClickHouse/pull/39418) ([Vladimir C](https://github.com/vdimir)) 。
* 通过跳过对空字面量的处理，优化了 LZ4 解压缩性能。[#40142](https://github.com/ClickHouse/ClickHouse/pull/40142) ([Nikita Taranov](https://github.com/nickitat)) 。
* 在可能的情况下，使用原生 `copy` 而非通过 `clickhouse-server` 内存复制，以加快备份过程。 [#40395](https://github.com/ClickHouse/ClickHouse/pull/40395) ([alesapin](https://github.com/alesapin)).
* 不再为每个 INSERT 块获取存储快照 (可略微提升性能) 。[#40638](https://github.com/ClickHouse/ClickHouse/pull/40638) ([Azat Khuzhin](https://github.com/azat)).
* 为具有多个 Nullable 参数的聚合函数支持批处理。 [#41058](https://github.com/ClickHouse/ClickHouse/pull/41058) ([Raúl Marín](https://github.com/Algunenano)).
* 加快读取 UniquesHashSet 的速度 (例如从磁盘读取 `uniqState` 时) 。[#41089](https://github.com/ClickHouse/ClickHouse/pull/41089) ([Raúl Marín](https://github.com/Algunenano)) 。
* 修复了在拥有大量列的表中对 compact parts 执行变更时内存占用过高的问题。[#41122](https://github.com/ClickHouse/ClickHouse/pull/41122) ([lthaooo](https://github.com/lthaooo)).
* 在 ARM 上启用 vectorscan 库，可加快正则表达式的求值速度。[#41033](https://github.com/ClickHouse/ClickHouse/pull/41033) ([Robert Schulze](https://github.com/rschu1ze)).
* 将 vectorscan 升级到 5.4.8，该版本包含多项性能优化，可加快正则表达式的求值速度。 [#41270](https://github.com/ClickHouse/ClickHouse/pull/41270) ([Robert Schulze](https://github.com/rschu1ze)).
* 修复了在极高并发下发生的错误回退问题：VFS (如 S3) 会跳过本地文件系统缓存。[#40420](https://github.com/ClickHouse/ClickHouse/pull/40420) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 如果行策略过滤器始终为 false，则会立即返回空结果，无需读取任何数据。此更改解决了 [#24012](https://github.com/ClickHouse/ClickHouse/issues/24012)。[#40740](https://github.com/ClickHouse/ClickHouse/pull/40740) ([Amos Bird](https://github.com/amosbird)) 。
* 用于 Float 数据类型的并行哈希 JOIN 可能不是最优方案。现已对其进行优化。[#41183](https://github.com/ClickHouse/ClickHouse/pull/41183) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。

<div id="improvement">
  #### 改进
</div>

* 在启动期间以及调用 ATTACH 时，`ReplicatedMergeTree` 表会保持为只读状态，直到与 ZooKeeper 建立连接并完成设置。[#40148](https://github.com/ClickHouse/ClickHouse/pull/40148) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 添加 `enable_extended_results_for_datetime_functions` 选项：当参数为 Date32 或 DateTime64 时，函数 toStartOfYear、toStartOfISOYear、toStartOfQuarter、toStartOfMonth、toStartOfWeek、toMonday 和 toLastDayOfMonth 将返回 Date32 类型的结果；否则将返回 Date 类型的结果。出于兼容性考虑，默认值为 '0'。[#41214](https://github.com/ClickHouse/ClickHouse/pull/41214) ([Roman Vasin](https://github.com/rvasin)) 。
* 出于安全性和稳定性考虑，CatBoost 模型不再在 ClickHouse server 内进行评估。现在，评估是在 clickhouse-library-bridge 中完成的；它是一个独立进程，负责加载 catboost 库，并通过 HTTP 与服务器进程通信。函数 `modelEvaluate()` 已替换为 `catboostEvaluate()`。[#40897](https://github.com/ClickHouse/ClickHouse/pull/40897) ([Robert Schulze](https://github.com/rschu1ze))。[#39629](https://github.com/ClickHouse/ClickHouse/pull/39629) ([Robert Schulze](https://github.com/rschu1ze))。
* 为磁盘临时数据添加更多指标，关闭了 [#40206](https://github.com/ClickHouse/ClickHouse/issues/40206)。[#40239](https://github.com/ClickHouse/ClickHouse/pull/40239) ([Vladimir C](https://github.com/vdimir)) 。
* 新增配置选项 `warning_supress_regexp`，解决 [#40330](https://github.com/ClickHouse/ClickHouse/issues/40330)。[#40548](https://github.com/ClickHouse/ClickHouse/pull/40548) ([Vladimir C](https://github.com/vdimir)) 。
* 新增用于禁用 kafka\_num\_consumers 限制的设置。关闭 [#40331](https://github.com/ClickHouse/ClickHouse/issues/40331)。[#40670](https://github.com/ClickHouse/ClickHouse/pull/40670) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 支持在 `DELETE ...` 查询中使用 `SETTINGS`。[#41533](https://github.com/ClickHouse/ClickHouse/pull/41533) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 为 S3 ObjectStorage 提供了按每次 S3 API 调用拆分的详细 S3 profile events `DiskS3*`。[#41532](https://github.com/ClickHouse/ClickHouse/pull/41532) ([Sergei Trifonov](https://github.com/serxa)) 。
* 在 `system.asynchronous_metrics` 中新增了两项指标：`NumberOfDetachedParts` 和 `NumberOfDetachedByUserParts`。[#40779](https://github.com/ClickHouse/ClickHouse/pull/40779) ([Sema Checherinda](https://github.com/CheSema)) 。
* 允许在 ODBC 和 JDBC 表上使用 CONSTRAINT。[#34551](https://github.com/ClickHouse/ClickHouse/pull/34551) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 如果原始查询中 `SETTINGS` 并未出现多次，则在查询格式化时不要将 `SETTINGS` 重复输出。[#38900](https://github.com/ClickHouse/ClickHouse/pull/38900) ([Raúl Marín](https://github.com/Algunenano)).
* 改进追踪 (OpenTelemetry) 上下文在线程间的传播。[#39010](https://github.com/ClickHouse/ClickHouse/pull/39010) ([Frank Chen](https://github.com/FrankChen021)) 。
* ClickHouse Keeper：如果指定了 `interserver_listen_host`，则仅在 Keeper 中为其添加监听器。[#39973](https://github.com/ClickHouse/ClickHouse/pull/39973) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 改进 Replicated 用户访问存储在出错后的恢复能力。 [#39977](https://github.com/ClickHouse/ClickHouse/pull/39977) ([Vitaly Baranov](https://github.com/vitlibar)).
* 为 `EmbeddedRocksDB` 增加生存时间 (TTL) 支持。[#39986](https://github.com/ClickHouse/ClickHouse/pull/39986) ([Lloyd-Pottiger](https://github.com/Lloyd-Pottiger)) 。
* 为 `clickhouse-obfuscator` 增加 schema 推断功能，这样就不再需要 `--structure` 参数了。[#40120](https://github.com/ClickHouse/ClickHouse/pull/40120) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 改进并修复了 `Arrow` 格式中的字典。[#40173](https://github.com/ClickHouse/ClickHouse/pull/40173) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 将 `Date32`、`DateTime64` 和 `Date` 转换为更窄类型时会更加自然：如果超出正常范围，则取正常范围的上界或下界值。[#40217](https://github.com/ClickHouse/ClickHouse/pull/40217) ([Andrey Zvonov](https://github.com/zvonand)).
* 修复了基于 `View` 的 `Merge` 表无法使用索引的问题。[#40233](https://github.com/ClickHouse/ClickHouse/pull/40233) ([Duc Canh Le](https://github.com/canhld94)) 。
* JSON 服务器日志支持自定义键名。[#40251](https://github.com/ClickHouse/ClickHouse/pull/40251) ([Mallik Hassan](https://github.com/SadiHassan)).
* 现在可以为函数 `throwIf` 抛出的异常指定自定义错误代码。[#40319](https://github.com/ClickHouse/ClickHouse/pull/40319) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 改进 schema inference 缓存，并考虑会更改 schema 的 format 设置。[#40414](https://github.com/ClickHouse/ClickHouse/pull/40414) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 允许将 `Date` 解析为 `DateTime` 和 `DateTime64`。这是对 [#36949](https://github.com/ClickHouse/ClickHouse/issues/36949) 中所提改进的实现。[#40474](https://github.com/ClickHouse/ClickHouse/pull/40474) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 允许将形如 `2022-08-22 01:02:03.456` 的 `DateTime64` 格式 `String` 转换为 `Date` 和 `Date32`。允许将形如 `2022-08-22 01:02:03` 的 `DateTime` 格式 String 转换为 `Date32`。这修复了 [#39598](https://github.com/ClickHouse/ClickHouse/issues/39598)。[#40475](https://github.com/ClickHouse/ClickHouse/pull/40475) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 更好地支持了 Parquet 格式中的嵌套数据结构 [#40485](https://github.com/ClickHouse/ClickHouse/pull/40485) ([Arthur Passos](https://github.com/arthurpassos)) 。
* 支持在 Avro 中将 Array(Record) 读取为扁平化嵌套表。[#40534](https://github.com/ClickHouse/ClickHouse/pull/40534) ([Kruglov Pavel](https://github.com/Avogar)).
* 为 `EmbeddedRocksDB` 新增只读支持。[#40543](https://github.com/ClickHouse/ClickHouse/pull/40543) ([Lloyd-Pottiger](https://github.com/Lloyd-Pottiger)) 。
* 对 URL 表引擎的压缩方法参数进行验证。[#40600](https://github.com/ClickHouse/ClickHouse/pull/40600) ([Frank Chen](https://github.com/FrankChen021)) 。
* 在文件名后带有查询字符串时，改进了对 url 表函数/引擎的格式识别。关闭了 [#40315](https://github.com/ClickHouse/ClickHouse/issues/40315)。[#40636](https://github.com/ClickHouse/ClickHouse/pull/40636) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 在使用 grouping set 时禁用投影功能，否则会产生错误结果。此修复解决了 [#40635](https://github.com/ClickHouse/ClickHouse/issues/40635)。[#40726](https://github.com/ClickHouse/ClickHouse/pull/40726) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了 `APPLY` 列转换器格式错误的问题；如果在表定义中使用，可能会破坏元数据。此修复对应 [#37590](https://github.com/ClickHouse/ClickHouse/issues/37590)。[#40727](https://github.com/ClickHouse/ClickHouse/pull/40727) ([Amos Bird](https://github.com/amosbird)) 。
* 支持在 `formatDateTime` 中使用 `%z` 描述符来格式化时区偏移量。 [#40736](https://github.com/ClickHouse/ClickHouse/pull/40736) ([Cory Levy](https://github.com/LevyCory)).
* `clickhouse-client` 中的交互模式现在会把 `.` 和 `/` 视为“执行上一条命令”。[#40750](https://github.com/ClickHouse/ClickHouse/pull/40750) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 修复了在 MySQL database engine 和 MySQL 表函数中传递 MySQL 超时参数时的问题。关闭 [#34168](https://github.com/ClickHouse/ClickHouse/issues/34168)。[#40751](https://github.com/ClickHouse/ClickHouse/pull/40751) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 为文件系统缓存目录创建状态文件，以确保不同服务器或缓存之间不会共享缓存目录。[#40820](https://github.com/ClickHouse/ClickHouse/pull/40820) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 为 `EmbeddedRocksDB` 存储增加了对 `DELETE` 和 `UPDATE` 的支持。[#40853](https://github.com/ClickHouse/ClickHouse/pull/40853) ([Antonio Andelic](https://github.com/antonio2368)) 。
* ClickHouse Keeper：修复长时间提交期间的关闭问题，并提高允许的请求大小上限。[#40941](https://github.com/ClickHouse/ClickHouse/pull/40941) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 修复 WriteBufferFromS3 中的竞态问题，并添加 TSA 注解。 [#40950](https://github.com/ClickHouse/ClickHouse/pull/40950) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 启用 group\_by\_use\_nulls 时，分组集应仅将键列转换为 Nullable。[#40997](https://github.com/ClickHouse/ClickHouse/pull/40997) ([Duc Canh Le](https://github.com/canhld94)) 。
* 提升对分布式表执行 INSERT 操作时的可观测性。[#41034](https://github.com/ClickHouse/ClickHouse/pull/41034) ([Frank Chen](https://github.com/FrankChen021)) 。
* 增加了更多与 S3 交互相关的底层指标。[#41039](https://github.com/ClickHouse/ClickHouse/pull/41039) ([mateng915](https://github.com/mateng0915)).
* 支持在 HTTP 重定向后的 Location 请求头中使用相对路径。关闭 [#40985](https://github.com/ClickHouse/ClickHouse/issues/40985)。[#41162](https://github.com/ClickHouse/ClickHouse/pull/41162) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 无需重启服务器，即可在线对 HTTP 处理程序应用更改。[#41177](https://github.com/ClickHouse/ClickHouse/pull/41177) ([Azat Khuzhin](https://github.com/azat)) 。
* ClickHouse Keeper：在关闭过程中正确关闭活动会话。[#41215](https://github.com/ClickHouse/ClickHouse/pull/41215) ([Antonio Andelic](https://github.com/antonio2368)) 。这会缩短出现“表处于只读状态”错误的持续时间。
* 新增在 clickhouse-client/local 中自动将 SQL 查询注释掉的功能 (按 `Alt-#`，类似 readline) 。[#41224](https://github.com/ClickHouse/ClickHouse/pull/41224) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了在将设置 `do_no_evict_index_and_mark_files` 从 1 切换到 0 或从 0 切换到 1 后，缓存不兼容的问题。[#41330](https://github.com/ClickHouse/ClickHouse/pull/41330) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 新增设置 `allow_suspicious_fixed_string_types`，防止用户创建大小 > 256 的 FixedString 类型列。[#41495](https://github.com/ClickHouse/ClickHouse/pull/41495) ([Duc Canh Le](https://github.com/canhld94)) 。
* 在 system.parts 中添加 `has_lightweight_delete`。 [#41564](https://github.com/ClickHouse/ClickHouse/pull/41564) ([Kseniia Sumarokova](https://github.com/kssenii)).

<div id="buildtestingpackaging-improvement">
  #### 构建/测试/打包改进
</div>

* 要求为每个设置项提供文档。[#40644](https://github.com/ClickHouse/ClickHouse/pull/40644) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 要求为当前的每个指标提供文档。[#40645](https://github.com/ClickHouse/ClickHouse/pull/40645) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 要求为每个 profile 事件计数器都编写文档。补写了缺失的文档。[#40646](https://github.com/ClickHouse/ClickHouse/pull/40646) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 通过修正一些依赖关系，允许构建最小化的 `clickhouse-local`。[#40460](https://github.com/ClickHouse/ClickHouse/pull/40460) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。其体积不到 50 MiB。
* 计算并在测试中报告 SQL 函数覆盖率。[#40593](https://github.com/ClickHouse/ClickHouse/issues/40593)。[#40647](https://github.com/ClickHouse/ClickHouse/pull/40647) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 要求为每个 MergeTree 设置提供文档。[#40648](https://github.com/ClickHouse/ClickHouse/pull/40648) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 面向高层统一 server 组件的嵌入式参考文档原型。[#40649](https://github.com/ClickHouse/ClickHouse/pull/40649) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 我们将检查已更改的性能测试中的所有查询，确保所有已修改的查询都已得到测试。[#40322](https://github.com/ClickHouse/ClickHouse/pull/40322) ([Nikita Taranov](https://github.com/nickitat)) 。
* 修复 TGZ 包。[#40681](https://github.com/ClickHouse/ClickHouse/pull/40681) ([Mikhail f. Shiryaev](https://github.com/Felixoid)) 。
* 修复调试符号问题。[#40873](https://github.com/ClickHouse/ClickHouse/pull/40873) ([Azat Khuzhin](https://github.com/azat)) 。
* 扩展了 CI 配置，以生成一个仅支持 x86 SSE2 的 build 版本。这对老旧或嵌入式硬件很有帮助。[#40999](https://github.com/ClickHouse/ClickHouse/pull/40999) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 切换至 llvm/clang 15。 [#41046](https://github.com/ClickHouse/ClickHouse/pull/41046) ([Azat Khuzhin](https://github.com/azat)).
* 延续 [#40938](https://github.com/ClickHouse/ClickHouse/issues/40938)。修复 `Loggers` 类的 ODR 违规问题。并修复了 [#40398](https://github.com/ClickHouse/ClickHouse/issues/40398)、[#40937](https://github.com/ClickHouse/ClickHouse/issues/40937)。[#41060](https://github.com/ClickHouse/ClickHouse/pull/41060) ([Dmitry Novik](https://github.com/novikd)) 。
* 将 macOS 二进制文件添加到 GitHub 发布资源中，修复了 [#37718](https://github.com/ClickHouse/ClickHouse/issues/37718)。[#41088](https://github.com/ClickHouse/ClickHouse/pull/41088) ([Mikhail f. Shiryaev](https://github.com/Felixoid)) 。
* c-ares 库现已集成到 ClickHouse 的构建系统中。[#41239](https://github.com/ClickHouse/ClickHouse/pull/41239) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 从 ClickHouse 主代码中去除 `dlopen`。它仍保留在 library-bridge 和 odbc-bridge 中。[#41428](https://github.com/ClickHouse/ClickHouse/pull/41428) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 不要在主 ClickHouse 二进制文件中允许使用 `dlopen`，因为它有害且不安全。我们不会使用它，但某些库可能会用它来实现“插件”。我们强烈反对这种老掉牙的做法：把不受控制的危险第三方库加载到进程地址空间中，因为这简直太疯狂了。[#41429](https://github.com/ClickHouse/ClickHouse/pull/41429) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 为 deb 软件包添加 `source` 字段，并更新 `nfpm`。[#41531](https://github.com/ClickHouse/ClickHouse/pull/41531) ([Mikhail f. Shiryaev](https://github.com/Felixoid)) 。
* 内部 DWARF 解析器现已支持 DWARF-5。[#40710](https://github.com/ClickHouse/ClickHouse/pull/40710) ([Azat Khuzhin](https://github.com/azat)) 。
* 为测试在 ZooKeeper 客户端中加入故障注入 [#30498](https://github.com/ClickHouse/ClickHouse/pull/30498) ([Alexander Tokmakov](https://github.com/tavplubix)) 。
* 添加支持调试和 tsan 的 S3 存储无状态测试 [#35262](https://github.com/ClickHouse/ClickHouse/pull/35262) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 在 S3 上进行压力测试 [#36837](https://github.com/ClickHouse/ClickHouse/pull/36837) ([alesapin](https://github.com/alesapin)).
* 在 `clang-tidy` 中启用 `concurrency-mt-unsafe` 检查 [#40224](https://github.com/ClickHouse/ClickHouse/pull/40224) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。

<div id="bug-fix">
  #### 问题修复
</div>

* 修复了因 [AWS SDK 中的一个缺陷](https://github.com/aws/aws-sdk-cpp/issues/658) 而可能导致的数据丢失问题。该缺陷仅会在通过 S3 使用 ClickHouse 时触发。[#40506](https://github.com/ClickHouse/ClickHouse/pull/40506) ([alesapin](https://github.com/alesapin))。这个 AWS SDK 缺陷已存在 5 年之久，并在我们提交报告后被关闭。
* Native format 中的恶意数据可能会导致程序崩溃。[#41441](https://github.com/ClickHouse/ClickHouse/pull/41441) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 聚合函数 `categorialInformationValue` 的属性定义有误，可能会导致运行时发生空指针解引用。此修复关闭了 [#41443](https://github.com/ClickHouse/ClickHouse/issues/41443)。[#41449](https://github.com/ClickHouse/ClickHouse/pull/41449) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 以 Apache `ORC` 格式写入数据时，可能会导致缓冲区越界。 [#41458](https://github.com/ClickHouse/ClickHouse/pull/41458) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 修复了在将 Array(Nullable) 用作参数时，函数 `encrypt` 和 `contingency` 的内存安全问题。此修复解决了 [#41004](https://github.com/ClickHouse/ClickHouse/issues/41004)。[#40195](https://github.com/ClickHouse/ClickHouse/pull/40195) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 修复了 MergeJoin 在 'not\_processed' 不为 null 时出现的问题。[#40335](https://github.com/ClickHouse/ClickHouse/pull/40335) ([liql2007](https://github.com/liql2007)) 。
* 修复了 IN 运算符中因小数精度丢失而导致结果不正确的问题，参见 [#41125](https://github.com/ClickHouse/ClickHouse/issues/41125)。[#41130](https://github.com/ClickHouse/ClickHouse/pull/41130) ([Vladimir C](https://github.com/vdimir)).
* 修复了多层级 `Nested` 列缺失项的填充问题。[#37152](https://github.com/ClickHouse/ClickHouse/pull/37152) ([Anton Popov](https://github.com/CurtizJ)).
* 修复了 Ordinary (已弃用) 数据库的 SYSTEM UNFREEZE 查询。另见 [https://github.com/ClickHouse/ClickHouse/pull/36424](https://github.com/ClickHouse/ClickHouse/pull/36424) 中的修复。[#38262](https://github.com/ClickHouse/ClickHouse/pull/38262) ([Vadim Volodin](https://github.com/PolyProgrammist)) 。
* 修复了由 WITH 语句引入的未使用未知列问题。此修复解决了 [#37812](https://github.com/ClickHouse/ClickHouse/issues/37812)。[#39131](https://github.com/ClickHouse/ClickHouse/pull/39131) ([Amos Bird](https://github.com/amosbird)).
* 修复存在窗口函数时 ORDER BY 的查询分析问题。修复了 [#38741](https://github.com/ClickHouse/ClickHouse/issues/38741) 和 [#24892](https://github.com/ClickHouse/ClickHouse/issues/24892)。[#39354](https://github.com/ClickHouse/ClickHouse/pull/39354) ([Dmitry Novik](https://github.com/novikd)).
* 修复了用户尝试对聚合函数计算 WINDOW ORDER BY/PARTITION BY 表达式时出现的 `Unknown identifier (aggregate-function)` 异常。[#39762](https://github.com/ClickHouse/ClickHouse/pull/39762) ([Vladimir Chebotaryov](https://github.com/quickhouse)) 。
* 通过设置 `max_analyze_depth` 来限制单个查询的 analyze 次数。这样可以防止在包含异常大量子查询的查询中，分析时间呈指数级增长。[#40334](https://github.com/ClickHouse/ClickHouse/pull/40334) ([Vladimir C](https://github.com/vdimir)).
* 修复了 MergeTree 引擎家族中列生存时间 (TTL) 的一个罕见 bug：在重复执行垂直合并时，可能会出现错误 `Cannot unlink file ColumnName.bin ... No such file or directory.`。[#40346](https://github.com/ClickHouse/ClickHouse/pull/40346) ([alesapin](https://github.com/alesapin)) 。
* 如果同时存在 IPv4 和 IPv6，则同时使用两者的 DNS 记录。[#40353](https://github.com/ClickHouse/ClickHouse/pull/40353) ([Maksim Kita](https://github.com/kitaisreal)).
* 支持从 Hadoop 读取 snappy 压缩文件。[#40482](https://github.com/ClickHouse/ClickHouse/pull/40482) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了解析包含可变维度数组的 `Object` 类型 (Experimental 功能) 值时发生的崩溃问题。 [#40483](https://github.com/ClickHouse/ClickHouse/pull/40483) ([Duc Canh Le](https://github.com/canhld94)).
* 修复了设置 `input_format_tsv_skip_first_lines` 的问题。 [#40491](https://github.com/ClickHouse/ClickHouse/pull/40491) ([mini4](https://github.com/mini4)).
* 修复 MaterializedPostgreSQL 数据库/表引擎启动时的 bug (竞态条件) 。[#40262](https://github.com/ClickHouse/ClickHouse/issues/40262)。修复达到 relcache\_callback\_list slots 上限时的错误。[#40511](https://github.com/ClickHouse/ClickHouse/pull/40511) ([Maksim Buren](https://github.com/maks-buren630501)) 。
* 修复解析 DateTime64 时可能出现的 'Decimal math overflow' 错误。[#40546](https://github.com/ClickHouse/ClickHouse/pull/40546) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了对包含轻量级删除行的 parts 进行垂直合并时的问题。[#40559](https://github.com/ClickHouse/ClickHouse/pull/40559) ([Alexander Gololobov](https://github.com/davenger)) 。
* 修复了在 URL 表引擎启用压缩时写入数据会触发段错误的问题。[#40565](https://github.com/ClickHouse/ClickHouse/pull/40565) ([Frank Chen](https://github.com/FrankChen021)) 。
* 修复了 arrayElement 函数处理 Map 时可能出现的逻辑错误 `'Invalid Field get from type UInt64 to type String'`。 [#40572](https://github.com/ClickHouse/ClickHouse/pull/40572) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复文件系统缓存中可能存在的竞争问题。[#40586](https://github.com/ClickHouse/ClickHouse/pull/40586) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 移除了在 `MergeTree` 表中对未受影响分区跳过变更的行为，因为该功能从未正常工作过，而且可能导致已完成的变更重新生效。[#40589](https://github.com/ClickHouse/ClickHouse/pull/40589) ([Alexander Tokmakov](https://github.com/tavplubix)).
* 如果在运行时向配置中添加一个已被占用的 grpc 端口，ClickHouse server 会崩溃。[#40597](https://github.com/ClickHouse/ClickHouse/pull/40597) ([何李夫](https://github.com/helifu)) 。
* 修复 `base58Encode / base58Decode` 处理前导 0 / '1' 时的问题。[#40620](https://github.com/ClickHouse/ClickHouse/pull/40620) ([Andrey Zvonov](https://github.com/zvonand)) 。
* keeper-fix：修复了在安装快照期间访问日志时出现的竞争问题。[#40627](https://github.com/ClickHouse/ClickHouse/pull/40627) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 修复 `toFixedString` 函数短路执行的问题。部分解决了 [#40622](https://github.com/ClickHouse/ClickHouse/issues/40622)。[#40628](https://github.com/ClickHouse/ClickHouse/pull/40628) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了 SQLite 中将 int8 列转换为 ClickHouse 中 int64 列时出现的问题。修复了 [#40639](https://github.com/ClickHouse/ClickHouse/issues/40639)。[#40642](https://github.com/ClickHouse/ClickHouse/pull/40642) ([Barum Rho](https://github.com/barumrho)) 。
* 修复递归 `Buffer` 表中的栈溢出。此项修复关闭了 [#40637](https://github.com/ClickHouse/ClickHouse/issues/40637)。[#40643](https://github.com/ClickHouse/ClickHouse/pull/40643) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 在向 `ProcessList` 中插入新查询时，会发生内存分配。如果在这些分配过程中达到内存限制，就无法使用 `OvercommitTracker`，因为 `ProcessList::mutex` 已经被持有。修复了 [#40611](https://github.com/ClickHouse/ClickHouse/issues/40611)。[#40677](https://github.com/ClickHouse/ClickHouse/pull/40677) ([Dmitry Novik](https://github.com/novikd)) 。
* 修复了在读取标记时将 max\_read\_buffer\_size=0 导致的 LOGICAL\_ERROR。 [#40705](https://github.com/ClickHouse/ClickHouse/pull/40705) ([Azat Khuzhin](https://github.com/azat)).
* 修复在无查询上下文的情况下向 MV 推送数据时的内存泄漏问题 (如来自 Kafka/...) 。[#40732](https://github.com/ClickHouse/ClickHouse/pull/40732) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了 CSV schema inference 中可能出现的“Attempt to read after eof”错误。[#40746](https://github.com/ClickHouse/ClickHouse/pull/40746) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复直写缓存中的逻辑错误："只有下载器才能完成 File 段的写入"。关闭 [#40748](https://github.com/ClickHouse/ClickHouse/issues/40748)。[#40759](https://github.com/ClickHouse/ClickHouse/pull/40759) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 使 GROUPING 函数的结果与 SQL 和其他 DBMS 中的结果保持一致。[#40762](https://github.com/ClickHouse/ClickHouse/pull/40762) ([Dmitry Novik](https://github.com/novikd)) 。
* 在 [#40595](https://github.com/ClickHouse/ClickHouse/issues/40595) 中，有报告指出，`host_regexp` 功能在 `/etc/hosts` 中进行名称到地址解析时无法正常工作。现已修复。[#40769](https://github.com/ClickHouse/ClickHouse/pull/40769) ([Arthur Passos](https://github.com/arthurpassos)) 。
* 修复了 Log 家族的增量备份问题。[#40827](https://github.com/ClickHouse/ClickHouse/pull/40827) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复了一个极其罕见的 bug，该 bug 可能会导致 zero-copy 复制中发生潜在的数据丢失。[#40844](https://github.com/ClickHouse/ClickHouse/pull/40844) ([alesapin](https://github.com/alesapin)).
* 修复了以下问题：当基于不同列构建相同的 Set 表达式时，分析键条件会发生崩溃。[#40850](https://github.com/ClickHouse/ClickHouse/pull/40850) ([Duc Canh Le](https://github.com/canhld94)) 。
* 修复嵌套 JSON 对象的 schema 推断。[#40851](https://github.com/ClickHouse/ClickHouse/pull/40851) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了文件系统缓存文件的三位数字前缀目录在为空时未被删除的问题。关闭 [#40797](https://github.com/ClickHouse/ClickHouse/issues/40797)。[#40867](https://github.com/ClickHouse/ClickHouse/pull/40867) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复连接副本失败时未捕获 DNS\_ERROR 的问题。 [#40881](https://github.com/ClickHouse/ClickHouse/pull/40881) ([Robert Coelho](https://github.com/coelho)).
* 修复了在子查询中删除不需要的列时出现的错误。[#40884](https://github.com/ClickHouse/ClickHouse/pull/40884) ([luocongkai](https://github.com/TKaxe)) 。
* 修复远程读取缓冲区中的额外内存分配问题。[#40896](https://github.com/ClickHouse/ClickHouse/pull/40896) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复了以下问题：即使用户的删除数据库权限已被显式撤销，仍然可以删除数据库。 [#40906](https://github.com/ClickHouse/ClickHouse/pull/40906) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* 修复 ClickHouse Keeper：在写入请求中，正确比较 path 与 Keeper 内部系统节点 path。[#40918](https://github.com/ClickHouse/ClickHouse/pull/40918) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 修复了 WriteBufferFromS3 中的死锁问题。[#40943](https://github.com/ClickHouse/ClickHouse/pull/40943) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复 `DESCRIBE TABLE url()` 以及其他一些 `DESCRIBE TABLE <table_function>()` 的访问权限问题。[#40975](https://github.com/ClickHouse/ClickHouse/pull/40975) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 移除 `WITH GROUPING SETS` 中存在错误的 parser 逻辑，该问题可能导致空指针解引用。[#41049](https://github.com/ClickHouse/ClickHouse/pull/41049) ([Duc Canh Le](https://github.com/canhld94)).
* 针对 ClickHouse Keeper 的一项修复：修复 Keeper 关闭期间可能出现的段错误。[#41075](https://github.com/ClickHouse/ClickHouse/pull/41075) ([Antonio Andelic](https://github.com/antonio2368)).
* 修复聚合函数组合器中可能出现的段错误、释放后继续使用堆内存和内存泄漏问题。关闭 [#40848](https://github.com/ClickHouse/ClickHouse/issues/40848)。[#41083](https://github.com/ClickHouse/ClickHouse/pull/41083) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复 Window views 中的 query\_views\_log 问题。[#41132](https://github.com/ClickHouse/ClickHouse/pull/41132) ([Raúl Marín](https://github.com/Algunenano)) 。
* 默认禁用 optimize\_monotonous\_functions\_in\_order\_by，以缓解：[#40094](https://github.com/ClickHouse/ClickHouse/issues/40094)。[#41136](https://github.com/ClickHouse/ClickHouse/pull/41136) ([Denny Crane](https://github.com/den-crane)).
* 修复了将数据库 engine 从 Ordinary 自动转换为 Atomic 时出现的 “possible deadlock avoided” 错误。[#41146](https://github.com/ClickHouse/ClickHouse/pull/41146) ([Alexander Tokmakov](https://github.com/tavplubix)) 。
* 修复了 SortedBlocksWriter 在处理空块时出现的 SIGSEGV 问题 (在使用 `optimize_aggregation_in_order` 和 `join_algorithm=auto` 时可能会出现) 。[#41154](https://github.com/ClickHouse/ClickHouse/pull/41154) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了在使用 array join 且启用 trivial count 优化时查询结果错误的问题。此修复解决了 [#39431](https://github.com/ClickHouse/ClickHouse/issues/39431)。[#41158](https://github.com/ClickHouse/ClickHouse/pull/41158) ([Denny Crane](https://github.com/den-crane)) 。
* 修复 GetPriorityForLoadBalancing::getPriorityFunc() 中的 stack-use-after-return 错误。[#41159](https://github.com/ClickHouse/ClickHouse/pull/41159) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复位置参数越界异常 “Positional argument out of bounds”。关闭 [#40634](https://github.com/ClickHouse/ClickHouse/issues/40634)。[#41189](https://github.com/ClickHouse/ClickHouse/pull/41189) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复损坏的 detached parts 的后台清理问题。[#41190](https://github.com/ClickHouse/ClickHouse/pull/41190) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复了在存在大量带 `where` 的交叉 `join` 时出现的查询重写指数级膨胀问题，关闭 [#21557](https://github.com/ClickHouse/ClickHouse/issues/21557)。[#41223](https://github.com/ClickHouse/ClickHouse/pull/41223) ([Vladimir C](https://github.com/vdimir)) 。
* 修复了写穿缓存中可能存在的逻辑错误，原因是并非所有类型的异常都得到了正确处理。关闭 [#41208](https://github.com/ClickHouse/ClickHouse/issues/41208)。[#41232](https://github.com/ClickHouse/ClickHouse/pull/41232) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复 system.filesystem\_cache\_log 中的 String 类型日志条目。 [#41233](https://github.com/ClickHouse/ClickHouse/pull/41233) ([jmimbrero](https://github.com/josemimbrero-tinybird)).
* 在子查询中使用 `OFFSET` 子句、且外层查询中使用 `WHERE` 子句的查询，可能返回错误结果；此问题现已修复。修复了 [#40416](https://github.com/ClickHouse/ClickHouse/issues/40416)。[#41280](https://github.com/ClickHouse/ClickHouse/pull/41280) ([Alexander Tokmakov](https://github.com/tavplubix)) 。
* 修复了在启用 `query_plan_optimize_primary_key` 时查询结果可能出错的问题。修复 [#40599](https://github.com/ClickHouse/ClickHouse/issues/40599)。[#41281](https://github.com/ClickHouse/ClickHouse/pull/41281) ([Nikolai Kochetov](https://github.com/KochetovNicolai))。
* 避免在 lowerUTF8/upperUTF8 中让无效序列影响其他行。 [#41286](https://github.com/ClickHouse/ClickHouse/pull/41286) ([Azat Khuzhin](https://github.com/azat)).
* 修复了 `ALTER <table> ADD COLUMN` 查询在处理 `Object` 类型列时的问题。[#41290](https://github.com/ClickHouse/ClickHouse/pull/41290) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了在配置中不存在 `distributed_ddl.path` 时，查询 `system.distributed_ddl_queue` 会报出 "No node" 错误的问题。修复 [#41096](https://github.com/ClickHouse/ClickHouse/issues/41096)。[#41296](https://github.com/ClickHouse/ClickHouse/pull/41296) ([young scott](https://github.com/young-scott)) 。
* 修复 disk 对象存储中错误抛出的逻辑错误 `Expected relative path`。与 [#41246](https://github.com/ClickHouse/ClickHouse/issues/41246) 相关。[#41297](https://github.com/ClickHouse/ClickHouse/pull/41297) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 在 MsgPack 格式下插入 UUID 前增加列类型检查。[#41309](https://github.com/ClickHouse/ClickHouse/pull/41309) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复了在启用设置 `async_insert` 时，将格式错误的数据异步插入到 `Object` 类型列后可能发生的崩溃。如果异步插入的所有批次中的 JSON 都无效且无法解析，就可能出现这种情况。[#41336](https://github.com/ClickHouse/ClickHouse/pull/41336) ([Anton Popov](https://github.com/CurtizJ)).
* 修复在同时使用 async\_socket\_for\_remote/use\_hedged\_requests 和并行 KILL 时可能发生的死锁。[#41343](https://github.com/ClickHouse/ClickHouse/pull/41343) ([Azat Khuzhin](https://github.com/azat)) 。
* 默认禁用 optimize\_rewrite\_sum\_if\_to\_count\_if，以缓解以下问题：[#38605](https://github.com/ClickHouse/ClickHouse/issues/38605) [#38683](https://github.com/ClickHouse/ClickHouse/issues/38683)。[#41388](https://github.com/ClickHouse/ClickHouse/pull/41388) ([Denny Crane](https://github.com/den-crane)) 。
* 自 22.8 起，如果 database 为 `Replicated`，且集群名称与数据库名称相同，则会忽略 `ON CLUSTER` 子句。因此，`DROP PARTITION ON CLUSTER` 与 `Replicated` 一起使用时会出现不符合预期的行为。此问题已修复，现在仅对在数据库级别复制的查询忽略 `ON CLUSTER` 子句。修复了 [#41299](https://github.com/ClickHouse/ClickHouse/issues/41299)。[#41390](https://github.com/ClickHouse/ClickHouse/pull/41390) ([Alexander Tokmakov](https://github.com/tavplubix)) 。
* 修复了在取消查询 (`KILL QUERY` 或关闭服务器) 时可能出现的挂起/死锁问题。[#41467](https://github.com/ClickHouse/ClickHouse/pull/41467) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了使用 JBOD 功能时 server 可能崩溃的问题。此修复解决了 [#41365](https://github.com/ClickHouse/ClickHouse/issues/41365)。[#41483](https://github.com/ClickHouse/ClickHouse/pull/41483) ([Amos Bird](https://github.com/amosbird)) 。
* 修复将 nullable fixed string 转换为 string 时的问题。[#41541](https://github.com/ClickHouse/ClickHouse/pull/41541) ([Duc Canh Le](https://github.com/canhld94)) 。
* 防止向 groupBitmap\* 传入错误的聚合状态时发生崩溃。[#41563](https://github.com/ClickHouse/ClickHouse/pull/41563) ([Raúl Marín](https://github.com/Algunenano)) 。
* 使用 `ORDER BY` 且 `1500 <= LIMIT <= max_block_size` 的查询可能会返回不正确的结果，前面的部分行可能缺失。修复了 [#41182](https://github.com/ClickHouse/ClickHouse/issues/41182)。[#41576](https://github.com/ClickHouse/ClickHouse/pull/41576) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复在使用 materialized views 时 X-ClickHouse-Summary 中读取字节数/行数的问题。[#41586](https://github.com/ClickHouse/ClickHouse/pull/41586) ([Raúl Marín](https://github.com/Algunenano)).
* 修复带有 `OFFSET` 的查询可能出现 `pipeline stuck` 异常的问题。该错误是在 `enable_optimize_predicate_expression = 0` 且 `WHERE` 中条件始终为 false 时发现的。修复了 [#41383](https://github.com/ClickHouse/ClickHouse/issues/41383)。[#41588](https://github.com/ClickHouse/ClickHouse/pull/41588) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。

### <a id="228" /> ClickHouse 发行版 22.8，2022-08-18。[演示文稿](https://presentations.clickhouse.com/2022-release-22.8/)，[视频](https://www.youtube.com/watch?v=yob7AnaBJz0)

<Frame>
  <iframe src="https://www.youtube.com/embed/yob7AnaBJz0" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen />
</Frame>

<div id="backward-incompatible-change-2">
  #### 不兼容变更
</div>

* 扩展了 `Date32` 和 `DateTime64` 的范围，以支持 1900 年至 2299 年的日期。此前版本中，支持的区间仅为 1925 年至 2283 年。该实现使用扩展的格里高利历 (proleptic Gregorian calendar，符合 [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601):2004 (第 3.2.1 条 The Gregorian calendar) ) ，而不是考虑从儒略历到格里高利历的历史切换。此变更会影响超出范围参数的实现特定行为。例如，在此前版本中，`1899-01-01` 的值会被截断为 `1925-01-01`；而在新版本中，它将被截断为 `1900-01-01`。如果传入 `INTERVAL 3 QUARTER`，还会改变 `toStartOfInterval` 的舍入行为，最多可能相差一个季度，因为这些时间间隔是从某个实现特定的时间点开始计数的。关闭 [#28216](https://github.com/ClickHouse/ClickHouse/issues/28216)，改进 [#38393](https://github.com/ClickHouse/ClickHouse/issues/38393)。[#39425](https://github.com/ClickHouse/ClickHouse/pull/39425) ([Roman Vasin](https://github.com/rvasin)).
* 现在，所有相关的字典源都会遵循 `remote_url_allow_hosts` 设置。此前 HTTP、Cassandra、Redis 已支持该设置；此次新增 ClickHouse、MongoDB、MySQL、PostgreSQL。仅对通过 DDL 创建的字典检查 host。[#39184](https://github.com/ClickHouse/ClickHouse/pull/39184) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 预构建的 ClickHouse x86 二进制文件现在要求支持 AVX 指令，也就是说，CPU 不能早于 Intel Sandy Bridge / AMD Bulldozer (两者均发布于 2011 年) 。[#39000](https://github.com/ClickHouse/ClickHouse/pull/39000) ([Robert Schulze](https://github.com/rschu1ze)).
* 使远程文件系统缓存支持组合式配置，允许某些文件 (如 idx、mrk 等) 不被淘汰，并删除旧版缓存。现在可以在 Azure Blob 存储磁盘、本地磁盘、StaticWeb 磁盘等之上配置缓存。此 PR 被标记为不兼容变更，因为缓存配置已发生变化，要使缓存生效，需要更新配置文件。旧缓存仍可在新配置下继续使用。服务器在旧缓存配置下也能正常启动。关闭 [https://github.com/ClickHouse/ClickHouse/issues/36140。关闭](https://github.com/ClickHouse/ClickHouse/issues/36140。关闭) [https://github.com/ClickHouse/ClickHouse/issues/37889。(\[Kseniia](https://github.com/ClickHouse/ClickHouse/issues/37889。\(\[Kseniia) Sumarokova]\([https://github.com/kssenii](https://github.com/kssenii))). [#36171](https://github.com/ClickHouse/ClickHouse/pull/36171))

<div id="new-feature-2">
  #### 新功能
</div>

* 在 merge tree 表上支持 SQL 标准 `DELETE FROM` 语法，并为 merge tree 系列表实现轻量级删除。[#37893](https://github.com/ClickHouse/ClickHouse/pull/37893) ([Jianmei Zhang](https://github.com/zhangjmruc)) ([Alexander Gololobov](https://github.com/davenger))。注意：这项新功能并不会让 ClickHouse 成为 HTAP DBMS。
* 查询参数可在交互模式下通过 `SET param_abc = 'def'` 设置，也可作为 settings 通过 native protocol 传输。[#39906](https://github.com/ClickHouse/ClickHouse/pull/39906) ([Nikita Taranov](https://github.com/nickitat))。
* 支持在 native protocol 中设置 Quota key ([Yakov Olkhovsky](https://github.com/ClickHouse/ClickHouse/pull/39874)) 。
* 新增 setting `exact_rows_before_limit` (0/1) 。启用后，ClickHouse 将为 `rows_before_limit_at_least` 统计信息提供精确值，但代价是必须完整读取 limit 之前的数据。此项变更解决了 [#6613](https://github.com/ClickHouse/ClickHouse/issues/6613)。[#25333](https://github.com/ClickHouse/ClickHouse/pull/25333) ([kevin wan](https://github.com/MaxWk))。
* 新增支持通过 `s3Cluster` table function，向使用 `Distributed` 和 `Replicated` engine 的表执行并行 distributed insert select。[#34670](https://github.com/ClickHouse/ClickHouse/issues/34670)。[#39107](https://github.com/ClickHouse/ClickHouse/pull/39107) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov))。
* 新增 settings，用于控制从 text formats 进行 schema inference：- `input_format_try_infer_dates` - 尝试从字符串推断日期。- `input_format_try_infer_datetimes` - 尝试从字符串推断日期时间。- `input_format_try_infer_integers` - 尝试推断为 `Int64` 而非 `Float64`。- `input_format_json_try_infer_numbers_from_strings` - 在 JSON formats 中尝试从 JSON 字符串推断数值。[#39186](https://github.com/ClickHouse/ClickHouse/pull/39186) ([Kruglov Pavel](https://github.com/Avogar))。
* 新增提供 JSON 格式日志输出的选项，目的是便于在日志分析工具中进行摄取和查询。[#39277](https://github.com/ClickHouse/ClickHouse/pull/39277) ([Mallik Hassan](https://github.com/SadiHassan))。
* 新增函数 `nowInBlock`，可在长时间运行和持续执行的查询过程中获取当前时间。关闭 [#39522](https://github.com/ClickHouse/ClickHouse/issues/39522)。注意：不存在 `now64InBlock` 和 `todayInBlock` 函数。[#39533](https://github.com/ClickHouse/ClickHouse/pull/39533) ([Alexey Milovidov](https://github.com/alexey-milovidov))。
* 新增可为 `executable()` table function 指定 settings。[#39681](https://github.com/ClickHouse/ClickHouse/pull/39681) ([Constantine Peresypkin](https://github.com/pkit))。
* 实现了将 database engine 从 `Ordinary` 自动转换为 `Atomic`。在 `flags` 目录中创建空的 `convert_ordinary_to_atomic` 文件后，所有 `Ordinary` databases 都会在下次 server 启动时自动完成转换。解决了 [#39546](https://github.com/ClickHouse/ClickHouse/issues/39546)。[#39933](https://github.com/ClickHouse/ClickHouse/pull/39933) ([Alexander Tokmakov](https://github.com/tavplubix))。
* 支持 `SELECT ... INTO OUTFILE '...' AND STDOUT`。[#37490](https://github.com/ClickHouse/ClickHouse/issues/37490)。[#39054](https://github.com/ClickHouse/ClickHouse/pull/39054) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni))。
* 新增 formats `PrettyMonoBlock`、`PrettyNoEscapesMonoBlock`、`PrettyCompactNoEscapes`、`PrettyCompactNoEscapesMonoBlock`、`PrettySpaceNoEscapes`、`PrettySpaceMonoBlock`、`PrettySpaceNoEscapesMonoBlock`。[#39646](https://github.com/ClickHouse/ClickHouse/pull/39646) ([Kruglov Pavel](https://github.com/Avogar))。

<div id="performance-improvement-3">
  #### 性能提升
</div>

* 改进了以内存高效方式合并聚合结果时的内存使用情况。[#39429](https://github.com/ClickHouse/ClickHouse/pull/39429) ([Nikita Taranov](https://github.com/nickitat)).
* 新增了并发控制逻辑，用于限制查询创建的并发线程总数。[#37558](https://github.com/ClickHouse/ClickHouse/pull/37558) ([Sergei Trifonov](https://github.com/serxa))。新增 `concurrent_threads_soft_limit parameter`，可在高 QPS 场景下通过限制所有查询的线程总数来提升性能。[#37285](https://github.com/ClickHouse/ClickHouse/pull/37285) ([Roman Vasin](https://github.com/rvasin))。
* 为未压缩缓存和标记缓存添加 `SLRU` 缓存策略。([Kseniia Sumarokova](https://github.com/kssenii)). [#34651](https://github.com/ClickHouse/ClickHouse/pull/34651) ([alexX512](https://github.com/alexX512)). 将本地缓存功能与缓存算法解耦 [#38048](https://github.com/ClickHouse/ClickHouse/pull/38048) ([Han Shukai](https://github.com/KinderRiven)).
* Intel® In-Memory Analytics Accelerator (Intel® IAA) 是一种硬件加速器，将在下一代 Intel® Xeon® Scalable 处理器 (“Sapphire Rapids”) 中提供。其目标是加速分析中的常见操作，例如数据 (解) 压缩和过滤操作。ClickHouse 新增了 “DeflateQpl” 压缩编解码器，利用 Intel® IAA 卸载技术提供高性能的 DEFLATE 实现。该编解码器使用 [Intel® Query Processing Library (QPL)](https://github.com/intel/qpl)，对硬件加速器的访问进行了抽象；如果硬件加速器不可用，则会回退到软件实现。总体而言，DEFLATE 的压缩率通常高于 ClickHouse 默认的 LZ4 编解码器，因此可减少磁盘 I/O 并降低主内存消耗。[#36654](https://github.com/ClickHouse/ClickHouse/pull/36654) ([jasperzhu](https://github.com/jinjunzh))。[#39494](https://github.com/ClickHouse/ClickHouse/pull/39494) ([Robert Schulze](https://github.com/rschu1ze))。
* 带有 `ORDER BY` 的按顺序 `DISTINCT`：根据输入 stream 的排序描述推导排序方式。如果输入 stream 已经有序，则跳过排序。[#38719](https://github.com/ClickHouse/ClickHouse/pull/38719) ([Igor Nikonov](https://github.com/devcrafter))。显著改善内存使用和查询执行时间 + 当 `DISTINCT` 列与 `ORDER BY` 列匹配时，最终 distinct 使用 `DistinctSortedChunkTransform`，但在 `EXPLAIN PIPELINE` 中将其重命名为 `DistinctSortedStreamTransform` → 这可显著改善内存使用 + 移除 `DistinctSortedChunkTransform` 热循环中不必要的内存分配。[#39432](https://github.com/ClickHouse/ClickHouse/pull/39432) ([Igor Nikonov](https://github.com/devcrafter))。仅当排序描述适用于 `DISTINCT` 列时才使用 `DistinctSortedTransform`，否则回退到普通的 `DISTINCT` 实现 + 这样可以减少 `DistinctSortedTransform` 执行期间的检查次数。[#39528](https://github.com/ClickHouse/ClickHouse/pull/39528) ([Igor Nikonov](https://github.com/devcrafter))。修复：`DistinctSortedTransform` 没有利用排序。它从未清空 HashSet，因为 `clearing_columns` 检测错误 (始终为空) 。因此，它实际上与普通的 `DISTINCT` (`DistinctTransform`) 一样工作。该修复可显著降低内存使用。[#39538](https://github.com/ClickHouse/ClickHouse/pull/39538) ([Igor Nikonov](https://github.com/devcrafter)).
* 执行 `cluster` 和类似表函数时，获取远程表结构将优先使用本地节点。[#39440](https://github.com/ClickHouse/ClickHouse/pull/39440) ([Mingliang Pan](https://github.com/liangliangpan)) 。
* 使用 AVX512VBMI2 compress store 优化数值列过滤。 [#39633](https://github.com/ClickHouse/ClickHouse/pull/39633) ([Guo Wangyang](https://github.com/guowangy)) 。对于支持 AVX512 VBMI2 的系统，此 PR 可将 SSB 基准测试查询 3.1、3.2 和 3.3 (SF=100) 的性能提升约 6%。已在 Intel Icelake Xeon 8380 \* 2 socket 上测试。 [#40033](https://github.com/ClickHouse/ClickHouse/pull/40033) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 在多线程场景下，使用函数表达式优化索引分析。[#39812](https://github.com/ClickHouse/ClickHouse/pull/39812) ([Guo Wangyang](https://github.com/guowangy)) 。
* 复杂查询优化：如果未注册任何 UDFs，则不会遍历其 AST。[#40069](https://github.com/ClickHouse/ClickHouse/pull/40069) ([Raúl Marín](https://github.com/Algunenano)) 。优化 CurrentMemoryTracker 的 alloc 和 free。[#40078](https://github.com/ClickHouse/ClickHouse/pull/40078) ([Raúl Marín](https://github.com/Algunenano)) 。
* 改进了 Base58 的编码/解码。[#39292](https://github.com/ClickHouse/ClickHouse/pull/39292) ([Andrey Zvonov](https://github.com/zvonand)) 。
* 改进 SSE/AVX/AVX512 的字节到位掩码转换。 [#39586](https://github.com/ClickHouse/ClickHouse/pull/39586) ([Guo Wangyang](https://github.com/guowangy)).

<div id="improvement">
  #### 改进
</div>

* 对 `AggregateFunction` 类型和状态表示进行规范化，因为像 [#35788](https://github.com/ClickHouse/ClickHouse/pull/35788) 这样的优化会将 `count(not null columns)` 视为 `count()`，这可能会导致分布式解释器报出以下错误：`Conversion from AggregateFunction(count) to AggregateFunction(count, Int64) is not supported`。[#39420](https://github.com/ClickHouse/ClickHouse/pull/39420) ([Amos Bird](https://github.com/amosbird)) 。状态相同的函数可以在 materialized view 中互换使用。
* 重构并简化 `system.backups` 表，移除 `internal` 列，允许用户设置操作的 ID，并新增 `num_files`、`uncompressed_size`、`compressed_size`、`start_time` 和 `end_time` 列。[#39503](https://github.com/ClickHouse/ClickHouse/pull/39503) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 改进了 `Replicated` database 的 DDL 查询结果表结构 (将 shard 和副本名称拆分为单独的列，状态更清晰) - 如果将 `distributed_ddl_entry_format_version` 设为 3 (默认值) ，则可先在 initiator 上对 `CREATE TABLE ... ON CLUSTER` 查询进行归一化。这意味着，如果 initiator 不属于查询中指定的 cluster，`ON CLUSTER` 查询可能无法正常工作。修复了 [#37318](https://github.com/ClickHouse/ClickHouse/issues/37318)、[#39500](https://github.com/ClickHouse/ClickHouse/issues/39500) - 如果 database 为 `Replicated` 且 cluster 名称等于 database 名称，则忽略 `ON CLUSTER` clause。与 [#35570](https://github.com/ClickHouse/ClickHouse/issues/35570) 相关 - 对 `Replicated` database engine 的其他一些小修复 - 在启动 `Replicated` database 时检查元数据一致性；如果本地元数据与 Keeper 中的元数据不一致，则启动副本恢复。解决了 [#24880](https://github.com/ClickHouse/ClickHouse/issues/24880)。[#37198](https://github.com/ClickHouse/ClickHouse/pull/37198) ([Alexander Tokmakov](https://github.com/tavplubix)) 。
* 在进度报告 (`X-ClickHouse-Summary`) 中添加 result\_rows 和 result\_bytes。[#39567](https://github.com/ClickHouse/ClickHouse/pull/39567) ([Raúl Marín](https://github.com/Algunenano)) 。
* 改进了 MergeTree 的主键分析。[#25563](https://github.com/ClickHouse/ClickHouse/pull/25563) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* `timeSlots` 现在支持 DateTime64；处理 DateTime64 时，可使用亚秒级耗时和槽大小。[#37951](https://github.com/ClickHouse/ClickHouse/pull/37951) ([Andrey Zvonov](https://github.com/zvonand)).
* 新增了对 `EmbeddedRocksDB` 表执行 `LEFT SEMI` 和 `LEFT ANTI` 直接 JOIN 的支持。[#38956](https://github.com/ClickHouse/ClickHouse/pull/38956) ([Vladimir C](https://github.com/vdimir)) 。
* 为 `fsync` 操作新增 profile events。[#39179](https://github.com/ClickHouse/ClickHouse/pull/39179) ([Azat Khuzhin](https://github.com/azat)) 。
* 为普通函数 `file(path[, default])` 新增了第二个参数；当文件不存在时，该函数会返回该参数的值。[#39218](https://github.com/ClickHouse/ClickHouse/pull/39218) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 针对通过 http 读取进行了一些小修复，允许在返回 200 OK 时重试部分内容。[#39244](https://github.com/ClickHouse/ClickHouse/pull/39244) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 支持 `CREATE TEMPORARY TABLE ... (<list of columns>) AS ...` 查询语句。[#39462](https://github.com/ClickHouse/ClickHouse/pull/39462) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 为自定义 TLD 添加对 `!`/`*` (感叹号/星号) 的支持 (`cutToFirstSignificantSubdomainCustom()`/`cutToFirstSignificantSubdomainCustomWithWWW()`/`firstSignificantSubdomainCustom()`) 。[#39496](https://github.com/ClickHouse/ClickHouse/pull/39496) ([Azat Khuzhin](https://github.com/azat)) 。
* 新增了对 NATS 的 TLS 连接支持。实现了 [#39525](https://github.com/ClickHouse/ClickHouse/issues/39525)。[#39527](https://github.com/ClickHouse/ClickHouse/pull/39527) ([Constantine Peresypkin](https://github.com/pkit)) 。
* `clickhouse-obfuscator` (一种用于测试和生成负载的数据库混淆工具) 现已新增 `--save` 和 `--load` 参数，可用于配合预训练模型使用。此更改修复了 [#39534](https://github.com/ClickHouse/ClickHouse/issues/39534)。[#39541](https://github.com/ClickHouse/ClickHouse/pull/39541) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 修复重启期间日志轮转行为异常的问题。[#39558](https://github.com/ClickHouse/ClickHouse/pull/39558) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 修复了在启用外部聚合时构建聚合投影的问题。之所以将其标记为改进，是因为这种情况较为少见，而且只需更改设置即可轻松绕过。这修复了 [#39667](https://github.com/ClickHouse/ClickHouse/issues/39667)。[#39671](https://github.com/ClickHouse/ClickHouse/pull/39671) ([Amos Bird](https://github.com/amosbird)) 。
* 允许对 `Map` 类型的参数执行哈希函数。[#39685](https://github.com/ClickHouse/ClickHouse/pull/39685) ([Anton Popov](https://github.com/CurtizJ)).
* 新增了一个配置参数，用于隐藏堆栈跟踪中的地址。它或许能略微提升一点安全性，但总体上弊大于利，不应使用。[#39690](https://github.com/ClickHouse/ClickHouse/pull/39690) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 调整 AggregateFunctionDistinct 的前缀大小，以确保嵌套函数数据的内存段对齐。[#39696](https://github.com/ClickHouse/ClickHouse/pull/39696) ([Pxl](https://github.com/BiteTheDDDDt)).
* 对传递给 `clickhouse-diagnostic` 工具的凭据进行了正确转义。[#39707](https://github.com/ClickHouse/ClickHouse/pull/39707) ([Dale McDiarmid](https://github.com/gingerwizard)) 。
* ClickHouse Keeper 改进：在退出时创建快照。可通过配置 `keeper_server.create_snapshot_on_exit` 控制，默认值为 `true`。[#39755](https://github.com/ClickHouse/ClickHouse/pull/39755) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 支持对 `row_policy_filter` 和 `additional_filter` 进行主键分析。这也有助于修复 [#37454](https://github.com/ClickHouse/ClickHouse/issues/37454) 等问题。[#39826](https://github.com/ClickHouse/ClickHouse/pull/39826) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了 Play UI 中的两个易用性问题：- 由于多余的圆角和边距，它在 iPad 上无法实现像素级精确显示；- 在首次查询后，进度指示不会再显示。这关闭了 [#39957](https://github.com/ClickHouse/ClickHouse/issues/39957)。这关闭了 [#39960](https://github.com/ClickHouse/ClickHouse/issues/39960)。[#39961](https://github.com/ClickHouse/ClickHouse/pull/39961) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Play UI：添加行号；支持点击选中单元格；为表格单元格增加迟滞。[#39962](https://github.com/ClickHouse/ClickHouse/pull/39962) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Play UI：在 textarea 中支持识别 Tab 键，同时不影响 Tab 导航。[#40053](https://github.com/ClickHouse/ClickHouse/pull/40053) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 客户端将显示服务器端的耗时。这对于比较位于远程数据中心的 ClickHouse 服务性能非常重要。此更改解决了 [#38070](https://github.com/ClickHouse/ClickHouse/issues/38070)。另请参见[这里](https://github.com/ClickHouse/ClickBench/blob/main/hardware/benchmark-cloud.sh#L37)，了解这样做的原因。[#39968](https://github.com/ClickHouse/ClickHouse/pull/39968) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 新增 `parseDateTime64BestEffortUS`、`parseDateTime64BestEffortUSOrNull` 和 `parseDateTime64BestEffortUSOrZero` 函数，修复了 [#37492](https://github.com/ClickHouse/ClickHouse/issues/37492)。[#40015](https://github.com/ClickHouse/ClickHouse/pull/40015) ([Tanya Bragin](https://github.com/tbragin)) 。
* 为 `system.processors_profile_log` 增加了更多信息，例如输入行数。[#40121](https://github.com/ClickHouse/ClickHouse/pull/40121) ([Amos Bird](https://github.com/amosbird)) 。
* 如果可用，`clickhouse-benchmark` 默认显示服务器端时间 (自 ClickHouse 22.8 版本起) 。这对于正确比较各云环境的性能是必需的。可通过新的命令行选项 `--client-side-time` 更改此行为。将命令行选项 `--randomize` 从 `--randomize 1` 改为不带参数的形式。[#40193](https://github.com/ClickHouse/ClickHouse/pull/40193) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 为已设置且已触发查询复杂度限制的情况新增计数器 (ProfileEvents)  (针对 `overflow_mode` = `break` 和 `throw` 分别提供单独的计数器) 。例如，如果你已设置 `max_rows_to_read` 且 `read_overflow_mode = 'break'`，查看 `OverflowBreak` 计数器的值将有助于识别不完整的结果。[#40205](https://github.com/ClickHouse/ClickHouse/pull/40205) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 修复出现 "Memory limit exceeded" 错误时的内存统计问题 (此前，\[peak] memory usage 也会将失败的内存分配计入其中) 。[#40249](https://github.com/ClickHouse/ClickHouse/pull/40249) ([Azat Khuzhin](https://github.com/azat)) 。
* 为文件系统缓存新增指标：`FilesystemCacheSize` 和 `FilesystemCacheElements`。[#40260](https://github.com/ClickHouse/ClickHouse/pull/40260) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 支持 Hadoop 安全 RPC 传输 (`hadoop.rpc.protection=privacy` 和 `hadoop.rpc.protection=integrity`) 。[#39411](https://github.com/ClickHouse/ClickHouse/pull/39411) ([michael1589](https://github.com/michael1589)) 。
* 避免在使用函数 multi(Fuzzy)Match(Any|AllIndices|AnyIndex)() 时，pattern cache 的内存占用持续增长。[#40264](https://github.com/ClickHouse/ClickHouse/pull/40264) ([Robert Schulze](https://github.com/rschu1ze)) 。

<div id="buildtestingpackaging-improvement">
  #### 构建/测试/打包改进
</div>

* [ClickFiddle](https://fiddle.clickhouse.com/)：一款可在读写模式下测试 ClickHouse 版本的新工具 (**Igor Baliuk**) 。
* ClickHouse 二进制文件现已改为自解压 [#35775](https://github.com/ClickHouse/ClickHouse/pull/35775) ([Yakov Olkhovskiy, Arthur Filatenkov](https://github.com/yakov-olkhovskiy)) 。
* 将 tzdata 更新到 2022b，以支持新的时区变更。参见 [https://github.com/google/cctz/pull/226。智利](https://github.com/google/cctz/pull/226。智利) 2022 年夏令时开始日期从 9 月 4 日推迟到 9 月 11 日。伊朗计划在 2022-09-21 回拨后永久停止实行夏令时。Asia/Tehran 在 1977 年的历史时区信息也已修正：伊朗是在 1935 年采用标准时间，而不是 1946 年。1977 年，伊朗的夏令时实行时间为 03-21 23:00 至 10-20 24:00；1978 年的切换日期是 03-24 和 08-05，而不是 03-20 和 10-20；1979 年春季的切换日期是 05-27，而不是 03-21 ([https://data.iana.org/time-zones/tzdb/NEWS](https://data.iana.org/time-zones/tzdb/NEWS)) 。([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 旧版软件包过去会将 systemd.service 文件安装到 `/etc`。那里的文件会被标记为 `conf`，因此既不会被清除，也不会自动更新。此 PR 会将这些文件清除掉。[#39323](https://github.com/ClickHouse/ClickHouse/pull/39323) ([Mikhail f. Shiryaev](https://github.com/Felixoid)).
* 确保 LSan 能正常生效。[#39430](https://github.com/ClickHouse/ClickHouse/pull/39430) ([Azat Khuzhin](https://github.com/azat)) 。
* TSAN 在 clang-14 下存在问题 ([https://github.com/google/sanitizers/issues/1552，https://github.com/google/sanitizers/issues/1540](https://github.com/google/sanitizers/issues/1552，https://github.com/google/sanitizers/issues/1540)) ，因此这里改用 clang-15 构建 TSAN 二进制文件。[#39450](https://github.com/ClickHouse/ClickHouse/pull/39450) ([Mikhail f. Shiryaev](https://github.com/Felixoid)) 。
* 移除将 ClickHouse 工具构建为独立可执行程序的选项。此项修复解决了 [#37847](https://github.com/ClickHouse/ClickHouse/issues/37847)。[#39520](https://github.com/ClickHouse/ClickHouse/pull/39520) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 为支持在 s390x (大端序) 上构建做了一些小准备。[#39627](https://github.com/ClickHouse/ClickHouse/pull/39627) ([Harry Lee](https://github.com/HarryLeeIBM))。[#39656](https://github.com/ClickHouse/ClickHouse/pull/39656) ([Harry Lee](https://github.com/HarryLeeIBM))。修复了 s390x 上 BitHelpers 中的端序问题。[#39656](https://github.com/ClickHouse/ClickHouse/pull/39656) ([Harry Lee](https://github.com/HarryLeeIBM))。为 s390x 架构 (ClickHouse 不支持该架构) 实现了一段与 SipHash 相关的代码。[#39732](https://github.com/ClickHouse/ClickHouse/pull/39732) ([Harry Lee](https://github.com/HarryLeeIBM))。修复了 s390x 架构 (ClickHouse 不支持该架构) 中协调快照代码的端序问题。[#39931](https://github.com/ClickHouse/ClickHouse/pull/39931) ([Harry Lee](https://github.com/HarryLeeIBM))。修复了 s390x 架构 (ClickHouse 不支持该架构) 中 Codec 代码的端序问题。[#40008](https://github.com/ClickHouse/ClickHouse/pull/40008) ([Harry Lee](https://github.com/HarryLeeIBM))。修复了 s390x 架构 (ClickHouse 不支持该架构) 中 ReadHelpers 和 WriteHelpers 代码在读写 BigEndian 二进制数据时的端序问题。[#40179](https://github.com/ClickHouse/ClickHouse/pull/40179) ([Harry Lee](https://github.com/HarryLeeIBM))。
* 支持使用 `clang-16` (trunk) 构建。这项改动修复了 [#39949](https://github.com/ClickHouse/ClickHouse/issues/39949)。[#40181](https://github.com/ClickHouse/ClickHouse/pull/40181) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 准备让 RISC-V 64 构建在 CI 中运行。这是针对 [#40141](https://github.com/ClickHouse/ClickHouse/issues/40141) 的改进。[#40197](https://github.com/ClickHouse/ClickHouse/pull/40197) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 简化了函数注册宏接口 (`FUNCTION_REGISTER*`) ，无需再在 registerFunctions.cpp 中添加并调用 extern 函数，同时也能加快新增函数的增量构建。[#38615](https://github.com/ClickHouse/ClickHouse/pull/38615) ([Li Yin](https://github.com/liyinsg)) 。
* Docker：现在，Docker 镜像中的 entrypoint.sh 会针对其在多磁盘配置中找到的所有文件夹创建并执行 chown [#17717](https://github.com/ClickHouse/ClickHouse/issues/17717)。[#39121](https://github.com/ClickHouse/ClickHouse/pull/39121) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。

<div id="bug-fix">
  #### 问题修复
</div>

* 修复 `CapnProto` 输入格式中可能发生的段错误。该问题由 *kiojj* 通过 ClickHouse 漏洞奖励[计划](https://github.com/ClickHouse/ClickHouse/issues/38986)发现并提交。[#40241](https://github.com/ClickHouse/ClickHouse/pull/40241) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复了数组下标运算符在一种极少见情况下的异常行为。此修复关闭了 [#28720](https://github.com/ClickHouse/ClickHouse/issues/28720)。[#40185](https://github.com/ClickHouse/ClickHouse/pull/40185) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 修复了加密函数参数检查不足的问题 (由查询模糊测试发现) 。此修复关闭了 [#39987](https://github.com/ClickHouse/ClickHouse/issues/39987)。[#40194](https://github.com/ClickHouse/ClickHouse/pull/40194) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 修复了这样一种情况：如果对包含多列且 `ENGINE = Set` 的表使用 `IN` 运算符，列顺序可能会出错。此修复对应于 [#13014](https://github.com/ClickHouse/ClickHouse/issues/13014)。[#40225](https://github.com/ClickHouse/ClickHouse/pull/40225) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 修复从加密磁盘读取时的寻道问题。此 PR 修复了 [#38381](https://github.com/ClickHouse/ClickHouse/issues/38381)。[#39687](https://github.com/ClickHouse/ClickHouse/pull/39687) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复 JOIN 计划中的重复列。终于解决了 [#26809](https://github.com/ClickHouse/ClickHouse/issues/26809)。[#40009](https://github.com/ClickHouse/ClickHouse/pull/40009) ([Vladimir C](https://github.com/vdimir)) 。
* 修复了在 SELECT 查询中，对不同日期/时间类型使用 ORDER BY WITH FILL 时出现挂起的问题。[#37849](https://github.com/ClickHouse/ClickHouse/pull/37849) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* 修复与投影的 ORDER BY 匹配的 ORDER BY 问题 (此前只会返回未排序结果) 。[#38725](https://github.com/ClickHouse/ClickHouse/pull/38725) ([Azat Khuzhin](https://github.com/azat)) 。
* 如果 `GROUP BY` 语句中的函数遮蔽了某个表列或表达式，则不要对这些函数进行优化。修复了 [#37032](https://github.com/ClickHouse/ClickHouse/issues/37032)。[#39103](https://github.com/ClickHouse/ClickHouse/pull/39103) ([Anton Kozlov](https://github.com/tonickkozlov)) 。
* 修复了 RENAME TABLE 后日志中的错误表名。此修复解决了 [#38018](https://github.com/ClickHouse/ClickHouse/issues/38018)。[#39227](https://github.com/ClickHouse/ClickHouse/pull/39227) ([Amos Bird](https://github.com/amosbird))。
* 修复了优化查询时列裁剪场景下的位置参数问题。关闭 [#38433](https://github.com/ClickHouse/ClickHouse/issues/38433)。[#39293](https://github.com/ClickHouse/ClickHouse/pull/39293) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 修复了 Protobuf/CapnProto 格式在消息为空时进行 schema 推断的 bug，该问题会导致创建出 `Tuple` 为空的列类型。关闭 [#39051](https://github.com/ClickHouse/ClickHouse/issues/39051) 新增 2 个设置 `input_format_{protobuf/capnproto}_skip_fields_with_unsupported_types_in_schema_inference`，允许在对 Protobuf 和 CapnProto 格式进行 schema 推断时跳过类型不受支持的字段。[#39357](https://github.com/ClickHouse/ClickHouse/pull/39357) ([Kruglov Pavel](https://github.com/Avogar)).
* (Window View 是 Experimental 功能) 修复了 `CREATE WINDOW VIEW .. ON CLUSTER ... INNER` 中的段错误。关闭 [#39363](https://github.com/ClickHouse/ClickHouse/issues/39363)。[#39384](https://github.com/ClickHouse/ClickHouse/pull/39384) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 修复取消向函数执行 insert 时 WriteBuffer finalize 的问题 (在早期版本中，这可能导致 `std::terminate`) 。[#39458](https://github.com/ClickHouse/ClickHouse/pull/39458) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复了以稀疏序列化方式存储 `Object` 类型列时的问题。[#39464](https://github.com/ClickHouse/ClickHouse/pull/39464) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了使用投影时可能出现的 "Not found column in block" 异常。此项修复关闭了 [#39469](https://github.com/ClickHouse/ClickHouse/issues/39469)。[#39470](https://github.com/ClickHouse/ClickHouse/pull/39470) ([小路](https://github.com/nicelulu)).
* 修复带有 materialized view 时 DROP 与 INSERT 之间竞态导致的异常。[#39477](https://github.com/ClickHouse/ClickHouse/pull/39477) ([Azat Khuzhin](https://github.com/azat)) 。
* Apache Avro 库中的一个缺陷：修复 Avro format 中的数据竞争问题以及可能发生的堆缓冲区溢出。关闭 [#39094](https://github.com/ClickHouse/ClickHouse/issues/39094)；关闭 [#33652](https://github.com/ClickHouse/ClickHouse/issues/33652)。[#39498](https://github.com/ClickHouse/ClickHouse/pull/39498) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了一个罕见的异步读取错误：在启用 `O_DIRECT` (通过设置 `min_bytes_to_use_direct_io` 启用) 并将 `local_filesystem_read_method='pread_threadpool'` 时会出现该问题。[#39506](https://github.com/ClickHouse/ClickHouse/pull/39506) ([Anton Popov](https://github.com/CurtizJ)) 。
* (仅在 FreeBSD 上) 修复了在 FreeBSD 上启动 ClickHouse 时出现的 "Code: 49. DB::Exception: FunctionFactory: the function name '' is not unique. (LOGICAL\_ERROR)" 错误。[#39551](https://github.com/ClickHouse/ClickHouse/pull/39551) ([Alexander Gololobov](https://github.com/davenger)) 。
* 修复了近期引入的 `splitByChar` 的 "maxsplit" 参数未正确生效的问题。[#39552](https://github.com/ClickHouse/ClickHouse/pull/39552) ([filimonov](https://github.com/filimonov)) 。
* 修复在启用 `enable_optimize_predicate_expression` 时 ASOF JOIN 中的错误，关闭 [#37813](https://github.com/ClickHouse/ClickHouse/issues/37813)。[#39556](https://github.com/ClickHouse/ClickHouse/pull/39556) ([Vladimir C](https://github.com/vdimir)).
* 修复了在使用 `ON CLUSTER` 或 `Replicated` 数据库与 `ReplicatedMergeTree` 时执行 `CREATE/DROP INDEX` 查询的问题。此前该查询会在所有副本上执行 (导致错误或 DDL 队列卡住) 。修复 [#39511](https://github.com/ClickHouse/ClickHouse/issues/39511)。[#39565](https://github.com/ClickHouse/ClickHouse/pull/39565) ([Alexander Tokmakov](https://github.com/tavplubix)) 。
* 修复了带有 join 的下推时“找不到列”错误，关闭 [#39505](https://github.com/ClickHouse/ClickHouse/issues/39505)。[#39575](https://github.com/ClickHouse/ClickHouse/pull/39575) ([Vladimir C](https://github.com/vdimir)) 。
* 修复错误的 `REGEXP_REPLACE` 别名。此修复解决了 [https://github.com/ClickHouse/ClickBench/issues/9。\[#39592](https://github.com/ClickHouse/ClickBench/issues/9。\[#39592)]\([https://github.com/ClickHouse/ClickHouse/pull/39592](https://github.com/ClickHouse/ClickHouse/pull/39592)) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 将指数衰减窗口函数的固定起点修正为窗口中的最后一个值。此前，衰减按公式 `exp((t - curr_row_t) / decay_length)` 计算；当窗口的右边界不是 `CURRENT ROW` 时，这种计算方式并不正确。现已改为：`exp((t - last_row_t) / decay_length)`。对于 `ROWS BETWEEN (smth) AND CURRENT ROW` 这样的窗口，结果没有变化。[#39593](https://github.com/ClickHouse/ClickHouse/pull/39593) ([Vladimir Chebotaryov](https://github.com/quickhouse)) 。
* 修复可根据操作数的标度检测到的 Decimal 除法溢出问题。[#39600](https://github.com/ClickHouse/ClickHouse/pull/39600) ([Andrey Zvonov](https://github.com/zvonand)) 。
* 修复设置 `output_format_arrow_string_as_string` 与 `output_format_arrow_low_cardinality_as_dictionary` 组合使用时无法正常工作的问题。关闭 [#39624](https://github.com/ClickHouse/ClickHouse/issues/39624)。[#39647](https://github.com/ClickHouse/ClickHouse/pull/39647) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了分布式表读取时默认数据库解析中的一个错误。[#39674](https://github.com/ClickHouse/ClickHouse/pull/39674) ([Anton Kozlov](https://github.com/tonickkozlov)) 。
* (仅适用于已废弃的 Ordinary database) 如果使用了 mmap IO 缓存，且 database engine 为 Ordinary，并且新建了与已删除表同名的新表，SELECT 可能会读取到已删除表的数据。此问题已修复。[#39708](https://github.com/ClickHouse/ClickHouse/pull/39708) ([Alexander Tokmakov](https://github.com/tavplubix)).
* 修复可能发生的错误 `Invalid column type for ColumnUnique::insertRangeFrom. Expected String, got ColumnLowCardinality`。修复 [#38460](https://github.com/ClickHouse/ClickHouse/issues/38460)。[#39716](https://github.com/ClickHouse/ClickHouse/pull/39716) ([Arthur Passos](https://github.com/arthurpassos)) 。
* JSON 格式中 `meta` 部分的字段名称曾被错误地进行了双重转义。此项修复解决了 [#39693](https://github.com/ClickHouse/ClickHouse/issues/39693)。[#39747](https://github.com/ClickHouse/ClickHouse/pull/39747) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 修复了 Tuple 和运算符 `IN` 的索引分析错误，该问题可能导致错误的查询结果。[#39752](https://github.com/ClickHouse/ClickHouse/pull/39752) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了 `EmbeddedRocksDB` 表使用参数按键过滤的问题。[#39757](https://github.com/ClickHouse/ClickHouse/pull/39757) ([Antonio Andelic](https://github.com/antonio2368)).
* 修复了因 ARRAY JOIN 优化导致的错误 `Invalid number of columns in chunk pushed to OutputPort`。修复 [#39164](https://github.com/ClickHouse/ClickHouse/issues/39164)。[#39799](https://github.com/ClickHouse/ClickHouse/pull/39799) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 针对 Linux 内核中一个缺陷的临时规避方案。通过设置 `local_filesystem_read_method=pread_threadpool`，修复 `CANNOT_READ_ALL_DATA` 异常。根据 [man](https://manpages.debian.org/testing/manpages-dev/preadv2.2.en.html#BUGS)，该缺陷仅影响 Linux 内核 5.9 和 5.10 版本。[#39800](https://github.com/ClickHouse/ClickHouse/pull/39800) ([Anton Popov](https://github.com/CurtizJ)) 。
* (仅限 NFS) 修复 root-squashed 卷上的 NFS `mkdir` 故障。[#39898](https://github.com/ClickHouse/ClickHouse/pull/39898) ([Constantine Peresypkin](https://github.com/pkit)) 。
* 在执行 DETACH/DROP 时，将字典从 Prometheus 指标中移除。[#39926](https://github.com/ClickHouse/ClickHouse/pull/39926) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了 StorageFile 读取虚拟列时的问题。关闭 [#39907](https://github.com/ClickHouse/ClickHouse/issues/39907)。[#39943](https://github.com/ClickHouse/ClickHouse/pull/39943) ([flynn](https://github.com/ucasfl)) 。
* 修复了拉取操作期间内存占用过大的问题。修复了 [#39915](https://github.com/ClickHouse/ClickHouse/issues/39915)。[#39990](https://github.com/ClickHouse/ClickHouse/pull/39990) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* (Experimental 功能) 修复了 `hashId` 崩溃问题以及 salt 参数未生效的问题。[#40002](https://github.com/ClickHouse/ClickHouse/pull/40002) ([Raúl Marín](https://github.com/Algunenano)) 。
* 如果使用了特定组合的常量列和非常量列，`EXCEPT` 和 `INTERSECT` 运算符可能导致崩溃。[#40020](https://github.com/ClickHouse/ClickHouse/pull/40020) ([Duc Canh Le](https://github.com/canhld94)) 。
* 修复了在 INSERT 过慢或 merge/变更 耗时过长时出现的 "分片目录不存在" 和 "`tmp_<part_name>` ... 没有那个文件或目录" 错误。还修复了一个问题：如果此前拉取分片失败，但 `tmp-fetch_<part_name>` 目录未被清理，可能会导致复制队列中的某些条目卡住，且日志中没有任何错误或警告。[#40031](https://github.com/ClickHouse/ClickHouse/pull/40031) ([Alexander Tokmakov](https://github.com/tavplubix)).
* 修复了 `Values` 格式中元组数组解析时少数罕见情况的问题。[#40034](https://github.com/ClickHouse/ClickHouse/pull/40034) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了 ArrowColumn 格式中将 Dictionary(X) 和 Dictionary(Nullable(X)) 分别转换为 ClickHouse LowCardinality(X) 和 LowCardinality(Nullable(X)) 的问题。[#40037](https://github.com/ClickHouse/ClickHouse/pull/40037) ([Arthur Passos](https://github.com/arthurpassos)).
* 修复了任务调度失败时写入 S3 可能导致的死锁。[#40070](https://github.com/ClickHouse/ClickHouse/pull/40070) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 通过为需要重新计算的索引添加正确的文件扩展名 (`.idx` 或 `idx2`) ，修复了 collectFilesToSkip() 中的 bug，从而避免错误的硬链接。已修复 [#39896](https://github.com/ClickHouse/ClickHouse/issues/39896)。[#40095](https://github.com/ClickHouse/ClickHouse/pull/40095) ([Jianmei Zhang](https://github.com/zhangjmruc)) 。
* 修复了反向 DNS 解析的一个问题。[#40134](https://github.com/ClickHouse/ClickHouse/pull/40134) ([Arthur Passos](https://github.com/arthurpassos)) 。
* 修复 `Array(UInt32)` 的 `arrayDifference` 返回意外结果的问题。[#40211](https://github.com/ClickHouse/ClickHouse/pull/40211) ([Duc Canh Le](https://github.com/canhld94)) 。

### <a id="227" /> ClickHouse 发行版 22.7，发布于 2022-07-21。[演示文稿](https://presentations.clickhouse.com/2022-release-22.7/), [视频](https://www.youtube.com/watch?v=IOJyo14BpTQ)

<Frame>
  <iframe src="https://www.youtube.com/embed/IOJyo14BpTQ" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen />
</Frame>

<div id="upgrade-notes">
  #### 升级说明
</div>

* 默认启用设置 `enable_positional_arguments`。它允许执行类似 `SELECT ... ORDER BY 1, 2` 的查询，其中 1、2 表示对 select 子句的引用。如需恢复旧行为，请禁用此设置。[#38204](https://github.com/ClickHouse/ClickHouse/pull/38204) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 默认禁用 `format_csv_allow_single_quotes`。参见 [#37096](https://github.com/ClickHouse/ClickHouse/issues/37096)。 ([Kruglov Pavel](https://github.com/Avogar)) 。
* `Ordinary` 数据库引擎以及 `*MergeTree` 表的旧存储定义语法已弃用。默认情况下，无法再使用 `Ordinary` 引擎创建新数据库。如果 `system` 数据库使用 `Ordinary` 引擎，则会在 server 启动时自动转换为 `Atomic`。可以通过一些设置保留旧行为 (`allow_deprecated_database_ordinary` 和 `allow_deprecated_syntax_for_merge_tree`) ，但这些设置在未来版本中可能会被移除。[#38335](https://github.com/ClickHouse/ClickHouse/pull/38335) ([Alexander Tokmakov](https://github.com/tavplubix)) 。
* 默认强制将逗号 join 重写为 inner (即将默认值设为 `cross_to_inner_join_rewrite = 2`) 。如需保留旧行为，请将 `cross_to_inner_join_rewrite = 1`。[#39326](https://github.com/ClickHouse/ClickHouse/pull/39326) ([Vladimir C](https://github.com/vdimir)) 。如果遇到任何不兼容问题，可以将此设置改回。

<div id="new-feature-2">
  #### 新功能
</div>

* 支持带窗口函数的表达式。解决了 [#19857](https://github.com/ClickHouse/ClickHouse/issues/19857)。[#37848](https://github.com/ClickHouse/ClickHouse/pull/37848) ([Dmitry Novik](https://github.com/novikd)) 。
* 为 `EmbeddedRocksDB` 表新增了 `direct` join 算法，参见 [#33582](https://github.com/ClickHouse/ClickHouse/issues/33582)。[#35363](https://github.com/ClickHouse/ClickHouse/pull/35363) ([Vladimir C](https://github.com/vdimir)).
* 新增 full sorting merge join 算法。[#35796](https://github.com/ClickHouse/ClickHouse/pull/35796) ([Vladimir C](https://github.com/vdimir)) 。
* 实现了 NATS 表引擎，支持通过 NATS 进行发布/订阅。关闭 [#32388](https://github.com/ClickHouse/ClickHouse/issues/32388)。[#37171](https://github.com/ClickHouse/ClickHouse/pull/37171) ([tchepavel](https://github.com/tchepavel)) 。 ([Kseniia Sumarokova](https://github.com/kssenii))
* 实现表函数 `mongodb`。允许向 `MongoDB` 存储 / 表函数写入数据。[#37213](https://github.com/ClickHouse/ClickHouse/pull/37213) ([aaapetrenko](https://github.com/aaapetrenko))。([Kseniia Sumarokova](https://github.com/kssenii))
* 新增 `SQLInsert` 输出格式。修复了 [#38441](https://github.com/ClickHouse/ClickHouse/issues/38441)。[#38477](https://github.com/ClickHouse/ClickHouse/pull/38477) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 引入了设置 `additional_table_filters`。使用此设置，可以为表指定附加过滤条件，该条件会在读取后立即应用。示例：`select number, x, y from (select number from system.numbers limit 5) f any left join (select x, y from table_1) s on f.number = s.x settings additional_table_filters={'system.numbers : 'number != 3', 'table_1' : 'x != 2'}`。引入了设置 `additional_result_filter`，用于为查询结果指定附加过滤条件。关闭 [#37918](https://github.com/ClickHouse/ClickHouse/issues/37918)。[#38475](https://github.com/ClickHouse/ClickHouse/pull/38475) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 新增 `compatibility` 设置和 `system.settings_changes` 系统表，其中包含各 ClickHouse 版本中设置变更的信息。关闭 [#35972](https://github.com/ClickHouse/ClickHouse/issues/35972)。[#38957](https://github.com/ClickHouse/ClickHouse/pull/38957) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 新增函数 `translate(string, from_string, to_string)` 和 `translateUTF8(string, from_string, to_string)`，用于将某些字符转换为其他字符。[#38935](https://github.com/ClickHouse/ClickHouse/pull/38935) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 支持 `parseTimeDelta` 函数。用法如下：` ;-+,:` 可作为分隔符，例如 `1yr-2mo`、`2m:6s`：`SELECT parseTimeDelta('1yr-2mo-4w + 12 days, 3 hours : 1 minute ; 33 seconds')`。[#39071](https://github.com/ClickHouse/ClickHouse/pull/39071) ([jiahui-97](https://github.com/jiahui-97)).
* 新增 `CREATE TABLE ... EMPTY AS SELECT` 查询。该查询会根据 SELECT 查询自动推断表结构，但在创建后不会向表中填充数据。解决了 [#38049](https://github.com/ClickHouse/ClickHouse/issues/38049)。[#38272](https://github.com/ClickHouse/ClickHouse/pull/38272) ([Alexander Tokmakov](https://github.com/tavplubix)) 。
* 新增了限制远程存储 IO 操作的选项：`max_remote_read_network_bandwidth_for_server` 和 `max_remote_write_network_bandwidth_for_server`。[#39095](https://github.com/ClickHouse/ClickHouse/pull/39095) ([Sergei Trifonov](https://github.com/serxa)) 。
* 添加 `group_by_use_nulls` 设置，使聚合键列在 ROLLUP、CUBE 和 GROUPING SETS 场景下可为空。修复 [#37359](https://github.com/ClickHouse/ClickHouse/issues/37359)。[#38642](https://github.com/ClickHouse/ClickHouse/pull/38642) ([Dmitry Novik](https://github.com/novikd)) 。
* 新增了可在数据导出时指定压缩级别的功能。[#38907](https://github.com/ClickHouse/ClickHouse/pull/38907) ([Nikolay Degterinsky](https://github.com/evillique)).
* 新增一个选项，要求必须具有显式授权才能从 `system` 数据库中执行 SELECT。详情：[#38970](https://github.com/ClickHouse/ClickHouse/pull/38970) ([Vitaly Baranov](https://github.com/vitlibar)).
* 函数 `multiMatchAny`、`multiMatchAnyIndex`、`multiMatchAllIndices` 及其模糊变体现在支持接受非常量的模式数组参数。[#38485](https://github.com/ClickHouse/ClickHouse/pull/38485) ([Robert Schulze](https://github.com/rschu1ze))。SQL 函数 `multiSearchAllPositions` 现在支持接受非常量的 needle 参数。[#39167](https://github.com/ClickHouse/ClickHouse/pull/39167) ([Robert Schulze](https://github.com/rschu1ze))。
* 新增设置 `zstd_window_log_max`，用于在导入外部文件时配置 zstd 解码的最大内存使用量。关闭 [#35693](https://github.com/ClickHouse/ClickHouse/issues/35693)。[#37015](https://github.com/ClickHouse/ClickHouse/pull/37015) ([wuxiaobai24](https://github.com/wuxiaobai24)) 。
* 添加 `send_logs_source_regexp` 设置。将服务器文本日志发送到与指定 regexp 匹配的日志源名称。空值表示所有来源。 [#39161](https://github.com/ClickHouse/ClickHouse/pull/39161) ([Amos Bird](https://github.com/amosbird)).
* 支持对 `Hive` 表进行 `ALTER`。[#38214](https://github.com/ClickHouse/ClickHouse/pull/38214) ([lgbo](https://github.com/lgbo-ustc)).
* 支持 `isNullable` 函数。该函数检查其 argument 是否为 Nullable，并返回 1 或 0。已关闭 [#38611](https://github.com/ClickHouse/ClickHouse/issues/38611)。[#38841](https://github.com/ClickHouse/ClickHouse/pull/38841) ([lokax](https://github.com/lokax)) 。
* 新增了 base58 编码/解码函数。[#38159](https://github.com/ClickHouse/ClickHouse/pull/38159) ([Andrey Zvonov](https://github.com/zvonand)) 。
* 在 Play UI 中添加图表可视化功能。[#38197](https://github.com/ClickHouse/ClickHouse/pull/38197) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 新增了适用于数组和元组的 L2 平方距离与范数函数。[#38545](https://github.com/ClickHouse/ClickHouse/pull/38545) ([Julian Gilyadov](https://github.com/israelg99)) 。
* 新增支持通过 SQL 向 `url` 表函数 / 存储传递 HTTP 请求头。关闭 [#37897](https://github.com/ClickHouse/ClickHouse/issues/37897)。[#38176](https://github.com/ClickHouse/ClickHouse/pull/38176) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 将 `clickhouse-diagnostics` 可执行文件添加到软件包中。[#38647](https://github.com/ClickHouse/ClickHouse/pull/38647) ([Mikhail f. Shiryaev](https://github.com/Felixoid))。

<div id="experimental-feature">
  #### Experimental 功能
</div>

* 新增设置 `implicit_transaction`，用于在事务中运行独立查询。它会自动处理事务的创建和结束 (如果查询成功，则通过 COMMIT 提交；否则通过 ROLLBACK 回滚) 。[#38344](https://github.com/ClickHouse/ClickHouse/pull/38344) ([Raúl Marín](https://github.com/Algunenano)).

<div id="performance-improvement-3">
  #### 性能提升
</div>

* 针对已排序列的 Distinct 优化。如果输入流在 distinct 中已按相关列排序，则使用专用的 distinct 转换。该优化可用于 pre-distinct、final distinct，或同时用于两者。最初由 @dimarub2000 实现。[#37803](https://github.com/ClickHouse/ClickHouse/pull/37803) ([Igor Nikonov](https://github.com/devcrafter)).
* 使用 `BinaryHeap` 的批次版本，提升 `ORDER BY`、`MergeTree` 合并操作和窗口函数的性能。[#38022](https://github.com/ClickHouse/ClickHouse/pull/38022) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 支持对带有 `FINAL` 的查询进行更高程度的并行执行 [#36396](https://github.com/ClickHouse/ClickHouse/pull/36396) ([Nikita Taranov](https://github.com/nickitat)).
* 修复了在 [#35616](https://github.com/ClickHouse/ClickHouse/pull/35616) 中引入的严重 join 性能回归。有意思的是，像 ssb 查询这样常见的 join 查询，在将近 3 个月里竟然慢了 10 倍，却一直没人抱怨。[#38052](https://github.com/ClickHouse/ClickHouse/pull/38052) ([Amos Bird](https://github.com/amosbird)) 。
* 将 Intel hyperscan 库迁移至 vectorscan，从而加快了非 x86 平台上许多字符串匹配操作的速度。 [#38171](https://github.com/ClickHouse/ClickHouse/pull/38171) ([Robert Schulze](https://github.com/rschu1ze)).
* 提高了聚合后执行的查询计划步骤的并行性。[#38295](https://github.com/ClickHouse/ClickHouse/pull/38295) ([Nikita Taranov](https://github.com/nickitat)).
* 优化向 `JSON` 类型列插入数据的性能。[#38320](https://github.com/ClickHouse/ClickHouse/pull/38320) ([Anton Popov](https://github.com/CurtizJ)).
* 对 HashTable 中的插入和查找进行了优化。[#38413](https://github.com/ClickHouse/ClickHouse/pull/38413) ([Nikita Taranov](https://github.com/nickitat)) 。
* 修复了 [#32493](https://github.com/ClickHouse/ClickHouse/issues/32493) 导致的性能下降问题。[#38417](https://github.com/ClickHouse/ClickHouse/pull/38417) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 使用 SIMD 指令提升数值列连接的性能。[#37235](https://github.com/ClickHouse/ClickHouse/pull/37235) ([zzachimed](https://github.com/zzachimed)) 。[#38565](https://github.com/ClickHouse/ClickHouse/pull/38565) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 数组的范数和距离函数速度提升 1.2-2 倍。[#38740](https://github.com/ClickHouse/ClickHouse/pull/38740) ([Alexander Gololobov](https://github.com/davenger)) 。
* 为 LZ4 解压添加了经过 AVX-512 VBMI 优化的 `copyOverlap32Shuffle`。换句话说，LZ4 解压性能提升了。[#37891](https://github.com/ClickHouse/ClickHouse/pull/37891) ([Guo Wangyang](https://github.com/guowangy)) 。
* `ORDER BY (a, b)` 将享有与 `ORDER BY a, b` 完全相同的优势。[#38873](https://github.com/ClickHouse/ClickHouse/pull/38873) ([Igor Nikonov](https://github.com/devcrafter)) 。
* 将分支对齐到 32B 边界，以使基准测试结果更稳定。[#38988](https://github.com/ClickHouse/ClickHouse/pull/38988) ([Guo Wangyang](https://github.com/guowangy)) 。对于 Intel，平均可提升 1..2% 的性能。
* 可执行 UDF、可执行字典和可执行表将避免在等待子进程终止时白白浪费一秒钟。[#38929](https://github.com/ClickHouse/ClickHouse/pull/38929) ([Constantine Peresypkin](https://github.com/pkit)) 。
* 如果未选择全部列，则优化对 `system.stack_trace` 表的访问。[#39177](https://github.com/ClickHouse/ClickHouse/pull/39177) ([Azat Khuzhin](https://github.com/azat)).
* 优化 LowCardinality 参数中 isNullable/isConstant/isNull/isNotNull 的性能。[#39192](https://github.com/ClickHouse/ClickHouse/pull/39192) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 优化了窗口函数中 ORDER BY 的处理方式。[#34632](https://github.com/ClickHouse/ClickHouse/pull/34632) ([Vladimir Chebotarev](https://github.com/excitoon)) 。
* 表 `system.asynchronous_metric_log` 进一步优化了存储空间占用。此更改关闭了 [#38134](https://github.com/ClickHouse/ClickHouse/issues/38134)。请参阅 [YouTube 视频](https://www.youtube.com/watch?v=0fSp9SF8N8A)。[#38428](https://github.com/ClickHouse/ClickHouse/pull/38428) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。

<div id="improvement">
  #### 改进
</div>

* 支持 SQL 标准的 CREATE INDEX 和 DROP INDEX 语法。[#35166](https://github.com/ClickHouse/ClickHouse/pull/35166) ([Jianmei Zhang](https://github.com/zhangjmruc)) 。
* 为 INSERT 查询发送 profile events (此前仅支持 SELECT 查询) 。[#37391](https://github.com/ClickHouse/ClickHouse/pull/37391) ([Azat Khuzhin](https://github.com/azat)) 。
* 为完全物化投影实现按顺序聚合 (`optimize_aggregation_in_order`) 。[#37469](https://github.com/ClickHouse/ClickHouse/pull/37469) ([Azat Khuzhin](https://github.com/azat)) 。
* 移除 Kerberos 初始化中的 subprocess run。新增一项集成测试。关闭 [#27651](https://github.com/ClickHouse/ClickHouse/issues/27651)。[#38105](https://github.com/ClickHouse/ClickHouse/pull/38105) ([Roman Vasin](https://github.com/rvasin)) 。
* * 添加设置 `multiple_joins_try_to_keep_original_names`，以便在多个 JOIN 重写时保留原始标识符名称，不对其进行重写，关闭 [#34697](https://github.com/ClickHouse/ClickHouse/issues/34697)。[#38149](https://github.com/ClickHouse/ClickHouse/pull/38149) ([Vladimir C](https://github.com/vdimir)).
* 优化了 trace-visualizer 的用户体验。[#38169](https://github.com/ClickHouse/ClickHouse/pull/38169) ([Sergei Trifonov](https://github.com/serxa)).
* 为 AArch64 启用堆栈跟踪收集和查询性能分析器。[#38181](https://github.com/ClickHouse/ClickHouse/pull/38181) ([Maksim Kita](https://github.com/kitaisreal)).
* 在加载 SQL 用户自定义函数时，不要跳过 `user_defined` 目录中的符号链接。修复了 [#38042](https://github.com/ClickHouse/ClickHouse/issues/38042)。[#38184](https://github.com/ClickHouse/ClickHouse/pull/38184) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 新增了对 `store/` 中子目录的后台清理。在某些情况下，clickhouse-server 可能会在 `store/` 中留下无用的子目录 (例如创建表失败时) ，而这些目录此前一直不会被删除。修复了 [#33710](https://github.com/ClickHouse/ClickHouse/issues/33710)。[#38265](https://github.com/ClickHouse/ClickHouse/pull/38265) ([Alexander Tokmakov](https://github.com/tavplubix)) 。
* 新增 `DESCRIBE CACHE` 查询，用于显示配置中的缓存设置。新增 `SHOW CACHES` 查询，用于显示可用的文件系统缓存列表。[#38279](https://github.com/ClickHouse/ClickHouse/pull/38279) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 为 `system drop filesystem cache` 新增访问检查。支持 ON CLUSTER。[#38319](https://github.com/ClickHouse/ClickHouse/pull/38319) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复从 21.3 升级到 22.3 时 PostgreSQL database engine 的兼容性问题。关闭 [#36659](https://github.com/ClickHouse/ClickHouse/issues/36659)。[#38369](https://github.com/ClickHouse/ClickHouse/pull/38369) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* `filesystemAvailable` 等类似函数现已可在 `clickhouse-local` 中使用。这一改动修复了 [#38423](https://github.com/ClickHouse/ClickHouse/issues/38423)。[#38424](https://github.com/ClickHouse/ClickHouse/pull/38424) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 新增 `revision` 函数。[#38555](https://github.com/ClickHouse/ClickHouse/pull/38555) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了通过代理隧道使用 GCS 时的问题。[#38726](https://github.com/ClickHouse/ClickHouse/pull/38726) ([Azat Khuzhin](https://github.com/azat)) 。
* 支持在 clickhouse client / local 中使用 `\i file` (类似于 psql 的 `\i`) 。[#38813](https://github.com/ClickHouse/ClickHouse/pull/38813) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* `EXPLAIN AST` 中新增了选项 `optimize = 1`。启用后，会显示重写后的 AST；否则显示原始查询的 AST。默认处于禁用状态。[#38910](https://github.com/ClickHouse/ClickHouse/pull/38910) ([Igor Nikonov](https://github.com/devcrafter)) 。
* 允许在列列表中使用行尾逗号。关闭 [#38425](https://github.com/ClickHouse/ClickHouse/issues/38425)。[#38440](https://github.com/ClickHouse/ClickHouse/pull/38440) ([chen](https://github.com/xiedeyantu)).
* 针对 `parallel_hash` JOIN 方法的缺陷修复和性能优化。[#37648](https://github.com/ClickHouse/ClickHouse/pull/37648) ([Vladimir C](https://github.com/vdimir)) 。
* 支持 Hadoop 安全 RPC 传输 (`hadoop.rpc.protection=privacy` 和 `hadoop.rpc.protection=integrity`) 。[#37852](https://github.com/ClickHouse/ClickHouse/pull/37852) ([Peng Liu](https://github.com/michael1589)) 。
* 为 `StorageHive` 新增对 struct 类型的支持。[#38118](https://github.com/ClickHouse/ClickHouse/pull/38118) ([lgbo](https://github.com/lgbo-ustc)).
* 现在，S3 的单个对象会通过 `RemoveObjectRequest` 删除。实现了与 GCP 的兼容性；此前由于它不支持有效使用 `removeFileIfExists`，导致 `remove` 功能大约有一半实际上失效。现已自动检测 GCS 不支持的 S3 API `DeleteObjects`。这样一来，无需在配置中显式设置 `support_batch_delete=0`，也可以使用 GCS。[#37882](https://github.com/ClickHouse/ClickHouse/pull/37882) ([Vladimir Chebotarev](https://github.com/excitoon)).
* 提供基本的 ClickHouse Keeper 相关监控数据 (通过 ProfileEvents 和 CurrentMetrics) 。[#38072](https://github.com/ClickHouse/ClickHouse/pull/38072) ([lingpeng0314](https://github.com/lingpeng0314)) 。
* 支持 PostgreSQL 引擎连接的 `auto_close` 选项。修复了 [#31486](https://github.com/ClickHouse/ClickHouse/issues/31486)。[#38363](https://github.com/ClickHouse/ClickHouse/pull/38363) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 允许在表函数的列声明中使用 `NULL` 修饰符。 [#38816](https://github.com/ClickHouse/ClickHouse/pull/38816) ([Kruglov Pavel](https://github.com/Avogar)).
* 在关闭前停用 `mutations_finalizing_task`，以避免在关闭过程中出现无害的 `TABLE_IS_READ_ONLY` 错误。[#38851](https://github.com/ClickHouse/ClickHouse/pull/38851) ([Raúl Marín](https://github.com/Algunenano)) 。
* 如果你使用已弃用的 Ordinary 数据库，那么在存在 INSERT 查询时，消除了 ALTER 查询之后 SELECT 查询的不必要等待。[#38864](https://github.com/ClickHouse/ClickHouse/pull/38864) ([Azat Khuzhin](https://github.com/azat)) 。
* `EXPLAIN AST` 中新增了 `rewrite` 选项。启用后，会显示重写后的 AST；否则显示原始查询的 AST。默认情况下处于禁用状态。[#38910](https://github.com/ClickHouse/ClickHouse/pull/38910) ([Igor Nikonov](https://github.com/devcrafter)) 。
* 在属于预期情况时，不再在 system.errors 中报告 ZooKeeper 的 "Node exists" 异常。[#38961](https://github.com/ClickHouse/ClickHouse/pull/38961) ([Raúl Marín](https://github.com/Algunenano)).
* `clickhouse-keeper`：新增对实时摘要计算与验证的支持，默认禁用。[#37555](https://github.com/ClickHouse/ClickHouse/pull/37555) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 允许在 `clickhouse-extract-from-config` 工具的键中使用通配符 `* or {expr1, expr2, expr3}`。[#38966](https://github.com/ClickHouse/ClickHouse/pull/38966) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* clearOldLogs：在并发删除时不再报告 KEEPER\_EXCEPTION。[#39016](https://github.com/ClickHouse/ClickHouse/pull/39016) ([Raúl Marín](https://github.com/Algunenano)) 。
* clickhouse-keeper 改进：将 Keeper 服务器的元信息持久化到磁盘。[#39069](https://github.com/ClickHouse/ClickHouse/pull/39069) ([Antonio Andelic](https://github.com/antonio2368)) 。这样一来，如果同时关闭或重启所有 Keeper 节点，运维会更方便。
* 使用文件系统缓存时，即使磁盘空间耗尽，也会继续运行而不抛出异常。 [#39106](https://github.com/ClickHouse/ClickHouse/pull/39106) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 处理来自 k8s 的 SIGTERM 信号。[#39130](https://github.com/ClickHouse/ClickHouse/pull/39130) ([Timur Solodovnikov](https://github.com/tsolodov)) 。
* 在 system.part\_log 中新增 `merge_algorithm` 列 (Undecided、Horizontal、Vertical) 。[#39181](https://github.com/ClickHouse/ClickHouse/pull/39181) ([Azat Khuzhin](https://github.com/azat)).
* 如果磁盘不是机械硬盘，则不要增加 `system.errors` 中的计数器。[#39216](https://github.com/ClickHouse/ClickHouse/pull/39216) ([Raúl Marín](https://github.com/Algunenano)) 。
* `system.query_log` 中 `INSERT` 查询的 `result_bytes` 指标现在会显示插入的字节数。此前该值不正确，存储的是与 `result_rows` 相同的值。[#39225](https://github.com/ClickHouse/ClickHouse/pull/39225) ([Ilya Yatsishin](https://github.com/qoega)) 。
* clickhouse-client 中的 CPU 使用率指标将以更佳的方式显示。修复了 [#38756](https://github.com/ClickHouse/ClickHouse/issues/38756)。[#39280](https://github.com/ClickHouse/ClickHouse/pull/39280) ([Sergei Trifonov](https://github.com/serxa)) 。
* 在服务器启动时初始化文件系统缓存时，会重新抛出异常，并提供更清晰的错误信息。[#39386](https://github.com/ClickHouse/ClickHouse/pull/39386) ([Kseniia Sumarokova](https://github.com/kssenii)).
* OpenTelemetry 现在默认收集链路追踪时不包含 Processors spans (因为数量过多) 。如需启用 Processors spans 的收集，请开启 `opentelemetry_trace_processors` 设置。[#39170](https://github.com/ClickHouse/ClickHouse/pull/39170) ([Ilya Yatsishin](https://github.com/qoega)) 。
* 函数 `multiMatch[Fuzzy](AllIndices/Any/AnyIndex)`：当 needle 参数为空时，不会抛出逻辑错误。[#39012](https://github.com/ClickHouse/ClickHouse/pull/39012) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 允许声明不带默认参数 `x-max-length` 和 `x-overflow` 的 `RabbitMQ` 队列。[#39259](https://github.com/ClickHouse/ClickHouse/pull/39259) ([rnbondarenko](https://github.com/rnbondarenko)).

<div id="buildtestingpackaging-improvement">
  #### 构建/测试/打包改进
</div>

* 为 ClickHouse 应用 Clang 线程安全分析 (TSA) 注解。 [#38068](https://github.com/ClickHouse/ClickHouse/pull/38068) ([Robert Schulze](https://github.com/rschu1ze)).
* 使通用安装脚本适配 FreeBSD。 [#39302](https://github.com/ClickHouse/ClickHouse/pull/39302) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 为在 `s390x` 平台上构建做好准备。 [#39193](https://github.com/ClickHouse/ClickHouse/pull/39193) ([Harry Lee](https://github.com/HarryLeeIBM)).
* 修复 `jemalloc` 库中的一个 bug。 [#38757](https://github.com/ClickHouse/ClickHouse/pull/38757) ([Azat Khuzhin](https://github.com/azat)).
* 硬件 benchmark 现已支持自动上传结果。 [#38427](https://github.com/ClickHouse/ClickHouse/pull/38427) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 系统表 “system.licenses” 现在可在 Mac (Darwin) 上正确填充。 [#38294](https://github.com/ClickHouse/ClickHouse/pull/38294) ([Robert Schulze](https://github.com/rschu1ze)).
* 将 `all|noarch` 软件包改为依赖架构的版本 - 修复相关文档 - 将 aarch64|arm64 软件包推送到 Artifactory 和发布资源 - 修复 [#36443](https://github.com/ClickHouse/ClickHouse/issues/36443)。 [#38580](https://github.com/ClickHouse/ClickHouse/pull/38580) ([Mikhail f. Shiryaev](https://github.com/Felixoid)).

<div id="bug-fix-user-visible-misbehavior-in-official-stable-or-prestable-release-2">
  #### 缺陷修复 (官方稳定版本或预稳定版本中用户可见的异常行为)
</div>

* 修复 `Decimal128/Decimal256` 在标度超过 19 位时的舍入问题。[#38027](https://github.com/ClickHouse/ClickHouse/pull/38027) ([Igor Nikonov](https://github.com/devcrafter)) 。
* 修复了存储 `Hive` (集成表引擎) 中因数据竞争导致的崩溃。[#38887](https://github.com/ClickHouse/ClickHouse/pull/38887) ([lgbo](https://github.com/lgbo-ustc)).
* 修复了执行 GRANT ALL ON *.* with ON CLUSTER 时发生的崩溃问题。该问题由 [https://github.com/ClickHouse/ClickHouse/pull/35767](https://github.com/ClickHouse/ClickHouse/pull/35767) 引入。此修复关闭了 [#38618](https://github.com/ClickHouse/ClickHouse/issues/38618)。[#38674](https://github.com/ClickHouse/ClickHouse/pull/38674) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修正了 `{0..10}` 形式下的 glob 展开。修复了 [#38498](https://github.com/ClickHouse/ClickHouse/issues/38498)。当前实现与 shell 的做法类似，正如 @rschu1ze 在[这里](https://github.com/ClickHouse/ClickHouse/pull/38502#issuecomment-1169057723)提到的那样。[#38502](https://github.com/ClickHouse/ClickHouse/pull/38502) ([Heena Bansal](https://github.com/HeenaBansal2009)).
* 修复了 `mapUpdate`、`mapFilter` 函数在使用常量 `map` 参数时发生崩溃的问题。关闭 [#38547](https://github.com/ClickHouse/ClickHouse/issues/38547)。[#38553](https://github.com/ClickHouse/ClickHouse/pull/38553) ([hexiaoting](https://github.com/hexiaoting)) 。
* 修复了 `toHour` 在查询优化中使用的单调性信息错误，该问题可能导致错误的查询结果 (即错误的索引分析) 。此修复对应 [#38333](https://github.com/ClickHouse/ClickHouse/issues/38333)。[#38675](https://github.com/ClickHouse/ClickHouse/pull/38675) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了检查 S3 存储是否支持并行写入的逻辑问题。该问题导致 S3 并行写入无法正常工作。[#38792](https://github.com/ClickHouse/ClickHouse/pull/38792) ([chen](https://github.com/xiedeyantu)) 。
* 修复并行读取缓冲区中的 S3 可寻道读取问题。 (会影响查询期间的内存使用。) 关闭 [#38258](https://github.com/ClickHouse/ClickHouse/issues/38258)。[#38802](https://github.com/ClickHouse/ClickHouse/pull/38802) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 更新 `simdjson`。这修复了 [#38621](https://github.com/ClickHouse/ClickHouse/issues/38621) 中的问题——在配备最新支持 AVX-512 VBMI 的 Intel CPU 的机器上会出现缓冲区溢出。[#38838](https://github.com/ClickHouse/ClickHouse/pull/38838) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 修复 Vertical merges 的潜在逻辑错误。[#38859](https://github.com/ClickHouse/ClickHouse/pull/38859) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 修复以秒为单位的 settings profile。[#38896](https://github.com/ClickHouse/ClickHouse/pull/38896) ([Raúl Marín](https://github.com/Algunenano)) 。
* 修复了存在 Nullable 分区键时分区裁剪不正确的问题。注意：你很可能不会用到 Nullable 分区键——这是个冷门功能，不建议使用。Nullable 键本身就没有什么意义，这个功能也只是在某些非常特殊的场景下才需要。此修复解决了 [#38941](https://github.com/ClickHouse/ClickHouse/issues/38941)。[#38946](https://github.com/ClickHouse/ClickHouse/pull/38946) ([Amos Bird](https://github.com/amosbird)).
* 改进拉取操作中的 `fsync_part_directory`。[#38993](https://github.com/ClickHouse/ClickHouse/pull/38993) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复 `OvercommitTracker` 内部可能出现的死锁问题。修复了 [#37794](https://github.com/ClickHouse/ClickHouse/issues/37794)。[#39030](https://github.com/ClickHouse/ClickHouse/pull/39030) ([Dmitry Novik](https://github.com/novikd)) 。
* 修复了文件系统缓存中的一个缺陷：在某些边缘情况下，当缓存容量达到上限时可能会触发该问题。关闭了 [#39066](https://github.com/ClickHouse/ClickHouse/issues/39066)。[#39070](https://github.com/ClickHouse/ClickHouse/pull/39070) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复了窗口表达式参数解析中的一些边界情况。修复了 [#38538](https://github.com/ClickHouse/ClickHouse/issues/38538)。允许在窗口表达式中使用高阶函数。[#39112](https://github.com/ClickHouse/ClickHouse/pull/39112) ([Dmitry Novik](https://github.com/novikd)) 。
* 在 `tuple` 函数中保留 `LowCardinality` 类型。此前，`LowCardinality` 类型会被移除，导致创建的 tuple 元素使用 `LowCardinality` 的底层类型。[#39113](https://github.com/ClickHouse/ClickHouse/pull/39113) ([Anton Popov](https://github.com/CurtizJ)).
* 修复了可能在向附加了 MATERIALIZED VIEW 且启用了 `extremes = 1` 设置的表执行 INSERT 时出现的 `Block structure mismatch` 错误。关闭了 [#29759](https://github.com/ClickHouse/ClickHouse/issues/29759) 和 [#38729](https://github.com/ClickHouse/ClickHouse/issues/38729)。[#39125](https://github.com/ClickHouse/ClickHouse/pull/39125) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了在 `optimize_trivial_count_query` 和 `empty_result_for_aggregation_by_empty_set` 均设为 true 时出现的非预期查询结果。此修复对应 [#39140](https://github.com/ClickHouse/ClickHouse/issues/39140)。[#39155](https://github.com/ClickHouse/ClickHouse/pull/39155) ([Amos Bird](https://github.com/amosbird)).
* 修复了在带有 `PREWHERE` 和顺序读取优化的 `SELECT` 查询中出现的错误 `Not found column Type in block`。[#39157](https://github.com/ClickHouse/ClickHouse/pull/39157) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* 修复了在远程文件系统上创建硬链接期间一个极其罕见的竞态条件。唯一的复现方式是并发运行备份。[#39190](https://github.com/ClickHouse/ClickHouse/pull/39190) ([alesapin](https://github.com/alesapin)).
* (零拷贝复制是一项实验性功能，不应在生产环境中使用) 修复了启用 `allow_remote_fs_zero_copy_replication` 时拉取内存中分片的问题。[#39214](https://github.com/ClickHouse/ClickHouse/pull/39214) ([Azat Khuzhin](https://github.com/azat)) 。
* (MaterializedPostgreSQL - Experimental 功能) 。修复了 MaterializedPostgreSQL 数据库引擎中的段错误；该问题可能会在复制初始化期间发生异常时出现。关闭 [#36939](https://github.com/ClickHouse/ClickHouse/issues/36939)。[#39272](https://github.com/ClickHouse/ClickHouse/pull/39272) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复从 PostgreSQL 数据库引擎错误拉取表元数据的问题。已关闭 [#33502](https://github.com/ClickHouse/ClickHouse/issues/33502)。[#39283](https://github.com/ClickHouse/ClickHouse/pull/39283) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复了聚合键嵌套在其他函数中时出现的 projection 异常。此修复解决了 [#37151](https://github.com/ClickHouse/ClickHouse/issues/37151)。[#37155](https://github.com/ClickHouse/ClickHouse/pull/37155) ([Amos Bird](https://github.com/amosbird)) 。
* 修复某些函数中可能存在的逻辑错误：`... with argument with type Nothing and default implementation for Nothing is expected to return result with type Nothing, got ...`。关闭：[ #37610](https://github.com/ClickHouse/ClickHouse/issues/37610) 关闭：[ #37741](https://github.com/ClickHouse/ClickHouse/issues/37741)。[#37759](https://github.com/ClickHouse/ClickHouse/pull/37759) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复 UNION 子查询中的列顺序错误问题 (当子查询中存在重复列时，可能会导致错误结果) 。[#37887](https://github.com/ClickHouse/ClickHouse/pull/37887) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复 MODIFY ALTER Column 在处理包含点号的列名时行为不正确的问题。关闭 [#37907](https://github.com/ClickHouse/ClickHouse/issues/37907)。[#37971](https://github.com/ClickHouse/ClickHouse/pull/37971) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了从将数据存储在 S3 中的 `MergeTree` 表读取稀疏列时的问题。[#37978](https://github.com/ClickHouse/ClickHouse/pull/37978) ([Anton Popov](https://github.com/CurtizJ)).
* 修复从配置中移除副本时，`Distributed` async insert 可能崩溃的问题。 [#38029](https://github.com/ClickHouse/ClickHouse/pull/38029) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 修复在无别名的 CTE 上使用 GLOBAL JOIN 时出现“缺少列”的问题。[#38056](https://github.com/ClickHouse/ClickHouse/pull/38056) ([Azat Khuzhin](https://github.com/azat)) 。
* 在向后兼容模式下，将元组函数重写为字面量。[#38096](https://github.com/ClickHouse/ClickHouse/pull/38096) ([Anton Kozlov](https://github.com/tonickkozlov)) 。
* 修复了 `ORDER BY` 期间为输出块重复预留内存的问题。[#38127](https://github.com/ClickHouse/ClickHouse/pull/38127) ([iyupeng](https://github.com/iyupeng)).
* 修复数组映射函数中可能存在的逻辑错误 `Bad cast from type DB::IColumn* to DB::ColumnNullable*`。已关闭 [#38006](https://github.com/ClickHouse/ClickHouse/issues/38006)。[#38132](https://github.com/ClickHouse/ClickHouse/pull/38132) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复 partial merge join 中的临时名称冲突，并关闭 [#37928](https://github.com/ClickHouse/ClickHouse/issues/37928)。[#38135](https://github.com/ClickHouse/ClickHouse/pull/38135) ([Vladimir C](https://github.com/vdimir)).
* 修复了类似 `CREATE TABLE nested_name_tuples (`a` Tuple(x String, y Tuple(i Int32, j String))) ENGINE = Memory;` 这类查询中的一个小问题 [#38136](https://github.com/ClickHouse/ClickHouse/pull/38136) ([lgbo](https://github.com/lgbo-ustc)).
* 修复了嵌套短路函数中的一个 bug：此前即使条件为 false，参数也会被执行。关闭 [#38040](https://github.com/ClickHouse/ClickHouse/issues/38040)。[#38173](https://github.com/ClickHouse/ClickHouse/pull/38173) ([Kruglov Pavel](https://github.com/Avogar)) 。
* (Window View 是一项 Experimental 功能) 修复了由 WINDOW VIEW 结构不正确导致的 LOGICAL\_ERROR。[#38205](https://github.com/ClickHouse/ClickHouse/pull/38205) ([Azat Khuzhin](https://github.com/azat)).
* 更新 librdkafka 子模块，修复设置 OAUTHBEARER 刷新回调时发生的崩溃问题。[#38225](https://github.com/ClickHouse/ClickHouse/pull/38225) ([Rafael Acevedo](https://github.com/racevedoo)).
* 修复了因 ProfileEvents 导致向 Distributed 执行 INSERT 时发生卡顿的问题。[#38307](https://github.com/ClickHouse/ClickHouse/pull/38307) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复 PostgreSQL 引擎中的重试问题。 [#38310](https://github.com/ClickHouse/ClickHouse/pull/38310) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复 `PartialSortingTransform` 中的优化问题 (SIGSEGV 以及可能导致结果错误的问题) 。[#38324](https://github.com/ClickHouse/ClickHouse/pull/38324) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了 RabbitMQ 中基于 PeekableReadBuffer 的 formats 相关问题。关闭 [#38061](https://github.com/ClickHouse/ClickHouse/issues/38061)。[#38356](https://github.com/ClickHouse/ClickHouse/pull/38356) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* MaterializedPostgreSQL - 实验性功能。修复了 MaterializedPostgreSQL 中可能出现的 `Invalid number of rows in Chunk` 错误。关闭 [#37323](https://github.com/ClickHouse/ClickHouse/issues/37323)。[#38360](https://github.com/ClickHouse/ClickHouse/pull/38360) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 修复了通过 connection string 进行设置的 RabbitMQ 配置问题。关闭 [#36531](https://github.com/ClickHouse/ClickHouse/issues/36531)。[#38365](https://github.com/ClickHouse/ClickHouse/pull/38365) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复 PostgreSQL engine 在获取数组维度大小时未使用 PostgreSQL schema 的问题。关闭 [#36755](https://github.com/ClickHouse/ClickHouse/issues/36755)。关闭 [#36772](https://github.com/ClickHouse/ClickHouse/issues/36772)。[#38366](https://github.com/ClickHouse/ClickHouse/pull/38366) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复了带有 `DISTINCT` 和 `LIMIT` 的分布式查询可能返回错误结果的问题。修复 [#38282](https://github.com/ClickHouse/ClickHouse/issues/38282)。[#38371](https://github.com/ClickHouse/ClickHouse/pull/38371) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复 countSubstrings() 和 position() 在模式包含 0 字节时返回错误结果的问题。 [#38589](https://github.com/ClickHouse/ClickHouse/pull/38589) ([Robert Schulze](https://github.com/rschu1ze)).
* 现在，即使表中的 IPv4/IPv6 表示值不正确，也可以启动 clickhouse-server 并对这些表执行 attach/detach 操作了。已正确修复问题 [#35156](https://github.com/ClickHouse/ClickHouse/issues/35156)。[#38590](https://github.com/ClickHouse/ClickHouse/pull/38590) ([alesapin](https://github.com/alesapin)).
* 即使某些参数为 NaN，`rankCorr` 函数也能正常工作。此修复关闭了 [#38396](https://github.com/ClickHouse/ClickHouse/issues/38396)。[#38722](https://github.com/ClickHouse/ClickHouse/pull/38722) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 修复 `parallel_view_processing=1` 与 `optimize_trivial_insert_select=1` 同时启用时的问题。修复向视图推送时 `max_insert_threads` 的问题。[#38731](https://github.com/ClickHouse/ClickHouse/pull/38731) ([Azat Khuzhin](https://github.com/azat)).
* 修复了带有 `Map` 组合器的聚合函数中释放后仍被使用的问题，该问题会导致结果错误。[#38748](https://github.com/ClickHouse/ClickHouse/pull/38748) ([Azat Khuzhin](https://github.com/azat)) 。

### <a id="226" /> ClickHouse 发行版 22.6，发布于 2022-06-16。[演示文稿](https://presentations.clickhouse.com/2022-release-22.6/), [视频](https://www.youtube.com/watch?v=0fSp9SF8N8A)

<Frame>
  <iframe src="https://www.youtube.com/embed/0fSp9SF8N8A" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen />
</Frame>

<div id="backward-incompatible-change">
  #### 向后不兼容的变更
</div>

* 移除对 SQL 中八进制数字字面量的支持。在此前版本中，它们会被解析为 Float64。[#37765](https://github.com/ClickHouse/ClickHouse/pull/37765) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)).
* 调整了类型为 `seconds` 的设置项的解析方式，以支持浮点值 (例如：`max_execution_time=0.5`) 。Infinity 或 NaN 值会抛出异常。[#37187](https://github.com/ClickHouse/ClickHouse/pull/37187) ([Raúl Marín](https://github.com/Algunenano)).
* 调整了实验性类型 `Object` 的列的二进制序列化格式。新格式更方便第三方客户端实现。[#37482](https://github.com/ClickHouse/ClickHouse/pull/37482) ([Anton Popov](https://github.com/CurtizJ)).
* 默认启用设置 `output_format_json_named_tuples_as_objects`。该设置允许在 JSON 格式中将命名元组序列化为 JSON 对象。[#37756](https://github.com/ClickHouse/ClickHouse/pull/37756) ([Anton Popov](https://github.com/CurtizJ)).
* 现在不再允许以转义符 ('\\') 结尾的 LIKE 模式 (这是 SQL 标准所要求的) 。[#37764](https://github.com/ClickHouse/ClickHouse/pull/37764) ([Robert Schulze](https://github.com/rschu1ze)).
* 如果你在使用 AArch64 CPU 的集群中运行不同版本的 ClickHouse，或者在同一集群中混用 AArch64 和 amd64，并且使用了带有多个固定大小类型键的 GROUP BY 分布式查询，且这些键总共可装入 256 位但无法装入 64 位，同时结果集非常大，那么在升级期间，这些查询的结果数据将无法被完全聚合。变通办法：使用停机升级，而不是滚动升级。

<div id="new-feature-2">
  #### 新功能
</div>

* 添加 `GROUPING` 函数。它可用于消除带有 `ROLLUP`、`CUBE` 或 `GROUPING SETS` 的查询中记录的歧义。关闭了 [#19426](https://github.com/ClickHouse/ClickHouse/issues/19426)。[#37163](https://github.com/ClickHouse/ClickHouse/pull/37163) ([Dmitry Novik](https://github.com/novikd)) 。
* 新增一种用于浮点数据压缩的 [FPC](https://userweb.cs.txstate.edu/~burtscher/papers/dcc07a.pdf) 编解码算法。[#37553](https://github.com/ClickHouse/ClickHouse/pull/37553) ([Mikhail Guzov](https://github.com/koloshmet)) 。
* 新增列式 JSON 格式：`JSONColumns`、`JSONCompactColumns`、`JSONColumnsWithMetadata`。关闭 [#36338](https://github.com/ClickHouse/ClickHouse/issues/36338) 和 [#34509](https://github.com/ClickHouse/ClickHouse/issues/34509)。[#36975](https://github.com/ClickHouse/ClickHouse/pull/36975) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 新增了基于 d3js 的 OpenTelemetry 链路追踪可视化工具。[#37810](https://github.com/ClickHouse/ClickHouse/pull/37810) ([Sergei Trifonov](https://github.com/serxa)) 。
* 支持向 `system.zookeeper` 表中执行 INSERT 操作。修复了 [#22130](https://github.com/ClickHouse/ClickHouse/issues/22130)。[#37596](https://github.com/ClickHouse/ClickHouse/pull/37596) ([Han Fei](https://github.com/hanfei1991)).
* 支持 `LIKE`、`ILIKE` 和 `match` 函数使用非常量 `pattern` 参数。[#37251](https://github.com/ClickHouse/ClickHouse/pull/37251) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 可执行用户自定义函数现已支持参数。示例：`SELECT test_function(parameters)(arguments)`。解决了 [#37578](https://github.com/ClickHouse/ClickHouse/issues/37578)。[#37720](https://github.com/ClickHouse/ClickHouse/pull/37720) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 在 system.part\_log 表中新增 `merge_reason` 列。[#36912](https://github.com/ClickHouse/ClickHouse/pull/36912) ([Sema Checherinda](https://github.com/CheSema)) 。
* 新增对 Avro 格式中 Map 和 Record 的支持。新增设置 `input_format_avro_null_as_default `，允许在 Avro 格式中将 null 作为默认值插入。已关闭 [#18925](https://github.com/ClickHouse/ClickHouse/issues/18925)、[#37378](https://github.com/ClickHouse/ClickHouse/issues/37378)、[#32899](https://github.com/ClickHouse/ClickHouse/issues/32899)。[#37525](https://github.com/ClickHouse/ClickHouse/pull/37525) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 新增 `clickhouse-disks` 工具，用于检查和操作为 ClickHouse 配置的虚拟文件系统。[#36060](https://github.com/ClickHouse/ClickHouse/pull/36060) ([Artyom Yurkov](https://github.com/Varinara)).
* 新增了 H3 单向边函数。[#36843](https://github.com/ClickHouse/ClickHouse/pull/36843) ([Bharat Nallan](https://github.com/bharatnc)) 。
* 新增了对从无符号整数生成 [hashids](https://hashids.org/) 的支持。[#37013](https://github.com/ClickHouse/ClickHouse/pull/37013) ([Michael Nutt](https://github.com/mnutt)) 。
* 现已支持为 `CREATE USER <user> IDENTIFIED WITH sha256_hash` 显式指定 `SALT`。[#37377](https://github.com/ClickHouse/ClickHouse/pull/37377) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* 新增两个设置 `input_format_csv_skip_first_lines/input_format_tsv_skip_first_lines`，支持在 CSV/TSV 格式下跳过文件开头指定数量的行。[#37537](https://github.com/ClickHouse/ClickHouse/pull/37537) ([Kruglov Pavel](https://github.com/Avogar)) 。
* `showCertificate` 函数用于显示当前 server 的 SSL 证书。[#37540](https://github.com/ClickHouse/ClickHouse/pull/37540) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* 现已支持在命名集合中为数据字典配置 HTTP 源。[#37581](https://github.com/ClickHouse/ClickHouse/pull/37581) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* 新增了窗口函数 `nonNegativeDerivative(metric_column, timestamp_column[, INTERVAL x SECOND])`。[#37628](https://github.com/ClickHouse/ClickHouse/pull/37628) ([Andrey Zvonov](https://github.com/zvonand)) 。
* 现已支持修改 `ReplicatedMergeTree` 表的注释。[#37416](https://github.com/ClickHouse/ClickHouse/pull/37416) ([Vasily Nemkov](https://github.com/Enmk)) 。
* 新增了 `SYSTEM UNFREEZE` 查询，该查询会删除整个备份，无论对应的表是否已删除。[#36424](https://github.com/ClickHouse/ClickHouse/pull/36424) ([Vadim Volodin](https://github.com/PolyProgrammist)) 。

<div id="experimental-feature">
  #### Experimental 功能
</div>

* 为 `WINDOW VIEW` 启用 `POPULATE`。 [#36945](https://github.com/ClickHouse/ClickHouse/pull/36945) ([vxider](https://github.com/Vxider)).
* `WINDOW VIEW` 现已支持 `ALTER TABLE ... MODIFY QUERY`。 [#37188](https://github.com/ClickHouse/ClickHouse/pull/37188) ([vxider](https://github.com/Vxider)).
* 此 PR 更改了 `WINDOW VIEW` 中 `ENGINE` 语法的行为，使其与 `MATERIALIZED VIEW` 保持一致。 [#37214](https://github.com/ClickHouse/ClickHouse/pull/37214) ([vxider](https://github.com/Vxider)).

<div id="performance-improvement">
  #### 性能改进
</div>

* 为 ARM NEON 增加了大量优化 [#38093](https://github.com/ClickHouse/ClickHouse/pull/38093)([Daniel Kutenin](https://github.com/danlark1)), ([Alexandra Pilipyuk](https://github.com/chalice19)) 注意：如果你在使用 ARM CPU 的集群上运行不同版本的 ClickHouse，并使用按多个键 `GROUP BY` 的分布式查询，且这些键属于可容纳在 256 位内但无法容纳在 64 位内的定长类型，那么在升级期间，aggregation query 的结果会出错。临时解决方法：使用停机升级，而不是滚动升级。
* 改进了在格式 Native、Protobuf、CapnProto、JSONEachRow、TSKV 以及所有带有 WithNames/WithNamesAndTypes 后缀的格式中选择部分列子集时的性能和内存占用。此前，从这些格式的文件中仅选择部分列时，仍会读取所有列并将其存储在内存中。现在只会读取所需的列。此 PR 还默认启用了设置 `input_format_skip_unknown_fields`，否则在选择部分列子集时会抛出异常。[#37192](https://github.com/ClickHouse/ClickHouse/pull/37192) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 现在可将更多过滤器下推到 join 中。[#37472](https://github.com/ClickHouse/ClickHouse/pull/37472) ([Amos Bird](https://github.com/amosbird)) 。
* 读取 wide parts 时，仅加载必要列的标记。[#36879](https://github.com/ClickHouse/ClickHouse/pull/36879) ([Anton Kozlov](https://github.com/tonickkozlov)) 。
* 改进了在将稀疏列 (可通过在 `MergeTree` 表中启用 Experimental 设置 `ratio_of_defaults_for_sparse_serialization`) 用作聚合函数参数时的聚合性能。[#37617](https://github.com/ClickHouse/ClickHouse/pull/37617) ([Anton Popov](https://github.com/CurtizJ)).
* 优化了接受两个参数的函数 `COALESCE`。[#37666](https://github.com/ClickHouse/ClickHouse/pull/37666) ([Anton Popov](https://github.com/CurtizJ)).
* 当 `multiIf` 只有一个条件时，将其替换为 `if`，因为 `if` 函数的性能更好。[#37695](https://github.com/ClickHouse/ClickHouse/pull/37695) ([Anton Popov](https://github.com/CurtizJ)) 。
* 改进 `dictGetDescendants`、`dictGetChildren` 函数的性能：在查询期间按查询而非按函数调用创建临时的父子层级索引。允许为 `HIERARHICAL` 属性指定 `BIDIRECTIONAL`，字典将在内存中维护父到子的索引，从而使 `dictGetDescendants`、`dictGetChildren` 函数无需在每次查询时创建临时索引。关闭 [#32481](https://github.com/ClickHouse/ClickHouse/issues/32481)。[#37148](https://github.com/ClickHouse/ClickHouse/pull/37148) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 现在，聚合状态的销毁也可以在线程池中执行。对于带有 LIMIT 且状态较大的查询，这能带来显著的性能提升，例如 `select uniq(number) from numbers_mt(1e7) group by number limit 100` 现在大约快了 2.5 倍。[#37855](https://github.com/ClickHouse/ClickHouse/pull/37855) ([Nikita Taranov](https://github.com/nickitat)) 。
* 优化了单列排序性能。[#37195](https://github.com/ClickHouse/ClickHouse/pull/37195) ([Maksim Kita](https://github.com/kitaisreal)).
* 通过排序队列特化提升单列排序性能。[#37990](https://github.com/ClickHouse/ClickHouse/pull/37990) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 数组范数和距离函数的性能提升了 2 到 4 倍。[#37394](https://github.com/ClickHouse/ClickHouse/pull/37394) ([Alexander Gololobov](https://github.com/davenger)) 。
* 使用动态分发提升数值比较函数的性能。[#37399](https://github.com/ClickHouse/ClickHouse/pull/37399) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 优化带有 LIMIT 的 ORDER BY 性能。 [#37481](https://github.com/ClickHouse/ClickHouse/pull/37481) ([Maksim Kita](https://github.com/kitaisreal)).
* 使用动态分发基础设施提升 `hasAll` 函数的性能。[#37484](https://github.com/ClickHouse/ClickHouse/pull/37484) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 提升 `greatCircleAngle`、`greatCircleDistance`、`geoDistance` 函数的性能。[#37524](https://github.com/ClickHouse/ClickHouse/pull/37524) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 当 ORDER BY 包含多个列时，提升向 MergeTree 插入数据的性能。[#35762](https://github.com/ClickHouse/ClickHouse/pull/35762) ([Maksim Kita](https://github.com/kitaisreal)).
* 修复了表数量很多时后台 CPU 占用过高的问题。[#38028](https://github.com/ClickHouse/ClickHouse/pull/38028) ([Maksim Kita](https://github.com/kitaisreal)).
* 使用动态分派提升 `not` 函数的性能。[#38058](https://github.com/ClickHouse/ClickHouse/pull/38058) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 优化了 LIKE 和 MATCH 函数等场景中使用的 re2 模式的内部缓存。[#37544](https://github.com/ClickHouse/ClickHouse/pull/37544) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 使用 AVX-512 指令改进一体化过滤器位掩码生成函数。[#37588](https://github.com/ClickHouse/ClickHouse/pull/37588) ([yaqi-zhao](https://github.com/yaqi-zhao)).
* 对 Hive 集成引擎采用 `threadpool` 读取方法。这将显著提升读取速度。[#36328](https://github.com/ClickHouse/ClickHouse/pull/36328) ([李扬](https://github.com/taiyang-li)) 。
* 当所有待读取的列都是分区键时，无需实际读取 Hive 文件，即可根据文件行号构造列。[#37103](https://github.com/ClickHouse/ClickHouse/pull/37103) ([lgbo](https://github.com/lgbo-ustc)).
* 支持使用多个 disk 来缓存 Hive 文件。[#37279](https://github.com/ClickHouse/ClickHouse/pull/37279) ([lgbo](https://github.com/lgbo-ustc)).
* 限制每个查询的最大缓存使用量，可以有效防止缓存池污染。[相关问题](https://github.com/ClickHouse/ClickHouse/issues/28961)。[#37859](https://github.com/ClickHouse/ClickHouse/pull/37859) ([Han Shukai](https://github.com/KinderRiven)) 。
* 目前，ClickHouse 会将所有远程文件直接下载到本地缓存中 (即使它们只会被读取一次) ，这会频繁触发本地磁盘 IO。在某些场景下，这些 IO 其实并非必要，反而很容易带来负优化。如下面的图所示，当我们运行 SSB Q1-Q4 时，缓存反而导致了负优化。[#37516](https://github.com/ClickHouse/ClickHouse/pull/37516) ([Han Shukai](https://github.com/KinderRiven)) 。
* 允许在从 S3 读取时，借助 `_file` 和 `_path` 等虚拟列筛除文件列表中的文件。这对应于 [#37174](https://github.com/ClickHouse/ClickHouse/issues/37174)、[#23494](https://github.com/ClickHouse/ClickHouse/issues/23494)。[#37356](https://github.com/ClickHouse/ClickHouse/pull/37356) ([Amos Bird](https://github.com/amosbird)) 。
* 在函数：CompressedWriteBuffer::nextImpl() 中，存在一个不必要的写时复制步骤，而这一步在插入数据时会频繁发生。下面展示了此补丁带来的差异：- 之前：1. 将 "working\_buffer" 压缩到 "compressed\_buffer" 中 2. 再写时复制到 "out" 中 - 之后：直接将 "working\_buffer" 压缩到 "out" 中。[#37242](https://github.com/ClickHouse/ClickHouse/pull/37242) ([jasperzhu](https://github.com/jinjunzh)).

<div id="improvement">
  #### 改进
</div>

* 支持在 ROLLUP、CUBE 和 GROUPING SETS 中为具有非标准默认值的类型提供支持。解决了 [#37360](https://github.com/ClickHouse/ClickHouse/issues/37360)。[#37667](https://github.com/ClickHouse/ClickHouse/pull/37667) ([Dmitry Novik](https://github.com/novikd)) 。
* 修复 ARM 上的堆栈跟踪采集问题。已关闭 [#37044](https://github.com/ClickHouse/ClickHouse/issues/37044)。已关闭 [#15638](https://github.com/ClickHouse/ClickHouse/issues/15638)。[#37797](https://github.com/ClickHouse/ClickHouse/pull/37797) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 客户端会尝试 DNS 解析返回的每个 IP 地址，直到成功连接为止。[#37273](https://github.com/ClickHouse/ClickHouse/pull/37273) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* 支持在 Arrow/Parquet/ORC 格式中使用 String 类型替代 Binary。此 PR 为此引入了 3 个新设置：`output_format_arrow_string_as_string`、`output_format_parquet_string_as_string`、`output_format_orc_string_as_string`。所有设置的默认值均为 `false`。[#37327](https://github.com/ClickHouse/ClickHouse/pull/37327) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 将设置 `input_format_max_rows_to_read_for_schema_inference` 应用于通配符中的所有文件合计读取的总行数。此前，设置 `input_format_max_rows_to_read_for_schema_inference` 是分别应用于通配符中的每个文件；在存在大量 NULL 的情况下，可能会从每个文件中都读取前 `input_format_max_rows_to_read_for_schema_inference` 行，却仍然一无所获。同时将该设置的默认值提高到 25000。[#37332](https://github.com/ClickHouse/ClickHouse/pull/37332) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 新增独立的 `CLUSTER` grant (以及用于向后兼容的 `access_control_improvements.on_cluster_queries_require_cluster_grant` 配置指令，默认值为 `false`) 。[#35767](https://github.com/ClickHouse/ClickHouse/pull/35767) ([Azat Khuzhin](https://github.com/azat)) 。
* 新增了对 `hdfsCluster` 的 schema 推断支持。[#35812](https://github.com/ClickHouse/ClickHouse/pull/35812) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 在卷内的各个 disk (多 disk 配置) 之间实现 `least_used` 负载均衡算法。[#36686](https://github.com/ClickHouse/ClickHouse/pull/36686) ([Azat Khuzhin](https://github.com/azat)) 。
* 修改 HTTP 端点，使其在 `send_progress_in_http_headers=0` 时于 `X-ClickHouse-Summary` 请求头中返回完整统计信息 (此前会返回全 0) 。- 修改 HTTP 端点，使其在此前已发送过进度信息时 (`send_progress_in_http_headers=1`) 返回 `X-ClickHouse-Exception-Code` 请求头 - 修改 HTTP 端点，使其在出现 `TIMEOUT_EXCEEDED` 错误时返回 `HTTP_REQUEST_TIMEOUT` (408)，而不是 `HTTP_INTERNAL_SERVER_ERROR` (500)。 [#36884](https://github.com/ClickHouse/ClickHouse/pull/36884) ([Raúl Marín](https://github.com/Algunenano)).
* 允许用户查看已授予角色所包含的授权。[#36941](https://github.com/ClickHouse/ClickHouse/pull/36941) ([nvartolomei](https://github.com/nvartolomei)) 。
* 不要以数值方式计算积分，而应改用 CDF 函数。这样可以加快执行速度并提高精度。此修复解决了 [#36714](https://github.com/ClickHouse/ClickHouse/issues/36714)。[#36953](https://github.com/ClickHouse/ClickHouse/pull/36953) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 为函数中的 Nothing 添加默认实现。现在，大多数函数在某个参数为 Nothing 时都会返回类型为 Nothing 的列。这也解决了 arrayMap/arrayFilter 等类似函数在参数为空数组时的问题。此前，像 `select arrayMap(x -> 2 * x, []);` 这样的查询会失败，因为 lambda 内部的函数无法处理 `Nothing` 类型；现在，这类查询会返回类型为 `Array(Nothing)` 的空数组。此外，还为 arrayFilter/arrayFill 等函数增加了对 Nullable 类型数组的支持。此前，像 `select arrayFilter(x -> x % 2, [1, NULL])` 这样的查询会失败，现在则可以正常执行 (如果 lambda 的结果为 NULL，则该值不会包含在结果中) 。关闭 [#37000](https://github.com/ClickHouse/ClickHouse/issues/37000)。[#37048](https://github.com/ClickHouse/ClickHouse/pull/37048) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 现在，如果某个分片有本地副本，我们会创建一个本地计划，以及一个从所有远程副本读取的计划。两者共用同一个发起节点，由其协调读取。[#37204](https://github.com/ClickHouse/ClickHouse/pull/37204) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 如果未显式设置配置选项 "mark\_cache\_size"，将不再中止服务器启动。[#37326](https://github.com/ClickHouse/ClickHouse/pull/37326) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 允许在列声明中直接在类型后指定 `NULL`/`NOT NULL`。[#37337](https://github.com/ClickHouse/ClickHouse/pull/37337) ([Igor Nikonov](https://github.com/devcrafter)) 。
* 优化 PARTIALLY\_DOWNLOADED File 段获取读取缓冲区的过程。[#37338](https://github.com/ClickHouse/ClickHouse/pull/37338) ([xiedeyantu](https://github.com/xiedeyantu)) 。
* 尝试优化短路函数处理，以修复压力测试中发现的问题。[#37384](https://github.com/ClickHouse/ClickHouse/pull/37384) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 已关闭 [#37395](https://github.com/ClickHouse/ClickHouse/issues/37395)。[#37415](https://github.com/ClickHouse/ClickHouse/pull/37415) ([Memo](https://github.com/Joeywzr)) 。
* 修复 zero-copy 复制中拉取分片时极少出现的死锁问题。修复了 [#37423](https://github.com/ClickHouse/ClickHouse/issues/37423)。[#37424](https://github.com/ClickHouse/ClickHouse/pull/37424) ([metahys](https://github.com/metahys)) 。
* 不允许创建使用未知数据格式的存储。[#37450](https://github.com/ClickHouse/ClickHouse/pull/37450) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 将 `global_memory_usage_overcommit_max_wait_microseconds` 的 default value 设为 5 秒。在 OOM Exception 消息中添加有关 `OvercommitTracker` 的信息。新增 `MemoryOvercommitWaitTimeMicroseconds` profile 事件。[#37460](https://github.com/ClickHouse/ClickHouse/pull/37460) ([Dmitry Novik](https://github.com/novikd)) 。
* 不要在 clickhouse-client 中显示 `-0.0` 的 CPU 时间。这可能是由舍入误差导致的。此更改关闭了 [#38003](https://github.com/ClickHouse/ClickHouse/issues/38003)。此更改关闭了 [#38038](https://github.com/ClickHouse/ClickHouse/issues/38038)。[#38064](https://github.com/ClickHouse/ClickHouse/pull/38064) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Play UI：页面水平滚动时，控件仍保持在原位。即使表很宽并且已向右滚动很远，编辑起来也会更方便。该功能由 CaspianDB 的 Maksym Tereshchenko 提出。[#37470](https://github.com/ClickHouse/ClickHouse/pull/37470) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 修改 play.html 中的查询 div，使其高度可扩展到超过 20%。对于很长的查询，能够拉伸 textarea 元素会很有帮助；但目前由于 div 高度固定，拉伸后的 textarea 会遮住下方的数据 div。通过此修复，拉伸 textarea 元素时会将数据 div 相应向下/上推移，这样扩展后的 textarea 就不会将其遮住。此外，即使用户调整查询 textarea 的大小，查询框的宽度也会始终保持 100%。[#37488](https://github.com/ClickHouse/ClickHouse/pull/37488) ([guyco87](https://github.com/guyco87)).
* 新增了用于查看已写入 (插入或合并) parts 类型内部信息的 `ProfileEvents` (`Inserted{Wide/Compact/InMemory}Parts`、`MergedInto{Wide/Compact/InMemory}Parts`) 。向 `system.part_log` 添加了列 `part_type`。解决了 [#37495](https://github.com/ClickHouse/ClickHouse/issues/37495)。[#37536](https://github.com/ClickHouse/ClickHouse/pull/37536) ([Anton Popov](https://github.com/CurtizJ)) 。
* clickhouse-keeper 改进：将损坏的日志移至带时间戳的文件夹。[#37565](https://github.com/ClickHouse/ClickHouse/pull/37565) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 在后续合并后，将不再写入因生存时间 (TTL) 而过期的列 (此前只有该分片首次 merge/optimize 时不会写入因生存时间 (TTL) 过期的列，其他情况下都会写入) 。[#37570](https://github.com/ClickHouse/ClickHouse/pull/37570) ([Azat Khuzhin](https://github.com/azat)) 。
* 在存在 LowCardinality 或稀疏列时，杂项函数 `dumpColumnStructure` 的结果会更精确。在之前的版本中，这些函数会在返回结果前先将参数转换为普通列。这是为回答 [#6935](https://github.com/ClickHouse/ClickHouse/issues/6935) 中的问题所必需的。[#37633](https://github.com/ClickHouse/ClickHouse/pull/37633) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* clickhouse-keeper：仅存储 watch 对应的唯一 session ID。[#37641](https://github.com/ClickHouse/ClickHouse/pull/37641) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复可能出现的“无法写入已终结的 buffer”问题。[#37645](https://github.com/ClickHouse/ClickHouse/pull/37645) ([Azat Khuzhin](https://github.com/azat)) 。
* 为 `DiskS3` 新增设置 `support_batch_delete`，用于禁用多对象删除调用，因为 Google Cloud Storage 不支持该功能。[#37659](https://github.com/ClickHouse/ClickHouse/pull/37659) ([Fred Wulff](https://github.com/frew)) 。
* 在 ODBC bridge 中新增了一个可禁用连接池的选项。[#37705](https://github.com/ClickHouse/ClickHouse/pull/37705) ([Anton Kozlov](https://github.com/tonickkozlov)) 。
* 函数 `dictGetHierarchy`、`dictIsIn`、`dictGetChildren`、`dictGetDescendants` 新增了对字典中可为 NULL 的 `HIERARCHICAL` 属性的支持。关闭了 [#35521](https://github.com/ClickHouse/ClickHouse/issues/35521)。[#37805](https://github.com/ClickHouse/ClickHouse/pull/37805) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 在 `system.build_options` 表中提供与 BoringSSL 版本相关的信息。[#37850](https://github.com/ClickHouse/ClickHouse/pull/37850) ([Bharat Nallan](https://github.com/bharatnc)).
* 现在，clickhouse-server 会在启动时删除 `delete_tmp` 目录。修复了 [#26503](https://github.com/ClickHouse/ClickHouse/issues/26503)。[#37906](https://github.com/ClickHouse/ClickHouse/pull/37906) ([alesapin](https://github.com/alesapin)) 。
* 超时后清理损坏的 detached parts。关闭了 [#25195](https://github.com/ClickHouse/ClickHouse/issues/25195)。[#37975](https://github.com/ClickHouse/ClickHouse/pull/37975) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 现在，在 MergeTree 表引擎家族中，移动失败的 parts 会被立即删除。[#37994](https://github.com/ClickHouse/ClickHouse/pull/37994) ([alesapin](https://github.com/alesapin)) 。
* 现在，如果为 ReplicatedMergeTree 启用了 `always_fetch_merged_part` 设置，合并操作将减少在其他副本上查找 parts 的频率，从而减轻 \[Zoo]Keeper 的负载。[#37995](https://github.com/ClickHouse/ClickHouse/pull/37995) ([alesapin](https://github.com/alesapin)) 。
* 还会一并添加带授权选项的隐式授权。例如，`GRANT CREATE TABLE ON test.* TO A WITH GRANT OPTION` 现在允许 `A` 执行 `GRANT CREATE VIEW ON test.* TO B`。[#38017](https://github.com/ClickHouse/ClickHouse/pull/38017) ([Vitaly Baranov](https://github.com/vitlibar)) 。

<div id="buildtestingpackaging-improvement">
  #### 构建/测试/打包改进
</div>

* 在构建中使用 `clang-14` 和 LLVM 基础设施 14 版本。此更改关闭了 [#34681](https://github.com/ClickHouse/ClickHouse/issues/34681)。[#34754](https://github.com/ClickHouse/ClickHouse/pull/34754) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。注意：`clang-14` 的 ThreadSanitizer 中有一个 [bug](https://github.com/google/sanitizers/issues/1540)，会导致我们的 CI 运行效果变差。
* 允许在启动时降权。这简化了 Docker 镜像。关闭 [#36293](https://github.com/ClickHouse/ClickHouse/issues/36293)。[#36341](https://github.com/ClickHouse/ClickHouse/pull/36341) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 将文档拼写检查加入 CI。[#37790](https://github.com/ClickHouse/ClickHouse/pull/37790) ([Vladimir C](https://github.com/vdimir)) 。
* 修复了过于激进的符号剥离问题，该问题移除了用于检查可执行文件一致性所需的内嵌哈希。[#37993](https://github.com/ClickHouse/ClickHouse/pull/37993) ([Robert Schulze](https://github.com/rschu1ze)) 。

<div id="bug-fix">
  #### 问题修复
</div>

* 修复 `SELECT ... INTERSECT` 和 `EXCEPT SELECT` 语句在处理常量字符串类型时的问题。[#37738](https://github.com/ClickHouse/ClickHouse/pull/37738) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 修复了对 `AggregateFunction` 类型列执行 `GROUP BY` 时的问题 (即按 `AggregateFunction` 类型的列进行 `GROUP BY`) 。[#37093](https://github.com/ClickHouse/ClickHouse/pull/37093) ([Azat Khuzhin](https://github.com/azat)) 。
* (Experimental WINDOW VIEW) 修复 WindowView 中的 `addDependency`。该问题可参照 [#37237](https://github.com/ClickHouse/ClickHouse/issues/37237) 复现。[#37224](https://github.com/ClickHouse/ClickHouse/pull/37224) ([vxider](https://github.com/Vxider)) 。
* 修复了 ORDER BY ... WITH FILL 功能中的不一致问题。包含 ORDER BY ... WITH FILL 的查询在存在多个 WITH FILL 列时，可能会生成额外的行。[#38074](https://github.com/ClickHouse/ClickHouse/pull/38074) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)).
* 此 PR 将 `addDependency` 从构造函数移至 `startup()`，以避免向已 *删除* 的表添加依赖，修复了 [#37237](https://github.com/ClickHouse/ClickHouse/issues/37237)。[#37243](https://github.com/ClickHouse/ClickHouse/pull/37243) ([vxider](https://github.com/Vxider)) 。
* 修复了在列式格式中为缺失值插入默认值的问题。此前，缺失列填充的是类型的默认值，而不是列的默认值。 [#37253](https://github.com/ClickHouse/ClickHouse/pull/37253) ([Kruglov Pavel](https://github.com/Avogar)).
* (Experimental Object 类型) 修复了某些将嵌套数组插入 `Object` 类型列时出现的问题。[#37305](https://github.com/ClickHouse/ClickHouse/pull/37305) ([Anton Popov](https://github.com/CurtizJ)).
* 修复了在聚合函数、prewhere 和 join 中因常量字符串冲突而导致的意外报错。关闭 [#36891](https://github.com/ClickHouse/ClickHouse/issues/36891)。[#37336](https://github.com/ClickHouse/ClickHouse/pull/37336) ([Vladimir C](https://github.com/vdimir)).
* 修复了查询中带有 GROUP/ORDER BY 的投影以及 optimize\_aggregation\_in\_order 的问题 (此前结果不正确，因为仅执行了最终排序) 。[#37342](https://github.com/ClickHouse/ClickHouse/pull/37342) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了 S3 中键名包含符号时导致的错误。修复了 [#33009](https://github.com/ClickHouse/ClickHouse/issues/33009)。[#37344](https://github.com/ClickHouse/ClickHouse/pull/37344) ([Vladimir Chebotarev](https://github.com/excitoon)) 。
* 当 GROUPING SETS 与 ROLLUP 或 CUBE 结合使用时，抛出异常。[#37367](https://github.com/ClickHouse/ClickHouse/pull/37367) ([Dmitry Novik](https://github.com/novikd)) 。
* 修复了在 merges 期间 `getMaxSourcePartsSizeForMerge` 中出现的 LOGICAL\_ERROR (当在 `config.xml` (新方式) 而非 `users.xml` (已弃用的方式) 中指定了非标准的、更大的 `background_pool_size`/`background_merges_mutations_concurrency_ratio` 值时) 。[#37413](https://github.com/ClickHouse/ClickHouse/pull/37413) ([Azat Khuzhin](https://github.com/azat)).
* 停止在 RowBinary format 中移除 UTF-8 BOM。 [#37428](https://github.com/ClickHouse/ClickHouse/pull/37428) ([Paul Loyd](https://github.com/loyd)). [#37428](https://github.com/ClickHouse/ClickHouse/pull/37428) ([Paul Loyd](https://github.com/loyd)).
* clickhouse-keeper 缺陷修复：修复单节点集群的强制恢复问题。[#37440](https://github.com/ClickHouse/ClickHouse/pull/37440) ([Antonio Andelic](https://github.com/antonio2368)).
* 修复了 `normalizeUTF8` 函数中的逻辑错误。已关闭 [#37298](https://github.com/ClickHouse/ClickHouse/issues/37298)。[#37443](https://github.com/ClickHouse/ClickHouse/pull/37443) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 修复 JoinSwitcher 中对 Nullable 的 lowcard CAST 问题，关闭 [#37385](https://github.com/ClickHouse/ClickHouse/issues/37385)。[#37453](https://github.com/ClickHouse/ClickHouse/pull/37453) ([Vladimir C](https://github.com/vdimir)).
* 修复 ORC/Arrow/Parquet 格式中命名元组的输出。[#37458](https://github.com/ClickHouse/ClickHouse/pull/37458) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了在存在 GROUPING SETS 的情况下，ORDER BY 子句中单调函数的优化问题。修复了 [#37401](https://github.com/ClickHouse/ClickHouse/issues/37401)。[#37493](https://github.com/ClickHouse/ClickHouse/pull/37493) ([Dmitry Novik](https://github.com/novikd)) 。
* 修复了在某些条件下与字典进行连接时出现的错误。关闭 [#37386](https://github.com/ClickHouse/ClickHouse/issues/37386)。[#37530](https://github.com/ClickHouse/ClickHouse/pull/37530) ([Vladimir C](https://github.com/vdimir)).
* 禁止 `optimize_aggregation_in_order` 与 `GROUPING SETS` 搭配使用 (修复了 `LOGICAL_ERROR`) 。[#37542](https://github.com/ClickHouse/ClickHouse/pull/37542) ([Azat Khuzhin](https://github.com/azat)) 。
* 修正了 ActionsDAG 的转储信息错误。[#37587](https://github.com/ClickHouse/ClickHouse/pull/37587) ([zhanglistar](https://github.com/zhanglistar)).
* 修复了 UNION 查询中的类型转换问题 (可能导致 LOGICAL\_ERROR) 。[#37593](https://github.com/ClickHouse/ClickHouse/pull/37593) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复 `STEP` 子句中 `WITH FILL` 修饰符在负时间间隔下的问题。修复了 [#37514](https://github.com/ClickHouse/ClickHouse/issues/37514)。[#37600](https://github.com/ClickHouse/ClickHouse/pull/37600) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了在 ` join_use_nulls = 1` 时 `joinGet` 对 Array 的非法用法。此修复解决了 [#37562](https://github.com/ClickHouse/ClickHouse/issues/37562)。[#37650](https://github.com/ClickHouse/ClickHouse/pull/37650) ([Amos Bird](https://github.com/amosbird)) 。
* 修复 cross join 中列数不一致的问题，关闭 [#37561](https://github.com/ClickHouse/ClickHouse/issues/37561)。[#37653](https://github.com/ClickHouse/ClickHouse/pull/37653) ([Vladimir C](https://github.com/vdimir))。
* 修复了在使用 named collections 配置的 MySQL database 上执行 `show create table` 时发生的段错误。关闭 [#37683](https://github.com/ClickHouse/ClickHouse/issues/37683)。[#37690](https://github.com/ClickHouse/ClickHouse/pull/37690) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 修复了一个问题：如果创建存储时未使用 SETTINGS 子句，那么服务器重启后 RabbitMQ Storage 将无法启动。关闭 [#37463](https://github.com/ClickHouse/ClickHouse/issues/37463)。[#37691](https://github.com/ClickHouse/ClickHouse/pull/37691) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* SQL 用户自定义函数在 readonly 模式下禁用 CREATE/DROP。已关闭 [#37280](https://github.com/ClickHouse/ClickHouse/issues/37280)。[#37699](https://github.com/ClickHouse/ClickHouse/pull/37699) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 修复可执行用户自定义函数中 Nullable 参数的格式化问题。关闭 [#35897](https://github.com/ClickHouse/ClickHouse/issues/35897)。[#37711](https://github.com/ClickHouse/ClickHouse/pull/37711) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 修复了在分布式查询中通过设置 `optimize_monotonous_functions_in_order_by` 启用优化的问题。修复了 [#36037](https://github.com/ClickHouse/ClickHouse/issues/36037)。[#37724](https://github.com/ClickHouse/ClickHouse/pull/37724) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复 `values` 表函数中可能存在的逻辑错误：`Invalid Field get from type UInt64 to type Float64`。关闭 [#37602](https://github.com/ClickHouse/ClickHouse/issues/37602)。[#37754](https://github.com/ClickHouse/ClickHouse/pull/37754) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了在 SchemaReader 构造函数抛出异常时，schema 推断可能导致段错误的问题。关闭 [#37680](https://github.com/ClickHouse/ClickHouse/issues/37680)。[#37760](https://github.com/ClickHouse/ClickHouse/pull/37760) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复内部 cast 函数中设置 cast\_ipv4\_ipv6\_default\_on\_conversion\_error 的问题。关闭 [#35156](https://github.com/ClickHouse/ClickHouse/issues/35156)。[#37761](https://github.com/ClickHouse/ClickHouse/pull/37761) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 修复 DatatypeDate32 的 toString 错误。 [#37775](https://github.com/ClickHouse/ClickHouse/pull/37775) ([LiuNeng](https://github.com/liuneng1994)).
* clickhouse-keeper 设置 `dead_session_check_period_ms` 被换算成了微秒 (乘以 1000) ，导致死会话要到几分钟后才会被清理 (而不是 500ms) 。[#37824](https://github.com/ClickHouse/ClickHouse/pull/37824) ([Michael Lex](https://github.com/mlex)).
* 修复在禁用 `async_socket_for_remote`/`use_hedged_requests` 时，Distributed 查询可能出现的 "No more packets are available" 问题。[#37826](https://github.com/ClickHouse/ClickHouse/pull/37826) ([Azat Khuzhin](https://github.com/azat)) 。
* (Experimental WINDOW VIEW) 在 WindowView 中执行 `ALTER TABLE ... MODIFY QUERY` 时，不应删除内部目标表。[#37879](https://github.com/ClickHouse/ClickHouse/pull/37879) ([vxider](https://github.com/Vxider)).
* 修复 clickhouse-keeper Docker 镜像中协调目录的目录所有权。修复了 [#37914](https://github.com/ClickHouse/ClickHouse/issues/37914)。[#37915](https://github.com/ClickHouse/ClickHouse/pull/37915) ([James Maidment](https://github.com/jamesmaidment)) 。
* 字典修复了包含 update 字段和 `{condition}` 的自定义查询问题。关闭 [#33746](https://github.com/ClickHouse/ClickHouse/issues/33746)。[#37947](https://github.com/ClickHouse/ClickHouse/pull/37947) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 修复了在应先对 `WITH FILL` 的结果再应用 `ORDER BY` 的情况下 (例如外层查询) ，`SELECT ... WITH FILL` 可能返回错误结果的问题。该错误是由针对 `ORDER BY` expression 的优化导致的 ([#35623](https://github.com/ClickHouse/ClickHouse/issues/35623)) 。关闭 [#37904](https://github.com/ClickHouse/ClickHouse/issues/37904)。[#37959](https://github.com/ClickHouse/ClickHouse/pull/37959) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* (Experimental WINDOW VIEW) 在向 WindowView 中的目标表推送数据时，添加缺失的默认列，修复了 [#37815](https://github.com/ClickHouse/ClickHouse/issues/37815)。[#37965](https://github.com/ClickHouse/ClickHouse/pull/37965) ([vxider](https://github.com/Vxider)) 。
* 修复了栈帧过大导致编译失败的问题。[#37996](https://github.com/ClickHouse/ClickHouse/pull/37996) ([Han Shukai](https://github.com/KinderRiven)) 。
* 启用 enable\_filesystem\_query\_cache\_limit 时，会抛出“预留缓存大小超过剩余缓存大小”异常。 [#38004](https://github.com/ClickHouse/ClickHouse/pull/38004) ([xiedeyantu](https://github.com/xiedeyantu)).
* 修复了 UNION 查询中的类型转换问题 (可能导致 LOGICAL\_ERROR) 。 [#34775](https://github.com/ClickHouse/ClickHouse/pull/34775) ([Azat Khuzhin](https://github.com/azat)).
* 如果 BackgroundExecutor 处于忙碌状态，生存时间 (TTL) merge 可能不会再次被调度。--merges\_with\_ttl\_counter 会在 selectPartsToMerge() 中增加；如果 BackgroundExecutor 处于忙碌状态，--merge 任务将被忽略；--merges\_with\_ttl\_counter 不会减少。 [#36387](https://github.com/ClickHouse/ClickHouse/pull/36387) ([lthaooo](https://github.com/lthaooo)).
* 修复 `normalize_function_names` 设置值被覆盖的问题。[#36937](https://github.com/ClickHouse/ClickHouse/pull/36937) ([李扬](https://github.com/taiyang-li)) 。
* 修复了指数时间衰减窗口函数的问题，现在会正确遵循窗口边界。[#36944](https://github.com/ClickHouse/ClickHouse/pull/36944) ([Vladimir Chebotarev](https://github.com/excitoon)).
* 修复读取 system.projection\_parts 和 system.projection\_parts\_columns 时可能出现的堆内存释放后仍被使用错误。此修复解决了 [#37184](https://github.com/ClickHouse/ClickHouse/issues/37184)。[#37185](https://github.com/ClickHouse/ClickHouse/pull/37185) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了 `DateTime64` 在 Unix 纪元之前的小数秒行为问题。[#37697](https://github.com/ClickHouse/ClickHouse/pull/37697) ([Andrey Zvonov](https://github.com/zvonand))。[#37039](https://github.com/ClickHouse/ClickHouse/pull/37039) ([李扬](https://github.com/taiyang-li))。

### <a id="225" /> ClickHouse 22.5 发行版，2022-05-19。 [演示文稿](https://presentations.clickhouse.com/2022-release-22.5/), [视频](https://www.youtube.com/watch?v=jkXmXrmjaKQ)

<Frame>
  <iframe src="https://www.youtube.com/embed/jkXmXrmjaKQ" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen />
</Frame>

<div id="upgrade-notes">
  #### 升级说明
</div>

* 现在，后台合并、变更和 `OPTIMIZE` 不再增加 `SelectedRows` 和 `SelectedBytes` 指标。它们 (仍然) 会像以前一样增加 `MergedRows` 和 `MergedUncompressedBytes`。这只会影响指标值，并使其更合理。此变更不会引入任何不兼容性，但你可能会注意到指标发生了变化，因此我们将其归入这一类别。[#37040](https://github.com/ClickHouse/ClickHouse/pull/37040) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 已将 BoringSSL 模块更新为官方的 FIPS 合规版本。这使 ClickHouse 符合 FIPS 要求。[#35914](https://github.com/ClickHouse/ClickHouse/pull/35914) ([Meena-Renganathan](https://github.com/Meena-Renganathan)). 加密算法 `aes-192-cfb128` 和 `aes-256-cfb128` 已被移除，因为它们不包含在通过 FIPS 认证的 BoringSSL 版本中。
* 已从 `users.xml` 中默认用户的 profile 里移除 `max_memory_usage` 设置。这样可为查询启用更灵活的内存限制，而不再使用旧的 10 GB 固定限制。
* 默认禁用 `log_query_threads` 设置。它用于记录参与查询执行的每个线程的统计信息。在支持异步读取后，不同线程 ID 的总数变得过大，写入 `query_thread_log` 的日志开销也变得过高。[#37077](https://github.com/ClickHouse/ClickHouse/pull/37077) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 移除存在缺陷的函数 `groupArraySorted`。[#36822](https://github.com/ClickHouse/ClickHouse/pull/36822) ([Alexey Milovidov](https://github.com/alexey-milovidov)).

<div id="new-feature-2">
  #### 新功能
</div>

* 默认启用内存 overcommit。[#35921](https://github.com/ClickHouse/ClickHouse/pull/35921) ([Dmitry Novik](https://github.com/novikd)) 。
* 在 GROUP BY 子句中新增对 GROUPING SETS 的支持。该实现支持并行处理 grouping sets。[#33631](https://github.com/ClickHouse/ClickHouse/pull/33631) ([Dmitry Novik](https://github.com/novikd)) 。
* 新增 `system.certificates` 表。[#37142](https://github.com/ClickHouse/ClickHouse/pull/37142) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* 新增 `h3Line`、`h3Distance` 和 `h3HexRing` 函数。[#37030](https://github.com/ClickHouse/ClickHouse/pull/37030) ([Bharat Nallan](https://github.com/bharatnc)) 。
* 新增基于单个 binary 的诊断工具 (clickhouse-diagnostics) 。[#36705](https://github.com/ClickHouse/ClickHouse/pull/36705) ([Dale McDiarmid](https://github.com/gingerwizard)) 。
* 新增输出格式 `Prometheus`。[#36051](https://github.com/ClickHouse/ClickHouse/issues/36051)。[#36206](https://github.com/ClickHouse/ClickHouse/pull/36206) ([Vladimir C](https://github.com/vdimir)) 。
* 新增 `MySQLDump` input format。它会从转储中读取属于同一张表的 INSERT 查询中的所有数据。如果包含多张表，则默认读取第一张表的数据。[#36667](https://github.com/ClickHouse/ClickHouse/pull/36667) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 在临时表的 `system.tables` 中显示 `total_rows` 和 `total_bytes` 字段。[#36401](https://github.com/ClickHouse/ClickHouse/issues/36401)。[#36439](https://github.com/ClickHouse/ClickHouse/pull/36439) ([xiedeyantu](https://github.com/xiedeyantu)) 。
* 允许使用查询级 Settings 覆盖 `parts_to_delay_insert` 和 `parts_to_throw_insert`。如果定义了这些设置，它们将覆盖表级 Settings。[#36371](https://github.com/ClickHouse/ClickHouse/pull/36371) ([Memo](https://github.com/Joeywzr)) 。

<div id="experimental-feature">
  #### Experimental 功能
</div>

* 为数组实现了 L1、L2、Linf、余弦距离函数，以及 L1、L2、Linf 范数函数。
  [#37033](https://github.com/ClickHouse/ClickHouse/pull/37033) ([qieqieplus](https://github.com/qieqieplus)). 注意：这些函数后续将重命名。
* 改进了 WindowView 中的 `WATCH` 查询：1. 通过调用 `fire_condition` 信号，降低返回查询结果的延迟。2. 通过更频繁地检查 `isCancelled()`，加快取消查询操作 (ctrl-c) 的响应速度。 [#37226](https://github.com/ClickHouse/ClickHouse/pull/37226) ([vxider](https://github.com/Vxider)).
* 增加了用于移除文件系统缓存的内部信息。 [#36802](https://github.com/ClickHouse/ClickHouse/pull/36802) ([Han Shukai](https://github.com/KinderRiven)).
* 为 SQL 新增了哈希函数 `wyHash64`。 [#36467](https://github.com/ClickHouse/ClickHouse/pull/36467) ([olevino](https://github.com/olevino)).
* 改进了 Replicated 数据库：新增 `SYSTEM SYNC DATABASE REPLICA` 查询，可用于同步 Replicated 数据库中的表元数据，因为当前同步是异步进行的。 [#35944](https://github.com/ClickHouse/ClickHouse/pull/35944) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* 改进了远程文件系统缓存：优化了从缓存读取的效果。 [#37054](https://github.com/ClickHouse/ClickHouse/pull/37054) ([Kseniia Sumarokova](https://github.com/kssenii)). 改进了 `SYSTEM DROP FILESYSTEM CACHE` 查询：增加了 `<path>` 选项和 `FORCE` 选项。 [#36639](https://github.com/ClickHouse/ClickHouse/pull/36639) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 改进了半结构化数据：允许将 `Object(...)` 类型的列转换为 `Object(Nullable(...))`。 [#36564](https://github.com/ClickHouse/ClickHouse/pull/36564) ([awakeljw](https://github.com/awakeljw)).
* 改进了并行副本：如果要在 localhost 副本上执行查询，会创建一个本地解释器；而在多个副本上执行查询时，则依赖已有连接，使副本能够与协调器通信。现在这一点已得到改进，localhost 副本可以在同一进程内直接与协调器通信。 [#36281](https://github.com/ClickHouse/ClickHouse/pull/36281) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).

<div id="performance-improvement">
  #### 性能改进
</div>

* 在不使用 GROUP BY 表达式的情况下，提升了 `avg`、`sum` 聚合函数的性能。[#37257](https://github.com/ClickHouse/ClickHouse/pull/37257) ([Maksim Kita](https://github.com/kitaisreal)).
* 通过动态分发提升了一元算术函数 (`bitCount`、`bitNot`、`abs`、`intExp2`、`intExp10`、`negate`、`roundAge`、`roundDuration`、`roundToExp2`、`sign`) 的性能。[#37289](https://github.com/ClickHouse/ClickHouse/pull/37289) ([Maksim Kita](https://github.com/kitaisreal)).
* 通过对排序列比较器进行 JIT 编译，提升了 ORDER BY、MergeJoin 以及向 MergeTree 插入数据时的性能。[#34469](https://github.com/ClickHouse/ClickHouse/pull/34469) ([Maksim Kita](https://github.com/kitaisreal)).
* 更改了 `system.asynchronous_metric_log` 的结构，占用空间减少约 10 倍。此更改关闭了 [#36357](https://github.com/ClickHouse/ClickHouse/issues/36357)。字段 `event_time_microseconds` 因无实际用途而被移除。[#36360](https://github.com/ClickHouse/ClickHouse/pull/36360) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 读取 wide parts 时，仅加载必要列的标记。[#36879](https://github.com/ClickHouse/ClickHouse/pull/36879) ([Anton Kozlov](https://github.com/tonickkozlov)).
* 通过缩小 mutex 的作用域，提升了文件描述符缓存的性能。[#36682](https://github.com/ClickHouse/ClickHouse/pull/36682) ([Anton Kozlov](https://github.com/tonickkozlov)).
* 当路径包含通配符且匹配的目录中包含大量文件时，提升了从存储 `File` 和 table function `file` 读取数据的性能。[#36647](https://github.com/ClickHouse/ClickHouse/pull/36647) ([Anton Popov](https://github.com/CurtizJ)).
* 对输入 format `HiveText` 启用并行 parsing，在读取本地文件时可将 HiveText parsing 速度提升 2 倍。[#36650](https://github.com/ClickHouse/ClickHouse/pull/36650) ([李扬](https://github.com/taiyang-li)).
* 默认的 `HashJoin` 在插入右表的行时不是线程安全的，因此只能以单线程运行。右表较大时，join 过程会因 CPU 利用率低而变得很慢。[#36415](https://github.com/ClickHouse/ClickHouse/pull/36415) ([lgbo](https://github.com/lgbo-ustc)).
* 允许将 `select countDistinct(a) from t` 重写为 `select count(1) from (select a from t groupBy a)`。[#35993](https://github.com/ClickHouse/ClickHouse/pull/35993) ([zhanglistar](https://github.com/zhanglistar)).
* 将 OR LIKE chain 转换为 multiMatchAny。待我们对其效果更有信心后会启用该功能。[#34932](https://github.com/ClickHouse/ClickHouse/pull/34932) ([Daniel Kutenin](https://github.com/danlark1)).
* 通过内联提升了部分函数的性能。[#34544](https://github.com/ClickHouse/ClickHouse/pull/34544) ([Daniel Kutenin](https://github.com/danlark1)).
* 添加了一个分支，以避免 readBig 中不必要的 memcpy，从而在一定程度上提升性能。[#36095](https://github.com/ClickHouse/ClickHouse/pull/36095) ([jasperzhu](https://github.com/jinjunzh)).
* 为 optimize\_aggregation\_in\_order 实现了部分 GROUP BY 键。[#35111](https://github.com/ClickHouse/ClickHouse/pull/35111) ([Azat Khuzhin](https://github.com/azat)).

<div id="improvement">
  #### 改进
</div>

* 在执行表函数 `file`、`s3` 和 `url` 时，如发生解析错误，将显示出错文件的名称。[#36314](https://github.com/ClickHouse/ClickHouse/pull/36314) ([Anton Popov](https://github.com/CurtizJ)).
* 如果在线程数是在顶层配置中指定的，则现在允许在运行时增加用于执行后台操作 (合并、变更、移动和拉取) 的线程数。[#36425](https://github.com/ClickHouse/ClickHouse/pull/36425) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 现在，对于会生成早于 1970-01-01 00:00:00 且使用非整小时/分钟时区的时间的日期时间转换函数，将不再发生溢出，而是饱和到零。这是对 [https://github.com/ClickHouse/ClickHouse/pull/29953](https://github.com/ClickHouse/ClickHouse/pull/29953) 的延续，旨在解决 [https://github.com/ClickHouse/ClickHouse/pull/29953#discussion\&#95;r800550280](https://github.com/ClickHouse/ClickHouse/pull/29953#discussion\&#95;r800550280) 中提出的问题。之所以将其标记为改进，是因为这是实现定义的行为 (且极为罕见) ，允许对此进行破坏性变更。[#36656](https://github.com/ClickHouse/ClickHouse/pull/36656) ([Amos Bird](https://github.com/amosbird)).
* 如果有人以 "test" 日志级别运行 clickhouse-server，则添加一条警告。"test" 日志级别是最近新增的，由于会导致不可避免、无法规避、致命且危及生命的性能下降，因此不能用于生产环境。[#36824](https://github.com/ClickHouse/ClickHouse/pull/36824) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 在 CREATE TABLE 中解析排序规则时，可抛出异常或忽略。关闭了 [#35892](https://github.com/ClickHouse/ClickHouse/issues/35892)。[#36271](https://github.com/ClickHouse/ClickHouse/pull/36271) ([yuuch](https://github.com/yuuch)) 。
* 选项 `compatibility_ignore_auto_increment_in_create_table` 支持在列声明中忽略 `AUTO_INCREMENT` 关键字，从而简化从 MySQL 迁移的过程。[#37178](https://github.com/ClickHouse/ClickHouse/pull/37178) ([Igor Nikonov](https://github.com/devcrafter)) 。
* 为 `JSONEachRow` 增加别名 `JSONLines` 和 `NDJSON`。关闭 [#36303](https://github.com/ClickHouse/ClickHouse/issues/36303)。[#36327](https://github.com/ClickHouse/ClickHouse/pull/36327) ([flynn](https://github.com/ucasfl)) 。
* 限制每个 Hive 表可查询的最大分区数，避免资源超限。[#37281](https://github.com/ClickHouse/ClickHouse/pull/37281) ([lgbo](https://github.com/lgbo-ustc)).
* 为提升易用性，已为 `h3kRing` 函数的第二个参数添加隐式类型转换。关闭了 [#35432](https://github.com/ClickHouse/ClickHouse/issues/35432)。[#37189](https://github.com/ClickHouse/ClickHouse/pull/37189) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 修复了 `clickhouse-local` 中任意查询的 `INSERT SELECT` 进度显示问题，以及客户端中的文件进度显示问题，使文件进度更准确。[#37075](https://github.com/ClickHouse/ClickHouse/pull/37075) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复了一个 bug：在删除 parts 期间如果发生文件系统故障，可能导致 MergeTree 表引擎家族中遗漏过期分区片段。修复前，只有在服务器第一次重启后才会将其删除。[#37014](https://github.com/ClickHouse/ClickHouse/pull/37014) ([alesapin](https://github.com/alesapin)).
* 实现了一种新的行策略处理模式，可在主配置中启用；该模式允许没有宽松行策略的用户读取数据行。[#36997](https://github.com/ClickHouse/ClickHouse/pull/36997) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* Play UI：表格单元格中的 Nullable 数值现在将右对齐。此更改关闭了 [#36982](https://github.com/ClickHouse/ClickHouse/issues/36982)。[#36988](https://github.com/ClickHouse/ClickHouse/pull/36988) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* Play UI：如果结果中只有一行且列数较多，则以纵向方式显示结果。[#36811](https://github.com/ClickHouse/ClickHouse/issues/36811) 的后续改进。[#36842](https://github.com/ClickHouse/ClickHouse/pull/36842) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 清理了 Play UI 中的 CSS。像素分布更加均匀。改进了表格单元格中长内容的可用性。[#36569](https://github.com/ClickHouse/ClickHouse/pull/36569) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 在发生异常时完成写入缓冲区的处理，以避免在析构函数中执行这些操作。希望这能修复：[#36907](https://github.com/ClickHouse/ClickHouse/issues/36907)。[#36979](https://github.com/ClickHouse/ClickHouse/pull/36979) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 在 [#36425](https://github.com/ClickHouse/ClickHouse/issues/36425) 之后，`background_fetches_pool_size` 这类设置已废弃，并且可以出现在顶层配置中，但 ClickHouse 仍会抛出类似 `Error updating configuration from '/etc/clickhouse-server/config.xml' config.: Code: 137. DB::Exception: A setting 'background_fetches_pool_size' appeared at top level in config /etc/clickhouse-server/config.xml.` 的异常。此问题已修复。[#36917](https://github.com/ClickHouse/ClickHouse/pull/36917) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 向其他服务器发送异常时，如适用，会附加额外的诊断信息。[#36872](https://github.com/ClickHouse/ClickHouse/pull/36872) ([tavplubix](https://github.com/tavplubix)).
* 允许对 `Array(Tuple(..))` 类型的参数执行哈希函数。[#36812](https://github.com/ClickHouse/ClickHouse/pull/36812) ([Anton Popov](https://github.com/CurtizJ)) 。
* 新增了 `user_defined_path` 配置项。[#36753](https://github.com/ClickHouse/ClickHouse/pull/36753) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 允许在 `s3Cluster` 表函数中使用 cluster 宏。[#36726](https://github.com/ClickHouse/ClickHouse/pull/36726) ([Vadim Volodin](https://github.com/PolyProgrammist)).
* 在 `clickhouse-client`/`clickhouse-local` 中可正确取消 INSERT 查询。 [#36710](https://github.com/ClickHouse/ClickHouse/pull/36710) ([Azat Khuzhin](https://github.com/azat)).
* 允许在 `MySQLHandler` 中取消查询，同时仍保留合理的查询 id。[#36699](https://github.com/ClickHouse/ClickHouse/pull/36699) ([Amos Bird](https://github.com/amosbird)) 。
* 在 `system.processes` 中添加 `is_all_data_sent` 列，并基于该列改进内部测试中的加固检查。[#36649](https://github.com/ClickHouse/ClickHouse/pull/36649) ([Azat Khuzhin](https://github.com/azat)) 。
* 关于从 S3 读取耗时的指标现在已能正确计算。关闭了 [#35483](https://github.com/ClickHouse/ClickHouse/issues/35483)。[#36572](https://github.com/ClickHouse/ClickHouse/pull/36572) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 如果在 clickhouse-local 中运行，则允许在表函数 file 中使用文件描述符。[#36562](https://github.com/ClickHouse/ClickHouse/pull/36562) ([wuxiaobai24](https://github.com/wuxiaobai24)) 。
* 允许元组元素名称以数字开头。 [#36544](https://github.com/ClickHouse/ClickHouse/pull/36544) ([Anton Popov](https://github.com/CurtizJ)).
* 现在，clickhouse-benchmark 已可从环境变量中读取身份验证信息。[#36497](https://github.com/ClickHouse/ClickHouse/pull/36497) ([Anton Kozlov](https://github.com/tonickkozlov)) 。
* `clickhouse-keeper` 改进：新增对强制恢复的支持，可在无需 quorum 的情况下重新配置 cluster。[#36258](https://github.com/ClickHouse/ClickHouse/pull/36258) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 改进对 JSON 对象的 schema 推断。[#36207](https://github.com/ClickHouse/ClickHouse/pull/36207) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 重构了结合通配符进行 schema inference 的相关代码。只有在确有必要时，才会尝试通配符匹配到的下一个文件 (此前只要发生任何错误，都会尝试下一个文件) 。此外，这还修复了 [#36317](https://github.com/ClickHouse/ClickHouse/issues/36317)。[#36205](https://github.com/ClickHouse/ClickHouse/pull/36205) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 新增独立的 `CLUSTER` grant (以及 `access_control_improvements.on_cluster_queries_require_cluster_grant` 配置指令；为保持向后兼容，默认值为 `false`) 。[#35767](https://github.com/ClickHouse/ClickHouse/pull/35767) ([Azat Khuzhin](https://github.com/azat)) 。
* 如果在选定查询停止之前就有了所需的内存，所有等待中的查询都会继续执行。现在，如果在选定查询得知已被取消之前内存已被释放，我们就不会停止任何查询。[#35637](https://github.com/ClickHouse/ClickHouse/pull/35637) ([Dmitry Novik](https://github.com/novikd)).
* 在 protobuf 中检测 Nullable。在 proto3 中，默认值不会在线路上传输。这使得对于 Nullable 列，区分 NULL 值和默认值并非易事。处理这一问题的标准方法，是使用 Google wrappers 将目标值封装在内部消息中 (参见 [https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/wrappers.proto](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/wrappers.proto)) 。在这种情况下，缺失的字段会被解释为 NULL 值；字段存在但值缺失时，会被解释为默认值；字段具有常规值时，则会被解释为常规值。然而，ClickHouse 会将 Google wrappers 解释为嵌套列。我们提议引入一种特殊行为，用于检测 Google wrappers，并按照上述说明对其进行解释。例如，要为 Nullable 列 `test` 序列化值，我们会在 .proto schema 中使用 `google.protobuf.StringValue test`。请注意，这些类型就是 Protobuf 中所谓的“well-known types”，由库本身实现。[#35149](https://github.com/ClickHouse/ClickHouse/pull/35149) ([Jakub Kuklis](https://github.com/jkuklis)).
* 新增支持在预定义和静态 HTTP 处理程序配置中指定 `content_type`。[#34916](https://github.com/ClickHouse/ClickHouse/pull/34916) ([Roman Nikonov](https://github.com/nic11)) 。
* 如果在前面未加 `--external` 的情况下使用 `clickhouse-client --file`，则会正确发出警告。关闭 [#34747](https://github.com/ClickHouse/ClickHouse/issues/34747)。[#34765](https://github.com/ClickHouse/ClickHouse/pull/34765) ([李扬](https://github.com/taiyang-li)) 。
* 改进 MySQL 数据库引擎，使其兼容 binary(0) 数据类型。[#37232](https://github.com/ClickHouse/ClickHouse/pull/37232) ([zzsmdfj](https://github.com/zzsmdfj)) 。
* 改进了 clickhouse-benchmark 的 JSON 报告。[#36473](https://github.com/ClickHouse/ClickHouse/pull/36473) ([Tian Xinhui](https://github.com/xinhuitian)) 。
* 如果无法解析外部 ClickHouse 字典的主机名，服务器可能会拒绝启动。该问题现已修复。修复了 [#36451](https://github.com/ClickHouse/ClickHouse/issues/36451)。[#36463](https://github.com/ClickHouse/ClickHouse/pull/36463) ([tavplubix](https://github.com/tavplubix)) 。

<div id="buildtestingpackaging-improvement">
  #### 构建/测试/打包改进
</div>

* 现在，`x86_64` 架构的 `clickhouse-keeper` 已静态链接到 [musl](https://musl.libc.org/)，不再依赖任何系统库。[#31833](https://github.com/ClickHouse/ClickHouse/pull/31833) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 现在可通过通用安装脚本 `curl https://clickhouse.com/ | sh` 和直接链接 `https://builds.clickhouse.com/master/powerpc64le/clickhouse` 获取 `PowerPC64LE` 架构的 ClickHouse 构建。[#37095](https://github.com/ClickHouse/ClickHouse/pull/37095) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 将 PowerPC 代码生成限制为 Power8，以提升兼容性。此更改关闭了 [#36025](https://github.com/ClickHouse/ClickHouse/issues/36025)。[#36529](https://github.com/ClickHouse/ClickHouse/pull/36529) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 简化了性能测试。这样我们就有机会使用它了。[#36769](https://github.com/ClickHouse/ClickHouse/pull/36769) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 如果报告中出现错误，则判定性能比较失败。[#34797](https://github.com/ClickHouse/ClickHouse/pull/34797) ([Mikhail f. Shiryaev](https://github.com/Felixoid)).
* 为 Arrow 添加 ZSTD 支持。此更改修复了 [#35283](https://github.com/ClickHouse/ClickHouse/issues/35283)。[#35486](https://github.com/ClickHouse/ClickHouse/pull/35486) ([Sean Lafferty](https://github.com/seanlaff)).

<div id="bug-fix">
  #### 问题修复
</div>

* 如果 URI 中包含 Version ID，则将其提取出来，并将请求添加到 AWS HTTP URI。已关闭 [#31221](https://github.com/ClickHouse/ClickHouse/issues/31221)。 - \[x] 如果 URI 中包含 `Version ID`，则将其提取出来，并在重新组装 URI 时将其排除。 - \[x] 使用请求配置 `AWS HTTP URI` 对象。 - \[x] 单元测试：[`gtest_s3_uri`](https://github.com/ClickHouse/ClickHouse/blob/2340a6c6849ebc05a8efbf97ba8de3ff9dc0eff4/src/IO/tests/gtest_s3_uri.cpp) - \[x] 删除 instrumentation 提交。[#34571](https://github.com/ClickHouse/ClickHouse/pull/34571) ([Saad Ur Rahman](https://github.com/surahman)).
* 修复 system.opentelemetry\_span\_log 中 attribute.values 的别名错误：应为 values，而不是 keys。[#37275](https://github.com/ClickHouse/ClickHouse/pull/37275) ([Aleksandr Razumov](https://github.com/ernado)) 。
* 修复了 Nullable(String) 到 Nullable(Bool/IPv4/IPv6) 的转换问题。关闭了 [#37221](https://github.com/ClickHouse/ClickHouse/issues/37221)。[#37270](https://github.com/ClickHouse/ClickHouse/pull/37270) ([Kruglov Pavel](https://github.com/Avogar)).
* Experimental 功能：修复了在包含 `Object` 类型列的表中执行变更时的问题。现在，已允许在 `UPDATE` 或 `DELETE` 查询的 `WHERE` 表达式中使用 `Object` 类型的子列，也允许对单独的子列执行 (`DROP`、`MODIFY`) 操作。修复了 [#37205](https://github.com/ClickHouse/ClickHouse/issues/37205)。[#37266](https://github.com/ClickHouse/ClickHouse/pull/37266) ([Anton Popov](https://github.com/CurtizJ)).
* Kafka 在 producer 阶段不需要 `group.id`。你可以在控制台日志中看到描述该问题的 Warning：`2022.05.15 17:59:13.270227 [ 137 ] {} <Warning> StorageKafka (topic-name): [rdk:CONFWARN] [thrd:app]: Configuration property group.id is a consumer property and will be ignored by this producer instance`。[#37228](https://github.com/ClickHouse/ClickHouse/pull/37228) ([Mark Andreev](https://github.com/mrk-andreev)) 。
* Experimental 功能 (WindowView) ：在块实际触发后才更新 `max_fired_watermark `，以防删除尚未触发的数据。[#37225](https://github.com/ClickHouse/ClickHouse/pull/37225) ([vxider](https://github.com/Vxider)).
* 修复分布式查询在使用 LIMIT BY 时出现的“Cannot create column of type Set”问题。[#37193](https://github.com/ClickHouse/ClickHouse/pull/37193) ([Azat Khuzhin](https://github.com/azat)) 。
* Experimental 功能：现在，WindowView `WATCH EVENTS` 查询不再会因 `WindowViewSource.h:58` 中创建的非空 Chunk 而被终止。[#37182](https://github.com/ClickHouse/ClickHouse/pull/37182) ([vxider](https://github.com/Vxider)) 。
* 为子查询启用 `enable_global_with_statement`，解决 [#37141](https://github.com/ClickHouse/ClickHouse/issues/37141)。[#37166](https://github.com/ClickHouse/ClickHouse/pull/37166) ([Vladimir C](https://github.com/vdimir)) 。
* 修复 optimize\_skip\_unused\_shards\_rewrite\_in 的隐式类型转换。 [#37153](https://github.com/ClickHouse/ClickHouse/pull/37153) ([Azat Khuzhin](https://github.com/azat)).
* 对 FixedString 列使用 ILIKE 函数时，可能会返回错误结果 (即匹配结果少于应有的数量) 。[#37117](https://github.com/ClickHouse/ClickHouse/pull/37117) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 修复了对 `AggregateFunction` 类型列执行 `GROUP BY` 时的问题。[#37093](https://github.com/ClickHouse/ClickHouse/pull/37093) ([Azat Khuzhin](https://github.com/azat)) 。
* Experimental 功能：修复了 optimize\_aggregation\_in\_order 在使用前缀 GROUP BY 和 \*Array 聚合函数时的问题。[#37050](https://github.com/ClickHouse/ClickHouse/pull/37050) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了某些带隐式聚合的 INSERT SELECT 查询性能下降的问题。修复了 [#36792](https://github.com/ClickHouse/ClickHouse/issues/36792)。[#37047](https://github.com/ClickHouse/ClickHouse/pull/37047) ([tavplubix](https://github.com/tavplubix)) 。
* Experimental 功能：修复按序 `GROUP BY` (`optimize_aggregation_in_order=1`) 与 `*Array` (`groupArrayArray`/...) 聚合函数配合使用时的问题。[#37046](https://github.com/ClickHouse/ClickHouse/pull/37046) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了当索引类型不是 UInt8 时，LowCardinality->ArrowDictionary 输出无效的问题。关闭 [#36832](https://github.com/ClickHouse/ClickHouse/issues/36832)。[#37043](https://github.com/ClickHouse/ClickHouse/pull/37043) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复了 `quantileTDigest` 中出现无穷大值的问题。修复 [#32107](https://github.com/ClickHouse/ClickHouse/issues/32107)。[#37021](https://github.com/ClickHouse/ClickHouse/pull/37021) ([Vladimir Chebotarev](https://github.com/excitoon)) 。
* 修复了在 HedgedConnections 中，当 max\_parallel\_replicas != 1 时发送外部表数据的问题。[#36981](https://github.com/ClickHouse/ClickHouse/pull/36981) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复了 `Replicated` database 中 `TRUNCATE` 查询的逻辑错误。已修复 [#33747](https://github.com/ClickHouse/ClickHouse/issues/33747)。[#36976](https://github.com/ClickHouse/ClickHouse/pull/36976) ([tavplubix](https://github.com/tavplubix)).
* Experimental 功能：修复在 WindowView 中删除源表时卡住的问题。关闭 [#35678](https://github.com/ClickHouse/ClickHouse/issues/35678)。 [#36967](https://github.com/ClickHouse/ClickHouse/pull/36967) ([vxider](https://github.com/Vxider)) 。
* Experimental 功能 (rocksdb cache) ：修复了问题：[#36671](https://github.com/ClickHouse/ClickHouse/issues/36671)。[#36929](https://github.com/ClickHouse/ClickHouse/pull/36929) ([李扬](https://github.com/taiyang-li)).
* Experimental 功能：通过添加转换操作，修复了在 WindowView 中使用多列时出现的问题，从而可以用略有不同的 schema 调用`writeIntoWindowView`。[#36928](https://github.com/ClickHouse/ClickHouse/pull/36928) ([vxider](https://github.com/Vxider)).
* 修复了 clickhouse-keeper 中的一个 bug：在负载较低且发生重启时，可能导致压缩日志文件损坏。 [#36910](https://github.com/ClickHouse/ClickHouse/pull/36910) ([alesapin](https://github.com/alesapin)).
* 修复进行常量聚合时查询结果不正确的问题。此修复解决了 [#36728](https://github.com/ClickHouse/ClickHouse/issues/36728)。[#36888](https://github.com/ClickHouse/ClickHouse/pull/36888) ([Amos Bird](https://github.com/amosbird)) 。
* Experimental 功能：修复 cache 中 `current_size` 计数不准确的问题。[#36887](https://github.com/ClickHouse/ClickHouse/pull/36887) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* Experimental 功能：修复带有 hop window 的 window view 中 fire 触发的问题 [#34044](https://github.com/ClickHouse/ClickHouse/issues/34044)。[#36861](https://github.com/ClickHouse/ClickHouse/pull/36861) ([vxider](https://github.com/Vxider)) 。
* Experimental 功能：修复远程文件系统缓存缓冲区中的错误类型转换。[#36809](https://github.com/ClickHouse/ClickHouse/pull/36809) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 修复了在 `flatten_nested = 0` 时创建表的问题。此前，未扁平化的 `Nested` 列在服务器重启后可能会被扁平化。[#36803](https://github.com/ClickHouse/ClickHouse/pull/36803) ([Anton Popov](https://github.com/CurtizJ)).
* 修复了从远程文件系统异步读取低基数数据时出现的一些问题。[#36763](https://github.com/ClickHouse/ClickHouse/pull/36763) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Experimental 功能：修复了通过带通配符的表函数 `file` 等方式从多个文件向 `Object` 类型的列插入数据时的问题。[#36762](https://github.com/ClickHouse/ClickHouse/pull/36762) ([Anton Popov](https://github.com/CurtizJ)).
* 修复 Hedged 请求中的超时问题。发送远程查询后，如果连接立即卡住，可能会导致一直等待。[#36749](https://github.com/ClickHouse/ClickHouse/pull/36749) ([Kruglov Pavel](https://github.com/Avogar)).
* Experimental 功能：修复了 `groupBitmapAndState`/`groupBitmapOrState`/`groupBitmapXorState` 在分布式表上的一个 bug。[#36739](https://github.com/ClickHouse/ClickHouse/pull/36739) ([Zhang Yifan](https://github.com/zhangyifan27)) 。
* Experimental 功能：在 [PR](https://github.com/ClickHouse/ClickHouse/pull/36376) 中的 [测试](https://s3.amazonaws.com/clickhouse-test-reports/36376/1cb1c7275cb53769ab826772db9b71361bb3e413/stress_test__thread__actions_/clickhouse-server.clean.log) 期间，我发现某个缓存类被初始化了两次，从而抛出异常。虽然这个问题的原因尚不清楚，但 ClickHouse 中应该存在重复加载 disk 的代码逻辑，因此我们需要对这种情况做特殊判断。[#36737](https://github.com/ClickHouse/ClickHouse/pull/36737) ([Han Shukai](https://github.com/KinderRiven)) 。
* 修复 wide parts 中垂直合并的问题。此前在合并过程中可能会抛出异常 `There is no column`。[#36707](https://github.com/ClickHouse/ClickHouse/pull/36707) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复端口变更时 server 重载的问题 (不要等待 query context 中的现有连接) 。[#36700](https://github.com/ClickHouse/ClickHouse/pull/36700) ([Azat Khuzhin](https://github.com/azat)) 。
* Experimental 功能：在之前的 [PR](https://github.com/ClickHouse/ClickHouse/pull/36376) 中，我发现测试 (无状态测试、flaky check (address、actions) ) 会出现超时。此外，在本地测试时也可能触发不稳定的系统死锁问题。即使使用 master 的最新源代码，这个问题仍然存在。[#36697](https://github.com/ClickHouse/ClickHouse/pull/36697) ([Han Shukai](https://github.com/KinderRiven)) 。
* Experimental 功能：修复缓存配置变更时服务器重启的问题。[#36685](https://github.com/ClickHouse/ClickHouse/pull/36685) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复 schema inference 中可能出现的堆内存释放后仍被使用的问题。关闭 [#36661](https://github.com/ClickHouse/ClickHouse/issues/36661)。[#36679](https://github.com/ClickHouse/ClickHouse/pull/36679) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了在未指定 engine 时，`CREATE` 查询中 Settings 的解析问题。另修复了 [https://github.com/ClickHouse/ClickHouse/pull/34187#issuecomment-1103812419。](https://github.com/ClickHouse/ClickHouse/pull/34187#issuecomment-1103812419。) [#36642](https://github.com/ClickHouse/ClickHouse/pull/36642) ([tavplubix](https://github.com/tavplubix)).
* Experimental 功能：修复了 `Object` 类型 wide parts 的合并问题。[#36637](https://github.com/ClickHouse/ClickHouse/pull/36637) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了默认表达式跟在 EPHEMERAL 之后且不是字面量时的格式崩溃问题。关闭了 [#36618](https://github.com/ClickHouse/ClickHouse/issues/36618)。[#36633](https://github.com/ClickHouse/ClickHouse/pull/36633) ([flynn](https://github.com/ucasfl)).
* 修复了在 `ENGINE = MergeTree` 表上使用 `INTERPOLATE` 时可能出现的 `Missing column` 异常。[#36549](https://github.com/ClickHouse/ClickHouse/pull/36549) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* 修复了在 join 查询的 `WHERE` 子句中使用字面量时可能出现的错误。关闭 [#36279](https://github.com/ClickHouse/ClickHouse/issues/36279)。[#36542](https://github.com/ClickHouse/ClickHouse/pull/36542) ([Vladimir C](https://github.com/vdimir)) 。
* 修复 `ReadBufferFromEncryptedFile` 中的 offset 更新问题，该问题可能导致未定义行为。[#36493](https://github.com/ClickHouse/ClickHouse/pull/36493) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复 Keeper 集群配置中 hostname 的合理性检查。新增 `keeper_server.host_checks_enabled` 配置，用于启用或禁用这些检查。[#36492](https://github.com/ClickHouse/ClickHouse/pull/36492) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 修复了在 GROUP BY 中使用可执行用户自定义函数的问题。此前，可执行用户自定义函数不能作为 GROUP BY 中的表达式使用。关闭 [#36448](https://github.com/ClickHouse/ClickHouse/issues/36448)。[#36486](https://github.com/ClickHouse/ClickHouse/pull/36486) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 修复了客户端在收到来自服务器的未知数据包时可能出现的异常。[#36481](https://github.com/ClickHouse/ClickHouse/pull/36481) ([Kseniia Sumarokova](https://github.com/kssenii)).
* Experimental 功能 (请务必不要使用 `system.session_log`，该功能即将被移除) ：为 system.session\_log 表补充缺失的枚举值。关闭 [#36474](https://github.com/ClickHouse/ClickHouse/issues/36474)。[#36480](https://github.com/ClickHouse/ClickHouse/pull/36480) ([Memo](https://github.com/Joeywzr)) 。
* 修复了 s3Cluster schema 推断中的一个 bug，该问题导致从 s3Cluster 执行 select 时无法读取全部数据。该 bug 出现在 [https://github.com/ClickHouse/ClickHouse/pull/35544。](https://github.com/ClickHouse/ClickHouse/pull/35544。) [#36434](https://github.com/ClickHouse/ClickHouse/pull/36434) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复 JOIN 和 COLUMNS 匹配器中的 nullptr 解引用问题，解决了 [#36416](https://github.com/ClickHouse/ClickHouse/issues/36416)。此修复对应 [https://github.com/ClickHouse/ClickHouse/pull/36417。\[#36430](https://github.com/ClickHouse/ClickHouse/pull/36417。\[#36430)]\([https://github.com/ClickHouse/ClickHouse/pull/36430](https://github.com/ClickHouse/ClickHouse/pull/36430)) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了 `ClickHouseDictionarySource` 包含标量子查询时字典重新加载的问题。[#36390](https://github.com/ClickHouse/ClickHouse/pull/36390) ([lthaooo](https://github.com/lthaooo)) 。
* 修复 JOIN 中的断言错误，关闭 [#36199](https://github.com/ClickHouse/ClickHouse/issues/36199)。[#36201](https://github.com/ClickHouse/ClickHouse/pull/36201) ([Vladimir C](https://github.com/vdimir)).
* 在特殊运算符中使用别名的查询会返回解析错误 (22.1 版本中存在此问题) 。示例：`SELECT substring('test' AS t, 1, 1)`. [#36167](https://github.com/ClickHouse/ClickHouse/pull/36167) ([Maksim Kita](https://github.com/kitaisreal)).
* Experimental 功能：修复将带有嵌套数组的复杂 JSON 插入 `Object` 类型列时的问题。[#36077](https://github.com/ClickHouse/ClickHouse/pull/36077) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复在存在 compact parts 时，对嵌套列执行 ALTER DROP COLUMN 的问题 (即当存在列 `n.d` 时，执行 `ALTER TABLE x DROP COLUMN n`) 。[#35797](https://github.com/ClickHouse/ClickHouse/pull/35797) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复当 `offset` 和 `length` 为负常量且 `s` 不是常量时，子串函数中的范围错误长度问题。[#33861](https://github.com/ClickHouse/ClickHouse/pull/33861) ([RogerYK](https://github.com/RogerYK)).

### <a id="224" /> ClickHouse 22.4 发行版，2022-04-19。[演示文稿](https://presentations.clickhouse.com/2022-release-22.4/), [视频](https://www.youtube.com/watch?v=aFQs_zoYoXY)

<Frame>
  <iframe src="https://www.youtube.com/embed/aFQs_zoYoXY" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen />
</Frame>

<div id="backward-incompatible-change">
  #### 向后不兼容的变更
</div>

* 不再允许在 INSERT 查询中于 FORMAT 之后使用 SETTINGS (可通过兼容性设置 `allow_settings_after_format_in_insert` 接受此类查询，但默认关闭) 。[#35883](https://github.com/ClickHouse/ClickHouse/pull/35883) ([Azat Khuzhin](https://github.com/azat)).
* 函数 `yandexConsistentHash` (Konstantin "kostik" Oblakov 提出的一致性哈希算法) 已重命名为 `kostikConsistentHash`。为保持兼容性，旧名称仍保留为别名。虽然这一变更向后兼容，但我们可能会在后续版本中移除此别名，因此建议你更新应用中对此函数的用法。[#35553](https://github.com/ClickHouse/ClickHouse/pull/35553) ([Alexey Milovidov](https://github.com/alexey-milovidov)).

<div id="new-feature-2">
  #### 新功能
</div>

* 为 ORDER BY ... WITH FILL 新增了 INTERPOLATE 扩展。已关闭 [#34903](https://github.com/ClickHouse/ClickHouse/issues/34903)。[#35349](https://github.com/ClickHouse/ClickHouse/pull/35349) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* 处理器级别的性能分析 (启用 `log_processors_profiles` 设置后，ClickHouse 会将处理器在执行期间及等待数据时耗费的时间写入 `system.processors_profile_log` 表) 。[#34355](https://github.com/ClickHouse/ClickHouse/pull/34355) ([Azat Khuzhin](https://github.com/azat)) 。
* 新增了函数 makeDate(year, month, day) 和 makeDate32(year, month, day)。[#35628](https://github.com/ClickHouse/ClickHouse/pull/35628) ([Alexander Gololobov](https://github.com/davenger)) 。实现了 makeDateTime() 和 makeDateTIme64()。[#35934](https://github.com/ClickHouse/ClickHouse/pull/35934) ([Alexander Gololobov](https://github.com/davenger)) 。
* 支持新增配额类型 `WRITTEN BYTES`，用于限制 `insert` 查询期间写入的字节数。[#35736](https://github.com/ClickHouse/ClickHouse/pull/35736) ([Anton Popov](https://github.com/CurtizJ)) 。
* 新增函数 `flattenTuple`。它接收嵌套的具名 `Tuple` 作为参数，并返回一个扁平化后的 `Tuple`，其元素为原始 `Tuple` 中的各个路径。例如：`Tuple(a Int, Tuple(b Int, c Int)) -> Tuple(a Int, b Int, c Int)`。`flattenTuple` 可用于将 `Object` 类型中的所有路径作为单独的列进行选择。[#35690](https://github.com/ClickHouse/ClickHouse/pull/35690) ([Anton Popov](https://github.com/CurtizJ)).
* 新增函数 `arrayFirstOrNull` 和 `arrayLastOrNull`。解决了 [#35238](https://github.com/ClickHouse/ClickHouse/issues/35238)。[#35414](https://github.com/ClickHouse/ClickHouse/pull/35414) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 新增函数 `minSampleSizeContinous` 和 `minSampleSizeConversion`。贡献者：[achimbab](https://github.com/achimbab)。[#35360](https://github.com/ClickHouse/ClickHouse/pull/35360) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 新增函数 minSampleSizeContinous 和 minSampleSizeConversion。 [#34354](https://github.com/ClickHouse/ClickHouse/pull/34354) ([achimbab](https://github.com/achimbab)).
* 引入 `ProtobufList` 格式 (在输出的 Protobuf 中，所有记录均作为重复消息) 。关闭 [#16436](https://github.com/ClickHouse/ClickHouse/issues/16436)。[#35152](https://github.com/ClickHouse/ClickHouse/pull/35152) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 新增 `h3PointDistM`、`h3PointDistKm`、`h3PointDistRads`、`h3GetRes0Indexes`、`h3GetPentagonIndexes` 函数。[#34568](https://github.com/ClickHouse/ClickHouse/pull/34568) ([Bharat Nallan](https://github.com/bharatnc)) 。
* 新增 `toLastDayOfMonth` 函数，用于将日期或日期时间向上舍入为当月最后一天。[#33501](https://github.com/ClickHouse/ClickHouse/issues/33501)。[#34394](https://github.com/ClickHouse/ClickHouse/pull/34394) ([Habibullah Oladepo](https://github.com/holadepo)) 。
* 为 \[Zoo]Keeper 客户端新增了负载均衡设置。已关闭 [#29617](https://github.com/ClickHouse/ClickHouse/issues/29617)。[#30325](https://github.com/ClickHouse/ClickHouse/pull/30325) ([小路](https://github.com/nicelulu)).
* 新增一种名为 `simple` 的行策略。在此 PR 之前，我们有两种行策略：`permissive` 和 `restrictive`。`simple` 行策略会为表新增一个过滤器，不会像 permissive 和 restrictive 策略那样产生任何副作用。[#35345](https://github.com/ClickHouse/ClickHouse/pull/35345) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 新增支持在 Replicated 数据库中指定集群密钥。[#35333](https://github.com/ClickHouse/ClickHouse/pull/35333) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 在服务器启动时增加了基本检查 (如可用内存和磁盘空间、最大线程数等) 。[#34566](https://github.com/ClickHouse/ClickHouse/pull/34566) ([Sergei Trifonov](https://github.com/serxa)) 。
* INTERVAL 改进——现可与 `[MILLI|MICRO|NANO]SECOND` 搭配使用。新增 `toStartOf[Milli|Micro|Nano]second()` 函数。新增 `[add|subtract][Milli|Micro|Nano]seconds()`。[#34353](https://github.com/ClickHouse/ClickHouse/pull/34353) ([Andrey Zvonov](https://github.com/zvonand)) 。

<div id="experimental-feature">
  #### Experimental 功能
</div>

* 为简单 `MergeTree` 表新增了事务支持。该功能仍处于高度实验阶段，不建议用于生产环境。属于 [#22086](https://github.com/ClickHouse/ClickHouse/issues/22086) 的一部分。[#24258](https://github.com/ClickHouse/ClickHouse/pull/24258) ([tavplubix](https://github.com/tavplubix))。
* 为 `JSONEachRow` 格式中的 `Object` 类型支持 schema inference。允许将 `Map` 类型的列转换为 `Object` 类型的列。[#35629](https://github.com/ClickHouse/ClickHouse/pull/35629) ([Anton Popov](https://github.com/CurtizJ))。
* 允许在所有写入操作中写入远程文件系统缓存。新增 `system.remote_filesystem_cache` 表。新增 `drop remote filesystem cache` 查询。通过 `system.remote_data_paths` 表增加对 S3 元数据的内部信息支持。关闭 [#34021](https://github.com/ClickHouse/ClickHouse/issues/34021)。通过新增模式 `read_from_filesystem_cache_if_exists_otherwise_bypass_cache`，为 merges 提供缓存选项 (默认对 merges 启用，也可通过同名查询设置启用) 。重命名了与缓存相关的设置 (`remote_fs_enable_cache -> enable_filesystem_cache` 等) 。[#35475](https://github.com/ClickHouse/ClickHouse/pull/35475) ([Kseniia Sumarokova](https://github.com/kssenii))。
* 提供了将 parts 元数据存储在 RocksDB 中的选项。加快 MergeTree 的 parts 加载过程，从而加速 clickhouse-server 启动。借助这一改进，在拥有 70 万个 MergeTree parts 的情况下，clickhouse-server 能够将启动时间从 75 分钟缩短到 20 秒。[#32928](https://github.com/ClickHouse/ClickHouse/pull/32928) ([李扬](https://github.com/taiyang-li))。

<div id="performance-improvement">
  #### 性能改进
</div>

* 新增一项查询计划优化：在可能的情况下，将函数计算延后到 `ORDER BY` 之后执行。例如，对于查询 `SELECT sipHash64(number) FROM numbers(1e8) ORDER BY number LIMIT 5`，函数 `sipHash64` 会在 `ORDER BY` 和 `LIMIT` 之后再计算，从而带来约 20 倍的性能提升。[#35623](https://github.com/ClickHouse/ClickHouse/pull/35623) ([Nikita Taranov](https://github.com/nickitat)).
* 现在会收集聚合过程中使用的哈希表大小，并在后续查询中加以利用，以避免哈希表扩容。[#33439](https://github.com/ClickHouse/ClickHouse/pull/33439) ([Nikita Taranov](https://github.com/nickitat)).
* 使用 SIMD 指令 (SSE 和 AVX2) 提升了 hasAll 函数的性能。[#27653](https://github.com/ClickHouse/ClickHouse/pull/27653) ([youennL-cs](https://github.com/youennL-cs)). [#35723](https://github.com/ClickHouse/ClickHouse/pull/35723) ([Maksim Kita](https://github.com/kitaisreal)).
* 进行了多项改动以提升 ASOF JOIN 性能 (提升 1.2 到 1.6 倍) ，并增加了对大整数的支持。[#34733](https://github.com/ClickHouse/ClickHouse/pull/34733) ([Raúl Marín](https://github.com/Algunenano)).
* 当键为原生整数类型时，进一步提升了 ASOF JOIN 的性能。[#35525](https://github.com/ClickHouse/ClickHouse/pull/35525) ([Maksim Kita](https://github.com/kitaisreal)).
* 实现了到 S3 存储的分段上传并行化。[#35343](https://github.com/ClickHouse/ClickHouse/pull/35343) ([Sergei Trifonov](https://github.com/serxa)).
* 如果端点支持 HTTP Range，URL 存储引擎现在会并行下载多个分块。新增了两个设置：`max_download_threads` 和 `max_download_buffer_size`，分别用于控制单个查询下载文件时可使用的最大线程数，以及每个线程可处理的最大字节数。[#35150](https://github.com/ClickHouse/ClickHouse/pull/35150) ([Antonio Andelic](https://github.com/antonio2368)).
* 支持使用多个线程从 S3 下载对象。下载行为可通过 `max_download_threads` 和 `max_download_buffer_size` 设置进行控制。[#35571](https://github.com/ClickHouse/ClickHouse/pull/35571) ([Antonio Andelic](https://github.com/antonio2368)).
* 在与 HDFS 交互时缩小了互斥锁的作用范围。相关见 [#35292](https://github.com/ClickHouse/ClickHouse/issues/35292)。[#35646](https://github.com/ClickHouse/ClickHouse/pull/35646) ([shuchaome](https://github.com/shuchaome)).
* 仅当表级 TTL 发生变化时，才需要执行变更。[#35953](https://github.com/ClickHouse/ClickHouse/pull/35953) ([Azat Khuzhin](https://github.com/azat)).

<div id="improvement">
  #### 改进
</div>

* 对 schema inference 进行了多项改进。通过一些优化和启发式规则，可在 CSV、TSV 和 TSVRaw 数据格式中识别数字、字符串、数组、元组和 Map。为 CSV 格式新增设置 `input_format_csv_use_best_effort_in_schema_inference`，用于启用/禁用这些启发式规则；如果禁用，则所有内容都会被视为字符串。还为 TSV/TSVRaw 格式新增了类似的设置 `input_format_tsv_use_best_effort_in_schema_inference`。这些设置默认启用。- 在 Values 格式的 schema inference 中新增了对 Map 的支持。- 修复了 Values 格式 schema inference 中可能出现的段错误。- 允许在 Arrow/ORC/Parquet 格式中跳过类型不受支持的列。为此新增了相应设置：`input_format_{parquet|orc|arrow}_skip_columns_with_unsupported_types_in_schema_inference`。这些设置默认禁用。- 允许在 Arrow/Parquet 格式中，将类型为 Null 的列转换为值全为 NULL 的 Nullable 列。- 允许通过设置 `column_names_for_schema_inference`，在 schema inference 时为不包含列名的格式 (如 CSV、TSV、JSONCompactEachRow 等) 指定列名。- 修复了 ORC/Arrow/Parquet 格式在处理 Nullable 列时的 schema inference 问题。此前，所有推断出的类型都不是 Nullable，这会导致无法从数据中读取 Nullable 列；现已修复，现在所有推断出的类型始终都是 Nullable (因为仅通过读取 schema 无法判断某列是否为 Nullable) 。- 修复了 Template 格式在使用 CSV 转义规则时的 schema inference 问题。[#35582](https://github.com/ClickHouse/ClickHouse/pull/35582) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 为 `JSONAsObject` 格式新增并行解析和 schema 推断。[#35592](https://github.com/ClickHouse/ClickHouse/pull/35592) ([Anton Popov](https://github.com/CurtizJ)) 。
* 为 `s3Cluster` 表函数新增了自动 schema 推断支持。同步了 `s3 ` 和 `s3Cluster` 的函数签名。[#35544](https://github.com/ClickHouse/ClickHouse/pull/35544) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 新增了对 `hdfsCluster` 的 schema inference 支持。[#35602](https://github.com/ClickHouse/ClickHouse/pull/35602) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 新增设置 `input_format_json_read_bools_as_numbers`，允许在 JSON 输入格式中将 bool 推断并解析为数值。该设置默认启用。由 @alexey-milovidov 提议。[#35735](https://github.com/ClickHouse/ClickHouse/pull/35735) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 改进了 TSKV 和 JSONEachRow 格式在 schema 推断中的列顺序，关闭了 [#35640](https://github.com/ClickHouse/ClickHouse/issues/35640)。在 TSKV 和 JSONEachRow 格式的 schema 推断过程中，读取到空行时不再停止推断。[#35724](https://github.com/ClickHouse/ClickHouse/pull/35724) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 新增设置 `input_format_orc_case_insensitive_column_matching`、`input_format_arrow_case_insensitive_column_matching` 和 `input_format_parquet_case_insensitive_column_matching`，允许 ClickHouse 在从 ORC、Arrow 或 Parquet 文件读取数据时，对列名进行不区分大小写的匹配。[#35459](https://github.com/ClickHouse/ClickHouse/pull/35459) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 在 `system.query_log` 中新增了 `is_secure` 列，用于表示客户端是否通过 TCP 或 HTTP 使用了安全连接。[#35705](https://github.com/ClickHouse/ClickHouse/pull/35705) ([Antonio Andelic](https://github.com/antonio2368)).
* 现在，在低资源机器 (少于 16 个核心) 上，`kafka_num_consumers` 可以大于物理核心数。[#35926](https://github.com/ClickHouse/ClickHouse/pull/35926) ([alesapin](https://github.com/alesapin)).
* 为 engine=Kafka 的表添加了一些基础监控指标。 [#35916](https://github.com/ClickHouse/ClickHouse/pull/35916) ([filimonov](https://github.com/filimonov)).
* 现在，已不允许对 MergeTree 引擎家族中不存在的设置执行 `ALTER TABLE ... RESET SETTING`。修复了 [#35816](https://github.com/ClickHouse/ClickHouse/issues/35816)。[#35884](https://github.com/ClickHouse/ClickHouse/pull/35884) ([alesapin](https://github.com/alesapin)) 。
* 现在，某些针对 `Arrays` 和 `Nullable` 类型的 `ALTER MODIFY COLUMN` 查询可以仅在元数据层完成，无需执行变更。例如，可将 `Array(Enum8('Option1'=1))` 修改为 `Array(Enum8('Option1'=1, 'Option2'=2))`。[#35882](https://github.com/ClickHouse/ClickHouse/pull/35882) ([alesapin](https://github.com/alesapin)).
* 为沙漏图标添加了动画，以提示用户查询正在运行。[#35860](https://github.com/ClickHouse/ClickHouse/pull/35860) ([peledni](https://github.com/peledni)).
* 新增对 ALTER TABLE t DETACH PARTITION (ALL) 的支持。[#35794](https://github.com/ClickHouse/ClickHouse/pull/35794) ([awakeljw](https://github.com/awakeljw)).
* 改进投影分析，进一步优化 `count()` 等简单查询。[#35788](https://github.com/ClickHouse/ClickHouse/pull/35788) ([Amos Bird](https://github.com/amosbird)) 。
* 支持在使用 `input` 表函数时，对 insert select 进行 schema 推断。对于从支持 schema 推断的表函数执行 insert select 的场景，不再从数据中推断 schema，而是从插入目标表中获取 schema。关闭 [#35639](https://github.com/ClickHouse/ClickHouse/issues/35639)。[#35760](https://github.com/ClickHouse/ClickHouse/pull/35760) ([Kruglov Pavel](https://github.com/Avogar)) 。
* Hive 表遵循 `remote_url_allow_hosts` 设置。[#35743](https://github.com/ClickHouse/ClickHouse/pull/35743) ([李扬](https://github.com/taiyang-li)) 。
* 为 clickhouse-local 添加 `send_logs_level`。关闭 [#35653](https://github.com/ClickHouse/ClickHouse/issues/35653)。[#35716](https://github.com/ClickHouse/ClickHouse/pull/35716) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 关闭了 [#35641](https://github.com/ClickHouse/ClickHouse/issues/35641)：允许 `EPHEMERAL` 列无需显式默认表达式。[#35706](https://github.com/ClickHouse/ClickHouse/pull/35706) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* 新增用于统计异步 INSERT 大小的 profile 事件计数器 `AsyncInsertBytes`。[#35644](https://github.com/ClickHouse/ClickHouse/pull/35644) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 改进了 JOIN 的管道描述。[#35612](https://github.com/ClickHouse/ClickHouse/pull/35612) ([何李夫](https://github.com/helifu)) 。
* 推断 HDFS 配置的绝对路径。[#35572](https://github.com/ClickHouse/ClickHouse/pull/35572) ([李扬](https://github.com/taiyang-li)) 。
* 改进 `clickhouse-client` 的粘贴性能和兼容性。这有助于修复 [#35501](https://github.com/ClickHouse/ClickHouse/issues/35501)。[#35541](https://github.com/ClickHouse/ClickHouse/pull/35541) ([Amos Bird](https://github.com/amosbird)) 。
* 如果在解析嵌套层级极深的数据类型时 (至少在 debug build 中) ，启用了设置 `async_socket_for_remote` 和 `use_hedged_requests` 中的任意一个，则分布式查询中可能会发生栈溢出。修复 [#35509](https://github.com/ClickHouse/ClickHouse/issues/35509)。[#35524](https://github.com/ClickHouse/ClickHouse/pull/35524) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 在 `system.parts_columns` 表中添加子列大小。[#35488](https://github.com/ClickHouse/ClickHouse/pull/35488) ([Anton Popov](https://github.com/CurtizJ)) 。
* 在查询计划和管道的扫描节点中添加显式表信息。[#35460](https://github.com/ClickHouse/ClickHouse/pull/35460) ([何李夫](https://github.com/helifu)).
* 允许服务器绑定到低编号端口 (例如 443) 。ClickHouse 安装脚本会为该二进制文件设置 `cap_net_bind_service`。[#35451](https://github.com/ClickHouse/ClickHouse/pull/35451) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 修复 INSERT INTO table FROM INFILE 不显示进度条的问题。[#35429](https://github.com/ClickHouse/ClickHouse/pull/35429) ([xiedeyantu](https://github.com/xiedeyantu)) 。
* 为 `clickhouse-diagnostics` 工具新增 `--user`、`--password`、`--host`、`--port` 参数。[#35422](https://github.com/ClickHouse/ClickHouse/pull/35422) ([李扬](https://github.com/taiyang-li)) 。
* 支持 Postgres 引擎中的 uuid。关闭 [#35384](https://github.com/ClickHouse/ClickHouse/issues/35384)。[#35403](https://github.com/ClickHouse/ClickHouse/pull/35403) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 对于 table function `s3cluster`、`HDFSCluster` 或 `hive`，我们无法通过 `StorageFactory::instance().getSourceAccessType(getStorageTypeName())` 获取正确的 `AccessType`。此 PR 修复了该问题。[#35365](https://github.com/ClickHouse/ClickHouse/pull/35365) ([李扬](https://github.com/taiyang-li)) 。
* 移除 clickhouse-client 的 `--testmode` 选项，并将其改为始终启用。[#35354](https://github.com/ClickHouse/ClickHouse/pull/35354) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 不再允许对 clickhouse-keeper 执行 `wchc` 命令 (四字命令) 。[#35320](https://github.com/ClickHouse/ClickHouse/pull/35320) ([zhangyuli1](https://github.com/zhangyuli1)) 。
* 新增函数 `getTypeSerializationStreams`。对于指定类型 (从列中检测) ，该函数会返回一个包含所有序列化子流 path 的数组。此函数主要供开发者使用。[#35290](https://github.com/ClickHouse/ClickHouse/pull/35290) ([李扬](https://github.com/taiyang-li)) 。
* 如果在集群配置中未指定 `port`，则会使用默认的服务器端口。这修复了 [#34769](https://github.com/ClickHouse/ClickHouse/issues/34769)。[#34772](https://github.com/ClickHouse/ClickHouse/pull/34772) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 在 Hive 引擎中为 orc/parquet 文件使用 `minmax` 索引。相关 PR：[https://github.com/ClickHouse/arrow/pull/10。\[#34631](https://github.com/ClickHouse/arrow/pull/10。\[#34631)]\([https://github.com/ClickHouse/ClickHouse/pull/34631](https://github.com/ClickHouse/ClickHouse/pull/34631)) ([李扬](https://github.com/taiyang-li)) 。
* 系统日志表现在支持在 ENGINE 声明中指定 COMMENT。修复了 [#33768](https://github.com/ClickHouse/ClickHouse/issues/33768)。[#34536](https://github.com/ClickHouse/ClickHouse/pull/34536) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 在按 sorting key 顺序读取且指定了 limit 的情况下，现已正确支持 `max_rows_to_read` 设置。此前，即使查询实际需要读取的行数更少，也可能抛出异常 `Limit for rows or bytes to read exceeded`。[#33230](https://github.com/ClickHouse/ClickHouse/pull/33230) ([Anton Popov](https://github.com/CurtizJ)) 。
* 仅遵循 cgroups 中的 quota 和 period，忽略 shares (因为它实际上并不能真正限制可用的 CPU 核心数) 。[#35815](https://github.com/ClickHouse/ClickHouse/pull/35815) ([filimonov](https://github.com/filimonov)) 。

<div id="buildtestingpackaging-improvement">
  #### 构建/测试/打包改进
</div>

* 在功能测试中添加下一批随机化设置。[#35047](https://github.com/ClickHouse/ClickHouse/pull/35047) ([Kruglov Pavel](https://github.com/Avogar)).
* 在压力测试中添加向后兼容性检查。关闭 [#25088](https://github.com/ClickHouse/ClickHouse/issues/25088)。[#27928](https://github.com/ClickHouse/ClickHouse/pull/27928) ([Kruglov Pavel](https://github.com/Avogar)).
* 将软件包构建迁移到 `nfpm` - 弃用 `release` 脚本，改用 `packages/build` - 在 clickhouse/binary-builder 镜像中构建全部内容 (清理：clickhouse/deb-builder) - 在 cmake 中加入符号剥离 (待办：使用 $prefix/lib/$bin\_dir/clickhouse/\$binary.debug) - 修复 DWARF 符号问题 - 添加 Alpine APK 软件包 - 将 `alien` 重命名为 `additional_pkgs`。[#33664](https://github.com/ClickHouse/ClickHouse/pull/33664) ([Mikhail f. Shiryaev](https://github.com/Felixoid)).
* 为 Coverity 添加夜间扫描和上传。[#34895](https://github.com/ClickHouse/ClickHouse/pull/34895) ([Boris Kuschel](https://github.com/bkuschel)).
* 为 `clickhouse-keeper` 提供一个专用的小型软件包。[#35308](https://github.com/ClickHouse/ClickHouse/pull/35308) ([Mikhail f. Shiryaev](https://github.com/Felixoid)).
* 使用 podman 运行时会失败：它会提示同一个卷被指定了两次。[#35978](https://github.com/ClickHouse/ClickHouse/pull/35978) ([Roman Nikonov](https://github.com/nic11)).
* 对 contrib/krb5 的构建配置进行了小幅改进。[#35832](https://github.com/ClickHouse/ClickHouse/pull/35832) ([Anton Kozlov](https://github.com/tonickkozlov)).
* 为每个镜像添加一个用于识别构建任务的标签。[#35583](https://github.com/ClickHouse/ClickHouse/pull/35583) ([Mikhail f. Shiryaev](https://github.com/Felixoid)).
* 将 `black` 代码格式化工具应用于 Python 代码，并添加按提交执行的检查。[#35466](https://github.com/ClickHouse/ClickHouse/pull/35466) ([Mikhail f. Shiryaev](https://github.com/Felixoid)).
* 重构 alpine 镜像，改用简洁的 Dockerfile。在 tests/ci 中创建一个脚本，用于构建 ubuntu 和 alpine 两种镜像。添加 clickhouse-keeper 镜像 (cc @nikitamikhaylov) 。向 PullRequestCI 添加构建检查。向 ReleaseCI 添加一个 job。向 MasterCI 添加一个 job，为每个已合并的 PR 构建并推送 `clickhouse/clickhouse-server:head` 和 `clickhouse/clickhouse-keeper:head` 镜像。[#35211](https://github.com/ClickHouse/ClickHouse/pull/35211) ([Mikhail f. Shiryaev](https://github.com/Felixoid)).
* 修复 CI 中的压力测试报告；现在仅上传一次 runlog，其中只包含已启动的压力测试信息。[#35093](https://github.com/ClickHouse/ClickHouse/pull/35093) ([Mikhail f. Shiryaev](https://github.com/Felixoid)).
* 切换到 LLVM 14 的 libcxx / libcxxabi。[#34906](https://github.com/ClickHouse/ClickHouse/pull/34906) ([Raúl Marín](https://github.com/Algunenano)).
* 更新 unixodbc 以缓解 CVE-2018-7485。注意：此 CVE 与 ClickHouse 无关，因为它为 ODBC 实现了自己的隔离层。[#35943](https://github.com/ClickHouse/ClickHouse/pull/35943) ([Mikhail f. Shiryaev](https://github.com/Felixoid)).

<div id="bug-fix">
  #### 问题修复
</div>

* 新增了设置 `input_format_ipv4_default_on_conversion_error` 和 `input_format_ipv6_default_on_conversion_error`，允许在插入表时将无效的 IP 地址值按默认值处理。关闭 [#35726](https://github.com/ClickHouse/ClickHouse/issues/35726)。[#35733](https://github.com/ClickHouse/ClickHouse/pull/35733) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 从 Hive 读取数据时，如果某列不存在，则避免从块中删除该列。[#35393](https://github.com/ClickHouse/ClickHouse/pull/35393) ([lgbo](https://github.com/lgbo-ustc)) 。
* 创建 materialized view 时新增类型检查。关闭：[#23684](https://github.com/ClickHouse/ClickHouse/issues/23684)。[#24896](https://github.com/ClickHouse/ClickHouse/pull/24896) ([hexiaoting](https://github.com/hexiaoting)) 。
* 修复 INSERT INFILE 查询的格式问题 (缺少引号) 。[#35886](https://github.com/ClickHouse/ClickHouse/pull/35886) ([Azat Khuzhin](https://github.com/azat)).
* 由于模糊测试发现了内存安全问题，因此禁用 `session_log`。参见 [#35714](https://github.com/ClickHouse/ClickHouse/issues/35714)。[#35873](https://github.com/ClickHouse/ClickHouse/pull/35873) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 避免对按列设置的生存时间 (TTL) 进行重复处理。[#35820](https://github.com/ClickHouse/ClickHouse/pull/35820) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了以下问题：当插入查询中包含属于多个分区的数据时，向 `Object` 类型列插入数据会出错。 [#35806](https://github.com/ClickHouse/ClickHouse/pull/35806) ([Anton Popov](https://github.com/CurtizJ)).
* 修复了 `-WithNames` 格式中未出现列的索引问题：当列数超过 256 时，会导致报错 `INCORRECT_NUMBER_OF_COLUMNS `。关闭 [#35793](https://github.com/ClickHouse/ClickHouse/issues/35793)。[#35803](https://github.com/ClickHouse/ClickHouse/pull/35803) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复了 [#35751](https://github.com/ClickHouse/ClickHouse/issues/35751)。[#35799](https://github.com/ClickHouse/ClickHouse/pull/35799) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 修复了从 HDFS 读取 Snappy 格式数据时的问题。[#35771](https://github.com/ClickHouse/ClickHouse/pull/35771) ([shuchaome](https://github.com/shuchaome)) 。
* 修复了从自定义类型转换为字符串时的一个缺陷，该缺陷可能导致段错误或出现意外的错误消息。关闭 [#35752](https://github.com/ClickHouse/ClickHouse/issues/35752)。[#35755](https://github.com/ClickHouse/ClickHouse/pull/35755) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复 any/all (子查询) 的实现。已关闭 [#35489](https://github.com/ClickHouse/ClickHouse/issues/35489)。[#35727](https://github.com/ClickHouse/ClickHouse/pull/35727) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复了 clickhouse-local 中删除非空 database 时的问题。关闭了 [#35692](https://github.com/ClickHouse/ClickHouse/issues/35692)。[#35711](https://github.com/ClickHouse/ClickHouse/pull/35711) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复了服务器重启后创建带有子查询的 materialized view 时的错误。此前，服务器重启后，向底层表插入数据后，materialized view 不会更新。关闭了 [#35511](https://github.com/ClickHouse/ClickHouse/issues/35511)。[#35691](https://github.com/ClickHouse/ClickHouse/pull/35691) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了读取实验性类型 `Object` 的子列时可能出现的 `Can't adjust last granule` 异常。[#35687](https://github.com/ClickHouse/ClickHouse/pull/35687) ([Anton Popov](https://github.com/CurtizJ)).
* 默认启用 JIT 编译构建。[#35683](https://github.com/ClickHouse/ClickHouse/pull/35683) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 修复了 Experimental 类型 `Object` 中子列可能丢失的问题。[#35682](https://github.com/ClickHouse/ClickHouse/pull/35682) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复对 ASOF JOIN 连接键可空性的校验，关闭 [#35565](https://github.com/ClickHouse/ClickHouse/issues/35565)。[#35674](https://github.com/ClickHouse/ClickHouse/pull/35674) ([Vladimir C](https://github.com/vdimir)).
* 修复带有 projections 的 parts 的 part 检查逻辑。当 projection 与主 part 的类型不一致时，会报错。这与 [https://github.com/ClickHouse/ClickHouse/pull/33774](https://github.com/ClickHouse/ClickHouse/pull/33774) 类似。该 bug 由 @caoyang10 修复。[#35667](https://github.com/ClickHouse/ClickHouse/pull/35667) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了向 `format` 函数传入大量参数时导致服务器崩溃的问题。请参阅测试文件，了解如何复现该崩溃。[#35651](https://github.com/ClickHouse/ClickHouse/pull/35651) ([Amos Bird](https://github.com/amosbird)).
* 修复配额与异步插入配合使用时的问题。[#35645](https://github.com/ClickHouse/ClickHouse/pull/35645) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复带别名的位置参数问题。关闭了 [#35600](https://github.com/ClickHouse/ClickHouse/issues/35600)。[#35620](https://github.com/ClickHouse/ClickHouse/pull/35620) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 在 URL engine 中进行 schema 推断前检查 `remote_url_allow_hosts`。关闭 [#35064](https://github.com/ClickHouse/ClickHouse/issues/35064)。[#35619](https://github.com/ClickHouse/ClickHouse/pull/35619) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了在使用 `LowCardinality` 类型列时 `HashJoin` 出现的问题。此项修复关闭了 [#35548](https://github.com/ClickHouse/ClickHouse/issues/35548)。[#35616](https://github.com/ClickHouse/ClickHouse/pull/35616) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 修复了 MaterializedPostgreSQL 中一个可能的段错误：如果在将内存中收集的数据同步到底层表时发生异常，就可能触发该问题。关闭 [#35611](https://github.com/ClickHouse/ClickHouse/issues/35611)。[#35614](https://github.com/ClickHouse/ClickHouse/pull/35614) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 设置 `database_atomic_wait_for_drop_and_detach_synchronously` 在此前已 detached 的表仍在使用时，对 `ATTACH TABLE` 查询处理不正确；该问题现已修复。 [#35594](https://github.com/ClickHouse/ClickHouse/pull/35594) ([tavplubix](https://github.com/tavplubix)).
* 修复命名集合中的 HTTP 请求头问题，并添加 compression\_method。关闭 [#35273](https://github.com/ClickHouse/ClickHouse/issues/35273)。关闭 [#35269](https://github.com/ClickHouse/ClickHouse/issues/35269)。[#35593](https://github.com/ClickHouse/ClickHouse/pull/35593) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复 S3 引擎获取虚拟列的问题。关闭 [#35411](https://github.com/ClickHouse/ClickHouse/issues/35411)。[#35586](https://github.com/ClickHouse/ClickHouse/pull/35586) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复了 `caseWithExpression` 的返回类型推断问题。现在会正确地将 ELSE 分支的类型考虑在内。[#35576](https://github.com/ClickHouse/ClickHouse/pull/35576) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 修复了对长度超过 39 个字符的 IPv6 地址的解析问题。关闭 [#34022](https://github.com/ClickHouse/ClickHouse/issues/34022)。[#35539](https://github.com/ClickHouse/ClickHouse/pull/35539) ([Maksim Kita](https://github.com/kitaisreal)).
* 修复了在 `IN` 子句中将值转换为 IPv4、IPv6 地址的问题。修复了 [#35528](https://github.com/ClickHouse/ClickHouse/issues/35528)。[#35534](https://github.com/ClickHouse/ClickHouse/pull/35534) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 修复了短路函数求值时，当某个参数为 Nullable 常量而导致崩溃的问题。关闭 [#35497](https://github.com/ClickHouse/ClickHouse/issues/35497)。关闭 [#35496](https://github.com/ClickHouse/ClickHouse/issues/35496)。[#35502](https://github.com/ClickHouse/ClickHouse/pull/35502) ([Maksim Kita](https://github.com/kitaisreal)).
* 修复了函数 `throwIf` 在使用常量参数时崩溃的问题。[#35500](https://github.com/ClickHouse/ClickHouse/pull/35500) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 修复了 Keeper 中一个可能导致客户端连接不稳定的缺陷。该问题首次引入于 [#35031](https://github.com/ClickHouse/ClickHouse/issues/35031)。[#35498](https://github.com/ClickHouse/ClickHouse/pull/35498) ([alesapin](https://github.com/alesapin)).
* 修复了函数 `if` 中的一个问题：当结果列类型与结果 Data type 不一致时，会导致诸如 `Logical error: 'Bad cast from type DB::ColumnVector<int> to DB::ColumnVector<long>'.` 这样的逻辑错误。关闭 [#35367](https://github.com/ClickHouse/ClickHouse/issues/35367)。[#35476](https://github.com/ClickHouse/ClickHouse/pull/35476) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了将 S3 用作 MergeTree 后端，或用作独立表引擎/函数时日志过多的问题。修复 [#30559](https://github.com/ClickHouse/ClickHouse/issues/30559)。[#35434](https://github.com/ClickHouse/ClickHouse/pull/35434) ([alesapin](https://github.com/alesapin)).
* 现在，使用 zero copy 复制 (Experimental) 执行的合并操作将不再在日志中反复打印消息 `Found parts with the same min block and with the same max block as the missing part _ on replica _. Hoping that it will eventually appear as a result of a merge.`。[#35430](https://github.com/ClickHouse/ClickHouse/pull/35430) ([alesapin](https://github.com/alesapin)).
* 如果 GroupingAggregatedTransform 中出现空数据块，则避免可能抛出的异常。[#35417](https://github.com/ClickHouse/ClickHouse/pull/35417) ([Nikita Taranov](https://github.com/nickitat)) 。
* 修复了 Arrow/Parquet/ORC 格式中对查询里不需要的列的处理问题，避免在文件包含不受支持类型的列且查询中未使用该列时，出现诸如 `Unsupported <format> type <type> of an input column <column_name>` 之类的错误。[#35406](https://github.com/ClickHouse/ClickHouse/pull/35406) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复远程文件系统 (Experimental 功能) 的本地缓存在高并发边界情况下的问题。[#35381](https://github.com/ClickHouse/ClickHouse/pull/35381) ([Kseniia Sumarokova](https://github.com/kssenii)). 修复缓存中可能发生的死锁。[#35378](https://github.com/ClickHouse/ClickHouse/pull/35378) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 修复了在 `WHERE` 中与常量比较时的分区裁剪问题。如果列与常量的类型不同，可能会发生溢出，从而导致查询错误地返回空结果。此修复解决了 [#35304](https://github.com/ClickHouse/ClickHouse/issues/35304)。[#35334](https://github.com/ClickHouse/ClickHouse/pull/35334) ([Amos Bird](https://github.com/amosbird)) 。
* 修复在 max\_read\_buffer\_size 较小时使用 TSKV 格式时的 schema 推断问题。[#35332](https://github.com/ClickHouse/ClickHouse/pull/35332) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复在启用稀疏列的表上执行变更时的问题。[#35284](https://github.com/ClickHouse/ClickHouse/pull/35284) ([Anton Popov](https://github.com/CurtizJ)).
* 默认不再延迟 final 分片的写入 (通过新增 `max_insert_delayed_streams_for_parallel_write`，修复 `INSERT` 期间可能出现的 `Memory limit exceeded`；写入 S3 时该设置的默认值为 1000，其他情况下则仍默认禁用) 。[#34780](https://github.com/ClickHouse/ClickHouse/pull/34780) ([Azat Khuzhin](https://github.com/azat)) 。

### <a id="223" /> ClickHouse 发行版 v22.3-lts，2022-03-17。[演示文稿](https://presentations.clickhouse.com/2022-release-22.3/)，[视频](https://www.youtube.com/watch?v=GzeANZzPras)

<Frame>
  <iframe src="https://www.youtube.com/embed/GzeANZzPras" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen />
</Frame>

<div id="backward-incompatible-change">
  #### 向后不兼容的变更
</div>

* 使 `arrayCompact` 函数的行为与其他高阶函数一致：执行 compact 处理时，不再基于 lambda function 的结果，而是基于原始数组。如果你在 `arrayCompact` 中使用了较复杂的 lambda function，可以通过将 `arrayCompact` 的参数包装到 `arrayMap` 中来恢复旧行为。关闭 [#34010](https://github.com/ClickHouse/ClickHouse/issues/34010) [#18535](https://github.com/ClickHouse/ClickHouse/issues/18535) [#14778](https://github.com/ClickHouse/ClickHouse/issues/14778)。[#34795](https://github.com/ClickHouse/ClickHouse/pull/34795) ([Alexandre Snarskii](https://github.com/snar)).
* 更改了函数 `toDatetime` 在 overflow 时的特定实现行为。现在它会饱和到 datetime 所支持的最近最小/最大时刻，而不是回绕。之所以将此变更标记为“向后不兼容”，是因为可能有人无意中依赖了旧行为。[#32898](https://github.com/ClickHouse/ClickHouse/pull/32898) ([HaiBo Li](https://github.com/marising)).
* 使函数 `cast(value, 'IPv4')`、`cast(value, 'IPv6')` 的行为与 `toIPv4`、`toIPv6` 函数一致。调整了向函数 `toIPv4`、`toIPv6` 传入错误 IP 地址时的行为：现在如果传入的是无效 IP 地址，这些函数会抛出 Exception；而此前这些函数会返回 default value。新增函数 `IPv4StringToNumOrDefault`、`IPv4StringToNumOrNull`、`IPv6StringToNumOrDefault`、`IPv6StringOrNull`、`toIPv4OrDefault`、`toIPv4OrNull`、`toIPv6OrDefault`、`toIPv6OrNull`。如果此前的逻辑依赖于 `IPv4StringToNum`、`toIPv4`、`toIPv6` 在地址无效时返回 default value，则应改用 `IPv4StringToNumOrDefault`、`toIPv4OrDefault`、`toIPv6OrDefault`。新增设置 `cast_ipv4_ipv6_default_on_conversion_error`，如果启用此设置，则 IP 地址转换函数将保持此前的行为。关闭 [#22825](https://github.com/ClickHouse/ClickHouse/issues/22825)。关闭 [#5799](https://github.com/ClickHouse/ClickHouse/issues/5799)。关闭 [#35156](https://github.com/ClickHouse/ClickHouse/issues/35156)。[#35240](https://github.com/ClickHouse/ClickHouse/pull/35240) ([Maksim Kita](https://github.com/kitaisreal)).

<div id="new-feature-2">
  #### 新功能
</div>

* 支持为远程 filesystem 在本地缓存数据。可为 `s3` disk 启用。关闭 [#28961](https://github.com/ClickHouse/ClickHouse/issues/28961)。[#33717](https://github.com/ClickHouse/ClickHouse/pull/33717) ([Kseniia Sumarokova](https://github.com/kssenii))。同时，我们已在 s3 filesystem 上启用测试套件，且已无其他已知问题，因此该功能已开始达到生产可用水平。
* 新增表函数 `hive`。其用法如下：`hive('<hive metastore url>', '<hive database>', '<hive table name>', '<columns definition>', '<partition columns>')`，例如 `SELECT * FROM hive('thrift://hivetest:9083', 'test', 'demo', 'id Nullable(String), score Nullable(Int32), day Nullable(String)', 'day')`。[#34946](https://github.com/ClickHouse/ClickHouse/pull/34946) ([lgbo](https://github.com/lgbo-ustc))。
* 支持通过 SSL 连接的用户基于其 X.509 证书进行身份验证。[#31484](https://github.com/ClickHouse/ClickHouse/pull/31484) ([eungenue](https://github.com/eungenue))。
* 支持在向表函数 `file`/`hdfs`/`s3`/`url` 插入时进行 schema inference。[#34732](https://github.com/ClickHouse/ClickHouse/pull/34732) ([Kruglov Pavel](https://github.com/Avogar))。
* 现在你可以读取 `system.zookeeper` 表，而不受 path 限制，也无需使用 `like` expression。此类读取可能会给 ZooKeeper 带来相当大的负载，因此若要启用此能力，必须开启设置 `allow_unrestricted_reads_from_keeper`。[#34609](https://github.com/ClickHouse/ClickHouse/pull/34609) ([Sergei Trifonov](https://github.com/serxa))。
* 在 clickhouse-local 中显示 CPU 和内存指标。关闭 [#34545](https://github.com/ClickHouse/ClickHouse/issues/34545)。[#34605](https://github.com/ClickHouse/ClickHouse/pull/34605) ([李扬](https://github.com/taiyang-li))。
* 为 arrays 实现了 `startsWith` 和 `endsWith` 函数，关闭 [#33982](https://github.com/ClickHouse/ClickHouse/issues/33982)。[#34368](https://github.com/ClickHouse/ClickHouse/pull/34368) ([usurai](https://github.com/usurai))。
* 为 Map data type 新增了三个函数：1. `mapReplace(map1, map2)` - 将 map1 中键对应的值替换为 map2 中对应键的值；并添加 map1 中不存在但 map2 中存在的键。2. `mapFilter` 3. `mapMap`。`mapFilter` 和 `mapMap` 是高阶函数，接受两个参数：第一个参数是一个 lambda function，以 k、v 键值对作为参数；第二个参数是一个 Map 类型的列。[#33698](https://github.com/ClickHouse/ClickHouse/pull/33698) ([hexiaoting](https://github.com/hexiaoting))。
* 允许 clickhouse-client 从环境变量 `CLICKHOUSE_USER` 和 `CLICKHOUSE_PASSWORD` 中获取默认用户和密码。关闭 [#34538](https://github.com/ClickHouse/ClickHouse/issues/34538)。[#34947](https://github.com/ClickHouse/ClickHouse/pull/34947) ([DR](https://github.com/freedomDR))。

<div id="experimental-feature">
  #### Experimental 功能
</div>

* 新增数据类型 `Object(<schema_format>)`，支持存储半结构化数据 (目前仅支持 JSON) 。数据会先以字符串形式写入该类型。随后会根据半结构化数据的格式提取所有路径，并以能够容纳各自全部值的最优类型将其写入到单独的列中。这些列可通过与源数据中路径对应的名称进行查询，例如 `data.key1.key2`，或使用类型转换运算符 `data.key1.key2::Int64`。
* 新增 `database_replicated_allow_only_replicated_engine` 设置。启用后，在 `Replicated` 数据库中将只允许创建 `Replicated` 表或使用无状态引擎的表。[#35214](https://github.com/ClickHouse/ClickHouse/pull/35214) ([Nikolai Kochetov](https://github.com/KochetovNicolai))。请注意，`Replicated` 数据库仍属于 Experimental 功能。

<div id="performance-improvement">
  #### 性能改进
</div>

* 通过优化排序，提升向 `MergeTree` 表插入数据的性能。在贴近实际场景的基准测试中，性能最高可提升 2 倍。[#34750](https://github.com/ClickHouse/ClickHouse/pull/34750) ([Maksim Kita](https://github.com/kitaisreal)).
* 从 URL 和 S3 读取 Parquet、ORC 和 Arrow 文件时支持列裁剪。关闭 [#34163](https://github.com/ClickHouse/ClickHouse/issues/34163)。[#34849](https://github.com/ClickHouse/ClickHouse/pull/34849) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 从 Hive 读取 Parquet、ORC 和 Arrow 文件时支持列裁剪。[#34954](https://github.com/ClickHouse/ClickHouse/pull/34954) ([lgbo](https://github.com/lgbo-ustc)).
* 这位性能超人带来了一系列性能优化：提升了处理大型 `IN` 子句查询的性能；提升了源为 `ClickHouse` 的 `direct` 字典性能；提升了 `detectCharset ` 和 `detectLanguageUnknown ` 函数的性能。[#34888](https://github.com/ClickHouse/ClickHouse/pull/34888) ([Maksim Kita](https://github.com/kitaisreal)).
* 通过增加批处理，提升了 `any` 聚合函数的性能。[#34760](https://github.com/ClickHouse/ClickHouse/pull/34760) ([Raúl Marín](https://github.com/Algunenano)).
* 对 `clickhouse-keeper` 进行了多项性能改进：减少锁竞争 [#35010](https://github.com/ClickHouse/ClickHouse/pull/35010) ([zhanglistar](https://github.com/zhanglistar))，通过对 snapshot 进行流式读写而非完整拷贝来降低内存占用。[#34584](https://github.com/ClickHouse/ClickHouse/pull/34584) ([zhanglistar](https://github.com/zhanglistar))，优化 RAFT 实现中日志存储的合并整理。[#34534](https://github.com/ClickHouse/ClickHouse/pull/34534) ([zhanglistar](https://github.com/zhanglistar))，以及为内部数据结构引入版本控制 [#34486](https://github.com/ClickHouse/ClickHouse/pull/34486) ([zhanglistar](https://github.com/zhanglistar)).

<div id="improvement">
  #### 改进
</div>

* 允许在表函数中使用异步插入。修复了 [#34864](https://github.com/ClickHouse/ClickHouse/issues/34864)。[#34866](https://github.com/ClickHouse/ClickHouse/pull/34866) ([Anton Popov](https://github.com/CurtizJ)) 。
* 为函数 `dictGetHierarchy`、`dictIsIn`、`dictGetChildren`、`dictGetDescendants` 的 key 参数添加了隐式类型转换。关闭 [#34970](https://github.com/ClickHouse/ClickHouse/issues/34970)。[#35027](https://github.com/ClickHouse/ClickHouse/pull/35027) ([Maksim Kita](https://github.com/kitaisreal)) 。
* `EXPLAIN AST` 查询可以将 AST 以 Graphviz 图的形式输出：`EXPLAIN AST graph = 1 SELECT * FROM system.parts`。[#35173](https://github.com/ClickHouse/ClickHouse/pull/35173) ([李扬](https://github.com/taiyang-li)) 。
* 当使用 `s3` 表函数或表引擎写入大文件时，由于 AWS SDK 中的一个 bug，文件的内容类型会被错误设置为 `application/xml`。此修复解决了 [#33964](https://github.com/ClickHouse/ClickHouse/issues/33964)。[#34433](https://github.com/ClickHouse/ClickHouse/pull/34433) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 对限制性行策略做了小幅调整，使其在简单场景下更容易作为宽松策略的替代方案。如果某个特定表只存在限制性策略 (而不存在宽松策略) ，用户也将能够看到部分行。此外，`SHOW CREATE ROW POLICY` 现在始终会在行策略定义中显示 `AS permissive` 或 `AS restrictive`。[#34596](https://github.com/ClickHouse/ClickHouse/pull/34596) ([Vitaly Baranov](https://github.com/vitlibar)).
* 改进 File/S3/HDFS/URL 引擎中使用通配符时的 schema 推断。在发生错误时，尝试使用下一个 path 进行 schema 推断。[#34465](https://github.com/ClickHouse/ClickHouse/pull/34465) ([Kruglov Pavel](https://github.com/Avogar)).
* Play UI 现在可以正确识别操作系统首选的浅色/深色主题。[#35068](https://github.com/ClickHouse/ClickHouse/pull/35068) ([peledni](https://github.com/peledni)).
* 新增了 `date_time_input_format = 'best_effort_us'`。修复了 [#34799](https://github.com/ClickHouse/ClickHouse/issues/34799)。[#34982](https://github.com/ClickHouse/ClickHouse/pull/34982) ([WenYao](https://github.com/Cai-Yao)) 。
* 在 server configuration 中新增了 `allow_plaintext_password` 和 `allow_no_password` 两项设置，用于启用/禁用某些在部分环境中可能存在安全隐患的身份验证类型。它们默认处于启用状态。[#34738](https://github.com/ClickHouse/ClickHouse/pull/34738) ([Heena Bansal](https://github.com/HeenaBansal2009)).
* 已支持 `Arrow` 格式中的 `DateTime64` 数据类型，关闭了 [#8280](https://github.com/ClickHouse/ClickHouse/issues/8280) 和 [#28574](https://github.com/ClickHouse/ClickHouse/issues/28574)。[#34561](https://github.com/ClickHouse/ClickHouse/pull/34561) ([李扬](https://github.com/taiyang-li)) 。
* 在配置更新时重新加载 `remote_url_allow_hosts` (用于过滤出站连接) 。[#35294](https://github.com/ClickHouse/ClickHouse/pull/35294) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 为 `clickhouse-local` 增加了 `--testmode` 参数支持。该参数可启用对我们在功能测试中使用的测试提示的解析。[#35264](https://github.com/ClickHouse/ClickHouse/pull/35264) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 在查询日志中添加 `distributed_depth`。它相当于 `is_initial_query` 的一个更详细的版本 [#35207](https://github.com/ClickHouse/ClickHouse/pull/35207) ([李扬](https://github.com/taiyang-li)).
* 使 `MySQL` 和 `PostgreSQL` 表函数遵循 `remote_url_allow_hosts`。[#35191](https://github.com/ClickHouse/ClickHouse/pull/35191) ([Heena Bansal](https://github.com/HeenaBansal2009)).
* 在 `system.part_log` 中新增了 `disk_name` 字段。[#35178](https://github.com/ClickHouse/ClickHouse/pull/35178) ([Artyom Yurkov](https://github.com/Varinara)) 。
* 查询远程 URL 时，对于不可重试的错误不再重试。关闭 [#35161](https://github.com/ClickHouse/ClickHouse/issues/35161)。[#35172](https://github.com/ClickHouse/ClickHouse/pull/35172) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 支持在分布式 INSERT SELECT 查询中使用表函数 `view()` (设置 `parallel_distributed_insert_select`) 。[#35132](https://github.com/ClickHouse/ClickHouse/pull/35132) ([Azat Khuzhin](https://github.com/azat)) 。
* 通过 `AggregateFunction` 向 `Buffer` 执行 `INSERT` 时，对内存的跟踪更加精确。[#35072](https://github.com/ClickHouse/ClickHouse/pull/35072) ([Azat Khuzhin](https://github.com/azat)) 。
* 如果 Linux 内核存在 bug，则避免 Query Profiler 中发生除以零错误。关闭了 [#34787](https://github.com/ClickHouse/ClickHouse/issues/34787)。[#35032](https://github.com/ClickHouse/ClickHouse/pull/35032) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 为 Keeper 配置增加了更多合理性检查：现在不允许混用 localhost 和非本地服务器，同时还新增了对 internal raft port 与 keeper client port 取值相同的检查。[#35004](https://github.com/ClickHouse/ClickHouse/pull/35004) ([alesapin](https://github.com/alesapin)) 。
* 目前，如果用户更改系统表的设置，就会产生大量日志，且 ClickHouse 每分钟都会重命名这些表。此项修复解决了 [#34929](https://github.com/ClickHouse/ClickHouse/issues/34929)。[#34949](https://github.com/ClickHouse/ClickHouse/pull/34949) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 为 Hive 元存储客户端启用连接池。[#34940](https://github.com/ClickHouse/ClickHouse/pull/34940) ([lgbo](https://github.com/lgbo-ustc)).
* 如果新表引擎不支持按列设置的 `TTL`，则在 `CREATE TABLE AS` 中忽略它 (即该引擎不属于 `MergeTree` 家族) 。[#34938](https://github.com/ClickHouse/ClickHouse/pull/34938) ([Azat Khuzhin](https://github.com/azat)).
* 允许将 `LowCardinality` String 用于 `ngrambf_v1`/`tokenbf_v1` 索引。解决了 [#21865](https://github.com/ClickHouse/ClickHouse/issues/21865)。[#34911](https://github.com/ClickHouse/ClickHouse/pull/34911) ([Lars Hiller Eidnes](https://github.com/larspars)) 。
* 如果文件不存在，则允许打开空的 sqlite 数据库文件。已关闭 [#33367](https://github.com/ClickHouse/ClickHouse/issues/33367)。[#34907](https://github.com/ClickHouse/ClickHouse/pull/34907) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 为 FreeBSD 实现内存统计功能——这是 `max_server_memory_usage` 正确运行所必需的。[#34902](https://github.com/ClickHouse/ClickHouse/pull/34902) ([Alexandre Snarskii](https://github.com/snar)) 。
* 在先前版本中，clickhouse-client 中的进度条会在接近 50% 时无故突然向前跳动。此更改解决了 [#34324](https://github.com/ClickHouse/ClickHouse/issues/34324)。[#34801](https://github.com/ClickHouse/ClickHouse/pull/34801) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 现在，对于 `MergeTree` 表引擎，如果 `columnX` 是 `ALIAS` 列，`ALTER TABLE DROP COLUMN columnX` 查询将可立即执行。修复了 [#34660](https://github.com/ClickHouse/ClickHouse/issues/34660)。[#34786](https://github.com/ClickHouse/ClickHouse/pull/34786) ([alesapin](https://github.com/alesapin)) 。
* 当用户输错数据跳过索引名称时，显示提示。关闭了 [#29698](https://github.com/ClickHouse/ClickHouse/issues/29698)。[#34764](https://github.com/ClickHouse/ClickHouse/pull/34764) ([flynn](https://github.com/ucasfl)) 。
* 支持在 `parallel_distributed_insert_select` 中使用 `remote()`/`cluster()` 表函数。[#34728](https://github.com/ClickHouse/ClickHouse/pull/34728) ([Azat Khuzhin](https://github.com/azat)) 。
* 如果配置文件中没有相关配置，不要重置通过 `--log-file`/`--errorlog-file` 命令行选项设置的日志。[#34718](https://github.com/ClickHouse/ClickHouse/pull/34718) ([Amos Bird](https://github.com/amosbird)) 。
* 仅在创建表时提取一次 schema，并防止在每次服务器启动时都通过读取本地文件/外部数据源来提取 schema。[#34684](https://github.com/ClickHouse/ClickHouse/pull/34684) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 允许为可执行 UDF 指定参数名。这对于参数名属于序列化内容一部分的格式是必需的，例如 `Native`、`JSONEachRow`。关闭 [#34604](https://github.com/ClickHouse/ClickHouse/issues/34604)。[#34653](https://github.com/ClickHouse/ClickHouse/pull/34653) ([Maksim Kita](https://github.com/kitaisreal)) 。
* `MaterializedMySQL` (Experimental 功能) 现已支持 `materialized_mysql_tables_list` (MySQL database 中各表的逗号分隔列表，这些表将由 MaterializedMySQL database engine 复制。默认值：空列表——表示将复制所有表) ，见 [#32977](https://github.com/ClickHouse/ClickHouse/issues/32977)。[#34487](https://github.com/ClickHouse/ClickHouse/pull/34487) ([zzsmdfj](https://github.com/zzsmdfj)) 。
* 改进对分布式表执行 INSERT 操作时的 OpenTelemetry span 日志。[#34480](https://github.com/ClickHouse/ClickHouse/pull/34480) ([Frank Chen](https://github.com/FrankChen021)) 。
* 使 ClickHouse Keeper 中各服务器间 znode 的 `ctime` 和 `mtime` 保持一致。[#33441](https://github.com/ClickHouse/ClickHouse/pull/33441) ([小路](https://github.com/nicelulu)).

<div id="buildtestingpackaging-improvement">
  #### 构建/测试/打包改进
</div>

* 软件包仓库已迁移至 JFrog Artifactory (**Mikhail f. Shiryaev**) 。
* 在功能测试中将部分设置随机化，以便测试更多可能的设置组合。这是另一种模糊测试方法，可进一步提升测试覆盖率。此项关闭了 [#32268](https://github.com/ClickHouse/ClickHouse/issues/32268)。[#34092](https://github.com/ClickHouse/ClickHouse/pull/34092) ([Kruglov Pavel](https://github.com/Avogar)).
* 从 CI 中移除 PVS-Studio。[#34680](https://github.com/ClickHouse/ClickHouse/pull/34680) ([Mikhail f. Shiryaev](https://github.com/Felixoid)).
* 新增了使用 CMake 构建剥离符号后二进制文件的能力。在此前的版本中，这项工作由 dh-tools 完成。[#35196](https://github.com/ClickHouse/ClickHouse/pull/35196) ([alesapin](https://github.com/alesapin)).
* 体积更小的“fat-free”版 `clickhouse-keeper` 构建。[#35031](https://github.com/ClickHouse/ClickHouse/pull/35031) ([alesapin](https://github.com/alesapin)).
* 对于类似 [https://github.com/ClickHouse/ClickHouse/pull/34685](https://github.com/ClickHouse/ClickHouse/pull/34685) 的 PR，使用 @robot-clickhouse 作为 author 和 committer。[#34793](https://github.com/ClickHouse/ClickHouse/pull/34793) ([Mikhail f. Shiryaev](https://github.com/Felixoid)).
* 将调试信息的 DWARF 版本最高限制为 4，因为我们的内部堆栈符号解析器无法解析 DWARF 第 5 版。如果你使用 clang-15 编译 ClickHouse，这项更改是有意义的。[#34777](https://github.com/ClickHouse/ClickHouse/pull/34777) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 移除 `clickhouse-test` Debian 软件包这一不必要的复杂设计。CI 使用仓库中的测试，且不再支持通过 deb 软件包进行独立测试。[#34606](https://github.com/ClickHouse/ClickHouse/pull/34606) ([Ilya Yatsishin](https://github.com/qoega)).

<div id="bug-fix-user-visible-misbehaviour-in-official-stable-or-prestable-release">
  #### 缺陷修复
</div>

* 修复了 HDFS 集成中的一个问题：当内部缓冲区过小时，`HadoopSnappyDecoder` 中的 NEED\_MORE\_INPUT 会对同一个压缩块运行多次 (>=3) 。这会导致输入数据被复制到 `HadoopSnappyDecoder::buffer` 中的错误位置。[#35116](https://github.com/ClickHouse/ClickHouse/pull/35116) ([lgbo](https://github.com/lgbo-ustc)).
* 在 ATTACH GRANT 语句中忽略已废弃的授权。此 PR 修复了 [#34815](https://github.com/ClickHouse/ClickHouse/issues/34815)。[#34855](https://github.com/ClickHouse/ClickHouse/pull/34855) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复了 Postgres 数据库中的段错误：如果数据库是通过 named collections 创建的，在获取 CREATE TABLE 查询时会触发该问题。关闭 [#35312](https://github.com/ClickHouse/ClickHouse/issues/35312)。[#35313](https://github.com/ClickHouse/ClickHouse/pull/35313) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复 partial merge join 导致行重复的 bug，关闭 [#31009](https://github.com/ClickHouse/ClickHouse/issues/31009)。[#35311](https://github.com/ClickHouse/ClickHouse/pull/35311) ([Vladimir C](https://github.com/vdimir))。
* 修复了在使用 bzip2 压缩且 `max_read_buffer_size` 设置值较小时，可能出现的 `Assertion 'position() != working_buffer.end()' failed` 错误。该问题是在 [https://github.com/ClickHouse/ClickHouse/pull/35047](https://github.com/ClickHouse/ClickHouse/pull/35047) 中发现的。[#35300](https://github.com/ClickHouse/ClickHouse/pull/35300) ([Kruglov Pavel](https://github.com/Avogar))。修复了在使用 lz4 压缩且 max\_read\_buffer\_size 设置值较小时可能出现的问题。[#35296](https://github.com/ClickHouse/ClickHouse/pull/35296) ([Kruglov Pavel](https://github.com/Avogar))。修复了在使用 lzma 压缩且 `max_read_buffer_size` 设置值较小时可能出现的问题。[#35295](https://github.com/ClickHouse/ClickHouse/pull/35295) ([Kruglov Pavel](https://github.com/Avogar))。修复了在使用 `brotli` 压缩且 `max_read_buffer_size` 设置值较小时可能出现的问题。该问题是在 [https://github.com/ClickHouse/ClickHouse/pull/35047](https://github.com/ClickHouse/ClickHouse/pull/35047) 中发现的。[#35281](https://github.com/ClickHouse/ClickHouse/pull/35281) ([Kruglov Pavel](https://github.com/Avogar))。
* 修复 `JSONEachRow` schema 推断中可能出现的段错误。[#35291](https://github.com/ClickHouse/ClickHouse/pull/35291) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了在表中启用稀疏列时 `CHECK TABLE` 查询出错的问题。[#35274](https://github.com/ClickHouse/ClickHouse/pull/35274) ([Anton Popov](https://github.com/CurtizJ)) 。
* 避免在从远程 VFS 读取时因异常而调用 `std::terminate`。[#35257](https://github.com/ClickHouse/ClickHouse/pull/35257) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复从配置中读取端口的问题，结案 [#34776](https://github.com/ClickHouse/ClickHouse/issues/34776)。[#35193](https://github.com/ClickHouse/ClickHouse/pull/35193) ([Vladimir C](https://github.com/vdimir)).
* 修复了在 `HAVING` 返回空结果时，带有 `WITH TOTALS` 的查询中的错误。此修复对应 [#33711](https://github.com/ClickHouse/ClickHouse/issues/33711)。[#35186](https://github.com/ClickHouse/ClickHouse/pull/35186) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了 `replaceRegexpAll` 在某些边界场景下的问题，关闭 [#35117](https://github.com/ClickHouse/ClickHouse/issues/35117)。[#35182](https://github.com/ClickHouse/ClickHouse/pull/35182) ([Vladimir C](https://github.com/vdimir)) 。
* 在 `INSERT INTO FUNCTION s3(...) FROM ...` 这种情况下，schema inference 未能正常工作：它尝试从 s3 文件而不是从 select 查询中读取 schema。[#35176](https://github.com/ClickHouse/ClickHouse/pull/35176) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复 MaterializedPostgreSQL (Experimental 功能) 中 `table overrides` 对 partition by 等的支持。关闭 [#35048](https://github.com/ClickHouse/ClickHouse/issues/35048)。[#35162](https://github.com/ClickHouse/ClickHouse/pull/35162) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复 MaterializedPostgreSQL (实验性功能) 在手动移除 (DETACH TABLE) 后，无法将新表添加到复制 (ATTACH TABLE) 中的问题。关闭了 [#33800](https://github.com/ClickHouse/ClickHouse/issues/33800)。关闭了 [#34922](https://github.com/ClickHouse/ClickHouse/issues/34922)。关闭了 [#34315](https://github.com/ClickHouse/ClickHouse/issues/34315)。[#35158](https://github.com/ClickHouse/ClickHouse/pull/35158) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复了将非单调函数与 IN 运算符配合使用时出现的分区裁剪错误。此修复解决了 [#35136](https://github.com/ClickHouse/ClickHouse/issues/35136)。[#35146](https://github.com/ClickHouse/ClickHouse/pull/35146) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了 YAML 配置转换为 XML 时存在的轻微错误。[#35135](https://github.com/ClickHouse/ClickHouse/pull/35135) ([Miel Donkers](https://github.com/mdonkers)).
* 修复 `optimize_skip_unused_shards_rewrite_in` 在有符号列和负值情况下的问题。[#35134](https://github.com/ClickHouse/ClickHouse/pull/35134) ([Azat Khuzhin](https://github.com/azat)) 。
* 外部字典配置选项 `update_lag` 无法使用，会显示错误信息 ``Unexpected key `update_lag` in dictionary source configuration``。[#35089](https://github.com/ClickHouse/ClickHouse/pull/35089) ([Jason Chu](https://github.com/1lann)) 。
* 避免在 server 关闭时发生潜在死锁。[#35081](https://github.com/ClickHouse/ClickHouse/pull/35081) ([Azat Khuzhin](https://github.com/azat)).
* 修复了在启用 `optimize_functions_to_subcolumns` 设置时，函数被优化为子列后别名丢失的问题。关闭 [#33798](https://github.com/ClickHouse/ClickHouse/issues/33798)。[#35079](https://github.com/ClickHouse/ClickHouse/pull/35079) ([qieqieplus](https://github.com/qieqieplus)) 。
* 修复了在存在向表函数执行异步插入时，读取 `system.asynchronous_inserts` 表的问题。[#35050](https://github.com/ClickHouse/ClickHouse/pull/35050) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了可能出现的异常 `Reading for MergeTree family tables must be done with last position boundary` (与远程 VFS 上的操作有关) 。关闭 [#34979](https://github.com/ClickHouse/ClickHouse/issues/34979)。[#35001](https://github.com/ClickHouse/ClickHouse/pull/35001) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复在窗口帧中使用 `-State` 类型聚合函数时产生的异常结果。[#34999](https://github.com/ClickHouse/ClickHouse/pull/34999) ([metahys](https://github.com/metahys)).
* 修复了 FileLog 中可能出现的段错误 (实验性功能) 。关闭 [#30749](https://github.com/ClickHouse/ClickHouse/issues/30749)。[#34996](https://github.com/ClickHouse/ClickHouse/pull/34996) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复了一个可能偶发的错误：`Cannot push block to port which already has data`。[#34993](https://github.com/ClickHouse/ClickHouse/pull/34993) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了 CSV 中未加引号的日期的错误 schema inference。关闭 [#34768](https://github.com/ClickHouse/ClickHouse/issues/34768)。[#34961](https://github.com/ClickHouse/ClickHouse/pull/34961) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 与 Hive 集成：修复在 Hive 查询的 `where` 子句中使用 `in` 时出现非预期结果的问题。[#34945](https://github.com/ClickHouse/ClickHouse/pull/34945) ([lgbo](https://github.com/lgbo-ustc)).
* 避免 ClickHouse Keeper 在查找待删除的更新日志文件时进行忙轮询。[#34931](https://github.com/ClickHouse/ClickHouse/pull/34931) ([Azat Khuzhin](https://github.com/azat)).
* 修复了从 PostgreSQL 转换 DateTime64 时的问题。关闭了 [#33364](https://github.com/ClickHouse/ClickHouse/issues/33364)。[#34910](https://github.com/ClickHouse/ClickHouse/pull/34910) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 修复在向使用基于 S3 的 VFS 的 MergeTree 表执行 `INSERT` 时，可能出现“Part directory doesn't exist”错误的问题。[#34876](https://github.com/ClickHouse/ClickHouse/pull/34876) ([Azat Khuzhin](https://github.com/azat)) 。
* 支持在跨复制集群中执行 CREATE USER 等 DDL 语句。[#34860](https://github.com/ClickHouse/ClickHouse/pull/34860) ([Jianmei Zhang](https://github.com/zhangjmruc)) 。
* 修复了 `WindowView` 中按多列进行 group by 时的错误 (实验性功能) 。[#34859](https://github.com/ClickHouse/ClickHouse/pull/34859) ([vxider](https://github.com/Vxider)).
* 修复了查询包含 const 列时 S2 函数可能失败的问题。 [#34745](https://github.com/ClickHouse/ClickHouse/pull/34745) ([Bharat Nallan](https://github.com/bharatnc)).
* 修复了 H3 函数在包含常量列时导致查询失败的问题。[#34743](https://github.com/ClickHouse/ClickHouse/pull/34743) ([Bharat Nallan](https://github.com/bharatnc)) 。
* 修复了在启用 `fsync_part_directory` 并进行垂直合并时出现的 `No such file or directory` 问题。[#34739](https://github.com/ClickHouse/ClickHouse/pull/34739) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复系统查询 `RELOAD MODEL`、`RELOAD FUNCTION`、`RESTART DISK` 在配合 `ON CLUSTER` 使用时的序列化/输出问题。关闭 [#34514](https://github.com/ClickHouse/ClickHouse/issues/34514)。[#34696](https://github.com/ClickHouse/ClickHouse/pull/34696) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 修复了 `allow_experimental_projection_optimization` 与 `enable_global_with_statement` 的兼容问题 (此前在 `WITH` 子句中包含多个 expression 时，可能会导致 `Stack size too large` 错误，而且还会反复执行 scalar subqueries，因此现在效率更高) 。[#34650](https://github.com/ClickHouse/ClickHouse/pull/34650) ([Azat Khuzhin](https://github.com/azat)).
* 当另一个副本已更新 `ReplatedMergeTree` 引擎的事务日志时，停止为 mutation 选择分片。[#34633](https://github.com/ClickHouse/ClickHouse/pull/34633) ([Jianmei Zhang](https://github.com/zhangjmruc)).
* 修复了在使用数据分片移动功能时，简单 `count` 查询结果错误的问题 [#34089](https://github.com/ClickHouse/ClickHouse/issues/34089)。[#34385](https://github.com/ClickHouse/ClickHouse/pull/34385) ([nvartolomei](https://github.com/nvartolomei)) 。
* 修复了分布式子查询中 `max_query_size` 限制不一致的问题。[#34078](https://github.com/ClickHouse/ClickHouse/pull/34078) ([Chao Ma](https://github.com/godliness)) 。

### <a id="222" /> ClickHouse 版本发布 v22.2，2022-02-17。[Presentation](https://presentations.clickhouse.com/2022-release-22.2/)、[Video](https://www.youtube.com/watch?v=6EG1gwhSTPg)

<Frame>
  <iframe src="https://www.youtube.com/embed/6EG1gwhSTPg" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen />
</Frame>

<div id="upgrade-notes">
  #### 升级说明
</div>

* 对带有 FINAL 的查询使用数据跳过索引可能会产生错误结果。在此版本中，我们默认禁用了带有 FINAL 的查询的数据跳过索引 (新增设置 `use_skip_indexes_if_final`，默认禁用) 。[#34243](https://github.com/ClickHouse/ClickHouse/pull/34243) ([Azat Khuzhin](https://github.com/azat)) 。

<div id="new-feature-2">
  #### 新功能
</div>

* 投影功能已达到生产可用状态。默认开启 `allow_experimental_projection_optimization`，并弃用该设置。[#34456](https://github.com/ClickHouse/ClickHouse/pull/34456) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 新增了一个选项，用于在 `File`/`S3`/`HDFS` 引擎中执行 insert 时创建新文件。允许覆盖 `HDFS` 中的文件。默认情况下，尝试覆盖 `S3` 中的文件时会抛出异常。对于带有后缀的格式，尝试向文件追加数据时会抛出异常 (因此这类格式不支持追加，例如 `Parquet`、`ORC`) 。关闭了 [#31640](https://github.com/ClickHouse/ClickHouse/issues/31640) 关闭了 [#31622](https://github.com/ClickHouse/ClickHouse/issues/31622) 关闭了 [#23862](https://github.com/ClickHouse/ClickHouse/issues/23862) 关闭了 [#15022](https://github.com/ClickHouse/ClickHouse/issues/15022) 关闭了 [#16674](https://github.com/ClickHouse/ClickHouse/issues/16674)。[#33302](https://github.com/ClickHouse/ClickHouse/pull/33302) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 新增了一个设置，允许用户在 `MergeTree`/`ReplicatedMergeTree` 中提供自定义去重语义。提供后，系统会用它而非数据摘要来生成块 ID。因此，例如，在每条 INSERT 语句中为该设置提供一个唯一值，用户就可以避免相同的已插入数据被去重。此项关闭了：[#7461](https://github.com/ClickHouse/ClickHouse/issues/7461)。[#32304](https://github.com/ClickHouse/ClickHouse/pull/32304) ([Igor Nikonov](https://github.com/devcrafter)) 。
* 为 `INSERT` 语句新增对 `DEFAULT` 关键字的支持。关闭 [#6331](https://github.com/ClickHouse/ClickHouse/issues/6331)。[#33141](https://github.com/ClickHouse/ClickHouse/pull/33141) ([Andrii Buriachevskyi](https://github.com/1over)) 。
* 在 `CREATE TABLE` 查询中新增了 `EPHEMERAL` 列修饰符。解决了 [#9436](https://github.com/ClickHouse/ClickHouse/issues/9436)。[#34424](https://github.com/ClickHouse/ClickHouse/pull/34424) ([yakov-olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* 支持在 `TTL expr TO [DISK|VOLUME] [IF EXISTS] 'xxx'` 功能中使用 `IF EXISTS` 子句。只有当某个磁盘或卷在副本上存在时，parts 才会被移动到该磁盘或卷，因此 `MOVE TTL` 规则可以根据现有存储策略在不同副本上表现出不同的行为。解决了 [#34455](https://github.com/ClickHouse/ClickHouse/issues/34455)。[#34504](https://github.com/ClickHouse/ClickHouse/pull/34504) ([Anton Popov](https://github.com/CurtizJ)) 。
* 允许设置默认表引擎，从而可以在不指定 ENGINE 的情况下创建表。[#34187](https://github.com/ClickHouse/ClickHouse/pull/34187) ([Ilya Yatsishin](https://github.com/qoega)).
* 新增表函数 `format(format_name, data)`。[#34125](https://github.com/ClickHouse/ClickHouse/pull/34125) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 即使文件是通过 stdin 传入的，`clickhouse-local` 也能根据文件名检测 format。[#33829](https://github.com/ClickHouse/ClickHouse/pull/33829) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 为 `values` 表函数新增 schema 推断。关闭 [#33811](https://github.com/ClickHouse/ClickHouse/issues/33811)。[#34017](https://github.com/ClickHouse/ClickHouse/pull/34017) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 在重新加载配置时，可动态重新加载 server TLS 证书。关闭了 [#15764](https://github.com/ClickHouse/ClickHouse/issues/15764)。[#15765](https://github.com/ClickHouse/ClickHouse/pull/15765) ([johnskopis](https://github.com/johnskopis))。[#31257](https://github.com/ClickHouse/ClickHouse/pull/31257) ([Filatenkov Artur](https://github.com/FArthur-cmd))。
* 现在，ReplicatedMergeTree 可以在部分 disk 损坏时恢复数据。[#13544](https://github.com/ClickHouse/ClickHouse/pull/13544) ([Amos Bird](https://github.com/amosbird)) 。
* clickhouse-client 中的容错连接支持：`clickhouse-client ... --host host1 --host host2 --port port2 --host host3 --port port --host host4`。[#34490](https://github.com/ClickHouse/ClickHouse/pull/34490) ([Kruglov Pavel](https://github.com/Avogar)) 。[#33824](https://github.com/ClickHouse/ClickHouse/pull/33824) ([Filippov Denis](https://github.com/DF5HSE)) 。
* 新增 `DEGREES` 和 `RADIANS` 函数，以兼容 MySQL。[#33769](https://github.com/ClickHouse/ClickHouse/pull/33769) ([Bharat Nallan](https://github.com/bharatnc)) 。
* 新增 `h3ToCenterChild` 函数。[#33313](https://github.com/ClickHouse/ClickHouse/pull/33313) ([Bharat Nallan](https://github.com/bharatnc)) 。新增 h3 其他函数：`edgeLengthKm`、`exactEdgeLengthKm`、`exactEdgeLengthM`、`exactEdgeLengthRads`、`numHexagons`。[#33621](https://github.com/ClickHouse/ClickHouse/pull/33621) ([Bharat Nallan](https://github.com/bharatnc)) 。
* 新增函数 `bitSlice`，用于从 String/FixedString 中提取位子序列。[#33360](https://github.com/ClickHouse/ClickHouse/pull/33360) ([RogerYK](https://github.com/RogerYK)).
* 新增 `meanZTest` 聚合函数。[#33354](https://github.com/ClickHouse/ClickHouse/pull/33354) ([achimbab](https://github.com/achimbab)) 。
* 为 T 检验聚合函数新增置信区间。[#33260](https://github.com/ClickHouse/ClickHouse/pull/33260) ([achimbab](https://github.com/achimbab)).
* 新增函数 `addressToLineWithInlines`。关闭了 [#26211](https://github.com/ClickHouse/ClickHouse/issues/26211)。[#33467](https://github.com/ClickHouse/ClickHouse/pull/33467) ([SuperDJY](https://github.com/cmsxbc)) 。
* 新增将 `#!` 和 `# ` 识别为单行注释起始标记的支持。关闭 [#34138](https://github.com/ClickHouse/ClickHouse/issues/34138)。[#34230](https://github.com/ClickHouse/ClickHouse/pull/34230) ([Aaron Katz](https://github.com/aaronstephenkatz)) 。

<div id="experimental-feature">
  #### Experimental 功能
</div>

* 用于文本分类的函数：语言和字符集检测。参见 [#23271](https://github.com/ClickHouse/ClickHouse/issues/23271)。[#33314](https://github.com/ClickHouse/ClickHouse/pull/33314) ([Nikolay Degterinsky](https://github.com/evillique))。
* 为 `MemoryTracker` 添加内存 overcommit。新增用于内存限制的 `guaranteed` 设置，表示软内存限制。当达到硬内存限制时，`MemoryTracker` 会尝试取消 overcommit 最严重的查询。新设置 `memory_usage_overcommit_max_wait_microseconds` 指定查询最多可等待另一查询停止多久。关闭 [#28375](https://github.com/ClickHouse/ClickHouse/issues/28375)。[#31182](https://github.com/ClickHouse/ClickHouse/pull/31182) ([Dmitry Novik](https://github.com/novikd))。
* 在 WindowView 中启用 stream 到表的 join。[#33729](https://github.com/ClickHouse/ClickHouse/pull/33729) ([vxider](https://github.com/Vxider))。
* 在 `MaterializedMySQL` 中支持 `SET`、`YEAR`、`TIME` 和 `GEOMETRY` 数据类型 (Experimental 功能) 。修复 [#18091](https://github.com/ClickHouse/ClickHouse/issues/18091)、[#21536](https://github.com/ClickHouse/ClickHouse/issues/21536)、[#26361](https://github.com/ClickHouse/ClickHouse/issues/26361)。[#33429](https://github.com/ClickHouse/ClickHouse/pull/33429) ([zzsmdfj](https://github.com/zzsmdfj))。
* 修复默认启用投影时的各种问题。每个问题都在单独的提交中描述。此项针对 [#33678](https://github.com/ClickHouse/ClickHouse/issues/33678)，并修复了 [#34273](https://github.com/ClickHouse/ClickHouse/issues/34273)。[#34305](https://github.com/ClickHouse/ClickHouse/pull/34305) ([Amos Bird](https://github.com/amosbird))。

<div id="performance-improvement">
  #### 性能改进
</div>

* 如果 sorting key 的前缀部分已经有序，则支持 `optimize_read_in_order`。例如，如果表中的 sorting key 为 `ORDER BY (a, b)`，且查询包含 `WHERE a = const ORDER BY b` 子句，现在就会按照 sorting key 的顺序读取，而不是进行完整排序。[#32748](https://github.com/ClickHouse/ClickHouse/pull/32748) ([Anton Popov](https://github.com/CurtizJ)) 。
* 提升向表函数 `URL`、`S3`、`File`、`HDFS` 进行分区插入的性能。关闭了 [#34348](https://github.com/ClickHouse/ClickHouse/issues/34348)。[#34510](https://github.com/ClickHouse/ClickHouse/pull/34510) ([Maksim Kita](https://github.com/kitaisreal)) 。
* clickhouse-keeper 的多项性能优化。[#34484](https://github.com/ClickHouse/ClickHouse/pull/34484) [#34587](https://github.com/ClickHouse/ClickHouse/pull/34587) ([zhanglistar](https://github.com/zhanglistar)) 。
* `FlatDictionary` 提高了字典数据加载性能。[#33871](https://github.com/ClickHouse/ClickHouse/pull/33871) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 优化 `mapPopulateSeries` 函数的性能。关闭 [#33944](https://github.com/ClickHouse/ClickHouse/issues/33944)。[#34318](https://github.com/ClickHouse/ClickHouse/pull/34318) ([Maksim Kita](https://github.com/kitaisreal))。
* `_file` 和 `_path` 虚拟列 (在类似文件的表引擎中) 已设为 `LowCardinality`，这将加快针对多个文件的查询。关闭 [#34300](https://github.com/ClickHouse/ClickHouse/issues/34300)。[#34317](https://github.com/ClickHouse/ClickHouse/pull/34317) ([flynn](https://github.com/ucasfl)).
* 加快了数据分区片段的加载速度。此前该过程无法并行化：设置 `part_loading_threads` 不生效。参见 [#4699](https://github.com/ClickHouse/ClickHouse/issues/4699)。[#34310](https://github.com/ClickHouse/ClickHouse/pull/34310) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 提升 `LineAsString` 格式的性能。此项更改修复了 [#34303](https://github.com/ClickHouse/ClickHouse/issues/34303)。[#34306](https://github.com/ClickHouse/ClickHouse/pull/34306) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 将 `quantilesExact{Low,High}` 优化为使用 `nth_element` 替代 `sort`。[#34287](https://github.com/ClickHouse/ClickHouse/pull/34287) ([Danila Kutenin](https://github.com/danlark1)) 。
* 略微提升了 `Regexp` 格式的性能。[#34202](https://github.com/ClickHouse/ClickHouse/pull/34202) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 对标量子查询的分析进行了小幅改进。[#34128](https://github.com/ClickHouse/ClickHouse/pull/34128) ([Federico Rodriguez](https://github.com/fedrod)) 。
* 让 ORDER BY tuple 的速度几乎与对列进行 ORDER BY 一样快。对于多列 ORDER BY，我们有专门的优化：[https://github.com/ClickHouse/ClickHouse/pull/10831。将其也应用到](https://github.com/ClickHouse/ClickHouse/pull/10831。将其也应用到) tuple 列上也很有益。[#34060](https://github.com/ClickHouse/ClickHouse/pull/34060) ([Amos Bird](https://github.com/amosbird)).
* 重构并将标量子查询缓存重新引入 materialized view 的执行过程。[#33958](https://github.com/ClickHouse/ClickHouse/pull/33958) ([Raúl Marín](https://github.com/Algunenano)) 。
* 通过为 `memcmpSmall` 函数新增 x86-64 AVX-512 支持来加速内存比较，`ORDER BY` 的性能略有提升。仅在自行编译 ClickHouse 时有效。[#33706](https://github.com/ClickHouse/ClickHouse/pull/33706) ([hanqf-git](https://github.com/hanqf-git)).
* 如果某个键对应大量时间间隔，`range_hashed` 字典的性能将得到提升。修复了 [#23821](https://github.com/ClickHouse/ClickHouse/issues/23821)。[#33516](https://github.com/ClickHouse/ClickHouse/pull/33516) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 对于向 S3 执行插入和合并时，应尽可能并行写入文件 (TODO：检查是否已合并) 。[#33291](https://github.com/ClickHouse/ClickHouse/pull/33291) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 改进 `clickhouse-keeper` 性能，并修复 NuRaft 库中的多处内存泄漏。[#33329](https://github.com/ClickHouse/ClickHouse/pull/33329) ([alesapin](https://github.com/alesapin)) 。

<div id="improvement">
  #### 改进
</div>

* 支持 `clickhouse-client` 对带内联数据的查询进行异步插入。[#34267](https://github.com/ClickHouse/ClickHouse/pull/34267) ([Anton Popov](https://github.com/CurtizJ)) 。
* 函数 `dictGet`、`dictHas` 会在键参数与字典键结构不一致时，隐式将键参数转换为字典键结构。[#33672](https://github.com/ClickHouse/ClickHouse/pull/33672) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 改进了 `range_hashed` 字典。在存在多个 attribute 时，提升了加载性能。允许创建不含 attribute 的字典。新增选项，可在时间间隔 `start` 和 `end` 为 `Nullable` 类型时指定 strategy；`convert_null_range_bound_to_open` 默认为 `true`。关闭了 [#29791](https://github.com/ClickHouse/ClickHouse/issues/29791)。允许将 `Float`、`Decimal`、`DateTime64`、`Int128`、`Int256`、`UInt128`、`UInt256` 指定为范围类型。`RangeHashedDictionary` 新增了对超出 `Int64` 类型范围值的支持。关闭了 [#28322](https://github.com/ClickHouse/ClickHouse/issues/28322)。新增选项 `range_lookup_strategy`，用于指定范围 lookup 类型 `min`、`max`，默认值为 `min`。关闭了 [#21647](https://github.com/ClickHouse/ClickHouse/issues/21647)。修复了已分配字节数的计算问题。修复了 `ComplexKeyHashedDictionary` 情况下 `system.dictionaries` 中的 type name。[#33927](https://github.com/ClickHouse/ClickHouse/pull/33927) ([Maksim Kita](https://github.com/kitaisreal)).
* `flat`、`hashed`、`hashed_array` 字典现已支持在属性为空的情况下创建，同时支持读取键并使用 `dictHas`。修复了 [#33820](https://github.com/ClickHouse/ClickHouse/issues/33820)。[#33918](https://github.com/ClickHouse/ClickHouse/pull/33918) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 新增了字典对 `DateTime64` 数据类型的支持。[#33914](https://github.com/ClickHouse/ClickHouse/pull/33914) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 支持写成 `s3(url, access_key_id, secret_access_key)` (自动检测数据格式和表结构，但显式指定凭据) 。[#34503](https://github.com/ClickHouse/ClickHouse/pull/34503) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 根据 [#34362](https://github.com/ClickHouse/ClickHouse/issues/34362) 中的建议，新增了将 output format 回传给客户端的功能，与 HTTP protocol 中的处理方式一致。关闭 [#34362](https://github.com/ClickHouse/ClickHouse/issues/34362)。[#34499](https://github.com/ClickHouse/ClickHouse/pull/34499) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 在执行 INSERT SELECT 查询时发送 ProfileEvents 统计信息 (以便在 `clickhouse-client` 中显示此类查询的指标) 。[#34498](https://github.com/ClickHouse/ClickHouse/pull/34498) ([Dmitry Novik](https://github.com/novikd)) 。
* 将 `.jsonl` 扩展名识别为 JSONEachRow 格式。[#34496](https://github.com/ClickHouse/ClickHouse/pull/34496) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 改进 clickhouse-local 中的 schema 推断。现在可以直接写 `clickhouse-local -q "select * from table" < data.format`。[#34495](https://github.com/ClickHouse/ClickHouse/pull/34495) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 现在，CREATE/ALTER/DROP ROW POLICY 权限既可以在某个表上授予，也可以在 `database.*` 上授予，还可以全局授予到 `*.*`。[#34489](https://github.com/ClickHouse/ClickHouse/pull/34489) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 支持将任意大的文件导出到 `s3`。新增两个设置：`s3_upload_part_size_multiply_factor` 和 `s3_upload_part_size_multiply_parts_count_threshold`。现在，对于单个查询上传到 S3 的数据，每当上传的分片数达到 `s3_upload_part_size_multiply_parts_count_threshold` 时，`s3_min_upload_part_size` 就会乘以 `s3_upload_part_size_multiply_factor`。修复 [#34244](https://github.com/ClickHouse/ClickHouse/issues/34244)。[#34422](https://github.com/ClickHouse/ClickHouse/pull/34422) ([alesapin](https://github.com/alesapin)) 。
* 使用 URL 存储 / 表函数时，允许在使用通配符时跳过未找到 (404) 的 URL。另行关闭了 [#34359](https://github.com/ClickHouse/ClickHouse/issues/34359)。[#34392](https://github.com/ClickHouse/ClickHouse/pull/34392) ([Kseniia Sumarokova](https://github.com/kssenii)).
* `clickhouse-local` 的默认输入和输出格式，可通过 --input-format 和 --output-format 进行覆盖。已关闭 [#30631](https://github.com/ClickHouse/ClickHouse/issues/30631)。[#34352](https://github.com/ClickHouse/ClickHouse/pull/34352) ([李扬](https://github.com/taiyang-li)).
* 为 `clickhouse-format` 添加选项，解决了 [#30528](https://github.com/ClickHouse/ClickHouse/issues/30528)——`max_query_size` 和 `max_parser_depth`。[#34349](https://github.com/ClickHouse/ClickHouse/pull/34349) ([李扬](https://github.com/taiyang-li)) 。
* 在客户端启动前，对预输入进行了更好的处理。这是为了解决 [#34308](https://github.com/ClickHouse/ClickHouse/issues/34308)。[#34336](https://github.com/ClickHouse/ClickHouse/pull/34336) ([Amos Bird](https://github.com/amosbird)) 。
* 为兼容 PostgreSQL，新增了 `REGEXP_MATCHES` 和 `REGEXP_REPLACE` 函数别名。关闭 [#30885](https://github.com/ClickHouse/ClickHouse/issues/30885)。[#34334](https://github.com/ClickHouse/ClickHouse/pull/34334) ([李扬](https://github.com/taiyang-li)) 。
* 一些服务器要求在其 HTTP 请求中包含 User-Agent 请求头。现已为 HTTP 请求添加了格式如下的 `User-Agent` 请求头项：User-Agent: ClickHouse/VERSION\_STRING。[#34330](https://github.com/ClickHouse/ClickHouse/pull/34330) ([Saad Ur Rahman](https://github.com/surahman)) 。
* 在某些情况下，在为 `TRUNCATE` 查询获取表锁之前先取消 merges，以避免出现 `DEADLOCK_AVOIDED` 错误。修复了 [#34302](https://github.com/ClickHouse/ClickHouse/issues/34302)。[#34304](https://github.com/ClickHouse/ClickHouse/pull/34304) ([tavplubix](https://github.com/tavplubix)) 。
* 将日志中 "Cancelled merging parts" 消息的严重级别进行调整，因为它不是错误。此项修复关闭了 [#34148](https://github.com/ClickHouse/ClickHouse/issues/34148)。[#34232](https://github.com/ClickHouse/ClickHouse/pull/34232) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 新增支持将 PostgreSQL 风格的 CAST 运算符 `::` 与使用 `[]` 和 `.` 运算符的表达式 (数组和 Tuple 索引) 组合使用。[#34229](https://github.com/ClickHouse/ClickHouse/pull/34229) ([Nikolay Degterinsky](https://github.com/evillique)).
* 在 `parseDateTimeBestEffort` 函数中支持识别 `YYYYMMDD-hhmmss` 格式。这解决了 [#34206](https://github.com/ClickHouse/ClickHouse/issues/34206)。[#34208](https://github.com/ClickHouse/ClickHouse/pull/34208) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 在使用 `Regexp` format 进行解析时，允许在行中间出现回车符。此更改修复了 [#34200](https://github.com/ClickHouse/ClickHouse/issues/34200)。[#34205](https://github.com/ClickHouse/ClickHouse/pull/34205) ([alexey-milovidov](https://github.com/alexey-milovidov))。
* 允许将字典的 `PRIMARY KEY` 解析为 `PRIMARY KEY (id, value)`；此前仅支持 `PRIMARY KEY id, value` 这种写法。已关闭 [#34135](https://github.com/ClickHouse/ClickHouse/issues/34135)。[#34141](https://github.com/ClickHouse/ClickHouse/pull/34141) ([Maksim Kita](https://github.com/kitaisreal)) 。
* `splitByChar` 的一个可选参数，用于限制返回元素的数量。已关闭 [#34081](https://github.com/ClickHouse/ClickHouse/issues/34081)。[#34140](https://github.com/ClickHouse/ClickHouse/pull/34140) ([李扬](https://github.com/taiyang-li))。
* 改进了 clickhouse-client 的多行编辑体验。这是 [#31123](https://github.com/ClickHouse/ClickHouse/pull/31123) 的后续工作。[#34114](https://github.com/ClickHouse/ClickHouse/pull/34114) ([Amos Bird](https://github.com/amosbird)) 。
* 在 `MsgPack` 输入/输出格式中增加了对 `UUID` 的支持。[#34065](https://github.com/ClickHouse/ClickHouse/pull/34065) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 追踪上下文 (用于 OpenTelemetry) 现在可从 GRPC 客户端元数据中传播 (这一变更适用于 GRPC 客户端-服务器协议) 。[#34064](https://github.com/ClickHouse/ClickHouse/pull/34064) ([andremarianiello](https://github.com/andremarianiello)) 。
* 支持所有带有 `ON CLUSTER` 子句的 `SYSTEM` 查询类型。[#34005](https://github.com/ClickHouse/ClickHouse/pull/34005) ([小路](https://github.com/nicelulu)) 。
* 改进了对内存使用低于 `max_untracker_memory` 的查询的内存统计。[#34001](https://github.com/ClickHouse/ClickHouse/pull/34001) ([Azat Khuzhin](https://github.com/azat)).
* 修复了 UTF-8 字符串在小写和大写字符所占字节数不同时进行不区分大小写搜索的问题，例如 `ẞ` 和 `ß`。这解决了 [#7334](https://github.com/ClickHouse/ClickHouse/issues/7334)。[#33992](https://github.com/ClickHouse/ClickHouse/pull/33992) ([Harry Lee](https://github.com/HarryLeeIBM)) 。
* 在 `clickhouse-local` 中支持从 stdin 自动检测 format 和 schema。[#33960](https://github.com/ClickHouse/ClickHouse/pull/33960) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 正确处理多个磁盘在文件系统上使用同一路径时的错误配置情况。[#29072](https://github.com/ClickHouse/ClickHouse/issues/29072)。[#33905](https://github.com/ClickHouse/ClickHouse/pull/33905) ([zhongyuankai](https://github.com/zhongyuankai)) 。
* 在获取 S3 代理时，会尝试每个已解析出的 IP 地址。S3 代理很少使用，主要见于 Yandex Cloud。 [#33862](https://github.com/ClickHouse/ClickHouse/pull/33862) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 现已支持 EXPLAIN AST CREATE FUNCTION 查询：`EXPLAIN AST CREATE FUNCTION mycast AS (n) -> cast(n as String)` 将返回 `EXPLAIN AST CREATE FUNCTION mycast AS n -> CAST(n, 'String')`。[#33819](https://github.com/ClickHouse/ClickHouse/pull/33819) ([李扬](https://github.com/taiyang-li)).
* 新增支持将 `Map(Key, Value)` 转换为 `Array(Tuple(Key, Value))`。[#33794](https://github.com/ClickHouse/ClickHouse/pull/33794) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 对 `Bool` 数据类型进行了一些改进和修复。修复了 [#33244](https://github.com/ClickHouse/ClickHouse/issues/33244)。[#33737](https://github.com/ClickHouse/ClickHouse/pull/33737) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 以大端序解析并存储 OpenTelemetry trace-id。 [#33723](https://github.com/ClickHouse/ClickHouse/pull/33723) ([Frank Chen](https://github.com/FrankChen021)).
* 改进了 `fromUnixTimestamp64` 家族函数。现在，它们可以接受任何可转换为 `Int64` 的整数值。此修复关闭了：[#14648](https://github.com/ClickHouse/ClickHouse/issues/14648)。[#33505](https://github.com/ClickHouse/ClickHouse/pull/33505) ([Andrey Zvonov](https://github.com/zvonand))。
* 将 `_shard_num` 从常量改为通过 `shardNum()` 函数实现 (参见 [#7624](https://github.com/ClickHouse/ClickHouse/issues/7624) 和 [#27020](https://github.com/ClickHouse/ClickHouse/issues/27020)) ，以避免潜在问题 (例如 [#16947](https://github.com/ClickHouse/ClickHouse/issues/16947) 中发现的问题) 。[#33392](https://github.com/ClickHouse/ClickHouse/pull/33392) ([Azat Khuzhin](https://github.com/azat)) 。
* 支持 Decimal 和 Float 之间的二元算术运算 (加、减、乘、除、least、greatest) 。[#33355](https://github.com/ClickHouse/ClickHouse/pull/33355) ([flynn](https://github.com/ucasfl)) 。
* 在自动检测 max\_threads 时遵循 cgroups 限制。[#33342](https://github.com/ClickHouse/ClickHouse/pull/33342) ([JaySon](https://github.com/JaySon-Huang)) 。
* 新增 clickhouse-keeper 配置项 `min_session_timeout_ms`。现在，clickhouse-keeper 将根据 `min_session_timeout_ms` 和 `session_timeout_ms` 这两个配置项来确定客户端会话超时时间。[#33288](https://github.com/ClickHouse/ClickHouse/pull/33288) ([JackyWoo](https://github.com/JackyWoo)) 。
* 函数 `hex` 和 `bin` 现已支持 `UUID` 数据类型。[#32170](https://github.com/ClickHouse/ClickHouse/pull/32170) ([Frank Chen](https://github.com/FrankChen021)) 。
* 修复了读取名称中带点号的子列时的问题。特别是，当元素名称包含点号时，修复了 `Nested` 列的读取问题 (例如 ``Nested(`keys.name` String, `keys.id` UInt64, values UInt64)``) 。[#34228](https://github.com/ClickHouse/ClickHouse/pull/34228) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了使用 `VALUES` 向表中插入数据时，`parallel_view_processing = 0` 不生效的问题。- 修复了 `query_views_log` 中的 `view_duration_ms` 在 materialized view 上未被正确设置的问题。[#34067](https://github.com/ClickHouse/ClickHouse/pull/34067) ([Raúl Marín](https://github.com/Algunenano)) 。
* 修复了从 ZooKeeper 解析表结构的问题：现在会以规范形式将来自 ZooKeeper 的元数据与本地元数据进行比对。这有助于解决不同 ClickHouse 版本之间规范函数名称可能发生变化的情况。[#33933](https://github.com/ClickHouse/ClickHouse/pull/33933) ([sunny](https://github.com/sunny19930321)).
* 对与 LDAP 交互时的某些字符进行了正确转义。[#33401](https://github.com/ClickHouse/ClickHouse/pull/33401) ([IlyaTsoi](https://github.com/IlyaTsoi)) 。

<div id="buildtestingpackaging-improvement">
  #### 构建/测试/打包改进
</div>

* 移除对非捆绑构建的支持。[#33690](https://github.com/ClickHouse/ClickHouse/pull/33690) ([Azat Khuzhin](https://github.com/azat)).
* 确保测试不依赖相同元素的非稳定排序结果。在调试模式下，新增了对排序后相等项区间的随机化处理，以防止在依赖相等项排序顺序时出现问题。[#34393](https://github.com/ClickHouse/ClickHouse/pull/34393) ([Maksim Kita](https://github.com/kitaisreal)).
* 为风格检查增加详细输出。[#34289](https://github.com/ClickHouse/ClickHouse/pull/34289) ([Mikhail f. Shiryaev](https://github.com/Felixoid)).
* 移除 `clickhouse-test` Debian 软件包，因为它已过时。[#33948](https://github.com/ClickHouse/ClickHouse/pull/33948) ([Ilya Yatsishin](https://github.com/qoega)).
* 对构建系统进行了多项改进，以避免偶尔使用操作系统的软件包，并强制实施封闭式构建。[#33695](https://github.com/ClickHouse/ClickHouse/pull/33695) ([Amos Bird](https://github.com/amosbird)).

<div id="bug-fix-user-visible-misbehavior-in-official-stable-or-prestable-release-2">
  #### 缺陷修复 (官方稳定版本或预稳定版本中用户可见的异常行为)
</div>

* 修复了在使用 `allow_experimental_parallel_reading_from_replicas` 且 `max_parallel_replicas` 等于 1 时的断言错误。此修复解决了 [#34525](https://github.com/ClickHouse/ClickHouse/issues/34525)。[#34613](https://github.com/ClickHouse/ClickHouse/pull/34613) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 修复了一个罕见 bug：读取空数组时，可能会导致 `Data compressed with different methods` 错误。如果数组大多为空，在使用 ORDER BY ... DESC 进行反向读取时，可能会复现，但并非每次都会发生。这个错误出现的概率极低。[#34327](https://github.com/ClickHouse/ClickHouse/pull/34327) ([Anton Popov](https://github.com/CurtizJ)).
* 修复了对小类型整数值进行舍入时 `round`/`roundBankers` 返回错误结果的问题。关闭 [#33267](https://github.com/ClickHouse/ClickHouse/issues/33267)。[#34562](https://github.com/ClickHouse/ClickHouse/pull/34562) ([李扬](https://github.com/taiyang-li)).
* 有时，在从 S3 或 HDFS 读取多个文件时，取消查询不会立即生效。修复了 [#34301](https://github.com/ClickHouse/ClickHouse/issues/34301)，与 [#34397](https://github.com/ClickHouse/ClickHouse/issues/34397) 相关。[#34539](https://github.com/ClickHouse/ClickHouse/pull/34539) ([Dmitry Novik](https://github.com/novikd)).
* 修复异常 `Chunk should have AggregatedChunkInfo in MergingAggregatedTransform` (在 `optimize_aggregation_in_order = 1` 且 `distributed_aggregation_memory_efficient = 0` 时) 。修复 [#34526](https://github.com/ClickHouse/ClickHouse/issues/34526)。[#34532](https://github.com/ClickHouse/ClickHouse/pull/34532) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了索引分析中整数与浮点数比较的问题。此前，这可能会导致误跳过某些应读取的粒度。修复了 [#34493](https://github.com/ClickHouse/ClickHouse/issues/34493)。[#34528](https://github.com/ClickHouse/ClickHouse/pull/34528) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复 URL 引擎中的压缩支持问题。[#34524](https://github.com/ClickHouse/ClickHouse/pull/34524) ([Frank Chen](https://github.com/FrankChen021)) 。
* 修复文件 schema 自动检测中可能出现的 'file\_size: Operation not supported' 错误。[#34479](https://github.com/ClickHouse/ClickHouse/pull/34479) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了删除表时可能出现的竞争条件。[#34416](https://github.com/ClickHouse/ClickHouse/pull/34416) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复短路函数求值时可能出现的错误 `Cannot convert column Function to mask`。关闭 [#34171](https://github.com/ClickHouse/ClickHouse/issues/34171)。[#34415](https://github.com/ClickHouse/ClickHouse/pull/34415) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复从 URL source 进行 schema 推断时可能发生的崩溃问题。关闭 [#34147](https://github.com/ClickHouse/ClickHouse/issues/34147)。[#34405](https://github.com/ClickHouse/ClickHouse/pull/34405) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 对于 UDFs，访问权限此前被错误地在 database 级别进行检查，而不是应有的全局级别。关闭 [#34281](https://github.com/ClickHouse/ClickHouse/issues/34281)。[#34404](https://github.com/ClickHouse/ClickHouse/pull/34404) ([Maksim Kita](https://github.com/kitaisreal)).
* 修复了对使用 `Memory` 引擎的数据库执行 `SHOW CREATE DATABASE` 查询时，结果中错误的引擎语法。此修复关闭了 [#34335](https://github.com/ClickHouse/ClickHouse/issues/34335)。[#34345](https://github.com/ClickHouse/ClickHouse/pull/34345) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了几个极其罕见的竞态条件，它们可能导致复制队列状态异常，并引发 "intersecting parts" 错误。[#34297](https://github.com/ClickHouse/ClickHouse/pull/34297) ([tavplubix](https://github.com/tavplubix)) 。
* 修复进度条宽度。此前它被错误地舍入为整数个字符。[#34275](https://github.com/ClickHouse/ClickHouse/pull/34275) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复了服务器间通信中 current\_user/current\_address 客户端信息字段的问题 (在此补丁之前，current\_user/current\_address 会保留上一条查询中的值) 。[#34263](https://github.com/ClickHouse/ClickHouse/pull/34263) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了在 `optimize_aggregation_in_order=1` 时，查询处理过程中发生某些 Exception 时的内存泄漏问题。[#34234](https://github.com/ClickHouse/ClickHouse/pull/34234) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复指标 `Query`，该指标显示正在执行的查询数量。在之前的几个版本中，该值一直为 0。[#34224](https://github.com/ClickHouse/ClickHouse/pull/34224) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复表函数 `s3` 的 schema 推断问题。[#34186](https://github.com/ClickHouse/ClickHouse/pull/34186) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了 `HDFS`、`S3` 和 `URL` 存储引擎中一种罕见但无害的竞态条件，该问题可能导致产生额外连接。[#34172](https://github.com/ClickHouse/ClickHouse/pull/34172) ([alesapin](https://github.com/alesapin)).
* 修复了一个极少发生的缺陷：读取使用 S3 等远程文件系统存储数据的 MergeTree 表引擎家族中的 LowCardinality 列时，偶尔可能会报错 "Cannot read all data" (基于 S3 的虚拟文件系统是一项尚未可用于生产环境的 Experimental 功能) 。[#34139](https://github.com/ClickHouse/ClickHouse/pull/34139) ([alesapin](https://github.com/alesapin)).
* 修复了 native 协议变更时向分布式表插入数据可能出现的问题。上一次变更是在 22.1 版本中，因此升级到该版本后，向分布式表插入数据可能会失败。[#34132](https://github.com/ClickHouse/ClickHouse/pull/34132) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了 `File` 表引擎中一个可能存在的数据竞争问题，该问题由 [#33960](https://github.com/ClickHouse/ClickHouse/pull/33960) 引入。关闭 [#34111](https://github.com/ClickHouse/ClickHouse/issues/34111)。[#34113](https://github.com/ClickHouse/ClickHouse/pull/34113) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了一个轻微的竞态条件：在极少数情况下，ZooKeeper 连接丢失后，可能会触发 "intersecting parts" 错误。[#34096](https://github.com/ClickHouse/ClickHouse/pull/34096) ([tavplubix](https://github.com/tavplubix)) 。
* 修复了 `Native` 格式下的异步插入问题。[#34068](https://github.com/ClickHouse/ClickHouse/pull/34068) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了一个 bug：当同时使用 replicated 访问存储和 Keeper (内嵌于 clickhouse-server 中) 时，server 无法启动。为 Keeper 套接字超时新增了两个设置项，用来替代默认用户中的设置：`keeper_server.socket_receive_timeout_sec` 和 `keeper_server.socket_send_timeout_sec`。修复了 [#33973](https://github.com/ClickHouse/ClickHouse/issues/33973)。[#33988](https://github.com/ClickHouse/ClickHouse/pull/33988) ([alesapin](https://github.com/alesapin)) 。
* 修复了解析页脚损坏的 ORC 文件时出现的段错误。关闭 [#33797](https://github.com/ClickHouse/ClickHouse/issues/33797)。[#33984](https://github.com/ClickHouse/ClickHouse/pull/33984) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了从查询参数中解析 IPv6 (预处理语句) 的问题，并修复了将 IPv6 转换为字符串的问题。关闭 [#33928](https://github.com/ClickHouse/ClickHouse/issues/33928)。[#33971](https://github.com/ClickHouse/ClickHouse/pull/33971) ([Kruglov Pavel](https://github.com/Avogar))。
* 修复读取嵌套元组时的崩溃问题。修复了 [#33838](https://github.com/ClickHouse/ClickHouse/issues/33838)。[#33956](https://github.com/ClickHouse/ClickHouse/pull/33956) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了在分布式查询中以字面量参数使用函数 `array` 和 `tuple` 时的问题。此前，这可能导致出现 `Not found columns` 异常。[#33938](https://github.com/ClickHouse/ClickHouse/pull/33938) ([Anton Popov](https://github.com/CurtizJ)) 。
* 聚合函数组合器 `-If` 未能正确处理 `Nullable` 过滤器参数。此项修复关闭了 [#27073](https://github.com/ClickHouse/ClickHouse/issues/27073)。[#33920](https://github.com/ClickHouse/ClickHouse/pull/33920) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复远程 disk 读取时可能出现的竞态条件 (基于 S3 的虚拟文件系统仍属 Experimental 功能，尚未达到生产可用状态) 。[#33912](https://github.com/ClickHouse/ClickHouse/pull/33912) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了使用带有非标识符参数的 lambda 创建 SQL UDF 时发生崩溃的问题。关闭 [#33866](https://github.com/ClickHouse/ClickHouse/issues/33866)。[#33868](https://github.com/ClickHouse/ClickHouse/pull/33868) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 修复了稀疏列的使用问题 (可通过 Experimental 设置 `ratio_of_defaults_for_sparse_serialization` 启用) 。[#33849](https://github.com/ClickHouse/ClickHouse/pull/33849) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了在副本实际处于 readonly 状态时，`SYSTEM RESTORE REPLICA` 查询中出现的 `replica is not readonly` 逻辑错误。修复 [#33806](https://github.com/ClickHouse/ClickHouse/issues/33806)。[#33847](https://github.com/ClickHouse/ClickHouse/pull/33847) ([tavplubix](https://github.com/tavplubix)) 。
* 修复了在使用压缩 (默认启用) 时 `clickhouse-keeper` 中的内存泄漏问题。[#33840](https://github.com/ClickHouse/ClickHouse/pull/33840) ([Azat Khuzhin](https://github.com/azat)).
* 修复了在没有可用公共类型时的索引分析问题。[#33833](https://github.com/ClickHouse/ClickHouse/pull/33833) ([Amos Bird](https://github.com/amosbird)) 。
* 修复 `JSONEachRow` 和 `JSONCompactEachRow` 的 schema 推断问题。 [#33830](https://github.com/ClickHouse/ClickHouse/pull/33830) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复了在使用 `redis` 源且键数量较多时外部字典的问题。[#33804](https://github.com/ClickHouse/ClickHouse/pull/33804) ([Anton Popov](https://github.com/CurtizJ)).
* 修复了 client 中的一个 bug，该问题会导致 server 中出现 'Connection reset by peer' 错误。关闭 [#33309](https://github.com/ClickHouse/ClickHouse/issues/33309)。[#33790](https://github.com/ClickHouse/ClickHouse/pull/33790) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了解析查询 INSERT INTO ... VALUES SETTINGS ... (...), ... 时的问题 [#33776](https://github.com/ClickHouse/ClickHouse/pull/33776) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了在使用宽格式和投影创建数据分区片段时检查表的 bug。[#33774](https://github.com/ClickHouse/ClickHouse/pull/33774) ([李扬](https://github.com/taiyang-li)).
* 修复了 MergeTree 中 count() 与 INSERT/合并/... 之间的微小竞态条件 (对于启用 optimize\_trivial\_count\_query 的 SELECT，可能返回错误的行数) 。 [#33753](https://github.com/ClickHouse/ClickHouse/pull/33753) ([Azat Khuzhin](https://github.com/azat)).
* 当存储 HDFS 中的目录列表请求失败时，会抛出异常。[#33724](https://github.com/ClickHouse/ClickHouse/pull/33724) ([LiuNeng](https://github.com/liuneng1994)) 。
* 修复表包含投影时变更操作的问题。此修复解决了 [#33010](https://github.com/ClickHouse/ClickHouse/issues/33010)。此修复解决了 [#33275](https://github.com/ClickHouse/ClickHouse/issues/33275)。[#33679](https://github.com/ClickHouse/ClickHouse/pull/33679) ([Amos Bird](https://github.com/amosbird)) 。
* 如果在具名 HTTP 会话中执行 `CREATE TEMPORARY TABLE AS SELECT` 查询，则能正确确定当前数据库。这是一个非常罕见的用例。此修复关闭了 [#8340](https://github.com/ClickHouse/ClickHouse/issues/8340)。[#33676](https://github.com/ClickHouse/ClickHouse/pull/33676) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 允许某些包含排序、LIMIT BY、ARRAY JOIN 和 lambda 函数的查询。这解决了 [#7462](https://github.com/ClickHouse/ClickHouse/issues/7462)。[#33675](https://github.com/ClickHouse/ClickHouse/pull/33675) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了 "zero copy replication" (一项仍在开发中且不应在生产环境中使用的功能) 中的一个错误，该错误会在执行 TTL move 时导致数据重复。修复了 [#33643](https://github.com/ClickHouse/ClickHouse/issues/33643)。[#33642](https://github.com/ClickHouse/ClickHouse/pull/33642) ([alesapin](https://github.com/alesapin)) 。
* 修复 `GroupingAggregatedTransform` 中 `Chunk` 应包含 `AggregatedChunkInfo` 的问题 (在 `optimize_aggregation_in_order = 1` 的情况下) 。[#33637](https://github.com/ClickHouse/ClickHouse/pull/33637) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复错误 `Bad cast from type ... to DB::DataTypeArray`：当表包含名称中带点的 `Nested` 列，且系统会为其生成默认值时 (例如在 insert 时未列出该列) ，可能会出现该错误。此修复是 [#28762](https://github.com/ClickHouse/ClickHouse/issues/28762) 的延续。[#33588](https://github.com/ClickHouse/ClickHouse/pull/33588) ([Alexey Pavlenko](https://github.com/alexeypavlenko)).
* 导出为 `lz4` 文件的问题已修复。关闭 [#31421](https://github.com/ClickHouse/ClickHouse/issues/31421)。[#31862](https://github.com/ClickHouse/ClickHouse/pull/31862) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了这样一种可能导致崩溃的问题：当 `group_by_overflow_mode` 设置为 `any` (近似 GROUP BY) ，并且对类型为 `LowCardinality` 的单列执行聚合时。[#34506](https://github.com/ClickHouse/ClickHouse/pull/34506) ([DR](https://github.com/freedomDR)).
* 修复了通过 gRPC 客户端-服务器协议向临时表插入数据的问题。修复了 [#34347](https://github.com/ClickHouse/ClickHouse/issues/34347) 和问题 `#2`。[#34364](https://github.com/ClickHouse/ClickHouse/pull/34364) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复了问题 [#19429](https://github.com/ClickHouse/ClickHouse/issues/19429)。[#34225](https://github.com/ClickHouse/ClickHouse/pull/34225) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复了问题 [#18206](https://github.com/ClickHouse/ClickHouse/issues/18206)。[#33977](https://github.com/ClickHouse/ClickHouse/pull/33977) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 此 PR 允许在同一个用户目录列表中使用多个 LDAP 存储。此前本可正常工作，但由于 LDAP 测试被禁用 (它们属于 testflows 测试的一部分) ，这一功能后来失效了。[#33574](https://github.com/ClickHouse/ClickHouse/pull/33574) ([Vitaly Baranov](https://github.com/vitlibar)) 。

### <a id="221" /> ClickHouse 版本 v22.1，2022-01-18。 [演示资料](https://presentations.clickhouse.com/2022-release-22.1/), [视频](https://www.youtube.com/watch?v=gP7I2SUBXig)

<Frame>
  <iframe src="https://www.youtube.com/embed/gP7I2SUBXig" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen />
</Frame>

<div id="upgrade-notes">
  #### 升级说明
</div>

* 函数 `left` 和 `right` 之前是在 parser 中实现的，现在已支持完整功能。如果集群中包含不同版本的 clickhouse-server，那么在没有别名的情况下使用 `left` 或 `right` 函数的分布式查询可能会抛出异常。如果你正在升级集群并遇到此错误，应完成整个集群的升级，以确保所有节点使用相同版本。你也可以为查询中的列添加别名 (`AS something`) 来避免此问题。 [#33407](https://github.com/ClickHouse/ClickHouse/pull/33407) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 从该版本起，标量子查询的资源使用情况会被完整统计。通过这一更改，标量子查询中读取的行现在会记录到 query\_log 中。如果标量子查询被缓存 (重复执行或针对多行调用) ，读取的行只会统计一次。这一更改使得查询在执行标量子查询期间也可以被 KILL，并且能够报告进度。 [#32271](https://github.com/ClickHouse/ClickHouse/pull/32271) ([Raúl Marín](https://github.com/Algunenano)).

<div id="new-feature-2">
  #### 新功能
</div>

* 为输入格式实现数据 schema 自动推断。允许在表函数 `file`、`url`、`s3`、`hdfs` 以及 `clickhouse-local` 的参数中省略结构定义 (或仅写 `auto`) 。允许在表引擎 `File`、`HDFS`、`S3`、`URL`、`Merge`、`Buffer`、`Distributed` 和 `ReplicatedMergeTree` 的 CREATE 查询中省略结构定义 (如果添加了新的副本) 。[#32455](https://github.com/ClickHouse/ClickHouse/pull/32455) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 在 `file`/`hdfs`/`s3`/`url` 表函数、`HDFS`/`S3`/`URL` 表引擎，以及 `SELECT INTO OUTFILE` 和 `INSERT FROM INFILE` 中，支持根据文件扩展名识别格式 [#33565](https://github.com/ClickHouse/ClickHouse/pull/33565) ([Kruglov Pavel](https://github.com/Avogar)) 。关闭 [#30918](https://github.com/ClickHouse/ClickHouse/issues/30918)。[#33443](https://github.com/ClickHouse/ClickHouse/pull/33443) ([OnePiece](https://github.com/zhongyuankai)) 。
* 一个在您需要支持时用于收集诊断数据的工具。[#33175](https://github.com/ClickHouse/ClickHouse/pull/33175) ([Alexander Burmak](https://github.com/Alex-Burmak)).
* 通过 Zoo/Keeper 实现集群自动发现。无需更改每台服务器上的配置，即可向集群中添加副本。[#31442](https://github.com/ClickHouse/ClickHouse/pull/31442) ([vdimir](https://github.com/vdimir)).
* 实现了 hive 表引擎，使 ClickHouse 能够访问 Apache Hive。该实现对应：[#29245](https://github.com/ClickHouse/ClickHouse/issues/29245)。[#31104](https://github.com/ClickHouse/ClickHouse/pull/31104) ([taiyang-li](https://github.com/taiyang-li)) 。
* 新增聚合函数 `cramersV`、`cramersVBiasCorrected`、`theilsU` 和 `contingency`。这些函数用于计算分类值之间的依赖关系 (即关联性的度量) 。这些函数的实现都使用了交叉表 (成对值的直方图) 。你可以将它理解为类似相关系数，但适用于任意离散值 (不一定是数值) 。[#33366](https://github.com/ClickHouse/ClickHouse/pull/33366) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。初始实现由 [Vanyok-All-is-OK](https://github.com/Vanyok-All-is-OK) 和 [antikvist](https://github.com/antikvist) 完成。
* 新增了表函数 `hdfsCluster`，它允许像 `s3Cluster` 一样，在指定 cluster 的多个节点上并行处理来自 HDFS 的文件。[#32400](https://github.com/ClickHouse/ClickHouse/pull/32400) ([Zhichang Yu](https://github.com/yuzhichang)) 。
* 新增了对以 Azure Blob 存储为后端的磁盘的支持，类似于此前对以 AWS S3 为后端的磁盘所提供的支持。[#31505](https://github.com/ClickHouse/ClickHouse/pull/31505) ([Jakub Kuklis](https://github.com/jkuklis)).
* 允许在 `CREATE VIEW` 语句中使用 `COMMENT` (适用于所有类型的 VIEW) 。[#31062](https://github.com/ClickHouse/ClickHouse/pull/31062) ([Vasily Nemkov](https://github.com/Enmk)) 。
* 在配置发生变化时，动态重新初始化监听端口和协议。[#30549](https://github.com/ClickHouse/ClickHouse/pull/30549) ([Kevin Michel](https://github.com/kmichel-aiven)) 。
* 新增了 `left`、`right`、`leftUTF8`、`rightUTF8` 函数。修复了 `substringUTF8` 函数在负偏移量 (即从字符串末尾开始偏移) 情况下实现中的错误。[#33407](https://github.com/ClickHouse/ClickHouse/pull/33407) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 为 `H3` 坐标系新增函数：`h3HexAreaKm2`、`h3CellAreaM2`、`h3CellAreaRads2`。[#33479](https://github.com/ClickHouse/ClickHouse/pull/33479) ([Bharat Nallan](https://github.com/bharatnc)) 。
* 新增 `MONTHNAME` 函数。[#33436](https://github.com/ClickHouse/ClickHouse/pull/33436) ([usurai](https://github.com/usurai)) 。
* 新增了函数 `arrayLast`。关闭了 [#33390](https://github.com/ClickHouse/ClickHouse/issues/33390)。[#33415](https://github.com/ClickHouse/ClickHouse/pull/33415) 新增了函数 `arrayLastIndex`。[#33465](https://github.com/ClickHouse/ClickHouse/pull/33465) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 新增函数 `decodeURLFormComponent`，与 `decodeURLComponent` 稍有不同。关闭 [#10298](https://github.com/ClickHouse/ClickHouse/issues/10298)。[#33451](https://github.com/ClickHouse/ClickHouse/pull/33451) ([SuperDJY](https://github.com/cmsxbc)) 。
* 支持按普通/带标签指标拆分 `GraphiteMergeTree` 的 rollup 规则 (可选的 rule\_type 字段) 。[#33494](https://github.com/ClickHouse/ClickHouse/pull/33494) ([Michail Safronov](https://github.com/msaf1980)) 。

<div id="performance-improvement">
  #### 性能改进
</div>

* 如果 `Merge` 引擎的所有底层表都支持 `PREWHERE`，则支持将条件移动到 `PREWHERE` (设置 `optimize_move_to_prewhere`) 。[#33300](https://github.com/ClickHouse/ClickHouse/pull/33300) ([Anton Popov](https://github.com/CurtizJ)).
* 更高效地处理 URL 存储中的通配符。现在你可以轻松地并行查询数百万个 URL，并支持重试。关闭 [#32866](https://github.com/ClickHouse/ClickHouse/issues/32866)。[#32907](https://github.com/ClickHouse/ClickHouse/pull/32907) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 避免解析器中的指数级回溯。此更改关闭了 [#20158](https://github.com/ClickHouse/ClickHouse/issues/20158)。[#33481](https://github.com/ClickHouse/ClickHouse/pull/33481) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 滥用 `untuple` 函数会导致查询分析出现指数级复杂度 (由模糊测试器发现) 。此更改关闭了 [#33297](https://github.com/ClickHouse/ClickHouse/issues/33297)。[#33445](https://github.com/ClickHouse/ClickHouse/pull/33445) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 减少带有字符串属性的字典的内存分配。[#33466](https://github.com/ClickHouse/ClickHouse/pull/33466) ([Maksim Kita](https://github.com/kitaisreal)).
* `reinterpret` 函数的性能略有提升。[#32587](https://github.com/ClickHouse/ClickHouse/pull/32587) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 这是一个影响不大的变更。在极少数情况下，当每个副本上的数据分区片段都丢失时，在某些数据分区片段合并后，后续查询在分区裁剪期间可能会少跳过一些分区。这几乎不会造成任何影响。[#32220](https://github.com/ClickHouse/ClickHouse/pull/32220) ([Azat Khuzhin](https://github.com/azat)).
* 通过优化大小计算逻辑，提升 `clickhouse-keeper` 的写入性能。[#32366](https://github.com/ClickHouse/ClickHouse/pull/32366) ([zhanglistar](https://github.com/zhanglistar)).
* 优化单个 part 的投影物化。此更改关闭了 [#31669](https://github.com/ClickHouse/ClickHouse/issues/31669)。[#31885](https://github.com/ClickHouse/ClickHouse/pull/31885) ([Amos Bird](https://github.com/amosbird)).
* 提升系统表的查询性能。[#33312](https://github.com/ClickHouse/ClickHouse/pull/33312) ([OnePiece](https://github.com/zhongyuankai)).
* 优化可在卷之间移动的 MergeTree parts 的选择。[#33225](https://github.com/ClickHouse/ClickHouse/pull/33225) ([OnePiece](https://github.com/zhongyuankai)).
* 修复 `sparse_hashed` 字典在顺序键场景下的性能问题 (哈希函数错误) 。[#32536](https://github.com/ClickHouse/ClickHouse/pull/32536) ([Azat Khuzhin](https://github.com/azat)).

<div id="experimental-feature">
  #### Experimental 功能
</div>

* 在分布式查询期间，无需使用样本键即可从同一分片内的多个副本并行读取。要启用此功能，请将 `allow_experimental_parallel_reading_from_replicas = 1`，并将 `max_parallel_replicas` 设置为任意数值。此更改关闭了 [#26748](https://github.com/ClickHouse/ClickHouse/issues/26748)。[#29279](https://github.com/ClickHouse/ClickHouse/pull/29279) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 实现了稀疏序列化。对于包含大量默认值 (零值) 的列，它可以减少磁盘空间占用，并提升某些查询的性能。可通过设置 `ratio_for_sparse_serialization` 启用。如果某列中默认值数量与总值数量的比率高于该阈值，则会为该列动态选择稀疏序列化。每个 part 中每一列的序列化方式 (默认或稀疏) 会固定下来，但不同 parts 之间可能有所不同。[#22535](https://github.com/ClickHouse/ClickHouse/pull/22535) ([Anton Popov](https://github.com/CurtizJ)) 。
* 添加 “TABLE OVERRIDE” 功能，用于自定义 MaterializedMySQL 表 schema。[#32325](https://github.com/ClickHouse/ClickHouse/pull/32325) ([Stig Bakken](https://github.com/stigsb)) 。
* 添加 `EXPLAIN TABLE OVERRIDE` 查询。[#32836](https://github.com/ClickHouse/ClickHouse/pull/32836) ([Stig Bakken](https://github.com/stigsb)) 。
* 为 MaterializedPostgreSQL 增加 TABLE OVERRIDE 子句支持。RFC：[#31480](https://github.com/ClickHouse/ClickHouse/issues/31480)。[#32749](https://github.com/ClickHouse/ClickHouse/pull/32749) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 更改了共享数据的零拷贝标记所使用的 ZooKeeper path。请注意，“zero-copy replication” 是一项非生产功能 (仍处于开发早期阶段) ，本就不建议使用。但如果你已经使用了它，请留意这一变更。[#32061](https://github.com/ClickHouse/ClickHouse/pull/32061) ([ianton-ru](https://github.com/ianton-ru)) 。
* 为 WINDOW VIEW watch 查询增加 Events 子句支持。[#32607](https://github.com/ClickHouse/ClickHouse/pull/32607) ([vxider](https://github.com/Vxider)) 。
* 修复了 `clickhouse-keeper` 中 ACL 使用显式数字哈希时的问题：现在其行为与 ZooKeeper 保持一致，并且生成的摘要始终会被接受。[#33249](https://github.com/ClickHouse/ClickHouse/pull/33249) ([小路](https://github.com/nicelulu)) 。[#33246](https://github.com/ClickHouse/ClickHouse/pull/33246)。
* 修复了分离 parts 时意外删除 projection 的问题。[#32067](https://github.com/ClickHouse/ClickHouse/pull/32067) ([Amos Bird](https://github.com/amosbird)) 。

<div id="improvement">
  #### 改进
</div>

* 现在，生成早于 `1970-01-01 00:00:00` 的时间的日期时间转换函数将不再发生溢出，而是会饱和为零。[#29953](https://github.com/ClickHouse/ClickHouse/pull/29953) ([Amos Bird](https://github.com/amosbird))。此外，它还修复了索引分析中的一个错误：如果日期截断函数会产生早于 Unix 纪元的结果。
* 始终在客户端显示资源使用情况 (总 CPU 使用量、总 RAM 使用量以及每台主机的最大 RAM 使用量) 。[#33271](https://github.com/ClickHouse/ClickHouse/pull/33271) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 改进 `Bool` 类型的序列化与反序列化，并增加对取值范围的检查。[#32984](https://github.com/ClickHouse/ClickHouse/pull/32984) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 如果通过 `SET` 查询或 HTTP 请求中的查询参数定义了无效设置，错误消息中将包含与该无效设置字符串相近的建议 (如果有) 。[#32946](https://github.com/ClickHouse/ClickHouse/pull/32946) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 为 clickhouse-client 和 clickhouse-local 支持对拼写错误的设置名称给出提示。关闭 [#32237](https://github.com/ClickHouse/ClickHouse/issues/32237)。[#32841](https://github.com/ClickHouse/ClickHouse/pull/32841) ([凌涛](https://github.com/lingtaolf)).
* 允许在 Materialized View 中使用虚拟列。关闭 [#11210](https://github.com/ClickHouse/ClickHouse/issues/11210)。[#33482](https://github.com/ClickHouse/ClickHouse/pull/33482) ([OnePiece](https://github.com/zhongyuankai)) 。
* 如有需要，可为 ClickHouse Keeper 添加禁用 IPv6 的配置。此更改关闭了 [#33381](https://github.com/ClickHouse/ClickHouse/issues/33381)。[#33450](https://github.com/ClickHouse/ClickHouse/pull/33450) ([Wu Xueyang](https://github.com/wuxueyang96)) 。
* 在 `system.build_options` 中添加了更多关于当前 Git 修订版本的信息。[#33431](https://github.com/ClickHouse/ClickHouse/pull/33431) ([taiyang-li](https://github.com/taiyang-li)).
* `clickhouse-local`：在 `--max_memory_usage_in_client` 选项下统计内存使用情况。[#33341](https://github.com/ClickHouse/ClickHouse/pull/33341) ([Azat Khuzhin](https://github.com/azat)) 。
* 允许在函数 `intervalLengthSum` 中使用负时间间隔，其长度也会一并计入。这修复了 [#33323](https://github.com/ClickHouse/ClickHouse/issues/33323)。[#33335](https://github.com/ClickHouse/ClickHouse/pull/33335) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* `LineAsString` 可作为输出格式使用。此更改解决了 [#30919](https://github.com/ClickHouse/ClickHouse/issues/30919)。[#33331](https://github.com/ClickHouse/ClickHouse/pull/33331) ([Sergei Trifonov](https://github.com/serxa)) 。
* 支持在集群配置中使用 `<secure/>`，作为 `<secure>1</secure>` 的另一种写法。关闭 [#33270](https://github.com/ClickHouse/ClickHouse/issues/33270)。[#33330](https://github.com/ClickHouse/ClickHouse/pull/33330) ([SuperDJY](https://github.com/cmsxbc)) 。
* 连续按两次 Ctrl+C 将立即终止 `clickhouse-benchmark`，无需等待正在执行的查询完成。此改动关闭了 [#32586](https://github.com/ClickHouse/ClickHouse/issues/32586)。[#33303](https://github.com/ClickHouse/ClickHouse/pull/33303) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 支持在 `parseDateTimeBestEffort` 函数中解析带毫秒的 Unix 时间戳。[#33276](https://github.com/ClickHouse/ClickHouse/pull/33276) ([Ben](https://github.com/benbiti)).
* 允许在从外部表读取以下格式的数据时取消查询：`Arrow` / `Parquet` / `ORC` —— 此前在处理大文件且将 input\_format\_allow\_seeks 设为 false 时，查询无法取消。关闭 [#29678](https://github.com/ClickHouse/ClickHouse/issues/29678)。[#33238](https://github.com/ClickHouse/ClickHouse/pull/33238) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 如果表引擎支持 `SETTINGS` 子句，则允许以键值对形式或通过配置传入这些设置。为 MySQL 添加了此支持。[#33231](https://github.com/ClickHouse/ClickHouse/pull/33231) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 在必要时正确禁止 Nullable 主键。这是针对 [#32780](https://github.com/ClickHouse/ClickHouse/issues/32780) 的修复。[#33218](https://github.com/ClickHouse/ClickHouse/pull/33218) ([Amos Bird](https://github.com/amosbird)) 。
* 为 `PostgreSQL` 连接添加重试机制，以防尚未拉取到任何数据。关闭了 [#33199](https://github.com/ClickHouse/ClickHouse/issues/33199)。[#33209](https://github.com/ClickHouse/ClickHouse/pull/33209) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 为外部字典的配置项增加校验。[#33095](https://github.com/ClickHouse/ClickHouse/issues/33095#issuecomment-1000577517)。[#33130](https://github.com/ClickHouse/ClickHouse/pull/33130) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 在 `clickhouse-local` 中发送 profile 信息。已关闭 [#33093](https://github.com/ClickHouse/ClickHouse/issues/33093)。[#33097](https://github.com/ClickHouse/ClickHouse/pull/33097) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 短路求值：支持 `throwIf` 函数。关闭 [#32969](https://github.com/ClickHouse/ClickHouse/issues/32969)。[#32973](https://github.com/ClickHouse/ClickHouse/pull/32973) ([Maksim Kita](https://github.com/kitaisreal)) 。
* (这仅会发生在非官方构建中。) 修复了向压缩的 Decimal、String、FixedString 和 Array 列插入数据时出现的段错误。此修复解决了 [#32939](https://github.com/ClickHouse/ClickHouse/issues/32939)。[#32940](https://github.com/ClickHouse/ClickHouse/pull/32940) ([N. Kolotov](https://github.com/nkolotov)) 。
* 新增支持将子查询指定为 SQL 用户自定义函数。示例：`CREATE FUNCTION test AS () -> (SELECT 1)`。解决了 [#30755](https://github.com/ClickHouse/ClickHouse/issues/30755)。[#32758](https://github.com/ClickHouse/ClickHouse/pull/32758) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 改进 [#28671](https://github.com/ClickHouse/ClickHouse/issues/28671) 中的 gRPC 压缩支持。[#32747](https://github.com/ClickHouse/ClickHouse/pull/32747) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 在关闭服务器或分离表时，如果未启用 WAL，则将所有内存中的数据分区片段刷写到存储。 [#32742](https://github.com/ClickHouse/ClickHouse/pull/32742) ([nauta](https://github.com/nautaa)).
* 现在可控制 MySQL 的连接超时 (此前仅支持字典源) 。关闭 [#16669](https://github.com/ClickHouse/ClickHouse/issues/16669)。此前默认的 connect\_timeout 较小，现在可配置。[#32734](https://github.com/ClickHouse/ClickHouse/pull/32734) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 支持为存储 `MongoDB` 指定 `authSource` 选项。已关闭 [#32594](https://github.com/ClickHouse/ClickHouse/issues/32594)。[#32702](https://github.com/ClickHouse/ClickHouse/pull/32702) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 在 `genarateRandom` 表函数中支持 `Date32` 类型。[#32643](https://github.com/ClickHouse/ClickHouse/pull/32643) ([nauta](https://github.com/nautaa)).
* 新增设置 `max_concurrent_select_queries` 和 `max_concurrent_insert_queries`，用于按查询类型控制并发查询。关闭 [#3575](https://github.com/ClickHouse/ClickHouse/issues/3575)。[#32609](https://github.com/ClickHouse/ClickHouse/pull/32609) ([SuperDJY](https://github.com/cmsxbc)) 。
* 改进了以 `Protobuf` 格式读取数据时，对缺失列的嵌套结构的处理。跟进 [https://github.com/ClickHouse/ClickHouse/pull/31988。\[#32531](https://github.com/ClickHouse/ClickHouse/pull/31988。\[#32531)]\([https://github.com/ClickHouse/ClickHouse/pull/32531](https://github.com/ClickHouse/ClickHouse/pull/32531)) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 允许 `MongoDB` 引擎使用空 credentials。已关闭 [#26267](https://github.com/ClickHouse/ClickHouse/issues/26267)。[#32460](https://github.com/ClickHouse/ClickHouse/pull/32460) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 禁用了一些可能导致 Exception 的 window function 优化。关闭了 [#31535](https://github.com/ClickHouse/ClickHouse/issues/31535)。关闭了 [#31620](https://github.com/ClickHouse/ClickHouse/issues/31620)。[#32453](https://github.com/ClickHouse/ClickHouse/pull/32453) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 支持连接到 MongoDB 5.0。已关闭 [#31483](https://github.com/ClickHouse/ClickHouse/issues/31483),. [#32416](https://github.com/ClickHouse/ClickHouse/pull/32416) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 支持比较 `Decimal` 和 `Float`。关闭了 [#22626](https://github.com/ClickHouse/ClickHouse/issues/22626)。[#31966](https://github.com/ClickHouse/ClickHouse/pull/31966) ([flynn](https://github.com/ucasFL)) 。
* 为 `StorageExecutable`、`StorageExecutablePool`、`ExecutableDictionary`、`ExecutablePoolDictionary`、`ExecutableUserDefinedFunctions` 新增了设置 `command_read_timeout` 和 `command_write_timeout`。其中，`command_read_timeout` 用于控制从命令的 stdout 读取数据的超时时间，单位为毫秒；`command_write_timeout` 用于控制向命令的 stdin 写入数据的超时时间，单位为毫秒。为 `ExecutableUserDefinedFunction`、`ExecutableDictionary`、`StorageExecutable` 新增了设置 `command_termination_timeout`。为 `ExecutableUserDefinedFunction` 新增了设置 `execute_direct`，默认值为 true。为 `ExecutableDictionary`、`ExecutablePoolDictionary` 新增了设置 `execute_direct`，默认值为 false。 [#30957](https://github.com/ClickHouse/ClickHouse/pull/30957) ([Maksim Kita](https://github.com/kitaisreal)) 。
* Bitmap 聚合函数在参数超出范围时将返回正确结果，而不是发生回绕。[#33127](https://github.com/ClickHouse/ClickHouse/pull/33127) ([DR](https://github.com/freedomDR)).
* 修复了 `FROM INFILE` 语句对错误查询的解析问题。[#33521](https://github.com/ClickHouse/ClickHouse/pull/33521) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 如果路径中包含通配符，则禁止向 \`S3\`\` 写入。[#33142](https://github.com/ClickHouse/ClickHouse/pull/33142) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 在单查询的批次模式下，`clickhouse-client` 不会使用 `--echo` 选项。[#32843](https://github.com/ClickHouse/ClickHouse/pull/32843) ([N. Kolotov](https://github.com/nkolotov)) 。
* 为 clickhouse-local 提供了 `--database` 选项。[#32797](https://github.com/ClickHouse/ClickHouse/pull/32797) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复了 SQL 普通函数 `file` 中一处糟糕得离谱的代码。现在它支持符号链接。[#32640](https://github.com/ClickHouse/ClickHouse/pull/32640) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 在分片移动后，更新 `system.parts` 中数据分区片段的 `modification_time`。[#32964](https://github.com/ClickHouse/ClickHouse/issues/32964) [#32965](https://github.com/ClickHouse/ClickHouse/pull/32965) ([save-my-heart](https://github.com/save-my-heart)) 。
* 潜在问题，但无法利用：调整数组大小时可能发生整数溢出。[#33024](https://github.com/ClickHouse/ClickHouse/pull/33024) ([varadarajkumar](https://github.com/varadarajkumar)) 。

<div id="buildtestingpackaging-improvement">
  #### 构建/测试/打包改进
</div>

* 为 AArch64 (ARM) 版 ClickHouse 增加软件包、功能测试和 Docker 构建。[#32911](https://github.com/ClickHouse/ClickHouse/pull/32911) ([Mikhail f. Shiryaev](https://github.com/Felixoid)). [#32415](https://github.com/ClickHouse/ClickHouse/pull/32415)
* 使 ClickHouse 支持使用 musl-libc 构建，默认未启用。[#33134](https://github.com/ClickHouse/ClickHouse/pull/33134) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 使安装脚本可在 FreeBSD 上运行。此项修改关闭了 [#33384](https://github.com/ClickHouse/ClickHouse/issues/33384)。[#33418](https://github.com/ClickHouse/ClickHouse/pull/33418) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 为 GitHub Actions 工作流添加 `actionlint`，并通过 `act --list` 校验工作流文件，以检查工作流语法是否正确。[#33612](https://github.com/ClickHouse/ClickHouse/pull/33612) ([Mikhail f. Shiryaev](https://github.com/Felixoid)).
* 为 Nullable 主键功能增加更多测试。新增了涵盖不同类型、不同 MergeTree Kind 以及随机生成数据的测试。[#33228](https://github.com/ClickHouse/ClickHouse/pull/33228) ([Amos Bird](https://github.com/amosbird)).
* 添加了一个简单工具，用于在 Web 浏览器中可视化不稳定测试。[#33185](https://github.com/ClickHouse/ClickHouse/pull/33185) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 为共享构建启用 hermetic build，主要面向开发者。[#32968](https://github.com/ClickHouse/ClickHouse/pull/32968) ([Amos Bird](https://github.com/amosbird)).
* 将 `libc++` 和 `libc++abi` 更新到最新版本。[#32484](https://github.com/ClickHouse/ClickHouse/pull/32484) ([Raúl Marín](https://github.com/Algunenano)).
* 为外部 .NET 客户端添加了集成测试 ([ClickHouse.Client](https://github.com/DarkWanderer/ClickHouse.Client)) 。[#23230](https://github.com/ClickHouse/ClickHouse/pull/23230) ([Oleg V. Kozlyuk](https://github.com/DarkWanderer)).
* 将 git 信息注入到 clickhouse 可执行文件中，以便能够轻松从该可执行文件中获取源代码修订版本。[#33124](https://github.com/ClickHouse/ClickHouse/pull/33124) ([taiyang-li](https://github.com/taiyang-li)).
* 从 ConfigProcessor 中移除过时代码。Yandex 特有的代码已不再使用。这段代码中包含一个小缺陷。该缺陷由 [Mallik Hassan](https://github.com/SadiHassan) 在 [#33032](https://github.com/ClickHouse/ClickHouse/issues/33032) 中报告。此项修改关闭了 [#33032](https://github.com/ClickHouse/ClickHouse/issues/33032)。[#33026](https://github.com/ClickHouse/ClickHouse/pull/33026) ([alexey-milovidov](https://github.com/alexey-milovidov)).

<div id="bug-fix-user-visible-misbehavior-in-official-stable-or-prestable-release-2">
  #### 缺陷修复 (官方稳定版本或预稳定版本中用户可见的异常行为)
</div>

* 修复了多项格式解析问题。如果 `clickhouse-server` 对攻击者开放了写访问权限，则会受到此问题影响。特制的 `Native` 格式输入数据可能导致读取未初始化的内存或崩溃。如果 `clickhouse-server` 对攻击者开放了写访问权限，则会受到此问题影响。[#33050](https://github.com/ClickHouse/ClickHouse/pull/33050) ([Heena Bansal](https://github.com/HeenaBansal2009))。修复了 Apache Avro 二进制格式中 Apache Avro Union 类型索引越界的问题。[#33022](https://github.com/ClickHouse/ClickHouse/pull/33022) ([Harry Lee](https://github.com/HarryLeeIBM))。修复了在 `Native` 格式中反序列化 `LowCardinality` 数据时发生的空指针解引用问题。[#33021](https://github.com/ClickHouse/ClickHouse/pull/33021) ([Harry Lee](https://github.com/HarryLeeIBM))。
* ClickHouse Keeper 处理器会在发送响应后正确移除该操作。[#32988](https://github.com/ClickHouse/ClickHouse/pull/32988) ([JackyWoo](https://github.com/JackyWoo)).
* 修复了配额可能出现的差一错误：配额上限尚未达到，却被判定为已超限。此修复解决了 [#31174](https://github.com/ClickHouse/ClickHouse/issues/31174)。[#31656](https://github.com/ClickHouse/ClickHouse/pull/31656) ([sunny](https://github.com/sunny19930321)).
* 修复了 String 与 IPv4 或 IPv6 之间的 CAST 转换及反向转换。修复了转换失败时的错误消息。[#29224](https://github.com/ClickHouse/ClickHouse/pull/29224) ([Dmitry Novik](https://github.com/novikd)) [#27914](https://github.com/ClickHouse/ClickHouse/pull/27914) ([Vasily Nemkov](https://github.com/Enmk)).
* 修复了在远程 server 上执行时出现 `Unknown aggregate function nothing` 这类 Exception 的问题。此修复解决了 [#16689](https://github.com/ClickHouse/ClickHouse/issues/16689)。[#26074](https://github.com/ClickHouse/ClickHouse/pull/26074) ([hexiaoting](https://github.com/hexiaoting)) 。
* 修复了在分布式查询中，未显式指定数据库时 JOIN 误用错误数据库的问题 (修复：[#10471](https://github.com/ClickHouse/ClickHouse/issues/10471)) 。[#33611](https://github.com/ClickHouse/ClickHouse/pull/33611) ([Azat Khuzhin](https://github.com/azat)).
* 修复了 Apache `Avro` 格式中的段错误，该错误会在向文件执行第二次插入后出现。 [#33566](https://github.com/ClickHouse/ClickHouse/pull/33566) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复了在 schema 包含 `Dictionary` 类型时 Apache `Arrow` 格式中的段错误。关闭 [#33507](https://github.com/ClickHouse/ClickHouse/issues/33507)。[#33529](https://github.com/ClickHouse/ClickHouse/pull/33529) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 带外 `offset` 和 `limit` 设置在视图中可能会被错误应用。关闭 [#33289](https://github.com/ClickHouse/ClickHouse/issues/33289) [#33518](https://github.com/ClickHouse/ClickHouse/pull/33518) ([hexiaoting](https://github.com/hexiaoting)) 。
* 修复了在向包含默认嵌套 `LowCardinality` 列的表中插入数据时可能发生的 `Block structure mismatch` 异常。修复 [#33028](https://github.com/ClickHouse/ClickHouse/issues/33028)。[#33504](https://github.com/ClickHouse/ClickHouse/pull/33504) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复通过 DDL 创建时，`range_hashed` 的 range min 和 range max 属性中的字典表达式问题。关闭 [#30809](https://github.com/ClickHouse/ClickHouse/issues/30809)。[#33478](https://github.com/ClickHouse/ClickHouse/pull/33478) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 修复在并发 DROP 的情况下，向 materialized view 执行 INSERT 时可能出现的释放后使用问题 ([Azat Khuzhin](https://github.com/azat)) 。
* 不要尝试读取 EOF 之后的内容 (为规避 Linux 内核中的一个 bug) ；该 bug 可在 (3.14..5.9) 版本的内核上复现，并且要求 `index_granularity_bytes=0` (即关闭自适应索引粒度) 。[#33372](https://github.com/ClickHouse/ClickHouse/pull/33372) ([Azat Khuzhin](https://github.com/azat)) 。
* 命令 `SYSTEM SUSPEND` 和 `SYSTEM ... THREAD FUZZER` 此前遗漏了访问控制，现已修复。作者：Kevin Michel。[#33333](https://github.com/ClickHouse/ClickHouse/pull/33333) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了字典的 `COMMENT` 未显示在 `system.tables` 和 `system.dictionaries` 中的问题。现在允许修改 `Dictionary` 引擎的注释。关闭 [#33251](https://github.com/ClickHouse/ClickHouse/issues/33251)。[#33261](https://github.com/ClickHouse/ClickHouse/pull/33261) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 将异步插入 (启用 `async_insert` 设置) 添加到查询日志中。此前，此类查询不会出现在查询日志中。[#33239](https://github.com/ClickHouse/ClickHouse/pull/33239) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了查询外部数据库时发送 `WHERE 1 = 0` 表达式的问题。关闭 [#33152](https://github.com/ClickHouse/ClickHouse/issues/33152)。[#33214](https://github.com/ClickHouse/ClickHouse/pull/33214) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复 MaterializedPostgreSQL 的 DDL 验证。修复设置项 `materialized_postgresql_allow_automatic_update`。关闭 [#29535](https://github.com/ClickHouse/ClickHouse/issues/29535)。[#33200](https://github.com/ClickHouse/ClickHouse/pull/33200) ([Kseniia Sumarokova](https://github.com/kssenii)) 。确保始终移除未使用的 replication slots。发现于 [#26952](https://github.com/ClickHouse/ClickHouse/issues/26952)。[#33187](https://github.com/ClickHouse/ClickHouse/pull/33187) ([Kseniia Sumarokova](https://github.com/kssenii)) 。修复 MaterializedPostreSQL 对使用非默认 schema 的表执行 detach/attach (从复制中移除/添加) 时的问题。发现于 [#29535](https://github.com/ClickHouse/ClickHouse/issues/29535)。[#33179](https://github.com/ClickHouse/ClickHouse/pull/33179) ([Kseniia Sumarokova](https://github.com/kssenii)) 。修复 DROP MaterializedPostgreSQL database 的问题。[#33468](https://github.com/ClickHouse/ClickHouse/pull/33468) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 指标 `StorageBufferBytes` 有时计算有误。[#33159](https://github.com/ClickHouse/ClickHouse/pull/33159) ([xuyatian](https://github.com/xuyatian)).
* 修复了在启用 `local_filesystem_read_prefetch` 或 `remote_filesystem_read_prefetch` 时，从 `LowCardinality` 列读取数据会出现错误 `Invalid version for SerializationLowCardinality key column` 的问题。[#33046](https://github.com/ClickHouse/ClickHouse/pull/33046) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复 `s3` 表函数读取空文件时的问题。关闭 [#33008](https://github.com/ClickHouse/ClickHouse/issues/33008)。[#33037](https://github.com/ClickHouse/ClickHouse/pull/33037) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 修复 `cancel&#95;http&#95;readonly&#95;queries&#95;on&#95;client&#95;close` 场景下的 Context 泄漏问题 (即已上传到 server 的外部表及其他资源发生泄漏) 。[#32982](https://github.com/ClickHouse/ClickHouse/pull/32982) ([Azat Khuzhin](https://github.com/azat)) 。
* 在使用自定义 CSV 分隔符时，修复了 `CSV` 格式中 tuple 输出错误的问题。[#32981](https://github.com/ClickHouse/ClickHouse/pull/32981) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了不允许使用 HA namenode 地址的 HDFS URL 校验问题。该缺陷是在 [https://github.com/ClickHouse/ClickHouse/pull/31042](https://github.com/ClickHouse/ClickHouse/pull/31042) 中引入的。[#32976](https://github.com/ClickHouse/ClickHouse/pull/32976) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了对非位置参数抛出“位置参数越界”等类似异常的问题。关闭 [#31173](https://github.com/ClickHouse/ClickHouse/issues/31173)#event-5789668239。 [#32961](https://github.com/ClickHouse/ClickHouse/pull/32961) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 修复了通过 HTTP 查询填充 Set 时，若期间意外遇到 EOF 而导致的 UB 问题 (也就是如果客户端在中途中断，例如 `timeout 0.15s curl -Ss -F 's=@t.csv;' 'http://127.0.0.1:8123/?s_structure=key+Int&query=SELECT+dummy+IN+s'`，且 `t.csv` 足够大时) 。[#32955](https://github.com/ClickHouse/ClickHouse/pull/32955) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了 `replaceRegexpAll` 函数中的一个回归问题。当匹配到的子串为空时，该函数会出现错误行为。此项关闭了 [#32777](https://github.com/ClickHouse/ClickHouse/issues/32777)。此项关闭了 [#30245](https://github.com/ClickHouse/ClickHouse/issues/30245)。[#32945](https://github.com/ClickHouse/ClickHouse/pull/32945) ([alexey-milovidov](https://github.com/alexey-milovidov)).
* 修复读取 `ORC` 格式 stripe 时的问题。[#32929](https://github.com/ClickHouse/ClickHouse/pull/32929) ([kreuzerkrieg](https://github.com/kreuzerkrieg)) 。
* `topKWeightedState` 在某些输入类型上会失败。[#32487](https://github.com/ClickHouse/ClickHouse/issues/32487)。[#32914](https://github.com/ClickHouse/ClickHouse/pull/32914) ([vdimir](https://github.com/vdimir)) 。
* 修复 materialized view 中出现的异常 `Single chunk is expected from view inner query (LOGICAL_ERROR)`。修复 [#31419](https://github.com/ClickHouse/ClickHouse/issues/31419)。[#32862](https://github.com/ClickHouse/ClickHouse/pull/32862) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了从远程文件系统异步读取时的延迟寻道优化问题。关闭 [#32803](https://github.com/ClickHouse/ClickHouse/issues/32803)。[#32835](https://github.com/ClickHouse/ClickHouse/pull/32835) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* `MergeTree` 表引擎在运行中的变更过多或内存占用过高时，可能会静默跳过某些变更；该问题已修复。修复了 [#17882](https://github.com/ClickHouse/ClickHouse/issues/17882)。[#32814](https://github.com/ClickHouse/ClickHouse/pull/32814) ([tavplubix](https://github.com/tavplubix)) 。
* 在处理 MV 块时，避免重用标量子查询缓存。这修复了标量查询引用源表时的一个缺陷，但这也意味着 MV 定义中的所有标量子查询都将针对每个块重新计算。[#32811](https://github.com/ClickHouse/ClickHouse/pull/32811) ([Raúl Marín](https://github.com/Algunenano)) 。
* 如果使用 `MySQL` engine 的数据库无法连接到 MySQL 服务器，服务器可能无法启动；该问题已修复。修复了 [#14441](https://github.com/ClickHouse/ClickHouse/issues/14441)。[#32802](https://github.com/ClickHouse/ClickHouse/pull/32802) ([tavplubix](https://github.com/tavplubix))。
* 修复了使用 `fuzzBits` 函数时发生崩溃的问题，关闭 [#32737](https://github.com/ClickHouse/ClickHouse/issues/32737)。[#32755](https://github.com/ClickHouse/ClickHouse/pull/32755) ([SuperDJY](https://github.com/cmsxbc)).
* 修复了在 `Kafka`/`RabbitMQ` 上，对带有 `GROUP BY (list of columns)` (会被解析为 `GROUP BY tuple(...)`) 的 MV 进行操作时出现的 `Column is not under aggregate function` 错误。修复 [#32668](https://github.com/ClickHouse/ClickHouse/issues/32668) 和 [#32744](https://github.com/ClickHouse/ClickHouse/issues/32744)。[#32751](https://github.com/ClickHouse/ClickHouse/pull/32751) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复 `ALTER TABLE ... MATERIALIZE TTL` 查询在 `TTL ... DELETE WHERE ...` 和 `TTL ... GROUP BY ...` 模式下的问题。[#32695](https://github.com/ClickHouse/ClickHouse/pull/32695) ([Anton Popov](https://github.com/CurtizJ)).
* 修复了在表引擎为 `Distributed` 或 `Merge`，且其底层 `MergeTree` 表的排序键前缀中包含单调函数时，`optimize_read_in_order` 优化失效的问题。[#32670](https://github.com/ClickHouse/ClickHouse/pull/32670) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复当 materialized view 的目标表为 JOIN 或 SET 表时出现的 LOGICAL\_ERROR 异常。 [#32669](https://github.com/ClickHouse/ClickHouse/pull/32669) ([Raúl Marín](https://github.com/Algunenano)).
* 使用分段上传向 Google Cloud Storage 上的 S3 写入数据时，可能导致中止。[#32504](https://github.com/ClickHouse/ClickHouse/issues/32504)。[#32649](https://github.com/ClickHouse/ClickHouse/pull/32649) ([vdimir](https://github.com/vdimir)).
* 通过延迟创建通道，修复了 `RabbitMQ` 存储启动时可能出现的异常。[#32584](https://github.com/ClickHouse/ClickHouse/pull/32584) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复了在并行执行 DROP TABLE 与 INSERT 时的表生命周期问题 (即可能出现释放后继续使用) 。[#32572](https://github.com/ClickHouse/ClickHouse/pull/32572) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了 `CustomSeparated`、`Template`、`Regexp`、`MsgPack` 和 `JSONAsString` 格式的异步插入问题。此前，使用这些格式的异步插入无法读取任何数据。[#32530](https://github.com/ClickHouse/ClickHouse/pull/32530) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复分布式表中 `groupBitmapAnd` 函数的问题。[#32529](https://github.com/ClickHouse/ClickHouse/pull/32529) ([minhthucdao](https://github.com/dmthuc)) 。
* 修复了 fuzzer 发现的 JOIN 崩溃问题，关闭了 [#32458](https://github.com/ClickHouse/ClickHouse/issues/32458)。[#32508](https://github.com/ClickHouse/ClickHouse/pull/32508) ([vdimir](https://github.com/vdimir)).
* 妥善处理 Apache Arrow 中列重复的情况。[#32507](https://github.com/ClickHouse/ClickHouse/pull/32507) ([Dmitriy Mokhnatkin](https://github.com/DMokhnatkin)) 。
* 修复了分布式查询中查询格式化歧义的问题：当某些表的列名为 `ALL` 或 `DISTINCT` 时，会导致报错。此修复关闭了 [#32391](https://github.com/ClickHouse/ClickHouse/issues/32391)。[#32490](https://github.com/ClickHouse/ClickHouse/pull/32490) ([alexey-milovidov](https://github.com/alexey-milovidov)) 。
* 修复了尝试使用尚未物化的数据跳过索引时查询失败的问题。修复了 [#32292](https://github.com/ClickHouse/ClickHouse/issues/32292) 和 [#30343](https://github.com/ClickHouse/ClickHouse/issues/30343)。[#32359](https://github.com/ClickHouse/ClickHouse/pull/32359) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复这样一个问题：当同一列上有超过 2 个行策略时，从同一会话中的第二次查询开始，select 查询会失效。[#31606](https://github.com/ClickHouse/ClickHouse/issues/31606)。[#32291](https://github.com/ClickHouse/ClickHouse/pull/32291) ([SuperDJY](https://github.com/cmsxbc)) 。
* 修复将带小数部分的 Unix 时间戳转换为 `DateTime64` 时的问题：对于负值的 Unix 时间戳 (早于 1970-01-01) ，其小数部分此前会被颠倒。[#32240](https://github.com/ClickHouse/ClickHouse/pull/32240) ([Ben](https://github.com/benbiti)).
* 复制队列中的某些条目可能会因 `temporary_directories_lifetime` (默认为 1 天) 而卡住，并报出 `Directory tmp_merge_<part_name>`、`Part ... (state Deleting) already exists, but it will be deleted soon` 或类似错误。现已修复。修复 [#29616](https://github.com/ClickHouse/ClickHouse/issues/29616)。[#32201](https://github.com/ClickHouse/ClickHouse/pull/32201) ([tavplubix](https://github.com/tavplubix)) 。
* 修复了 `APPLY lambda` 列转换器的解析问题，该问题可能导致客户端/服务器崩溃。[#32138](https://github.com/ClickHouse/ClickHouse/pull/32138) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复了 `base64Encode` 在较短字符串上附加尾随字节的问题。[#31797](https://github.com/ClickHouse/ClickHouse/pull/31797) ([Kevin Michel](https://github.com/kmichel-aiven)) 。
* 修复了窗口函数的 `LowCardinality` 参数在某些情况下可能导致崩溃 (或结果错误) 的问题。修复 [#31114](https://github.com/ClickHouse/ClickHouse/issues/31114)。[#31888](https://github.com/ClickHouse/ClickHouse/pull/31888) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复执行命令 `DROP TABLE system.query_log sync` 时卡死的问题。[#33293](https://github.com/ClickHouse/ClickHouse/pull/33293) ([zhanghuajie](https://github.com/zhanghuajieHIT)).

<div id="changelog-for-2021">
  ## [2021 年更新日志](/zh/resources/changelogs/oss/2021)
</div>
