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

# 2024 更新日志

> 2024 年更新日志

<div id="table-of-contents">
  ### 目录
</div>

**[ClickHouse 版本发布 v24.12，2024-12-19](/zh/resources/changelogs/oss/2024#a-id2412a-clickhouse-release-2412-2024-12-19)**<br />
**[ClickHouse 版本发布 v24.11，2024-11-26](/zh/resources/changelogs/oss/2024#a-id2411a-clickhouse-release-2411-2024-11-26)**<br />
**[ClickHouse 版本发布 v24.10，2024-10-31](/zh/resources/changelogs/oss/2024#a-id2410a-clickhouse-release-2410-2024-10-31)**<br />
**[ClickHouse 版本发布 v24.9，2024-09-26](/zh/resources/changelogs/oss/2024#a-id249a-clickhouse-release-249-2024-09-26)**<br />
**[ClickHouse 版本发布 v24.8 LTS，2024-08-20](/zh/resources/changelogs/oss/2024#a-id248a-clickhouse-release-248-lts-2024-08-20)**<br />
**[ClickHouse 版本发布 v24.7，2024-07-30](/zh/resources/changelogs/oss/2024#a-id247a-clickhouse-release-247-2024-07-30)**<br />
**[ClickHouse 版本发布 v24.6，2024-07-01](/zh/resources/changelogs/oss/2024#a-id246a-clickhouse-release-246-2024-07-01)**<br />
**[ClickHouse 版本发布 v24.5，2024-05-30](/zh/resources/changelogs/oss/2024#a-id245a-clickhouse-release-245-2024-05-30)**<br />
**[ClickHouse 版本发布 v24.4，2024-04-30](/zh/resources/changelogs/oss/2024#a-id244a-clickhouse-release-244-2024-04-30)**<br />
**[ClickHouse 版本发布 v24.3 LTS，2024-03-26](/zh/resources/changelogs/oss/2024#a-id243a-clickhouse-release-243-lts-2024-03-27)**<br />
**[ClickHouse 版本发布 v24.2，2024-02-29](/zh/resources/changelogs/oss/2024#a-id242a-clickhouse-release-242-2024-02-29)**<br />
**[ClickHouse 版本发布 v24.1，2024-01-30](/zh/resources/changelogs/oss/2024#a-id241a-clickhouse-release-241-2024-01-30)**<br />
**[2023 年更新日志](/zh/resources/changelogs/oss/2023)**<br />

### <a id="2412" /> ClickHouse 24.12 版本发布，2024-12-19。 [演示文稿](https://presentations.clickhouse.com/2024-release-24.12/), [视频](https://www.youtube.com/watch?v=bv-ut-Q6vnc)

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

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

* 函数 `greatest` 和 `least` 现在会忽略 NULL 输入值，而此前只要参数中有一个为 NULL，它们就会返回 NULL。例如，`SELECT greatest(1, 2, NULL)` 现在会返回 2。这使其行为与 PostgreSQL 保持一致，但同时也不再兼容会返回 NULL 的 MySQL。若要保留之前的行为，请将设置 `least_greatest_legacy_null_behavior` (默认值：`false`) 设为 `true`。[#65519](https://github.com/ClickHouse/ClickHouse/pull/65519) [#73344](https://github.com/ClickHouse/ClickHouse/pull/73344) ([kevinyhzou](https://github.com/KevinyhZou)) 。
* 新的 MongoDB 集成现已成为默认选项。想要使用旧版 MongoDB 驱动 (基于 Poco 驱动) 的用户，可以启用服务器级设置 `use_legacy_mongodb_integration`。[#73359](https://github.com/ClickHouse/ClickHouse/pull/73359) ([Kirill Nikiforov](https://github.com/allmazz).

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

* 将 `JSON`/`Dynamic`/`Variant` 类型从实验性功能提升为 Beta。[#72294](https://github.com/ClickHouse/ClickHouse/pull/72294) ([Pavel Kruglov](https://github.com/Avogar)) 。我们还将所有修复以及这项变更一并回移到了 24.11。
* [Iceberg data storage](https://iceberg.apache.org/spec/#file-system-operations) 格式的 schema 演化为用户提供了丰富的表 schema 修改选项。列顺序、列名以及简单的类型扩展都可以在底层进行调整。[#69445](https://github.com/ClickHouse/ClickHouse/pull/69445) ([Daniil Ivanik](https://github.com/divanik)) 。
* 集成 Iceberg REST Catalog：新增了一个名为 Iceberg 的数据库引擎，可将整个 Catalog 接入 ClickHouse。[#71542](https://github.com/ClickHouse/ClickHouse/pull/71542) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 为 `MergeTree` 表的主索引新增了缓存 (可通过表设置 `use_primary_key_cache` 启用) 。如果主索引启用了懒加载和缓存，则会按需将其加载到缓存中 (类似于 mark cache) ，而不是一直常驻内存。新增了在数据分区片段的插入/合并/拉取过程中，以及表重启时，对主索引进行预热的功能 (可通过设置 `prewarm_primary_key_cache` 启用) 。这可以降低共享存储上超大表的内存使用量，我们已在记录数超过一千万亿的表上进行了测试。[#72102](https://github.com/ClickHouse/ClickHouse/pull/72102) ([Anton Popov](https://github.com/CurtizJ)). [#72750](https://github.com/ClickHouse/ClickHouse/pull/72750) ([Alexander Gololobov](https://github.com/davenger)).
* 实现 `SYSTEM LOAD PRIMARY KEY` 命令，用于为指定表的所有 parts 加载主索引；如果未指定表，则为所有表加载主索引。这有助于进行基准测试，并避免在查询执行期间产生额外延迟。[#66252](https://github.com/ClickHouse/ClickHouse/pull/66252) [#67733](https://github.com/ClickHouse/ClickHouse/pull/67733) ([ZAWA\_ll](https://github.com/Zawa-ll)) 。
* 新增了一项查询功能，允许将 `MergeTree` 表 Attach 为 `ReplicatedMergeTree`，反之亦然：`ATTACH TABLE ... AS REPLICATED` 和 `ATTACH TABLE ... AS NOT REPLICATED`。[#65401](https://github.com/ClickHouse/ClickHouse/pull/65401) ([Kirill](https://github.com/kirillgarbar)) 。
* 新增设置 `http_response_headers`，允许你自定义 HTTP 响应头。例如，你可以告诉浏览器渲染存储在数据库中的图片。此项改动关闭了 [#59620](https://github.com/ClickHouse/ClickHouse/issues/59620)。[#72656](https://github.com/ClickHouse/ClickHouse/pull/72656) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 新增函数 `toUnixTimestamp64Second`，可将 `DateTime64` 转换为具有固定秒级精度的 `Int64` 值，因此如果日期早于 Unix 纪元，也支持返回负值。[#70597](https://github.com/ClickHouse/ClickHouse/pull/70597) ([zhanglistar](https://github.com/zhanglistar))。[#73146](https://github.com/ClickHouse/ClickHouse/pull/73146) ([Robert Schulze](https://github.com/rschu1ze))。
* 新增设置 `enforce_index_structure_match_on_partition_manipulation`，以便在源表的投影和二级索引集合为目标表对应集合的子集时允许执行 attach。关闭 [#70602](https://github.com/ClickHouse/ClickHouse/issues/70602)。[#70603](https://github.com/ClickHouse/ClickHouse/pull/70603) ([zwy991114](https://github.com/zwy991114)) 。
* 新增语法 ALTER USER `{ADD|MODIFY|DROP SETTING}`、ALTER USER `{ADD|DROP PROFILE}`，ALTER ROLE 和 ALTER PROFILE 也同样支持。因此，你现在可以直接修改设置集合，而不必替换整组设置。[#72050](https://github.com/ClickHouse/ClickHouse/pull/72050) ([pufit](https://github.com/pufit)).
* 新增了 `arrayPRAUC` 函数，用于计算精确率-召回率曲线的 AUC (曲线下面积) 。[#72073](https://github.com/ClickHouse/ClickHouse/pull/72073) ([Emmanuel](https://github.com/emmanuelsdias)) 。
* 为数组类型新增 `indexOfAssumeSorted` 函数。在数组按非递减顺序排序的情况下，可优化搜索性能。该优化效果会在非常大的数组 (超过 100,000 个元素) 上体现出来。[#72517](https://github.com/ClickHouse/ClickHouse/pull/72517) ([Eric Kurbanov](https://github.com/erickurbanov)) 。
* 支持在聚合函数 `groupConcat` 中将分隔符作为可选的第二个参数使用。[#72540](https://github.com/ClickHouse/ClickHouse/pull/72540) ([Yarik Briukhovetskyi](https://github.com/yariks5s)) 。
* 函数 `translate` 现在支持删除字符：如果 `from` 参数包含的字符多于 `to` 参数中的字符。示例：`SELECT translate('clickhouse', 'clickhouse', 'CLICK')` 现在返回 `CLICK`。[#71441](https://github.com/ClickHouse/ClickHouse/pull/71441) ([shuai.xu](https://github.com/shuai-xu)).

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

* 新增 MergeTree 设置项 `allow_experimental_reverse_key`，用于在 MergeTree 排序键中支持降序排序。这对时间序列分析尤其有用，特别是 TopN 查询。示例用法：`ENGINE = MergeTree ORDER BY (time DESC, key)` - `time` 字段按降序排序。[#71095](https://github.com/ClickHouse/ClickHouse/pull/71095) ([Amos Bird](https://github.com/amosbird)) 。

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

* JOIN 重排序。新增了一个选项，用于在查询计划中选择 join 的哪一侧作为内部 (build) 表。该选项由 `query_plan_join_swap_table` 控制，可设置为 `auto`。在此模式下，ClickHouse 会尝试选择行数最少的表。[#71577](https://github.com/ClickHouse/ClickHouse/pull/71577) ([Vladimir Cherkasov](https://github.com/vdimir)) 。
* 现在，当 `join_algorithm` 设置为 `default` 时，如果适用，将使用 `parallel_hash` 算法。当 `parallel_hash` 无法使用时，仍会考虑此前的两种备选方案 (`direct` 和 `hash`) 。[#70788](https://github.com/ClickHouse/ClickHouse/pull/70788) ([Nikita Taranov](https://github.com/nickitat)) 。
* 新增一个选项，可从 `WHERE` 和 `ON` 表达式中提取公共表达式，以减少 JOIN 期间使用的哈希表数量。当 `JOIN ON` 条件在不同 OR 分支的 AND 条件中包含公共部分时，这样做会很有意义。可通过 `optimize_extract_common_expressions = 1` 启用。[#71537](https://github.com/ClickHouse/ClickHouse/pull/71537) ([János Benjamin Antal](https://github.com/antaljanosbenjamin)) 。
* 允许在 `SELECT` 中使用索引，即使已建立索引的列被 CAST 为 `LowCardinality(String)` 也是如此；这种情况可能出现在对 Merge 表执行查询时，其中部分表使用 `String`，而部分表使用 `LowCardinality(String)`。[#71598](https://github.com/ClickHouse/ClickHouse/pull/71598) ([Yarik Briukhovetskyi](https://github.com/yariks5s)) 。
* 在启用本地计划并使用并行副本执行查询时，不要在工作线程上进行索引分析。协调器会根据自身一侧 (即查询发起节点) 的索引分析结果，为工作线程选择要读取的范围。这样一来，使用并行副本的短查询也能实现与单节点查询一样低的延迟。[#72109](https://github.com/ClickHouse/ClickHouse/pull/72109) ([Igor Nikonov](https://github.com/devcrafter)) 。
* 对于对象存储磁盘，`clickhouse disks remove --recursive` 的内存占用已降低。[#67323](https://github.com/ClickHouse/ClickHouse/pull/67323) ([Kirill](https://github.com/kirillgarbar)).
* 恢复了 [#57631](https://github.com/ClickHouse/ClickHouse/pull/57631) 中针对在 compact parts 中读取单列 subcolumns 的优化。该优化此前被意外删除。[#72285](https://github.com/ClickHouse/ClickHouse/pull/72285) ([Pavel Kruglov](https://github.com/Avogar)) 。
* 通过在比较器中将调用去虚拟化，提升了 `LowCardinality(String)` 列的排序速度。[#72337](https://github.com/ClickHouse/ClickHouse/pull/72337) ([Alexander Gololobov](https://github.com/davenger)).
* 优化了 `argMin`/`argMax` 函数对某些简单数据类型的处理。[#72350](https://github.com/ClickHouse/ClickHouse/pull/72350) ([alesapin](https://github.com/alesapin)).
* 通过在内存跟踪器中使用共享锁优化加锁机制，减少锁竞争，从而提升 CPU 数量极多的系统上的性能。 [#72375](https://github.com/ClickHouse/ClickHouse/pull/72375) ([Jiebin Sun](https://github.com/jiebinn)).
* 新增设置 `use_async_executor_for_materialized_views`。materialized view 查询可使用异步且可能为多线程的执行方式，这可以加快 INSERT 期间的视图处理，但也会占用更多内存。[#72497](https://github.com/ClickHouse/ClickHouse/pull/72497) ([alesapin](https://github.com/alesapin)).
* 优化了聚合函数状态的反序列化性能 (包括数据类型 `AggregateFunction` 中的状态以及分布式查询中的状态) 。还小幅提升了 `RowBinary` 格式的解析性能。[#72818](https://github.com/ClickHouse/ClickHouse/pull/72818) ([Anton Popov](https://github.com/CurtizJ)).
* 在读取时，按表键顺序拆分并行副本的读取范围，以减少读取过程中的内存占用。[#72173](https://github.com/ClickHouse/ClickHouse/pull/72173) ([JIaQi](https://github.com/JiaQiTang98)).
* 当插入批次中的分区键只有单个值时，加快向 MergeTree 插入的速度。 [#72348](https://github.com/ClickHouse/ClickHouse/pull/72348) ([alesapin](https://github.com/alesapin)).
* 支持在从备份恢复时并行创建表。在此 PR 之前，`RESTORE` 命令始终只使用单个线程创建表，因此在备份包含大量表时可能会很慢。[#72427](https://github.com/ClickHouse/ClickHouse/pull/72427) ([Vitaly Baranov](https://github.com/vitlibar)).
* 如果标记缓存很大，清空它可能需要比较明显的时间。如果在此期间一直持有上下文互斥锁，就会阻塞许多其他操作，甚至在释放之前连新的客户端连接都无法建立。而且从同步角度看，其实并不需要持有这个互斥锁；只要通过 shared ptr 在本地保留对缓存的引用就足够了。[#72749](https://github.com/ClickHouse/ClickHouse/pull/72749) ([Alexander Gololobov](https://github.com/davenger)).

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

* 移除 `allow_experimental_join_condition` 设置，默认支持非等值条件。[#69910](https://github.com/ClickHouse/ClickHouse/pull/69910) ([Vladimir Cherkasov](https://github.com/vdimir)) 。
* 现在，server 配置 (users.xml) 中的 Settings 也会应用到客户端。这对 format 相关设置 (例如 `date_time_output_format`) 很有用。[#71178](https://github.com/ClickHouse/ClickHouse/pull/71178) ([Michael Kolupaev](https://github.com/al13n321)) 。
* 根据服务器/用户的内存使用量，自动将 `GROUP BY`/`ORDER BY` 转为落盘执行。通过 `max_bytes_ratio_before_external_group_by`/`max_bytes_ratio_before_external_sort` 查询设置控制。[#71406](https://github.com/ClickHouse/ClickHouse/pull/71406) ([Azat Khuzhin](https://github.com/azat)) 。
* 新增一套取消机制：`CancellationChecker` 会检查每个已启动查询是否超时，并在超时后将其停止。[#69880](https://github.com/ClickHouse/ClickHouse/pull/69880) ([Yarik Briukhovetskyi](https://github.com/yariks5s)) 。
* 支持将 `Object` 通过 ALTER 转换为 `JSON`，这意味着你可以轻松从已弃用的 `Object` 类型迁移。[#71784](https://github.com/ClickHouse/ClickHouse/pull/71784) ([Pavel Kruglov](https://github.com/Avogar)).
* 允许 `set` 中出现 Enum 中不存在的未知值。修复 [#72662](https://github.com/ClickHouse/ClickHouse/issues/72662)。[#72686](https://github.com/ClickHouse/ClickHouse/pull/72686) ([zhanglistar](https://github.com/zhanglistar)).
* 支持对 `Enum` 数据类型使用字符串搜索运算符 (例如 `LIKE`) ，实现了 [#72661](https://github.com/ClickHouse/ClickHouse/issues/72661)。[#72732](https://github.com/ClickHouse/ClickHouse/pull/72732) ([zhanglistar](https://github.com/zhanglistar)) 。
* 一些无意义的 ALTER USER 查询也会被接受。修复了 [#71227](https://github.com/ClickHouse/ClickHouse/issues/71227)。[#71286](https://github.com/ClickHouse/ClickHouse/pull/71286) ([Arthur Passos](https://github.com/arthurpassos)) 。
* 在为分布式 `INSERT ... SELECT` 构建执行计划时遵循 `prefer_locahost_replica`。[#72190](https://github.com/ClickHouse/ClickHouse/pull/72190) ([filimonov](https://github.com/filimonov)) 。
* Azure 违反了 Iceberg 规范，误将 Iceberg v1 标记为 Iceberg v2。该问题[见此处说明](https://github.com/ClickHouse/ClickHouse/issues/72091)。Azure Iceberg Writer 创建的 Iceberg 元数据文件 (以及 manifest 文件) 不符合规范。现在我们会尝试用 v2 读取器读取 v1 Iceberg 格式的元数据 (因为他们就是这样写的) ，并且在他们未在 manifest 文件中创建对应字段时新增了报错。[#72277](https://github.com/ClickHouse/ClickHouse/pull/72277) ([Daniil Ivanik](https://github.com/divanik)) 。
* 现在，已支持在查询中使用 `UNION [ALL]` 来 `CREATE MATERIALIZED VIEW`。其行为与带有 `JOIN` 的 materialized view 相同：只有 `SELECT` expression 中的第一个表会作为 insert 的触发器，其他所有表都会被忽略。不过，如果对第一个表有多处引用 (例如与其自身进行 UNION) ，则这些引用都会按 inserted 的数据块进行处理。[#72347](https://github.com/ClickHouse/ClickHouse/pull/72347) ([alesapin](https://github.com/alesapin)) 。
* 当 ClickHouse 作为字典的数据源时，新增了对源查询的验证。[#72548](https://github.com/ClickHouse/ClickHouse/pull/72548) ([Alexey Katsman](https://github.com/alexkats)) 。
* 确保 ClickHouse 在重新加载配置时能够感知 ZooKeeper 的变更。[#72593](https://github.com/ClickHouse/ClickHouse/pull/72593) ([Azat Khuzhin](https://github.com/azat)) 。
* 改进了对已缓存标记内存占用的估算，从而降低缓存的总体内存占用。[#72630](https://github.com/ClickHouse/ClickHouse/pull/72630) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 新增 `StartupScriptsExecutionState` 指标。该指标可以有三个值：0 = 启动脚本尚未执行完毕，1 = 启动脚本已成功执行，2 = 启动脚本执行失败。之所以需要这个指标，是为了了解云环境中的启动脚本是否成功执行，尤其是在基础配置发布之后。[#72637](https://github.com/ClickHouse/ClickHouse/pull/72637) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* 将新的 `MergeTreeIndexGranularityInternalArraysTotalSize` 指标添加到 `system.metrics` 中。需要此指标来查找拥有超大数据集、易受高
* 为创建复制表增加重试机制。[#72682](https://github.com/ClickHouse/ClickHouse/pull/72682) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 向 `system.tables` 中添加 `total_bytes_with_inactive`，以统计非活动 parts 的总字节数。[#72690](https://github.com/ClickHouse/ClickHouse/pull/72690) ([Kai Zhu](https://github.com/nauu)) 。
* 向 `system.settings_changes` 添加 MergeTree 设置。[#72694](https://github.com/ClickHouse/ClickHouse/pull/72694) ([Raúl Marín](https://github.com/Algunenano)) 。
* 为 `notEmpty` 函数增加对 JSON 类型的支持。[#72741](https://github.com/ClickHouse/ClickHouse/pull/72741) ([Pavel Kruglov](https://github.com/Avogar)) 。
* 支持解析 GCS S3 的 `AuthenticationRequired` 错误。[#72753](https://github.com/ClickHouse/ClickHouse/pull/72753) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 函数 `ifNull` 和 `coalesce` 现已支持 `Dynamic` 类型。[#72772](https://github.com/ClickHouse/ClickHouse/pull/72772) ([Pavel Kruglov](https://github.com/Avogar)) 。
* 支持在函数 `toFloat64`/`touInt32`/等中使用 `Dynamic`。[#72989](https://github.com/ClickHouse/ClickHouse/pull/72989) ([Pavel Kruglov](https://github.com/Avogar)) 。
* 新增 S3 请求设置 `http_max_fields`、`http_max_field_name_size` 和 `http_max_field_value_size`，并在创建备份或恢复过程中解析 S3 API 响应时使用这些设置。[#72778](https://github.com/ClickHouse/ClickHouse/pull/72778) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 仅在使用该元数据的最后一个表被删除后，才删除 Storage S3(Azure)Queue 中 keeper 内的表元数据。[#72810](https://github.com/ClickHouse/ClickHouse/pull/72810) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 新增 `JoinBuildTableRowCount`/`JoinProbeTableRowCount/JoinResultRowCount` profile events。[#72842](https://github.com/ClickHouse/ClickHouse/pull/72842) ([Vladimir Cherkasov](https://github.com/vdimir)) 。
* 支持在 MergeTree 排序键和跳过索引中使用子列。[#72644](https://github.com/ClickHouse/ClickHouse/pull/72644) ([Pavel Kruglov](https://github.com/Avogar)).

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

* 修复 MergeTree 中可能存在的 parts 交叉问题 (在将 part 移动到 detached 目录的操作失败后，可能是由对象存储上的操作引起) 。[#70476](https://github.com/ClickHouse/ClickHouse/pull/70476) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了表名过长时错误检测的问题。现在会提供一条诊断信息，说明最大长度。新增函数 `getMaxTableNameLengthForDatabase`。[#70810](https://github.com/ClickHouse/ClickHouse/pull/70810) ([Yarik Briukhovetskyi](https://github.com/yariks5s)) 。
* 修复了 `clickhouse-library-bridge` 崩溃后遗留僵尸进程的问题 (该程序允许运行不安全的库) 。[#71301](https://github.com/ClickHouse/ClickHouse/pull/71301) ([MikhailBurdukov](https://github.com/MikhailBurdukov)) 。
* 修复了在 `plain_rewritable` 磁盘创建目录失败时，事务回滚期间出现的 NoSuchKey 错误。[#71439](https://github.com/ClickHouse/ClickHouse/pull/71439) ([Julia Kartseva](https://github.com/jkartseva)) 。
* 修复 `Pretty` JSON 格式中 `Dynamic` 值序列化的问题。[#71923](https://github.com/ClickHouse/ClickHouse/pull/71923) ([Pavel Kruglov](https://github.com/Avogar)) 。
* 为 `File`/`S3`/`URL`/`HDFS`/`Azure` 引擎中的 CREATE 查询添加推断出的格式名称。此前，每次服务器重启时都会重新推断格式名称；如果指定的数据文件已被删除，就会导致服务器在启动期间报错。[#72108](https://github.com/ClickHouse/ClickHouse/pull/72108) ([Pavel Kruglov](https://github.com/Avogar)) 。
* 修复了在旧 analyzer 中使用带有 UDF 的 join on expression 时出现的问题。[#72179](https://github.com/ClickHouse/ClickHouse/pull/72179) ([Raúl Marín](https://github.com/Algunenano)).
* 修复了 `StorageObjectStorage` 中的一些小问题。现在默认启用 `use_hive_partitioning`。[#72185](https://github.com/ClickHouse/ClickHouse/pull/72185) ([Yarik Briukhovetskyi](https://github.com/yariks5s)) 。
* 修复了一个 bug：`min_age_to_force_merge_on_partition_only` 会卡住，反复尝试合并同一个已合并为单个 part 的分区，却不去合并包含多个 parts 的分区。[#72209](https://github.com/ClickHouse/ClickHouse/pull/72209) ([Christoph Wurm](https://github.com/cwurm)).
* 修复了 `SimpleSquashingChunksTransform` 在处理稀疏列时极少数情况下会发生的崩溃问题。[#72226](https://github.com/ClickHouse/ClickHouse/pull/72226) ([Vladimir Cherkasov](https://github.com/vdimir)) 。
* 修复了 `GraceHashJoin` 中的数据竞争问题；此前这可能导致 join 输出中缺少某些行。[#72233](https://github.com/ClickHouse/ClickHouse/pull/72233) ([Nikita Taranov](https://github.com/nickitat)).
* 修复了在启用设置 `enable_block_number_column` 时，带有已物化 `_block_number` 列的 `ALTER DELETE` 查询问题。[#72261](https://github.com/ClickHouse/ClickHouse/pull/72261) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了并发调用 `ColumnDynamic::dumpStructure()` 时出现的数据竞争问题，例如在 `ConcurrentHashJoin` 构造函数中。[#72278](https://github.com/ClickHouse/ClickHouse/pull/72278) ([Nikita Taranov](https://github.com/nickitat)).
* 修复了 `ORDER BY ... WITH FILL` 中重复列可能引发的 `LOGICAL_ERROR`。[#72387](https://github.com/ClickHouse/ClickHouse/pull/72387) ([Vladimir Cherkasov](https://github.com/vdimir)) 。
* 修复了在应用 `optimize_functions_to_subcolumns` 后多个场景下的类型不匹配问题。[#72394](https://github.com/ClickHouse/ClickHouse/pull/72394) ([Anton Popov](https://github.com/CurtizJ)) 。
* 使用 `AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE`，而非 `AWS_CONTAINER_AUTHORIZATION_TOKEN_PATH`。修复了 [#71074](https://github.com/ClickHouse/ClickHouse/issues/71074)。[#72397](https://github.com/ClickHouse/ClickHouse/pull/72397) ([Konstantin Bogdanov](https://github.com/thevar1able)) 。
* 修复了解析 `BACKUP DATABASE db EXCEPT TABLES db.table` 查询时出现失败的问题。[#72429](https://github.com/ClickHouse/ClickHouse/pull/72429) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* 禁止创建空 `Variant`。[#72454](https://github.com/ClickHouse/ClickHouse/pull/72454) ([Pavel Kruglov](https://github.com/Avogar)) 。
* 修复 `system.merges` 中 `result_part_path` 的错误格式化。[#72567](https://github.com/ClickHouse/ClickHouse/pull/72567) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* 修复了解析仅包含一个元素的 glob (例如 `{file}`) 时的问题。[#72572](https://github.com/ClickHouse/ClickHouse/pull/72572) ([Konstantin Bogdanov](https://github.com/thevar1able)) 。
* 修复在带有 `ARRAY JOIN` 的分布式查询场景下，follower 服务器的查询生成问题。修复了 [#69276](https://github.com/ClickHouse/ClickHouse/issues/69276)。[#72608](https://github.com/ClickHouse/ClickHouse/pull/72608) ([Dmitry Novik](https://github.com/novikd)) 。
* 修复 DateTime64 IN DateTime64 返回空结果的问题。 [#72640](https://github.com/ClickHouse/ClickHouse/pull/72640) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* 修复了在向包含使用 `flatten_nested=0` 创建的表的 Replicated database 添加新副本时，元数据不一致的问题。[#72685](https://github.com/ClickHouse/ClickHouse/pull/72685) ([Alexander Tokmakov](https://github.com/tavplubix)) 。
* 修复 Keeper 内部通信中的高级 SSL 配置问题。 [#72730](https://github.com/ClickHouse/ClickHouse/pull/72730) ([Antonio Andelic](https://github.com/antonio2368)).
* 修复在 S3Queue 无序模式下，当 `tracked_files_limit` 设置值小于 S3 文件出现速率时出现的 "No such key" 错误。[#72738](https://github.com/ClickHouse/ClickHouse/pull/72738) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复了在用户本地不存在时，RemoteQueryExecutor 抛出的异常。[#72759](https://github.com/ClickHouse/ClickHouse/pull/72759) ([Andrey Zvonov](https://github.com/zvonand)).
* 修复了在启用 `enable_block_number_column` 设置时，对已物化的 `_block_number` 列执行变更操作的问题。[#72854](https://github.com/ClickHouse/ClickHouse/pull/72854) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了在备份中包含空文件时，使用普通可重写磁盘进行备份/恢复会出问题的情况。[#72858](https://github.com/ClickHouse/ClickHouse/pull/72858) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 修复 DistributedAsyncInsertDirectoryQueue 中无法正确取消插入操作的问题。[#72885](https://github.com/ClickHouse/ClickHouse/pull/72885) ([Antonio Andelic](https://github.com/antonio2368)).
* 修复了解析错误数据到稀疏列时发生的崩溃 (在启用设置 `enable_parsing_to_custom_serialization` 时可能出现) 。[#72891](https://github.com/ClickHouse/ClickHouse/pull/72891) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复从备份恢复时可能发生的崩溃。[#72947](https://github.com/ClickHouse/ClickHouse/pull/72947) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复了 `parallel_hash` JOIN 方法中的一个 bug：当查询的 `ON` 子句包含带有不等式过滤器的复杂条件时，可能会出现该问题。[#72993](https://github.com/ClickHouse/ClickHouse/pull/72993) ([Nikita Taranov](https://github.com/nickitat)) 。
* 在 JSON 解析期间使用默认的格式设置，以避免反序列化出错。[#73043](https://github.com/ClickHouse/ClickHouse/pull/73043) ([Pavel Kruglov](https://github.com/Avogar)).
* 修复了事务使用不支持的存储时发生的崩溃。[#73045](https://github.com/ClickHouse/ClickHouse/pull/73045) ([Raúl Marín](https://github.com/Algunenano)).
* 修复了内存跟踪可能高估的问题 (即 `MemoryTracking` 与 `MemoryResident` 之间的差值持续增大时) 。[#73081](https://github.com/ClickHouse/ClickHouse/pull/73081) ([Azat Khuzhin](https://github.com/azat)).
* 在解析 Tuple 时，会检查是否存在重复的 JSON 键。此前，这可能会在解析过程中导致逻辑错误 `Invalid number of rows in Chunk`。[#73082](https://github.com/ClickHouse/ClickHouse/pull/73082) ([Pavel Kruglov](https://github.com/Avogar)) 。

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

* 之前存放在 `/utils` 目录中、且需要从源码手动编译的所有小型实用工具，现已并入 ClickHouse 主安装包。此项关闭了：[#72404](https://github.com/ClickHouse/ClickHouse/issues/72404)。[#72426](https://github.com/ClickHouse/ClickHouse/pull/72426) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 取消了 22.3 中引入的删除 `/etc/systemd/system/clickhouse-server.service` 的操作。[#39323](https://github.com/ClickHouse/ClickHouse/issues/39323)。[#72259](https://github.com/ClickHouse/ClickHouse/pull/72259) ([Mikhail f. Shiryaev](https://github.com/Felixoid)) 。
* 拆分大型翻译单元，以避免因内存/CPU 限制导致编译失败。[#72352](https://github.com/ClickHouse/ClickHouse/pull/72352) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* OSX：构建时启用 ICU 支持，从而支持排序规则、字符集转换及其他本地化功能。[#73083](https://github.com/ClickHouse/ClickHouse/pull/73083) ([Raúl Marín](https://github.com/Algunenano)) 。

### <a id="2411" /> ClickHouse 24.11 版本发布，2024-11-26。[演示文稿](https://presentations.clickhouse.com/2024-release-24.11/)，[视频](https://www.youtube.com/watch?v=0hpTvtq__4g)

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

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

* 移除系统表 `generate_series` 和 `generateSeries`。它们此前在这里被误加入：[ #59390](https://github.com/ClickHouse/ClickHouse/issues/59390)。[#71091](https://github.com/ClickHouse/ClickHouse/pull/71091) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 移除 `StorageExternalDistributed`。关闭 [#70600](https://github.com/ClickHouse/ClickHouse/issues/70600)。[#71176](https://github.com/ClickHouse/ClickHouse/pull/71176) ([flynn](https://github.com/ucasfl)).
* Kafka、NATS 和 RabbitMQ 表引擎现在在 `SOURCES` 层级下分别由各自的授权控制。请为所有使用这些引擎类型创建表的非默认数据库用户添加相应授权。[#71250](https://github.com/ClickHouse/ClickHouse/pull/71250) ([Christoph Wurm](https://github.com/cwurm)).
* 在执行完整的变更查询前先检查整个查询 (包括子查询) 。这可避免误执行无效查询，并防止累积会阻塞有效变更的失效变更。[#71300](https://github.com/ClickHouse/ClickHouse/pull/71300) ([Christoph Wurm](https://github.com/cwurm)).
* 将文件系统缓存设置 `skip_download_if_exceeds_query_cache` 重命名为 `filesystem_cache_skip_download_if_exceeds_per_query_cache_write_limit`。[#71578](https://github.com/ClickHouse/ClickHouse/pull/71578) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 移除 `deltaSumTimestamp` 对 `Enum`、`UInt128` 和 `UInt256` 参数的支持。同时移除 `deltaSumTimestamp` 第二个 (“timestamp”) 参数对 `Int8`、`UInt8`、`Int16` 和 `UInt16` 的支持。[#71790](https://github.com/ClickHouse/ClickHouse/pull/71790) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 现在，如果通过 Dictionary 存储、dictionary 表函数，或直接对字典本身执行 SELECT 来直接从字典中获取数据，只需具备该字典的 `SELECT` 权限或 `dictGet` 权限即可。这与此前为防止 ACL 被绕过所做的尝试保持一致：[https://github.com/ClickHouse/ClickHouse/pull/57362](https://github.com/ClickHouse/ClickHouse/pull/57362) 和 [https://github.com/ClickHouse/ClickHouse/pull/65359。同时，这也使后者具备了向后兼容性。\[#72051](https://github.com/ClickHouse/ClickHouse/pull/65359。同时，这也使后者具备了向后兼容性。\[#72051)]\([https://github.com/ClickHouse/ClickHouse/pull/72051](https://github.com/ClickHouse/ClickHouse/pull/72051)) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).

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

* 将 `allow_feature_tier` 实现为全局开关，用于禁用所有 experimental / beta 功能。[#71841](https://github.com/ClickHouse/ClickHouse/pull/71841) [#71145](https://github.com/ClickHouse/ClickHouse/pull/71145) ([Raúl Marín](https://github.com/Algunenano)).
* 修复了 JSON 子列文件中因特殊符号未转义而可能导致的 `No such file or directory` 错误。[#71182](https://github.com/ClickHouse/ClickHouse/pull/71182) ([Pavel Kruglov](https://github.com/Avogar)).
* 支持从 String 修改为 JSON。此 PR 还将 JSON 和 Dynamic 类型的序列化升级到新版本 V2。旧版本 V1 仍可通过启用设置 `merge_tree_use_v1_object_and_dynamic_serialization` 继续使用 (可在升级期间启用，以便在需要时无问题回滚版本) 。[#70442](https://github.com/ClickHouse/ClickHouse/pull/70442) ([Pavel Kruglov](https://github.com/Avogar)).
* 通过 JSON 字符串的序列化/反序列化，实现了从 Map/Tuple/Object 到新 JSON 的简单 CAST。[#71320](https://github.com/ClickHouse/ClickHouse/pull/71320) ([Pavel Kruglov](https://github.com/Avogar)).
* 默认不允许在 ORDER BY/GROUP BY/PARTITION BY/PRIMARY KEY 中使用 Variant/Dynamic 类型，因为这可能会导致意外结果。[#69731](https://github.com/ClickHouse/ClickHouse/pull/69731) ([Pavel Kruglov](https://github.com/Avogar)).
* 禁止在 min/max 函数中使用 Dynamic/Variant 类型，以避免混淆。[#71761](https://github.com/ClickHouse/ClickHouse/pull/71761) ([Pavel Kruglov](https://github.com/Avogar)).

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

* 新增了用于描述工作负载和资源管理的 SQL 语法。[https://clickhouse.com/docs/operations/workload-scheduling](https://clickhouse.com/docs/operations/workload-scheduling). [#69187](https://github.com/ClickHouse/ClickHouse/pull/69187) ([Sergei Trifonov](https://github.com/serxa)).
* 新增数据类型 `BFloat16`，表示 16 位浮点数，包含 8 位指数、符号位和 7 位尾数。此项关闭了 [#44206](https://github.com/ClickHouse/ClickHouse/issues/44206)。此项关闭了 [#49937](https://github.com/ClickHouse/ClickHouse/issues/49937)。[#64712](https://github.com/ClickHouse/ClickHouse/pull/64712) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 新增 `CHECK GRANT` 查询，用于检查当前用户/角色是否已被授予特定权限，以及内存中是否存在相应的表/列。[#68885](https://github.com/ClickHouse/ClickHouse/pull/68885) ([Unalian](https://github.com/Unalian)).
* 新增 `iceberg[S3;HDFS;Azure]Cluster`、`deltaLakeCluster`、`hudiCluster` 表函数。[#72045](https://github.com/ClickHouse/ClickHouse/pull/72045) ([Mikhail Artemenko](https://github.com/Michicosun)).
* 新增了在 http\_handlers 中设置用户名/密码的能力 (用于 `dynamic_query_handler`/`predefined_query_handler`) 。[#70725](https://github.com/ClickHouse/ClickHouse/pull/70725) ([Azat Khuzhin](https://github.com/azat)).
* 为 ORDER BY WITH FILL 操作符新增了对 staleness 子句的支持。[#71151](https://github.com/ClickHouse/ClickHouse/pull/71151) ([Mikhail Artemenko](https://github.com/Michicosun)).
* 允许每种身份验证方法单独设置过期日期，并将其从用户实体中移除。[#70090](https://github.com/ClickHouse/ClickHouse/pull/70090) ([Arthur Passos](https://github.com/arthurpassos)).
* 新增函数 `parseDateTime64`、`parseDateTime64OrNull` 和 `parseDateTime64OrZero`。与现有函数 `parseDateTime` (及其变体) 相比，它们返回的是 `DateTime64` 类型的值，而不是 `DateTime`。[#71581](https://github.com/ClickHouse/ClickHouse/pull/71581) ([kevinyhzou](https://github.com/KevinyhZou)).

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

* 如果某个数据分区片段的索引粒度保持恒定，其索引粒度值的内存占用就会得到优化。新增了一个选项，可始终为数据分区片段选择恒定粒度 (设置 `use_const_adaptive_granularity`) ，从而确保这部分内存始终处于优化状态。这有助于在大型工作负载 (共享存储中的数万亿行) 场景下，避免数据分区片段元数据 (索引粒度值) 导致内存占用持续增长。[#71786](https://github.com/ClickHouse/ClickHouse/pull/71786) ([Anton Popov](https://github.com/CurtizJ)) 。
* 现在，对于 `join_algorithm = 'parallel_hash'`，在将输入块中的列分配到各线程进行并行处理时，我们不再复制这些列。[#67782](https://github.com/ClickHouse/ClickHouse/pull/67782) ([Nikita Taranov](https://github.com/nickitat)) 。
* 针对非相交 parts 优化了 `Replacing` 合并算法。 [#70977](https://github.com/ClickHouse/ClickHouse/pull/70977) ([Anton Popov](https://github.com/CurtizJ)).
* 不要在指标和 system.detached\_parts 中列出位于 readonly 和一次写入磁盘上的 detached parts。[#71086](https://github.com/ClickHouse/ClickHouse/pull/71086) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 默认不计算高开销异步指标。该功能是在 [#40332](https://github.com/ClickHouse/ClickHouse/issues/40332) 中引入的，但为了仅单个客户的需求而保留一个高开销的后台任务，并不合理。[#71087](https://github.com/ClickHouse/ClickHouse/pull/71087) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 对于 `plain_rewritable` 磁盘：列出目录时不要调用对象存储 API，因为这样做的成本效益可能不高。应改为将文件名列表存储在内存中。这样做的权衡是：初始加载时间会增加，并且需要更多内存来存储文件名。[#70823](https://github.com/ClickHouse/ClickHouse/pull/70823) ([Julia Kartseva](https://github.com/jkartseva)) 。
* 通过缩小临界区，提升 `system.query_metric_log` 收集间隔的性能和准确性。[#71473](https://github.com/ClickHouse/ClickHouse/pull/71473) ([Pablo Marcos](https://github.com/pamarcos)) 。
* 通过生成虚拟行来优化按序读取，从而在归并排序期间减少读取的数据量，尤其在存在多个 parts 时非常有用。[#62125](https://github.com/ClickHouse/ClickHouse/pull/62125) ([Shichao Jin](https://github.com/jsc0218)).
* 新增了服务器级设置 `async_load_system_database`，允许服务器在系统数据库尚未完全加载时启动。如果系统表很多，这有助于 ClickHouse 更快启动。[#69847](https://github.com/ClickHouse/ClickHouse/pull/69847) ([Sergei Trifonov](https://github.com/serxa)) 。
* 为 `clickhouse-compressor` 新增 `--threads` 参数，支持并行压缩数据。[#70860](https://github.com/ClickHouse/ClickHouse/pull/70860) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 新增了一个设置 `prewarm_mark_cache`，可在插入、合并、拉取 parts 以及表启动时，将标记预加载到标记缓存中。[#71053](https://github.com/ClickHouse/ClickHouse/pull/71053) ([Anton Popov](https://github.com/CurtizJ)).
* 缩减内存中的 index\_granularity 数组大小，以降低 MergeTree 表引擎家族的内存占用。 [#71595](https://github.com/ClickHouse/ClickHouse/pull/71595) ([alesapin](https://github.com/alesapin)).
* 对非磁盘读取禁用文件系统缓存设置 `boundary_alignment`，从而提升了从启用缓存的独立远程文件中读取数据的性能。 [#71827](https://github.com/ClickHouse/ClickHouse/pull/71827) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 像 `SELECT * FROM table LIMIT ...` 这样的查询，过去即使实际上并未使用分片索引，也会将其加载。[#71866](https://github.com/ClickHouse/ClickHouse/pull/71866) ([Alexander Gololobov](https://github.com/davenger)) 。
* 默认启用 `parallel_replicas_local_plan`。在查询发起节点上构建完整的本地执行计划，可在减少资源消耗的同时提升并行副本的性能，并带来更多应用查询优化的机会。[#70171](https://github.com/ClickHouse/ClickHouse/pull/70171) ([Igor Nikonov](https://github.com/devcrafter)) 。

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

* 允许将文件作为参数传给 clickhouse 使用，例如 `ch queries.sql`。 [#71589](https://github.com/ClickHouse/ClickHouse/pull/71589) ([Raúl Marín](https://github.com/Algunenano)).
* `Vertical` 格式 (在查询末尾加上 `\G` 时也会启用) 具备 Pretty 格式的特性，例如：- 对数值中的千位分组进行高亮；- 输出易于阅读的数字提示。[#71630](https://github.com/ClickHouse/ClickHouse/pull/71630) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 将外部用户角色从查询发起节点推送到集群中的其他节点。在只有发起节点能够访问外部身份验证器 (如 LDAP) 的情况下，这项功能很有帮助。[#70332](https://github.com/ClickHouse/ClickHouse/pull/70332) ([Andrey Zvonov](https://github.com/zvonand)).
* 为聚合函数 `any` 添加了别名 `anyRespectNulls`、`firstValueRespectNulls` 和 `anyValueRespectNulls`。同时，还为聚合函数 `anyLast` 添加了别名 `anyLastRespectNulls` 和 `lastValueRespectNulls`。这样就可以使用更自然的纯驼峰式语法，而不是驼峰式与下划线混用的语法，例如：使用 `SELECT anyLastRespectNullsStateIf` 代替 `anyLast_respect_nullsStateIf`。[#71403](https://github.com/ClickHouse/ClickHouse/pull/71403) ([Peter Nguyen](https://github.com/petern48)) 。
* 新增了配置参数 `date_time_utc`，使 JSON 日志格式支持 RFC 3339/ISO8601 格式的 UTC 日期时间。[#71560](https://github.com/ClickHouse/ClickHouse/pull/71560) ([Ali](https://github.com/xogoodnow)) 。
* 为 S3 端点的用户身份验证新增了一种请求头类型 (`access_header`) 。这样可以以最低优先级获取某个访问请求头；如果任意其他来源 (例如表 schema 或 named collection) 提供了 `access_key_id`，则会覆盖它。[#71011](https://github.com/ClickHouse/ClickHouse/pull/71011) ([MikhailBurdukov](https://github.com/MikhailBurdukov)).
* 使用常量数组和已捕获常量参数的高阶函数将返回常量。[#58400](https://github.com/ClickHouse/ClickHouse/pull/58400) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 查询计划步骤名称 (`EXPLAIN PLAN json=1`) 和管道处理器名称 (`EXPLAIN PIPELINE compact=0,graph=1`) 现在都会附带一个唯一 id 作为后缀。这使得处理器 Profiler 输出和 OpenTelemetry 链路追踪能够与 explain 输出相匹配。[#63518](https://github.com/ClickHouse/ClickHouse/pull/63518) ([qhsong](https://github.com/qhsong)).
* 新增了一个选项，可在将对象写入 Azure Blob 存储后检查其是否存在，该选项由设置 `check_objects_after_upload` 控制。[#64847](https://github.com/ClickHouse/ClickHouse/pull/64847) ([Smita Kulkarni](https://github.com/SmitaRKulkarni)).
* 默认在 `clickhouse-local` 中使用 `Atomic` database。处理了 [#50647](https://github.com/ClickHouse/ClickHouse/issues/50647) 中的第 1 和第 5 项。关闭 [#44817](https://github.com/ClickHouse/ClickHouse/issues/44817)。[#68024](https://github.com/ClickHouse/ClickHouse/pull/68024) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 异常会中断 HTTP 协议，以便向客户端报告错误。[#68800](https://github.com/ClickHouse/ClickHouse/pull/68800) ([Sema Checherinda](https://github.com/CheSema)) 。
* 通过创建 replica\_dir，并在 DDLWorker 中将副本标记为活跃，以上报运行 distributed DDL 查询的主机。[#69658](https://github.com/ClickHouse/ClickHouse/pull/69658) ([tuanpach](https://github.com/tuanpach)) 。
* 如果 distributed\_ddl\_output\_mode 设置为 \*\_only\_active，则 database ON CLUSTER 查询将仅等待活跃副本。[#69660](https://github.com/ClickHouse/ClickHouse/pull/69660) ([tuanpach](https://github.com/tuanpach)) 。
* 改进了 `ON CLUSTER` 备份和恢复的错误处理与取消机制：- 如果某台主机上的备份或恢复失败，其他主机上的相应操作也会自动取消 - 不会再因为部分主机失败而其他主机继续执行，导致出现莫名其妙的错误 - 如果某台主机上的备份或恢复被取消，其他主机上的相应操作也会自动取消 - 修复了 `test_disallow_concurrency` 的相关问题 - 现在禁用并发的效果更可靠 - 备份和恢复现在对 ZooKeeper 断开连接的情况也更加稳健。[#70027](https://github.com/ClickHouse/ClickHouse/pull/70027) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 支持对存储 S3Queue 中的某些设置使用 `ALTER TABLE ... MODIFY/RESET SETTING ...`。 [#70811](https://github.com/ClickHouse/ClickHouse/pull/70811) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 新增了按与重新加载服务器证书相同的方式重新加载客户端证书的功能。[#70997](https://github.com/ClickHouse/ClickHouse/pull/70997) ([Roman Antonov](https://github.com/Romeo58rus)).
* 支持配置客户端历史记录大小，并增大默认值。[#71014](https://github.com/ClickHouse/ClickHouse/pull/71014) ([Jiří Kozlovský](https://github.com/jirislav)) 。
* Parquet 原生读取器现已支持布尔类型。[#71055](https://github.com/ClickHouse/ClickHouse/pull/71055) ([Arthur Passos](https://github.com/arthurpassos)).
* 与 S3 交互时，会对更多错误进行重试，例如 "Malformed message"。[#71088](https://github.com/ClickHouse/ClickHouse/pull/71088) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 降低了部分 S3 相关消息的日志级别。[#71090](https://github.com/ClickHouse/ClickHouse/pull/71090) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 支持写入文件名包含空格的 HDFS 文件。 [#71105](https://github.com/ClickHouse/ClickHouse/pull/71105) ([exmy](https://github.com/exmy)).
* 新增了用于限制复制表、字典和视图数量的设置。[#71179](https://github.com/ClickHouse/ClickHouse/pull/71179) ([Kirill](https://github.com/kirillgarbar)).
* 如果可用，优先使用 `AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE`，而不要使用 `AWS_CONTAINER_AUTHORIZATION_TOKEN`。修复了 [#71074](https://github.com/ClickHouse/ClickHouse/issues/71074)。[#71269](https://github.com/ClickHouse/ClickHouse/pull/71269) ([Konstantin Bogdanov](https://github.com/thevar1able)) 。
* 从 ReplicatedMergeTree 重启线程中移除创建 metadata\_version ZooKeeper 节点的逻辑。只有在用户从早于 20.4 的版本直接升级到高于 24.10 的版本时，才需要创建该节点。ClickHouse 不支持跨度超过一年的升级，因此我们应该抛出异常并提示用户逐步升级，而不是创建该节点。 [#71385](https://github.com/ClickHouse/ClickHouse/pull/71385) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)) 。
* 为高级仪表板新增按主机划分的仪表盘 `Overview (host)` 和 `Cloud overview (host)`。[#71422](https://github.com/ClickHouse/ClickHouse/pull/71422) ([alesapin](https://github.com/alesapin)).
* `clickhouse-local` 默认使用隐式 SELECT，因此可将其当作计算器使用。改进了隐式 SELECT 模式下的语法高亮。[#71620](https://github.com/ClickHouse/ClickHouse/pull/71620) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 命令行应用程序现在即使对于多条语句也会进行语法高亮。[#71622](https://github.com/ClickHouse/ClickHouse/pull/71622) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 命令行应用程序在发生错误时会返回非零退出码。此前的版本中，`disks` 应用程序在出错时会返回零，其他应用程序在出现错误 256 (`PARTITION_ALREADY_EXISTS`) 和 512 (`SET_NON_GRANTED_ROLE`) 时也会返回零。[#71623](https://github.com/ClickHouse/ClickHouse/pull/71623) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 当用户/组以 ID 形式指定时，`clickhouse su` 会报错。此补丁修复了该问题，使其也能接受 `UID:GID`。[#71626](https://github.com/ClickHouse/ClickHouse/pull/71626) ([Mikhail f. Shiryaev](https://github.com/Felixoid)).
* 允许通过设置 `filesystem_cache_prefer_bigger_buffer_size` 禁用文件系统缓存增大内存缓冲区的行为。[#71640](https://github.com/ClickHouse/ClickHouse/pull/71640) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 为文件系统缓存中后台下载的最大 File 段大小新增了单独的设置 `background_download_max_file_segment_size`。[#71648](https://github.com/ClickHouse/ClickHouse/pull/71648) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* JSON 类型解析略有优化：如果 JSON 路径的当前块中包含多种类型的值，则会按一种特殊的尽力而为顺序依次尝试这些类型，以选出最合适的类型。[#71785](https://github.com/ClickHouse/ClickHouse/pull/71785) ([Pavel Kruglov](https://github.com/Avogar)) 。
* 此前，读取 `system.asynchronous_metrics` 时需要等待并发更新完成。如果系统负载很高，这可能需要较长时间。通过这项更改，始终都可以读取先前收集的值。[#71798](https://github.com/ClickHouse/ClickHouse/pull/71798) ([Alexander Gololobov](https://github.com/davenger)) 。
* S3Queue 和 AzureQueue：将 `polling_max_timeout_ms` 设为 10 分钟，将 `polling_backoff_ms` 设为 30 秒。[#71817](https://github.com/ClickHouse/ClickHouse/pull/71817) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 在一个 `history` 周期内三次更新 `HostResolver`。[#71863](https://github.com/ClickHouse/ClickHouse/pull/71863) ([Sema Checherinda](https://github.com/CheSema)) 。
* 在高级仪表板 HTML 页面中，新增了一个下拉选择器，用于从 `system.dashboards` 表中选择仪表盘。[#72081](https://github.com/ClickHouse/ClickHouse/pull/72081) ([Sergei Trifonov](https://github.com/serxa)) 。
* 授权后检查默认 database 是否存在。修复了 [#71097](https://github.com/ClickHouse/ClickHouse/issues/71097)。[#71140](https://github.com/ClickHouse/ClickHouse/pull/71140) ([Konstantin Bogdanov](https://github.com/thevar1able)) 。

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

* 在 `ATTACH PART` 查询期间被去重的 parts 不会再卡在带有 `attaching_` 前缀的状态。 [#65636](https://github.com/ClickHouse/ClickHouse/pull/65636) ([Kirill](https://github.com/kirillgarbar)).
* 修复了 `IN` 函数中 DateTime64 精度丢失的问题。[#67230](https://github.com/ClickHouse/ClickHouse/pull/67230) ([Yarik Briukhovetskyi](https://github.com/yariks5s)) 。
* 修复在 `ORDER BY ... WITH FILL` 中使用带有 `IGNORE/RESPECT NULLS` 的函数时可能发生的逻辑错误，关闭 [#57609](https://github.com/ClickHouse/ClickHouse/issues/57609)。[#68234](https://github.com/ClickHouse/ClickHouse/pull/68234) ([Vladimir Cherkasov](https://github.com/vdimir)) 。
* 修复了在达到内存限制时，使用 `Native` 格式进行异步插入时出现的罕见逻辑错误。[#68965](https://github.com/ClickHouse/ClickHouse/pull/68965) ([Anton Popov](https://github.com/CurtizJ)).
* 修复 CREATE TABLE 中 EPHEMERAL 列的 COMMENT 问题。 [#70458](https://github.com/ClickHouse/ClickHouse/pull/70458) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)).
* 修复了 JSONExtract 与 LowCardinality(Nullable) 配合使用时的逻辑错误。[#70549](https://github.com/ClickHouse/ClickHouse/pull/70549) ([Pavel Kruglov](https://github.com/Avogar)) 。
* 当存在另一个使用相同 zk path 的副本时，允许执行 system drop replica zkpath。[#70642](https://github.com/ClickHouse/ClickHouse/pull/70642) ([MikhailBurdukov](https://github.com/MikhailBurdukov)) 。
* 修复了 AggregateFunctionGroupArraySorted 中的崩溃和内存泄漏。[#70820](https://github.com/ClickHouse/ClickHouse/pull/70820) ([Michael Kolupaev](https://github.com/al13n321)) 。
* 在 URL 引擎中新增了可通过用户请求头覆盖 Content-Type 的能力。[#70859](https://github.com/ClickHouse/ClickHouse/pull/70859) ([Artem Iurin](https://github.com/ortyomka)) 。
* 修复 `StorageS3Queue` 中的逻辑错误："无法在 /processed 中创建持久节点，因为它已存在"。[#70984](https://github.com/ClickHouse/ClickHouse/pull/70984) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复了在某些情况下命名会话无法关闭、始终挂起的问题。[#70998](https://github.com/ClickHouse/ClickHouse/pull/70998) ([Márcio Martins](https://github.com/marcio-absmartly)) 。
* 修复了投影轻量级删除的重建选项未考虑 \_row\_exists 列的缺陷。 [#71089](https://github.com/ClickHouse/ClickHouse/pull/71089) ([Shichao Jin](https://github.com/jsc0218)).
* 修复在 Oracle Linux UEK 6.10 上运行时出现的 `AT_* is out of range` 超出范围问题。[#71109](https://github.com/ClickHouse/ClickHouse/pull/71109) ([Örjan Fors](https://github.com/op)).
* 修复了因意外竞态条件导致 `system.query&#95;metric&#95;log` 中值错误的问题。[#71124](https://github.com/ClickHouse/ClickHouse/pull/71124) ([Pablo Marcos](https://github.com/pamarcos)).
* 修复 quantileExactWeightedInterpolated 的聚合函数名称不一致问题。该错误是在 [https://github.com/ClickHouse/ClickHouse/pull/69619](https://github.com/ClickHouse/ClickHouse/pull/69619) 中引入的，并抄送 @Algunenano。[#71168](https://github.com/ClickHouse/ClickHouse/pull/71168) ([李扬](https://github.com/taiyang-li)) 。
* 修复函数比较中使用 Dynamic 时出现的 bad\_weak\_ptr 异常。[#71183](https://github.com/ClickHouse/ClickHouse/pull/71183) ([Pavel Kruglov](https://github.com/Avogar)).
* 检查待读取的 7z 文件是否位于本机上。[#71184](https://github.com/ClickHouse/ClickHouse/pull/71184) ([Daniil Ivanik](https://github.com/divanik)).
* 修复了通过 HTTP 和异步插入使用 Native format 时忽略格式设置的问题。[#71193](https://github.com/ClickHouse/ClickHouse/pull/71193) ([Pavel Kruglov](https://github.com/Avogar)) 。
* 启用设置 `use_query_cache = 1` 运行的 SELECT 查询，如果系统表名称以字符串字面量形式出现，将不再被拒绝；例如，`SELECT * FROM users WHERE name = 'system.metrics' SETTINGS use_query_cache = true;` 现在已可正常执行。[#71254](https://github.com/ClickHouse/ClickHouse/pull/71254) ([Robert Schulze](https://github.com/rschu1ze)).
* 修复了一个问题：如果启用 enable\_filesystem\_cache=1，但存储配置中的磁盘未配置任何缓存，则内存使用量会增加。[#71261](https://github.com/ClickHouse/ClickHouse/pull/71261) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复对来自 Dynamic 列的 LowCardinality 字典进行反序列化时，可能出现的“Cannot read all data”错误。 [#71299](https://github.com/ClickHouse/ClickHouse/pull/71299) ([Pavel Kruglov](https://github.com/Avogar)).
* 修复了客户端中并行输出格式未完全清理的问题。[#71304](https://github.com/ClickHouse/ClickHouse/pull/71304) ([Raúl Marín](https://github.com/Algunenano)).
* 为 named collections 补上了缺失的反转义处理。若无此修复，clickhouse-server 将无法启动。[#71308](https://github.com/ClickHouse/ClickHouse/pull/71308) ([MikhailBurdukov](https://github.com/MikhailBurdukov)) 。
* 修复了通过原生协议进行异步插入时空块导致的问题。[#71312](https://github.com/ClickHouse/ClickHouse/pull/71312) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复在授予错误的通配符授权时 AST 格式不一致的问题 [#71309](https://github.com/ClickHouse/ClickHouse/issues/71309)。[#71332](https://github.com/ClickHouse/ClickHouse/pull/71332) ([pufit](https://github.com/pufit)) 。
* 为数据分区片段的析构函数添加 try/catch，以避免 `std::terminate`。 [#71364](https://github.com/ClickHouse/ClickHouse/pull/71364) ([alesapin](https://github.com/alesapin)).
* 检查 JSON 类型提示中的可疑类型和 Experimental 类型。[#71369](https://github.com/ClickHouse/ClickHouse/pull/71369) ([Pavel Kruglov](https://github.com/Avogar)) 。
* 也在非 Linux 操作系统上启动 memory 工作线程 (修复 [#71051](https://github.com/ClickHouse/ClickHouse/issues/71051)) 。[#71384](https://github.com/ClickHouse/ClickHouse/pull/71384) ([Alexandre Snarskii](https://github.com/snar)) 。
* 修复 Variant 列出现“Invalid number of rows in Chunk”错误的问题。 [#71388](https://github.com/ClickHouse/ClickHouse/pull/71388) ([Pavel Kruglov](https://github.com/Avogar)).
* 修复旧版 PostgreSQL 中出现的 "列 attgenerated 不存在" 错误，修复了 [#60651](https://github.com/ClickHouse/ClickHouse/issues/60651)。[#71396](https://github.com/ClickHouse/ClickHouse/pull/71396) ([0xMihalich](https://github.com/0xMihalich)) 。
* 为避免服务器日志被大量刷屏，失败的身份验证尝试现在会以 `DEBUG` 级别记录，而不是 `ERROR`。[#71405](https://github.com/ClickHouse/ClickHouse/pull/71405) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 修复了 `mongodb` 表函数在传入错误参数 (如 `NULL`) 时发生崩溃的问题。[#71426](https://github.com/ClickHouse/ClickHouse/pull/71426) ([Vladimir Cherkasov](https://github.com/vdimir)).
* 修复了 optimize\_rewrite\_array\_exists\_to\_has 引发的崩溃问题。 [#71432](https://github.com/ClickHouse/ClickHouse/pull/71432) ([Raúl Marín](https://github.com/Algunenano)).
* 修复了在插入操作中使用设置 `max_insert_delayed_streams_for_parallel_write` 的问题。此前该设置行为不正确，可能导致将数据写入多个分区的插入操作占用较高内存。[#71474](https://github.com/ClickHouse/ClickHouse/pull/71474) ([Anton Popov](https://github.com/CurtizJ)).
* 修复了一种可能出现的错误：在 `arrayJoin` 表面上可出现在 `WHERE` 条件中的情况下，可能会触发 `Argument for function must be constant` (旧版 analyzer) 。这是 [https://github.com/ClickHouse/ClickHouse/pull/65414](https://github.com/ClickHouse/ClickHouse/pull/65414) 之后引入的回归问题。[#71476](https://github.com/ClickHouse/ClickHouse/pull/71476) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 防止 SortCursor 在 0 列情况下崩溃 (旧 analyzer) 。[#71494](https://github.com/ClickHouse/ClickHouse/pull/71494) ([Raúl Marín](https://github.com/Algunenano)).
* 修复了由未初始化的 ORC 数据导致的 Date32 越界问题。更多详情见 [https://github.com/apache/incubator-gluten/issues/7823。](https://github.com/apache/incubator-gluten/issues/7823。) [#71500](https://github.com/ClickHouse/ClickHouse/pull/71500) ([李扬](https://github.com/taiyang-li)).
* 修复了 wide part 中 Dynamic 和 JSON 类型列大小统计错误的问题。[#71526](https://github.com/ClickHouse/ClickHouse/pull/71526) ([Pavel Kruglov](https://github.com/Avogar)).
* 修复了 materialized view 中的查询在结合 CTE 使用 IN 时的 analyzer 问题。关闭 [#65598](https://github.com/ClickHouse/ClickHouse/issues/65598)。[#71538](https://github.com/ClickHouse/ClickHouse/pull/71538) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 避免在约束条件中使用 UDF 时发生崩溃。[#71541](https://github.com/ClickHouse/ClickHouse/pull/71541) ([Raúl Marín](https://github.com/Algunenano)) 。
* 发生越界时，`bitShift` 函数会返回 0 或默认字符，而不是抛出错误。[#71580](https://github.com/ClickHouse/ClickHouse/pull/71580) ([Pablo Marcos](https://github.com/pamarcos)).
* 修复了在某些引擎上使用 materialized view 时导致服务器崩溃的问题。[#71593](https://github.com/ClickHouse/ClickHouse/pull/71593) ([Pervakov Grigorii](https://github.com/GrigoryPervakov)).
* 对包含常量数组别名的嵌套数据结构执行 Array join 时，会触发空指针解引用。此修复关闭了 [#71677](https://github.com/ClickHouse/ClickHouse/issues/71677)。[#71678](https://github.com/ClickHouse/ClickHouse/pull/71678) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 修复对空元组执行 ALTER 时出现的 LOGICAL\_ERROR。此修复解决了 [#71647](https://github.com/ClickHouse/ClickHouse/issues/71647)。[#71679](https://github.com/ClickHouse/ClickHouse/pull/71679) ([Amos Bird](https://github.com/amosbird)) 。
* 在针对分区列的谓词中使用 NOT IN 运算符时，不要转换常量集合。[#71695](https://github.com/ClickHouse/ClickHouse/pull/71695) ([Eduard Karacharov](https://github.com/korowa)) 。
* 修复 docker 初始化脚本失败时的日志消息，使其含义更清晰易懂。[#71734](https://github.com/ClickHouse/ClickHouse/pull/71734) ([Андрей](https://github.com/andreineustroev)).
* 修复了从 LowCardinality(Nullable) 到 Dynamic 的 CAST 问题。此前，这可能导致错误 `Bad cast from type DB::ColumnVector<int> to DB::ColumnNullable`。 [#71742](https://github.com/ClickHouse/ClickHouse/pull/71742) ([Pavel Kruglov](https://github.com/Avogar)) 。
* 修复了在主键为 DateTime64 类型的 WHERE 条件中使用 toDayOfWeek 时触发的异常。[#71849](https://github.com/ClickHouse/ClickHouse/pull/71849) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* 修复了解析到稀疏列后默认值填充不正确的问题。[#71854](https://github.com/ClickHouse/ClickHouse/pull/71854) ([Anton Popov](https://github.com/CurtizJ)).
* 修复在分布式表上，当输入为 ALIAS 时 GROUPING 函数报错的问题，关闭 [#68602](https://github.com/ClickHouse/ClickHouse/issues/68602)。[#71855](https://github.com/ClickHouse/ClickHouse/pull/71855) ([Vladimir Cherkasov](https://github.com/vdimir)).
* 修复了使用 `allow_experimental_join_condition` 时可能发生的崩溃，关闭了 [#71693](https://github.com/ClickHouse/ClickHouse/issues/71693)。[#71857](https://github.com/ClickHouse/ClickHouse/pull/71857) ([Vladimir Cherkasov](https://github.com/vdimir)) 。
* 修复了使用 `WITH TIES` 子句的 select 语句可能返回行数不足的问题。[#71886](https://github.com/ClickHouse/ClickHouse/pull/71886) ([wxybear](https://github.com/wxybear)).
* 修复了这样一种 TOO\_LARGE\_ARRAY\_SIZE 异常：当 `arrayWithConstant` 求值生成的一列被误判为超过数组大小限制时，会触发该异常。[#71894](https://github.com/ClickHouse/ClickHouse/pull/71894) ([Udi](https://github.com/udiz)).
* `clickhouse-benchmark` 对耗时超过 1 秒的查询报告了错误的指标。[#71898](https://github.com/ClickHouse/ClickHouse/pull/71898) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 修复 `clickhouse-client` 中进度指示器与进度表之间的竞态问题。使用 FROM INFILE 时，此问题会出现。在执行 INSERT 查询期间拦截按键输入，以切换进度表的显示。[#71901](https://github.com/ClickHouse/ClickHouse/pull/71901) ([Julia Kartseva](https://github.com/jkartseva)) 。
* 使用辅助 Keeper 实现集群自动发现。[#71911](https://github.com/ClickHouse/ClickHouse/pull/71911) ([Anton Ivashkin](https://github.com/ianton-ru)) 。
* 修复了 24.6 中 system.s3/azure\_queue\_log 的 rows\_processed 列损坏的问题。关闭 [#69975](https://github.com/ClickHouse/ClickHouse/issues/69975)。[#71946](https://github.com/ClickHouse/ClickHouse/pull/71946) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复了 `s3`/`s3Cluster` 函数在某些情况下可能返回不完整结果或抛出异常的问题。该问题与在 S3 URI 中使用 glob pattern (如 `pattern/*`) 有关，并且要求存在一个键为 `pattern/` 的空 object (这类 object 会由 S3 Console 自动创建) 。此外，设置 `s3_skip_empty_files` 的默认值也已由 `false` 改为 `true`。 [#71947](https://github.com/ClickHouse/ClickHouse/pull/71947) ([Nikita Taranov](https://github.com/nickitat)).
* 修复了 clickhouse-client 语法高亮中的崩溃问题。关闭 [#71864](https://github.com/ClickHouse/ClickHouse/issues/71864)。[#71949](https://github.com/ClickHouse/ClickHouse/pull/71949) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 修复了在第一个参数为常量时，`MergeTree` 表在 `ORDER BY` 中使用二元单调函数时出现的 `Illegal type` 错误。修复 [#71941](https://github.com/ClickHouse/ClickHouse/issues/71941)。[#71966](https://github.com/ClickHouse/ClickHouse/pull/71966) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 仅允许在子查询中使用的 EXPLAIN AST 包含 SELECT 查询。其他类型的查询会导致逻辑错误：'Bad cast from type DB::ASTCreateQuery to DB::ASTSelectWithUnionQuery' 或 `Inconsistent AST formatting`。[#71982](https://github.com/ClickHouse/ClickHouse/pull/71982) ([Pavel Kruglov](https://github.com/Avogar)) 。
* 当通过 `clickhouse-client` 插入一条记录时，客户端会从服务器读取列描述。但此前有一个 bug：我们写入这些描述时顺序错了，正确顺序应为 \[statistics, ttl, settings]。[#71991](https://github.com/ClickHouse/ClickHouse/pull/71991) ([Han Fei](https://github.com/hanfei1991)).
* 修复了在启用 `format_alter_commands_with_parentheses` 时，`MOVE PARTITION ... TO TABLE ...` ALTER 命令的格式问题。[#72080](https://github.com/ClickHouse/ClickHouse/pull/72080) ([János Benjamin Antal](https://github.com/antaljanosbenjamin)).
* 修复了使用并行副本的查询中 RIGHT / FULL JOIN 的问题。现在，RIGHT JOIN 可以与并行副本一起执行 (右表读取会分布式进行) 。FULL JOIN 无法在节点间并行化，因此会在本地执行。[#71162](https://github.com/ClickHouse/ClickHouse/pull/71162) ([Igor Nikonov](https://github.com/devcrafter)) 。
* 修复了一个问题：由于系统调用受限，Docker 容器中的 ClickHouse 会将 "get\_mempolicy: Operation not permitted" 输出到 stderr。[#70900](https://github.com/ClickHouse/ClickHouse/pull/70900) ([filimonov](https://github.com/filimonov)) 。
* 将 ZooKeeper 中的 metadata\_version 记录修复操作放到重启线程中执行，而不是 attach 线程。[#70297](https://github.com/ClickHouse/ClickHouse/pull/70297) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)) 。
* 这是对不受支持且即将被彻底移除的“zero-copy”复制的一项修复：在 ReplicatedMergeTree 使用 zero-copy 复制且仍有节点依赖该 blob 时，不要删除该 blob。[#71186](https://github.com/ClickHouse/ClickHouse/pull/71186) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 这是对“zero-copy”复制的一项修复；该功能目前不受支持，并将被彻底移除。在将分片移动到 zero-copy 磁盘之前，先获取 zero-copy 共享锁，以防 Keeper 不可用时发生潜在的数据丢失。[#71845](https://github.com/ClickHouse/ClickHouse/pull/71845) ([Aleksei Filatov](https://github.com/aalexfvk)).

### <a id="2410" /> ClickHouse 24.10 版本发布，2024-10-31。 [演示文稿](https://presentations.clickhouse.com/2024-release-24.10/), [视频](https://www.youtube.com/watch?v=AamIAjURp4U)

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

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

* 当子查询位于括号内时，现在允许在带有 `UNION` 的查询链中将 `SETTINGS` 写在 `FORMAT` 之前。此更改修复了 [#39712](https://github.com/ClickHouse/ClickHouse/issues/39712)。同时还调整了在同一查询序列中两次指定 SETTINGS 子句时的行为：距离对应子查询最近的 SETTINGS 子句将优先生效。此前版本中，最外层的 SETTINGS 子句可能会优先于内层子句生效。[#68614](https://github.com/ClickHouse/ClickHouse/pull/68614) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 现在默认允许对 `[PRE]WHERE` 子句中的过滤条件进行重新排序。可通过将 `allow_reorder_prewhere_conditions` 设为 `false` 来禁用。[#70657](https://github.com/ClickHouse/ClickHouse/pull/70657) ([Nikita Taranov](https://github.com/nickitat)).
* 移除了采用不兼容许可证的 `idxd-config` 库。这也一并移除了 Experimental 的 Intel DeflateQPL 编解码器。[#70987](https://github.com/ClickHouse/ClickHouse/pull/70987) ([Alexey Milovidov](https://github.com/alexey-milovidov)).

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

* 允许对通配符前缀授予访问权限。`GRANT SELECT ON db.table_pefix_* TO user`。[#65311](https://github.com/ClickHouse/ClickHouse/pull/65311) ([pufit](https://github.com/pufit)) 。
* 如果你在查询执行期间按下空格键，客户端会显示一个包含详细指标的实时表格。你可以在 clickhouse-client 中使用新的 `--progress-table` 选项全局启用该功能；新增的 `--enable-progress-table-toggle` 与 `--progress-table` 选项配合使用，可通过按下控制键 (Space) 来切换进度表的显示。[#63689](https://github.com/ClickHouse/ClickHouse/pull/63689) ([Maria Khristenko](https://github.com/mariaKhr)) ，[#70423](https://github.com/ClickHouse/ClickHouse/pull/70423) ([Julia Kartseva](https://github.com/jkartseva)) 。
* 允许为对象存储表引擎和数据湖缓存读取文件，并使用 ETag + 文件路径的哈希作为缓存键。 [#70135](https://github.com/ClickHouse/ClickHouse/pull/70135) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 支持通过查询创建表：`CREATE TABLE ... CLONE AS ...`。它会克隆源表的 schema，然后将所有分区附加到新创建的表中。此功能仅支持 `MergeTree` 家族的表。关闭 [#65015](https://github.com/ClickHouse/ClickHouse/issues/65015)。[#69091](https://github.com/ClickHouse/ClickHouse/pull/69091) ([tuanpach](https://github.com/tuanpach)) 。
* 新增系统表 `system.query_metric_log`，该表包含来自 `system.events` 表的各个查询的内存和指标值历史，并会定期写入磁盘。[#66532](https://github.com/ClickHouse/ClickHouse/pull/66532) ([Pablo Marcos](https://github.com/pamarcos)).
* 简单的 SELECT 查询现在支持省略显式 SELECT，从而启用计算器风格的表达式，例如 `ch "1 + 2"`。这由新设置 `implicit_select` 控制。[#68502](https://github.com/ClickHouse/ClickHouse/pull/68502) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 支持在 clickhouse local 中使用 `--copy` 模式作为格式转换的快捷方式 [#68503](https://github.com/ClickHouse/ClickHouse/issues/68503)。[#68583](https://github.com/ClickHouse/ClickHouse/pull/68583) ([Denis Hananein](https://github.com/denis-hananein)) 。
* 新增一个用于可视化 merges 的内置 HTML 页面，可通过 `/merges` path 访问。[#70821](https://github.com/ClickHouse/ClickHouse/pull/70821) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 增加了对 `arrayUnion` 函数的支持。[#68989](https://github.com/ClickHouse/ClickHouse/pull/68989) ([Peter Nguyen](https://github.com/petern48)) 。
* 支持参数化 SQL 别名。[#50665](https://github.com/ClickHouse/ClickHouse/pull/50665) ([Anton Kozlov](https://github.com/tonickkozlov)) 。
* 新增聚合函数 `quantileExactWeightedInterpolated`，它是基于 quantileExactWeighted 的插值版本。有人可能会疑惑，既然已经有了 `quantileExactInterpolatedWeighted`，为什么还需要新的 `quantileExactWeightedInterpolated`。原因在于，新函数比旧函数更精确。这是为了兼容 Spark。[#69619](https://github.com/ClickHouse/ClickHouse/pull/69619) ([李扬](https://github.com/taiyang-li)).
* 新增函数 `arrayElementOrNull`。当数组索引超出范围，或找不到 Map 键时，返回 `NULL`。[#69646](https://github.com/ClickHouse/ClickHouse/pull/69646) ([李扬](https://github.com/taiyang-li)) 。
* 允许用户通过 `config.xml` 文件中新增的 `message_regexp` 和 `message_regexp_negative` 字段指定正则表达式，以过滤日志。日志会作用于格式化后的无颜色文本，从而为开发者提供最直观的体验。[#69657](https://github.com/ClickHouse/ClickHouse/pull/69657) ([Peter Nguyen](https://github.com/petern48)) 。
* 新增了 `RIPEMD160` 函数，用于计算字符串的 RIPEMD-160 加密哈希值。示例：`SELECT HEX(RIPEMD160('The quick brown fox jumps over the lazy dog'))` 返回 `37F332F68DB77BD9D7EDD4969571AD671CF9DD3B`。[#70087](https://github.com/ClickHouse/ClickHouse/pull/70087) ([Dergousov Maxim](https://github.com/m7kss1)) 。
* 支持在 `HDFS` 上读取 `Iceberg` 表。[#70268](https://github.com/ClickHouse/ClickHouse/pull/70268) ([flynn](https://github.com/ucasfl)) 。
* 新增对 `WITH ... INSERT` 形式的 CTE 的支持，此前仅支持 `INSERT ... WITH ...`。[#70593](https://github.com/ClickHouse/ClickHouse/pull/70593) ([Shichao Jin](https://github.com/jsc0218)) 。
* MongoDB 集成：支持所有 MongoDB 类型，支持在 MongoDB 端执行 WHERE 和 ORDER BY 语句，并对 MongoDB 不支持的表达式加以限制。请注意，新的集成默认处于禁用状态；如需使用，请在服务器配置中将 `<use_legacy_mongodb_integration>` 设置为 `false`。[#63279](https://github.com/ClickHouse/ClickHouse/pull/63279) ([Kirill Nikiforov](https://github.com/allmazz)) 。
* 新增函数 `getSettingOrDefault`，用于在当前 profile 中找不到自定义 setting 时返回默认值，避免抛出异常。[#69917](https://github.com/ClickHouse/ClickHouse/pull/69917) ([Shankar](https://github.com/shiyer7474)) 。

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

* 可刷新materialized view 已达到生产可用状态。[#70550](https://github.com/ClickHouse/ClickHouse/pull/70550) ([Michael Kolupaev](https://github.com/al13n321))。现在，Replicated 数据库也已支持可刷新materialized view。[#60669](https://github.com/ClickHouse/ClickHouse/pull/60669) ([Michael Kolupaev](https://github.com/al13n321))。
* 并行副本已从 experimental 阶段升级为 Beta。重构了控制并行副本算法行为的相关设置。简要回顾一下：ClickHouse 有四种涉及多个副本的并行读取算法，这一点体现在设置 `parallel_replicas_mode` 中，其默认值为 `read_tasks`。此外，还新增了开关设置 `enable_parallel_replicas`。[#63151](https://github.com/ClickHouse/ClickHouse/pull/63151) ([Alexey Milovidov](https://github.com/alexey-milovidov)), ([Nikita Mikhaylov](https://github.com/nikitamikhaylov))。
* 现在大多数函数都支持 `Dynamic` 类型，方法是在 `Dynamic` 的内部类型上执行这些函数。[#69691](https://github.com/ClickHouse/ClickHouse/pull/69691) ([Pavel Kruglov](https://github.com/Avogar))。
* 允许在设置 `input_format_binary_read_json_as_string/output_format_binary_write_json_as_string` 下，将 `JSON` 类型作为 `RowBinary` 格式中的 binary string 进行读写。[#70288](https://github.com/ClickHouse/ClickHouse/pull/70288) ([Pavel Kruglov](https://github.com/Avogar))。
* 允许在 Native format 中将 `JSON` 列序列化/反序列化为单个 String 列。输出时使用设置 `output_format_native_write_json_as_string`。输入时，在列数据之前使用序列化版本 `1`。[#70312](https://github.com/ClickHouse/ClickHouse/pull/70312) ([Pavel Kruglov](https://github.com/Avogar))。
* 为 MergeTree 表引入了一种特殊的 (experimental) 合并选择器模式，使其在 parts 数量接近上限的分区上更为激进。该模式由 MergeTree 级别的设置 `merge_selector_use_blurry_base` 控制。[#70645](https://github.com/ClickHouse/ClickHouse/pull/70645) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov))。
* 实现了 Avro 的 `Union` 与 ClickHouse 的 `Variant` 类型之间的通用序列化/反序列化。解决了 [#69713](https://github.com/ClickHouse/ClickHouse/issues/69713)。[#69712](https://github.com/ClickHouse/ClickHouse/pull/69712) ([Jiří Kozlovský](https://github.com/jirislav))。

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

* 重构 `IDisk` 和 `IObjectStorage` 以提升性能。来自 `plain` 和 `plain_rewritable` 对象存储的表将初始化得更快。[#68146](https://github.com/ClickHouse/ClickHouse/pull/68146) ([Alexey Milovidov](https://github.com/alexey-milovidov), [Julia Kartseva](https://github.com/jkartseva))。在判断 plain rewritable 磁盘上的文件或目录是否存在时，不要调用对象存储的 LIST API，因为这样做的成本可能过高。[#70852](https://github.com/ClickHouse/ClickHouse/pull/70852) ([Julia Kartseva](https://github.com/jkartseva))。减少 plain\_rewritable 磁盘中对象存储的 HEAD API 请求次数。[#70915](https://github.com/ClickHouse/ClickHouse/pull/70915) ([Julia Kartseva](https://github.com/jkartseva))。
* 新增了可将数据直接解析到稀疏列的功能。[#69828](https://github.com/ClickHouse/ClickHouse/pull/69828) ([Anton Popov](https://github.com/CurtizJ)) 。
* 提升了在缺失值较多时解析格式 (如 `JSONEachRow`) 的性能。[#69875](https://github.com/ClickHouse/ClickHouse/pull/69875) ([Anton Popov](https://github.com/CurtizJ)) 。
* 支持并行读取 Parquet 行组，并在单线程模式下对行组进行预取。[#69862](https://github.com/ClickHouse/ClickHouse/pull/69862) ([LiuNeng](https://github.com/liuneng1994)).
* 为 `pointInPolygon` 支持 minmax 索引。[#62085](https://github.com/ClickHouse/ClickHouse/pull/62085) ([JackyWoo](https://github.com/JackyWoo)).
* 读取 Parquet 文件时使用布隆过滤器。[#62966](https://github.com/ClickHouse/ClickHouse/pull/62966) ([Arthur Passos](https://github.com/arthurpassos)) 。
* 采用无锁的 parts 重命名机制，避免 INSERT 因 parts 锁而影响 SELECT (正常情况下，在启用 `fsync_part_directory` 时，并行执行 SELECT 和 INSERT 的 QPS 可提升 2 倍；在高负载下效果更为明显) 。请注意，目前暂仅适用于 `ReplicatedMergeTree`。[#64955](https://github.com/ClickHouse/ClickHouse/pull/64955) ([Azat Khuzhin](https://github.com/azat)) 。
* 在 `materialize ttl` 时遵循 `ttl_only_drop_parts`；仅读取重新计算生存时间 (TTL) 所需的列，并通过将 parts 替换为空 part 来删除它们。[#65488](https://github.com/ClickHouse/ClickHouse/pull/65488) ([Andrey Zvonov](https://github.com/zvonand)) 。
* 优化了 ThreadPool 中的线程创建机制，以尽量减少锁竞争。现在，线程创建会在临界区之外进行，从而避免在高负载情况下 `job` 调度和线程管理出现延迟。这使 ClickHouse 在高并发负载下的响应速度显著提升。[#68694](https://github.com/ClickHouse/ClickHouse/pull/68694) ([filimonov](https://github.com/filimonov)).
* 支持读取 `ORC` 中的 `LowCardinality` 字符串列。[#69481](https://github.com/ClickHouse/ClickHouse/pull/69481) ([李扬](https://github.com/taiyang-li)) 。
* 在 `part_log`、`query_views_log`、`filesystem_cache_log` 等系统日志中，`ProfileEvents` 现已使用 `LowCardinality`。[#70152](https://github.com/ClickHouse/ClickHouse/pull/70152) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 优化 `fromUnixTimestamp`/`toUnixTimestamp` 函数的性能。[#71042](https://github.com/ClickHouse/ClickHouse/pull/71042) ([kevinyhzou](https://github.com/KevinyhZou)) 。
* 在执行阻塞式 I/O 读取时，不要在整个服务器范围内禁用从页缓存进行的非阻塞读取。此前，如果某个文件系统 (例如 tmpfs) 不支持 `preadv2` 系统调用，而其他文件系统支持，就会导致性能下降。[#70299](https://github.com/ClickHouse/ClickHouse/pull/70299) ([Antonio Andelic](https://github.com/antonio2368)).
* `ALTER TABLE .. REPLACE PARTITION` 现在不再等待其他分区中的变更/合并操作。[#59138](https://github.com/ClickHouse/ClickHouse/pull/59138) ([Vasily Nemkov](https://github.com/Enmk)) 。
* 从 Keeper 同步 ACL 时不要执行验证。创建时已经验证过了。这本来影响不大，但有些部署中创建了数万甚至更多用户，而这类不必要的哈希验证在 server 启动期间可能要很长时间才能完成 (因为它会从 Keeper 同步所有内容) 。[#70644](https://github.com/ClickHouse/ClickHouse/pull/70644) ([Raúl Marín](https://github.com/Algunenano)) 。

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

* `CREATE TABLE AS` 将复制 `PRIMARY KEY`、`ORDER BY` 等类似子句 (适用于 `MergeTree` 表) 。[#69739](https://github.com/ClickHouse/ClickHouse/pull/69739) ([sakulali](https://github.com/sakulali)) 。
* Keeper 现已支持 64 位 XID。可通过 `use_xid_64` 配置值启用。[#69908](https://github.com/ClickHouse/ClickHouse/pull/69908) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 如果未为参数提供值，Bool 设置的命令行参数会被设为 true (例如 `clickhouse-client --optimize_aggregation_in_order --query "SELECT 1"`) 。[#70459](https://github.com/ClickHouse/ClickHouse/pull/70459) ([davidtsuk](https://github.com/davidtsuk)) 。
* 新增了用户级设置 `min_free_disk_bytes_to_perform_insert` 和 `min_free_disk_perform_to_throw_insert`，以防止在磁盘接近写满时执行插入操作。[#69755](https://github.com/ClickHouse/ClickHouse/pull/69755) ([Marco Vilas Boas](https://github.com/marco-vb)) 。
* 内嵌的设置文档将比网站上的文档更加详细、完整。这是实现网站文档始终从源代码自动生成之前的第一步。这将带来长期影响：- 可以保证涵盖每一项设置；- 不会再出现默认值过时的情况；- 我们可以为每个 ClickHouse 版本生成这份文档；- 即使无法访问 Internet，文档也可以由 server 自身显示。从源代码生成网站上的文档。[#70289](https://github.com/ClickHouse/ClickHouse/pull/70289) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 允许函数 `replace` 使用空 needle，行为与 PostgreSQL 保持一致。[#69918](https://github.com/ClickHouse/ClickHouse/pull/69918) ([zhanglistar](https://github.com/zhanglistar)).
* 允许在 `replaceRegexp*` 函数中使用空 needle。[#70053](https://github.com/ClickHouse/ClickHouse/pull/70053) ([zhanglistar](https://github.com/zhanglistar)) 。
* 会根据存储策略，在 `data/database_name/` 目录中为表数据的实际 path 创建符号链接，而不是在默认磁盘上的 `store/...` 目录中创建。 [#61777](https://github.com/ClickHouse/ClickHouse/pull/61777) ([Kirill](https://github.com/kirillgarbar)).
* 在从 `JSON` 解析 `Enum` 字段时，内容为整数的字符串会被解释为对应的 `Enum` 元素。这修复了 [#65119](https://github.com/ClickHouse/ClickHouse/issues/65119)。[#66801](https://github.com/ClickHouse/ClickHouse/pull/66801) ([scanhex12](https://github.com/scanhex12)) 。
* 允许对空字符串执行 `TRIM` `LEADING` 或 `TRAILING`，并将其视为空操作。关闭 [#67792](https://github.com/ClickHouse/ClickHouse/issues/67792)。[#68455](https://github.com/ClickHouse/ClickHouse/pull/68455) ([Peter Nguyen](https://github.com/petern48)) 。
* 改进 `cast(timestamp as String)` 与 Spark 的兼容性。[#69179](https://github.com/ClickHouse/ClickHouse/pull/69179) ([Wenzheng Liu](https://github.com/lwz9103)) 。
* 当 `enable_analyzer` 设置为 `true` 时，始终使用新的 analyzer 计算常量表达式。现已支持在不使用用于计算常量表达式的 `SELECT` 查询的情况下，计算 `executable` 表函数参数。[#69292](https://github.com/ClickHouse/ClickHouse/pull/69292) ([Dmitry Novik](https://github.com/novikd)) 。
* 新增设置 `enable_secure_identifiers`，禁止使用包含特殊字符的标识符。[#69411](https://github.com/ClickHouse/ClickHouse/pull/69411) ([tuanpach](https://github.com/tuanpach)) 。
* 添加 `show_create_query_identifier_quoting_rule`，用于定义 `SHOW CREATE TABLE` 查询结果中标识符的引号规则。可能的值：- `user_display`：当标识符是关键字时。- `when_necessary`：当标识符是 `{"distinct", "all", "table"}` 之一，且可能引发歧义时：列名、字典属性名。- `always`：始终为标识符加引号。[#69448](https://github.com/ClickHouse/ClickHouse/pull/69448) ([tuanpach](https://github.com/tuanpach)) 。
* 改进访问实体依赖项的恢复 [#69563](https://github.com/ClickHouse/ClickHouse/pull/69563) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 如果你运行 `clickhouse-client` 或其他 CLI 应用程序，并且由于服务器过载导致启动缓慢，这时你开始输入查询 (例如 `SELECT`) ，那么在之前的版本中，会先显示终端回显内容的剩余部分，然后才打印欢迎消息，比如会显示 `SELECTClickHouse local version 24.10.1.1.`，而不是 `ClickHouse local version 24.10.1.1.`。现在这个问题已修复。此更改关闭了 [#31696](https://github.com/ClickHouse/ClickHouse/issues/31696)。[#69856](https://github.com/ClickHouse/ClickHouse/pull/69856) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 向 `system.replicas` 表新增列 `readonly_duration`。用于在告警中区分真正的只读副本与哨兵副本。[#69871](https://github.com/ClickHouse/ClickHouse/pull/69871) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* 将 `join_output_by_rowlist_perkey_rows_threshold` 设置项的类型改为无符号整数。[#69886](https://github.com/ClickHouse/ClickHouse/pull/69886) ([kevinyhzou](https://github.com/KevinyhZou)) 。
* 增强 OpenTelemetry span 日志记录，使其包含查询设置。[#70011](https://github.com/ClickHouse/ClickHouse/pull/70011) ([sharathks118](https://github.com/sharathks118)).
* 如果 lambda 的结果类型不符合预期，则为高阶数组函数补充诊断信息。[#70093](https://github.com/ClickHouse/ClickHouse/pull/70093) ([ttanay](https://github.com/ttanay)).
* Keeper 改进：在集群变更期间减少加锁。[#70275](https://github.com/ClickHouse/ClickHouse/pull/70275) ([Antonio Andelic](https://github.com/antonio2368)).
* 为 `SHOW GRANTS` 命令新增 `WITH IMPLICIT` 和 `FINAL` 关键字。修复了隐式授权中的一个小问题：[#70094](https://github.com/ClickHouse/ClickHouse/issues/70094)。[#70293](https://github.com/ClickHouse/ClickHouse/pull/70293) ([pufit](https://github.com/pufit)) 。
* 对 MergeTree settings 遵循 `compatibility`。`compatibility` 的值会在 server 启动时从 `default` profile 中读取，并相应调整默认的 MergeTree settings。此后再修改 `compatibility` setting，也不会影响 MergeTree settings。[#70322](https://github.com/ClickHouse/ClickHouse/pull/70322) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 避免在服务器间通信出错时，将大型 HTTP 响应体大量写入日志。[#70487](https://github.com/ClickHouse/ClickHouse/pull/70487) ([Vladimir Cherkasov](https://github.com/vdimir)) 。
* 新增了一个新设置 `max_parts_to_move`，用于控制一次最多可移动的 parts 数量。[#70520](https://github.com/ClickHouse/ClickHouse/pull/70520) ([Vladimir Cherkasov](https://github.com/vdimir)) 。
* 限制某些日志消息的输出频率。[#70601](https://github.com/ClickHouse/ClickHouse/pull/70601) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 带有 `PART` 限定符的 `CHECK TABLE` 在客户端中的格式显示不正确。[#70660](https://github.com/ClickHouse/ClickHouse/pull/70660) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 支持使用 Parquet 原生写入器写入列索引和偏移索引。[#70669](https://github.com/ClickHouse/ClickHouse/pull/70669) ([LiuNeng](https://github.com/liuneng1994)) 。
* 支持在 Joda 语法中解析带微秒和时区的 `DateTime64` (“joda” 是一个流行的 Java 日期和时间库，而“joda syntax”指的是该库的风格) 。[#70737](https://github.com/ClickHouse/ClickHouse/pull/70737) ([kevinyhzou](https://github.com/KevinyhZou)).
* 更改了判断云存储是否支持[批量删除](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjects.html)的方法。[#70786](https://github.com/ClickHouse/ClickHouse/pull/70786) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 原生读取器现已支持 Parquet page v2。[#70807](https://github.com/ClickHouse/ClickHouse/pull/70807) ([Arthur Passos](https://github.com/arthurpassos)) 。
* 新增了一项检查，用于判断表是否同时设置了 `storage_policy` 和 `disk`。另外，还新增了一项检查，用于在使用 `disk` 设置时判断新的存储策略是否与旧的存储策略兼容。[#70839](https://github.com/ClickHouse/ClickHouse/pull/70839) ([Kirill](https://github.com/kirillgarbar)).
* 新增 `system.s3_queue_settings` 和 `system.azure_queue_settings`。[#70841](https://github.com/ClickHouse/ClickHouse/pull/70841) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 函数 `base58Encode` 和 `base58Decode` 现已支持接受 `FixedString` 类型的参数。示例：`SELECT base58Encode(toFixedString('plaintext', 9));`。[#70846](https://github.com/ClickHouse/ClickHouse/pull/70846) ([Faizan Patel](https://github.com/faizan2786)) 。
* 为 part 日志的每种条目类型都添加了 `partition` 列。此前，只有部分条目设置了该列。此更改关闭了 [#70819](https://github.com/ClickHouse/ClickHouse/issues/70819)。[#70848](https://github.com/ClickHouse/ClickHouse/pull/70848) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 在 `system.part_log` 中添加 `MergeStart` 和 `MutateStart` 事件，有助于分析和可视化合并过程。[#70850](https://github.com/ClickHouse/ClickHouse/pull/70850) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 新增了一个 profile 事件，用于记录已合并的源 parts 数量。这使得可以在生产环境中监控 MergeTree 合并树的扇出情况。[#70908](https://github.com/ClickHouse/ClickHouse/pull/70908) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 已重新启用文件系统缓存的后台下载。[#70929](https://github.com/ClickHouse/ClickHouse/pull/70929) ([Nikita Taranov](https://github.com/nickitat)) 。
* 新增一种名为 `Trivial` 的合并选择器算法，仅限专业用途。它比 `Simple` 合并选择器更差。[#70969](https://github.com/ClickHouse/ClickHouse/pull/70969) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 支持原子化 `CREATE OR REPLACE VIEW`。[#70536](https://github.com/ClickHouse/ClickHouse/pull/70536) ([tuanpach](https://github.com/tuanpach))
* 为聚合函数 `windowFunnel` 新增了 `strict_once` 模式，以避免某个事件在匹配多个条件时被重复计数，关闭 [#21835](https://github.com/ClickHouse/ClickHouse/issues/21835)。[#69738](https://github.com/ClickHouse/ClickHouse/pull/69738) ([Vladimir Cherkasov](https://github.com/vdimir)) 。

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

* 在全局 Context 对象中应用配置更新。此更改修复了 [#62308](https://github.com/ClickHouse/ClickHouse/issues/62308) 等问题。[#62944](https://github.com/ClickHouse/ClickHouse/pull/62944) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了 `ReadSettings` 未采用用户设置值的问题，此前一直只使用默认值。[#65625](https://github.com/ClickHouse/ClickHouse/pull/65625) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 修复了在使用有符号参数时 `sumMapFiltered` 的类型不匹配问题。[#58408](https://github.com/ClickHouse/ClickHouse/pull/58408) ([Chen768959](https://github.com/Chen768959)).
* 修复传入可选时区参数时，toHour 等转换函数的单调性问题。[#60264](https://github.com/ClickHouse/ClickHouse/pull/60264) ([Amos Bird](https://github.com/amosbird)) 。
* 放宽对 `Merge` 表的 `supportsPrewhere` 检查，修复了 [#61064](https://github.com/ClickHouse/ClickHouse/issues/61064)。该检查此前在 [#60082](https://github.com/ClickHouse/ClickHouse/issues/60082) 中被不必要地收紧了。[#61091](https://github.com/ClickHouse/ClickHouse/pull/61091) ([Amos Bird](https://github.com/amosbird)).
* 修复 `use_concurrency_control` 设置的处理逻辑，以正确执行 `concurrent_threads_soft_limit_num` 限制。由于此前该功能存在问题，现在默认启用并发控制。[#61473](https://github.com/ClickHouse/ClickHouse/pull/61473) ([Sergei Trifonov](https://github.com/serxa)).
* 修复了这样一种情况下 `JOIN ON` 部分的错误优化：`IS NULL` 检查位于其他任意函数 (如 `NOT`) 之下时，可能会导致结果错误。关闭 [#67915](https://github.com/ClickHouse/ClickHouse/issues/67915)。[#68049](https://github.com/ClickHouse/ClickHouse/pull/68049) ([Vladimir Cherkasov](https://github.com/vdimir)) 。
* 阻止会导致表的 `CREATE` 查询无效的 `ALTER` 查询。[#68574](https://github.com/ClickHouse/ClickHouse/pull/68574) ([János Benjamin Antal](https://github.com/antaljanosbenjamin)) 。
* 修复 `negate` (`-`) 和 `NOT` 函数在处理元组和数组时 AST 格式不一致的问题。[#68600](https://github.com/ClickHouse/ClickHouse/pull/68600) ([Vladimir Cherkasov](https://github.com/vdimir)).
* 修复了在反序列化过程中将不完整类型插入 `Dynamic` 的问题。这可能导致 `Parameter out of bound` 错误。[#69291](https://github.com/ClickHouse/ClickHouse/pull/69291) ([Pavel Kruglov](https://github.com/Avogar)) 。
* 零拷贝复制仍属 Experimental 阶段，不应在生产环境中使用：修复了在启用零拷贝的 Replicated MergeTree 中执行 `restore replica` 后陷入无限循环的问题。[#69293](https://github.com/CljmnickHouse/ClickHouse/pull/69293) ([MikhailBurdukov](https://github.com/MikhailBurdukov)).
* 将存储 `S3Queue` 中 `processing_threads_num` 的默认值改回 CPU 核心数。[#69384](https://github.com/ClickHouse/ClickHouse/pull/69384) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 在将嵌套的 repeated protobuf 反序列化/序列化为嵌套列时，绕过 try/catch 流程 (修复了 [#41971](https://github.com/ClickHouse/ClickHouse/issues/41971)) 。[#69556](https://github.com/ClickHouse/ClickHouse/pull/69556) ([Eliot Hautefeuille](https://github.com/hileef)) 。
* 修复了在 PostgreSQL 引擎中向 FixedString 列插入数据时发生的崩溃问题。[#69584](https://github.com/ClickHouse/ClickHouse/pull/69584) ([Pavel Kruglov](https://github.com/Avogar)) 。
* 修复执行 `create view t as (with recursive 42 as ttt select ttt);` 时崩溃的问题。[#69676](https://github.com/ClickHouse/ClickHouse/pull/69676) ([Han Fei](https://github.com/hanfei1991)) 。
* 修复了当值类型为 DateTime64 时，`maxMapState` 会抛出 'Bad get' 异常的问题。[#69787](https://github.com/ClickHouse/ClickHouse/pull/69787) ([Michael Kolupaev](https://github.com/al13n321)) 。
* 通过重写 `useDefaultImplementationForLowCardinalityColumns` 并使其返回 `true`，修复 `getSubcolumn` 对 `LowCardinality` 列的处理问题。 [#69831](https://github.com/ClickHouse/ClickHouse/pull/69831) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* 修复：如果分布式表的 DROP 操作失败，可能导致分布式发送永久阻塞的问题。[#69843](https://github.com/ClickHouse/ClickHouse/pull/69843) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了包含 NaN 键的 WITH FILL 查询无法取消的问题。此修复关闭了 [#69261](https://github.com/ClickHouse/ClickHouse/issues/69261)。[#69845](https://github.com/ClickHouse/ClickHouse/pull/69845) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 修复 analyzer 在旧兼容性值下的默认设置问题。[#69895](https://github.com/ClickHouse/ClickHouse/pull/69895) ([Raúl Marín](https://github.com/Algunenano)).
* 在 DROP 旧表期间执行 CREATE OR REPLACE VIEW 时，不再检查依赖关系。此前，如果被重建的视图存在依赖表，CREATE OR REPLACE 查询会失败。[#69907](https://github.com/ClickHouse/ClickHouse/pull/69907) ([Pavel Kruglov](https://github.com/Avogar)).
* Decimal 相关修复。修复了 [#69730](https://github.com/ClickHouse/ClickHouse/issues/69730)。[#69978](https://github.com/ClickHouse/ClickHouse/pull/69978) ([Arthur Passos](https://github.com/arthurpassos)) 。
* 现在，DEFINER/INVOKER 已可用于参数化视图。[#69984](https://github.com/ClickHouse/ClickHouse/pull/69984) ([pufit](https://github.com/pufit)) 。
* 修复视图定义者的解析问题。 [#69985](https://github.com/ClickHouse/ClickHouse/pull/69985) ([pufit](https://github.com/pufit)).
* 修复了一个 bug：在带有 `Date` 或 `Date32` 参数的查询中，时区可能会影响查询结果。[#70036](https://github.com/ClickHouse/ClickHouse/pull/70036) ([Yarik Briukhovetskyi](https://github.com/yariks5s)) 。
* 修复了在带有嵌套视图和 `WHERE` 条件的查询中出现的 `Block structure mismatch` 问题。修复了 [#66209](https://github.com/ClickHouse/ClickHouse/issues/66209)。[#70054](https://github.com/ClickHouse/ClickHouse/pull/70054) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 在求值 `tuple` 函数时，避免在不同命名元组之间复用列。这修复了 [#70022](https://github.com/ClickHouse/ClickHouse/issues/70022)。[#70103](https://github.com/ClickHouse/ClickHouse/pull/70103) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了在范围中替换字面量时误报的 LOGICAL\_ERROR。[#70122](https://github.com/ClickHouse/ClickHouse/pull/70122) ([Pablo Marcos](https://github.com/pamarcos)) 。
* 在 ALTER TABLE MODIFY COLUMN/QUERY 期间检查 Nullable(Nothing) 类型，以防止创建具有此类数据类型的表。[#70123](https://github.com/ClickHouse/ClickHouse/pull/70123) ([Pavel Kruglov](https://github.com/Avogar)) 。
* 为非法查询 `JOIN ... ON *` 提供了正确的错误信息，关闭了 [#68650](https://github.com/ClickHouse/ClickHouse/issues/68650)。[#70124](https://github.com/ClickHouse/ClickHouse/pull/70124) ([Vladimir Cherkasov](https://github.com/vdimir)) 。
* 修复使用跳过索引时结果错误的问题。[#70127](https://github.com/ClickHouse/ClickHouse/pull/70127) ([Raúl Marín](https://github.com/Algunenano)) 。
* 修复了 ColumnObject/ColumnTuple 解压方法中的数据竞争问题，该问题可能导致堆内存在释放后仍被使用。[#70137](https://github.com/ClickHouse/ClickHouse/pull/70137) ([Pavel Kruglov](https://github.com/Avogar)) 。
* 修复 ALTER COLUMN 在使用 Dynamic 类型时可能卡死的问题。[#70144](https://github.com/ClickHouse/ClickHouse/pull/70144) ([Pavel Kruglov](https://github.com/Avogar)) 。
* 现在，ClickHouse 会将更多错误视为可重试错误，并且在发生此类错误时，不会将数据分区片段标记为损坏。[#70145](https://github.com/ClickHouse/ClickHouse/pull/70145) ([alesapin](https://github.com/alesapin)).
* 为 JSON 子列创建 Dynamic 类型时，使用正确的 `max_types` 参数。[#70147](https://github.com/ClickHouse/ClickHouse/pull/70147) ([Pavel Kruglov](https://github.com/Avogar)) 。
* 修复了采用 bcrypt 密码身份验证方法的用户，其密码会显示在 `system.query_log` 中的问题。[#70148](https://github.com/ClickHouse/ClickHouse/pull/70148) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 修复 native 接口 (InterfaceNativeSendBytes) 的事件计数器问题。[#70153](https://github.com/ClickHouse/ClickHouse/pull/70153) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* 修复了可能与 JSON 列有关的崩溃问题。[#70172](https://github.com/ClickHouse/ClickHouse/pull/70172) ([Pavel Kruglov](https://github.com/Avogar)) 。
* 修复了 arrayMin 和 arrayMax 中的多个问题。[#70207](https://github.com/ClickHouse/ClickHouse/pull/70207) ([Raúl Marín](https://github.com/Algunenano)).
* 使 JSON 类型解析器遵循 allow\_simdjson 设置。[#70218](https://github.com/ClickHouse/ClickHouse/pull/70218) ([Pavel Kruglov](https://github.com/Avogar)) 。
* 修复了在创建包含两个 SELECT 子句和一个 `INTERSECT` 的 materialized view 时出现的空指针解引用错误，例如 `CREATE MATERIALIZED VIEW v0 AS (SELECT 1) INTERSECT (SELECT 1);`。[#70264](https://github.com/ClickHouse/ClickHouse/pull/70264) ([Konstantin Bogdanov](https://github.com/thevar1able)) 。
* 不要通过启动脚本修改全局设置。此前，在启动脚本中修改某项设置会使其在全局范围内生效。[#70310](https://github.com/ClickHouse/ClickHouse/pull/70310) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 修复了在降低 `Dynamic` 类型的 max\_types 参数时执行 `ALTER` 可能导致服务器崩溃的问题。[#70328](https://github.com/ClickHouse/ClickHouse/pull/70328) ([Pavel Kruglov](https://github.com/Avogar)) 。
* 修复误用 WITH FILL 时导致的崩溃。[#70338](https://github.com/ClickHouse/ClickHouse/pull/70338) ([Raúl Marín](https://github.com/Algunenano)) 。
* 修复 `SYSTEM DROP FORMAT SCHEMA CACHE FOR Protobuf` 中可能存在的释放后使用问题。[#70358](https://github.com/ClickHouse/ClickHouse/pull/70358) ([Azat Khuzhin](https://github.com/azat)).
* 修复对 JSON 子对象子列执行 GROUP BY 时发生的崩溃。[#70374](https://github.com/ClickHouse/ClickHouse/pull/70374) ([Pavel Kruglov](https://github.com/Avogar)) 。
* 如果 part 中没有行，则不要为垂直合并预取 parts。[#70452](https://github.com/ClickHouse/ClickHouse/pull/70452) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 修复了在 WHERE 中使用 lambda 函数时发生崩溃的问题。[#70464](https://github.com/ClickHouse/ClickHouse/pull/70464) ([Raúl Marín](https://github.com/Algunenano)).
* 修复了在使用 `Replicated` 数据库，且次级副本上的表函数源不可用时，通过 `CREATE ... AS table_function(...)` 创建表的问题。[#70511](https://github.com/ClickHouse/ClickHouse/pull/70511) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 在 `wait_for_async_insert=1` 时，忽略 async insert 的所有输出。关闭了 [#62644](https://github.com/ClickHouse/ClickHouse/issues/62644)。[#70530](https://github.com/ClickHouse/ClickHouse/pull/70530) ([Konstantin Bogdanov](https://github.com/thevar1able)) 。
* 遍历来自 system.remote\_data\_paths 的 shadow 目录时，会忽略 frozen\_metadata.txt。[#70590](https://github.com/ClickHouse/ClickHouse/pull/70590) ([Aleksei Filatov](https://github.com/aalexfvk)) 。
* 修复了在内存未对齐时创建有状态窗口函数的问题。[#70631](https://github.com/ClickHouse/ClickHouse/pull/70631) ([Raúl Marín](https://github.com/Algunenano)).
* 修复了一个罕见崩溃问题：添加带有非空默认 expression 的 `Array` 类型列后，`SELECT` 查询和 merges 过程中可能发生崩溃。[#70695](https://github.com/ClickHouse/ClickHouse/pull/70695) ([Anton Popov](https://github.com/CurtizJ)).
* 向表函数 s3 插入数据时会遵循查询设置。[#70696](https://github.com/ClickHouse/ClickHouse/pull/70696) ([Vladimir Cherkasov](https://github.com/vdimir)) 。
* 修复了在启用跳过不受支持字段时，推断 protobuf schema 过程中出现无限递归的问题。[#70697](https://github.com/ClickHouse/ClickHouse/pull/70697) ([Raúl Marín](https://github.com/Algunenano)) 。
* 默认关闭 enable\_named\_columns\_in\_function\_tuple。 [#70833](https://github.com/ClickHouse/ClickHouse/pull/70833) ([Raúl Marín](https://github.com/Algunenano)).
* 修复了以下问题：当 S3Queue 表引擎设置 processing\_threads\_num 的值是根据服务器上的 CPU 核心数推导得出时，该设置不会生效。[#70837](https://github.com/ClickHouse/ClickHouse/pull/70837) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 规范化聚合状态中的命名元组参数。此修复解决了 [#69732](https://github.com/ClickHouse/ClickHouse/issues/69732)。[#70853](https://github.com/ClickHouse/ClickHouse/pull/70853) ([Amos Bird](https://github.com/amosbird)).
* 修复了双层哈希表中因负零导致的逻辑错误。此修复已关闭 [#70973](https://github.com/ClickHouse/ClickHouse/issues/70973)。[#70979](https://github.com/ClickHouse/ClickHouse/pull/70979) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 修复了分布式环境和并行副本下的 `limit by`、`limit with ties` 问题。 [#70880](https://github.com/ClickHouse/ClickHouse/pull/70880) ([Nikita Taranov](https://github.com/nickitat)).

### <a id="249" /> ClickHouse 24.9 发行版，2024-09-26。 [Presentation](https://presentations.clickhouse.com/2024-release-24.9/), [Video](https://www.youtube.com/watch?v=ray6wJGCHbs)

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

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

* 现已支持对命名元组使用 `a[b].c` 这类表达式，也支持对任意表达式使用带名称的下标访问，例如 `expr().name`。这对处理 JSON 很有帮助。此更改关闭了 [#54965](https://github.com/ClickHouse/ClickHouse/issues/54965)。在此前版本中，`expr().name` 形式的表达式会被解析为 `tupleElement(expr(), name)`，查询分析器会去查找名为 `name` 的列，而不是对应的元组元素；而在新版本中，它已改为 `tupleElement(expr(), 'name')`。在大多数情况下，旧版本的行为其实并不生效，但仍可设想一种非常罕见的场景，在这种情况下，此更改可能导致不兼容：如果你将元组元素名称存储在某个列或别名中，且该名称与元组元素本身的名称不同：`SELECT 'b' AS a, CAST([tuple(123)] AS 'Array(Tuple(b UInt8))') AS t, t[1].a`。你几乎不可能使用过这类查询，但我们仍需将此更改标记为可能存在向后兼容性问题。[#68435](https://github.com/ClickHouse/ClickHouse/pull/68435) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 启用设置 `print_pretty_type_names` 后，`Tuple` 数据类型会在 `SHOW CREATE TABLE` 语句、`formatQuery` 函数，以及 `clickhouse-client` 和 `clickhouse-local` 的交互模式中以更易读的形式打印出来。在此前版本中，此设置仅适用于 `DESCRIBE` 查询和 `toTypeName`。此更改关闭了 [#65753](https://github.com/ClickHouse/ClickHouse/issues/65753)。[#68492](https://github.com/ClickHouse/ClickHouse/pull/68492) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 在 `Replicated` 数据库中创建表时，不再允许显式指定 UUID。此外，对于 Replicated 数据库中的 \*MergeTree 表，也不再允许显式指定 Keeper 路径和副本名称。此更改引入了新设置 `database_replicated_allow_explicit_uuid`，并将 `database_replicated_allow_replicated_engine_arguments` 的类型从 Bool 改为 UInt64 [#66104](https://github.com/ClickHouse/ClickHouse/pull/66104) ([Alexander Tokmakov](https://github.com/tavplubix)).

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

* 允许一个用户配置多种身份验证方法，而不再仅限一种。支持将身份验证方法重置为最近添加的方法。如果你想在一段时间内同时运行多个 24.8 实例和一个 24.9 实例，最好在这段期间将 `max_authentication_methods_per_user` 设为 1，以避免潜在的不兼容问题。[#65277](https://github.com/ClickHouse/ClickHouse/pull/65277) ([Arthur Passos](https://github.com/arthurpassos)).
* 增加了对 `ATTACH PARTITION ALL FROM` 的支持。[#61987](https://github.com/ClickHouse/ClickHouse/pull/61987) ([Kirill Nikiforov](https://github.com/allmazz)) 。
* 新增 `input_format_json_empty_as_default` 设置；启用后，会将 JSON 输入中的空字段视为默认值。解决了 [#59339](https://github.com/ClickHouse/ClickHouse/issues/59339)。[#66782](https://github.com/ClickHouse/ClickHouse/pull/66782) ([Alexis Arnaud](https://github.com/a-a-f)) 。
* 新增了 `overlay` 和 `overlayUTF8` 函数，用于将字符串的一部分替换为另一个字符串。示例：`SELECT overlay('Hello New York', 'Jersey', 11)` 返回 `Hello New Jersey`。[#66933](https://github.com/ClickHouse/ClickHouse/pull/66933) ([李扬](https://github.com/taiyang-li)) 。
* 为分区级 `DELETE FROM [db.]table [ON CLUSTER cluster] [IN PARTITION partition_expr] WHERE expr; ` 添加了轻量级删除支持。 [#67805](https://github.com/ClickHouse/ClickHouse/pull/67805) ([sunny](https://github.com/sunny19930321)).
* 已支持对不同域 (如秒和分钟) 的 `Interval` 数据类型值进行比较，它们现在会被转换为最小公共超类型。[#68057](https://github.com/ClickHouse/ClickHouse/pull/68057) ([Yarik Briukhovetskyi](https://github.com/yariks5s)) 。
* 添加 `create_if_not_exists` 设置，使 CREATE 语句默认采用 `IF NOT EXISTS` 行为。[#68164](https://github.com/ClickHouse/ClickHouse/pull/68164) ([Peter Nguyen](https://github.com/petern48)) 。
* 支持在 Azure 和本地读取 `Iceberg` 表。[#68210](https://github.com/ClickHouse/ClickHouse/pull/68210) ([Daniil Ivanik](https://github.com/divanik)) 。
* 现在支持按标签删除查询缓存条目。例如，由 `SELECT 1 SETTINGS use_query_cache = true, query_cache_tag = 'abc'` 创建的查询缓存条目，现在可以通过 `SYSTEM DROP QUERY CACHE TAG 'abc'` 删除。[#68477](https://github.com/ClickHouse/ClickHouse/pull/68477) ([Michał Tabaszewski](https://github.com/pinsvin00)).
* 为 named collections 增加存储加密。[#68615](https://github.com/ClickHouse/ClickHouse/pull/68615) ([Pablo Marcos](https://github.com/pamarcos)) 。
* 为 `URL` 表引擎新增虚拟列 `_headers`。关闭 [#65026](https://github.com/ClickHouse/ClickHouse/issues/65026)。[#68867](https://github.com/ClickHouse/ClickHouse/pull/68867) ([flynn](https://github.com/ucasfl)) 。
* 添加 `system.projections` 表，用于跟踪可用投影。[#68901](https://github.com/ClickHouse/ClickHouse/pull/68901) ([Jordi Villar](https://github.com/jrdi)) 。
* 新增函数 `arrayZipUnaligned` 以兼容 Spark (在 Spark 中名为 `arrays_zip`) ，该函数基于原有的 `arrayZip`，支持未对齐的数组。[#69030](https://github.com/ClickHouse/ClickHouse/pull/69030) ([李扬](https://github.com/taiyang-li)) 。
* 为 Keeper 客户端命令行应用程序新增了 `cp`/`mv` 命令，支持以原子方式复制/移动节点。[#69034](https://github.com/ClickHouse/ClickHouse/pull/69034) ([Mikhail Artemenko](https://github.com/Michicosun)).
* 为函数 `arrayAUC` 新增参数 `scale` (默认值：`true`) ，可跳过归一化步骤 (问题 [#69609](https://github.com/ClickHouse/ClickHouse/issues/69609)) 。[#69717](https://github.com/ClickHouse/ClickHouse/pull/69717) ([gabrielmcg44](https://github.com/gabrielmcg44)) 。

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

* 新增设置 `input_format_try_infer_variants`，当列/数组元素存在多种可能类型时，允许在文本格式的 schema inference 过程中推断 `Variant` 类型。[#63798](https://github.com/ClickHouse/ClickHouse/pull/63798) ([Shaun Struwig](https://github.com/Blargian))。
* 新增聚合函数 `distinctDynamicTypes`/`distinctJSONPaths`/`distinctJSONPathsAndTypes`，以便更好地分析 JSON column type 的内容。[#68463](https://github.com/ClickHouse/ClickHouse/pull/68463) ([Kruglov Pavel](https://github.com/Avogar))。
* 新增一种算法，通过一致性哈希确定并行副本之间标记分布的单位。针对不同的读取模式选择不同数量的标记，以提升性能。[#68424](https://github.com/ClickHouse/ClickHouse/pull/68424) ([Nikita Taranov](https://github.com/nickitat))。
* 此前，并行副本通知处理中的分片去重逻辑算法复杂度为 O(n^2)，对于包含大量分片 (或分区) 的表，可能需要耗费明显时间。此次变更将复杂度降为 O(n\*log(n))。[#69596](https://github.com/ClickHouse/ClickHouse/pull/69596) ([Alexander Gololobov](https://github.com/davenger))。
* 可刷新materialized view 改进：追加模式 (`... REFRESH EVERY 1 MINUTE APPEND ...`) ，可向现有表追加行而非覆盖整张表；重试 (默认禁用，在查询的 SETTINGS 部分中配置) ；`SYSTEM WAIT VIEW <name>` 查询，可等待当前正在运行的刷新完成；以及一些修复。[#58934](https://github.com/ClickHouse/ClickHouse/pull/58934) ([Michael Kolupaev](https://github.com/al13n321))。
* 新增 `min_max` 作为一种新的 (实验性) 统计信息类型。它支持估算数值列上的范围谓词，例如 `x < 100`。[#67013](https://github.com/ClickHouse/ClickHouse/pull/67013) ([JackyWoo](https://github.com/JackyWoo))。
* 改进了来自 Variant/Dynamic 列的 castOrDefault，使其在内部类型完全无法转换时也能正常工作。[#67150](https://github.com/ClickHouse/ClickHouse/pull/67150) ([Kruglov Pavel](https://github.com/Avogar))。
* 现在可通过 MaterializedPostgreSQL 复制部分列。关闭 [#33748](https://github.com/ClickHouse/ClickHouse/issues/33748)。[#69092](https://github.com/ClickHouse/ClickHouse/pull/69092) ([Kruglov Kirill](https://github.com/1on))。

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

* 针对 Hive 分区，实现了仅读取所需文件。[#68963](https://github.com/ClickHouse/ClickHouse/pull/68963) ([Yarik Briukhovetskyi](https://github.com/yariks5s)) 。
* 在 LEFT 或 INNER 哈希 JOIN 中，当表键较为稠密时，通过按键重排右表来提升 JOIN 性能。[#60341](https://github.com/ClickHouse/ClickHouse/pull/60341) ([kevinyhzou](https://github.com/KevinyhZou)) 。
* 通过延迟追加行列表来提升 ALL JOIN 性能。[#63677](https://github.com/ClickHouse/ClickHouse/pull/63677) ([kevinyhzou](https://github.com/KevinyhZou)) 。
* 在启动过程中异步加载文件系统缓存元数据，以加快重启速度 (由设置 `load_metadata_asynchronously` 控制) 。[#65736](https://github.com/ClickHouse/ClickHouse/pull/65736) ([Daniel Pozo Escalona](https://github.com/danipozo)) 。
* 对函数 `array` 和 `map` 进行了优化，使其在某些常见场景下的处理速度大幅提升。[#67707](https://github.com/ClickHouse/ClickHouse/pull/67707) ([李扬](https://github.com/taiyang-li)) 。
* 对 ORC 字符串读取做了简单优化，尤其适用于列中不包含 NULL 的情况。[#67794](https://github.com/ClickHouse/ClickHouse/pull/67794) ([李扬](https://github.com/taiyang-li)) 。
* 通过减少 merge 调度步骤的开销，提升了 merges 的整体性能。[#68016](https://github.com/ClickHouse/ClickHouse/pull/68016) ([Anton Popov](https://github.com/CurtizJ)) 。
* 当未设置 profile、未设置凭据且 IMDS 不可用时 (例如在 Cloud 之外的机器上查询公共 bucket) ，加快了对 S3 的请求速度。此更改关闭了 [#52771](https://github.com/ClickHouse/ClickHouse/issues/52771)。[#68082](https://github.com/ClickHouse/ClickHouse/pull/68082) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 在 `RowInputFormatWithNamesAndTypes` 中对 format reader 进行去虚拟化，以获得一定的性能提升。[#68437](https://github.com/ClickHouse/ClickHouse/pull/68437) ([李扬](https://github.com/taiyang-li)) 。
* 在按键进行 group by 聚合时，为 `uniq` aggregate function 增加并行 merge，以最大化 CPU 利用率。[#68441](https://github.com/ClickHouse/ClickHouse/pull/68441) ([Jiebin Sun](https://github.com/jiebinn)) 。
* 新增设置 `output_format_orc_dictionary_key_size_threshold`，允许用户为 `ORC` output format 中的字符串列启用字典编码。这有助于减小输出 `ORC` 文件的大小，并显著提升读取性能。[#68591](https://github.com/ClickHouse/ClickHouse/pull/68591) ([李扬](https://github.com/taiyang-li)) 。
* 引入新的 Keeper 请求 RemoveRecursive，可删除节点及其整个子树。[#69332](https://github.com/ClickHouse/ClickHouse/pull/69332) ([Mikhail Artemenko](https://github.com/Michicosun)) 。
* 通过并行向向量相似度索引写入数据，加快了向带有向量相似度索引的表中插入数据的速度。[#69493](https://github.com/ClickHouse/ClickHouse/pull/69493) ([flynn](https://github.com/ucasfl)) 。
* 通过使用自适应写入缓冲区大小，降低了向 JSON 插入数据时的内存使用量。wide 分片中由 JSON 列创建的大量文件仅包含少量数据，因此为它们分配 1MB 缓冲区并不合理。[#69272](https://github.com/ClickHouse/ClickHouse/pull/69272) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 避免在线concurrent hash join threadpool中归还线程，以防查询生成过多线程。[#69406](https://github.com/ClickHouse/ClickHouse/pull/69406) ([Duc Canh Le](https://github.com/canhld94)) 。

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

* CREATE TABLE AS 现在会复制 PRIMARY KEY、ORDER BY 等类似子句。目前仅支持 MergeTree 家族的表引擎。[#69076](https://github.com/ClickHouse/ClickHouse/pull/69076) ([sakulali](https://github.com/sakulali)).
* 加强了代码库中与小型实体 parsing 相关的部分。发现并修复了以下 (轻微) 问题：- 如果 `DeltaLake` 表按 Bool 分区，分区值始终会被解释为 false；- `ExternalDistributed` 表在提供的地址中只使用了一个分片；`max_threads` 设置及类似设置的值会被打印为 `'auto(N)'`，而不是 `auto(N)`。[#52503](https://github.com/ClickHouse/ClickHouse/pull/52503) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 使用 cgroup 专用指标来统计 CPU 使用量，而不是系统级指标。[#62003](https://github.com/ClickHouse/ClickHouse/pull/62003) ([Nikita Taranov](https://github.com/nickitat)) 。
* 现在，远程 S3 磁盘的 IO 调度已改为在 HTTP 套接字流层面进行 (而不是以整个 S3 请求为单位) ，以解决 `bandwidth_limit` 限流问题。[#65182](https://github.com/ClickHouse/ClickHouse/pull/65182) ([Sergei Trifonov](https://github.com/serxa)) 。
* 函数 `upperUTF8` 和 `lowerUTF8` 此前只能对西里尔字母进行大小写转换。现在这一限制已取消，任意语言的字符都可以进行大小写转换。示例：`SELECT upperUTF8('Süden')` 现在返回 `SÜDEN`。[#65761](https://github.com/ClickHouse/ClickHouse/pull/65761) ([李扬](https://github.com/taiyang-li)) 。
* 当对带有投影的表执行轻量级删除时，以往用户只能选择两种方式：抛出异常 (默认) 或在执行轻量级删除时删除投影。现在新增了第三种选择：继续执行轻量级删除，然后重建投影。[#66169](https://github.com/ClickHouse/ClickHouse/pull/66169) ([jsc0218](https://github.com/jsc0218)).
* 新增了两个选项 (`dns_allow_resolve_names_to_ipv4` 和 `dns_allow_resolve_names_to_ipv6`) ，以支持按 IP 协议族屏蔽连接。[#66895](https://github.com/ClickHouse/ClickHouse/pull/66895) ([MikhailBurdukov](https://github.com/MikhailBurdukov)) 。
* 使 clickhouse-client 对 Ctrl-Z 的忽略可配置 (ignore\_shell\_suspend) 。[#67134](https://github.com/ClickHouse/ClickHouse/pull/67134) ([Azat Khuzhin](https://github.com/azat)) 。
* 改进 JSON 输出格式中的 UTF-8 验证。在结果数据包含某些字节序列时，确保能够生成有效的 JSON。 [#67938](https://github.com/ClickHouse/ClickHouse/pull/67938) ([mwoenker](https://github.com/mwoenker)).
* 新增了用于 merge 和变更的 profile events，以便更好地获取内部信息。[#68015](https://github.com/ClickHouse/ClickHouse/pull/68015) ([Anton Popov](https://github.com/CurtizJ)) 。
* ODBC：从服务器配置中读取 http\_max\_tries。[#68128](https://github.com/ClickHouse/ClickHouse/pull/68128) ([Rodolphe Dugé de Bernonville](https://github.com/RodolpheDuge)) 。
* 为 X.509 SubjectAltName 扩展中的用户身份识别新增通配符支持。[#68236](https://github.com/ClickHouse/ClickHouse/pull/68236) ([Marco Vilas Boas](https://github.com/marco-vb)).
* 改进日期时间的 schema 推断。现在仅当日期时间包含小数部分时才使用 `DateTime64`，否则使用普通的 DateTime。现在对 Date/DateTime 的推断也更加严格，尤其是在 `date_time_input_format='best_effort'` 时，以避免在一些边界情况下从字符串中推断出日期时间。[#68382](https://github.com/ClickHouse/ClickHouse/pull/68382) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 删除字典中旧版命名集合代码，并替换为新版代码，从而支持在字典中使用通过 DDL 创建的命名集合。关闭 [#60936](https://github.com/ClickHouse/ClickHouse/issues/60936) 和 [#36890](https://github.com/ClickHouse/ClickHouse/issues/36890)。[#68412](https://github.com/ClickHouse/ClickHouse/pull/68412) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 外部 HTTP 身份验证器现改为使用 HTTP/1.1，而非默认设置的 HTTP/1.0。[#68456](https://github.com/ClickHouse/ClickHouse/pull/68456) ([Aleksei Filatov](https://github.com/aalexfvk)) 。
* 新增了一组用于线程池内部信息的指标，能更深入地了解线程池的性能和行为。[#68674](https://github.com/ClickHouse/ClickHouse/pull/68674) ([filimonov](https://github.com/filimonov)) 。
* 支持在采用 `Values` 格式的异步插入中使用查询参数。[#68741](https://github.com/ClickHouse/ClickHouse/pull/68741) ([Anton Popov](https://github.com/CurtizJ)).
* `dateTrunc` 和 `toStartOfInterval` 现已支持 `Date32`。[#68874](https://github.com/ClickHouse/ClickHouse/pull/68874) ([LiuNeng](https://github.com/liuneng1994)) 。
* 为 `system.processors_profile_log` 新增 `plan_step_name` 和 `plan_step_description` 列。[#68954](https://github.com/ClickHouse/ClickHouse/pull/68954) ([Alexander Gololobov](https://github.com/davenger)) 。
* 嵌入式字典已支持西班牙语。[#69035](https://github.com/ClickHouse/ClickHouse/pull/69035) ([Vasily Okunev](https://github.com/VOkunev)) 。
* 在简短的故障信息中加入 CPU 架构。[#69037](https://github.com/ClickHouse/ClickHouse/pull/69037) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* 如果在重试期间无法建立新的 Keeper 连接，查询会更快地失败。[#69148](https://github.com/ClickHouse/ClickHouse/pull/69148) ([Raúl Marín](https://github.com/Algunenano)).
* 更新 Database Factory，使用户定义的数据库引擎也能支持参数、设置和表覆盖 (类似于 StorageFactory) 。[#69201](https://github.com/ClickHouse/ClickHouse/pull/69201) ([NikBarykin](https://github.com/NikBarykin)).
* 将所有外部表引擎和函数替换为 `Null` 引擎的恢复模式 (`restore_replace_external_engines_to_null`、`restore_replace_external_table_functions_to_null` 设置) 在表带有 SETTINGS 时会失败。现在在这种情况下，会从表定义中移除 SETTINGS，从而可以恢复此类表。[#69253](https://github.com/ClickHouse/ClickHouse/pull/69253) ([Ilya Yatsishin](https://github.com/qoega)) 。
* 在 ClickHouse 镜像的入口点脚本中，CLICKHOUSE\_PASSWORD 已正确进行 XML 转义。[#69301](https://github.com/ClickHouse/ClickHouse/pull/69301) ([aohoyd](https://github.com/aohoyd)).
* 允许 `arrayZip`/`arrayZipUnaligned` 接受空参数，与 [https://github.com/ClickHouse/ClickHouse/pull/65887](https://github.com/ClickHouse/ClickHouse/pull/65887) 中 `concat` 的处理方式一致。这是为了兼容 Gluten CH Backend 中的 Spark。[#69576](https://github.com/ClickHouse/ClickHouse/pull/69576) ([李扬](https://github.com/taiyang-li)) 。
* 支持 Keeper 内部通信使用更多高级 SSL 选项 (例如，带口令的私钥) 。[#69582](https://github.com/ClickHouse/ClickHouse/pull/69582) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 对于拥有大量 parts 或分区的大表，索引分析可能会花费较长时间。此更改应可支持在该阶段终止高负载查询。[#69606](https://github.com/ClickHouse/ClickHouse/pull/69606) ([Alexander Gololobov](https://github.com/davenger)).
* 在 `gcs` 表函数中屏蔽敏感信息。[#69611](https://github.com/ClickHouse/ClickHouse/pull/69611) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 对减少行数的合并操作重建投影。[#62364](https://github.com/ClickHouse/ClickHouse/pull/62364) ([cangyin](https://github.com/cangyin)).

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

* 修复在 Experimental 且不受支持的 MaterializedPostgreSQL 引擎中，当 pg dbname 包含 "-" 时无法附加表的问题。[#62730](https://github.com/ClickHouse/ClickHouse/pull/62730) ([takakawa](https://github.com/takakawa)) 。
* 修复了 Experimental 且完全不受支持的 MaterializedPostgreSQL 引擎中，在 adnum 排序错乱时生成列报错的问题 [#63161](https://github.com/ClickHouse/ClickHouse/issues/63161)。修复了 Experimental 且完全不受支持的 MaterializedPostgreSQL 中，当表中存在生成列时，默认值为 nextval expression 的 id 列报错的问题。修复了删除名称中包含 \[a-z1-9-] 之外字符的 publication 时出现的错误。[#67664](https://github.com/ClickHouse/ClickHouse/pull/67664) ([Kruglov Kirill](https://github.com/1on)) 。
* Storage Join 已支持左表中的 Nullable 列，修复了 [#61247](https://github.com/ClickHouse/ClickHouse/issues/61247)。[#66926](https://github.com/ClickHouse/ClickHouse/pull/66926) ([vdimir](https://github.com/vdimir)) 。
* 当 `IN` 运算符中包含转换为 Decimal() 时，并行副本 (同时分发查询) 会导致查询结果错误。该问题由新的 analyzer 引入。[#67234](https://github.com/ClickHouse/ClickHouse/pull/67234) ([Igor Nikonov](https://github.com/devcrafter)) 。
* 修复了 alter modify order by 导致元数据不一致的问题。[#67436](https://github.com/ClickHouse/ClickHouse/pull/67436) ([iceFireser](https://github.com/iceFireser)) 。
* 修复了函数 `fromModifiedJulianDay` 的上限值。其原本应为 `9999-12-31`，但被误设为 `9999-01-01`。[#67583](https://github.com/ClickHouse/ClickHouse/pull/67583) ([PHO](https://github.com/depressed-pho)) 。
* 修复了在 `IN` 查询中，索引不位于元组开头时出现的问题。[#67626](https://github.com/ClickHouse/ClickHouse/pull/67626) ([Yarik Briukhovetskyi](https://github.com/yariks5s)) 。
* 修复 `RoleCache` 过期问题。[#67748](https://github.com/ClickHouse/ClickHouse/pull/67748) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复因写入视图过慢导致窗口视图丢失块的问题。[#67983](https://github.com/ClickHouse/ClickHouse/pull/67983) ([Raúl Marín](https://github.com/Algunenano)) 。
* 修复了由日期格式错误导致的 MSan 问题。[#68105](https://github.com/ClickHouse/ClickHouse/pull/68105) ([JackyWoo](https://github.com/JackyWoo)) 。
* 修复了在 Parquet 过滤过程中，当文件中的数据类型与请求的数据类型差异较大时发生崩溃的问题 (例如 `... FROM file('a.parquet', Parquet, 'x String')`，而文件中的 `x` 实际上是 `Int64`) 。在此修复之前，可将 `input_format_parquet_filter_push_down = 0` 用作临时规避方案。[#68131](https://github.com/ClickHouse/ClickHouse/pull/68131) ([Michael Kolupaev](https://github.com/al13n321)) 。
* 修复了 `lag`/`lead` 中由 [#67091](https://github.com/ClickHouse/ClickHouse/issues/67091) 引入的崩溃问题。[#68262](https://github.com/ClickHouse/ClickHouse/pull/68262) ([lgbo](https://github.com/lgbo-ustc)) 。
* 尝试修复查询取消时 Postgres 崩溃的问题。 [#68288](https://github.com/ClickHouse/ClickHouse/pull/68288) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 在 [https://github.com/ClickHouse/ClickHouse/pull/61984](https://github.com/ClickHouse/ClickHouse/pull/61984) 之后，`schema_inference_make_columns_nullable=0` 在 Parquet/Arrow 格式中仍可能将列设为 `Nullable`。这一变更破坏了向后兼容性，用户也注意到了这一行为变化。此 PR 使 `schema_inference_make_columns_nullable=0` 恢复为此前的行为 (不会推断出 Nullable 列) ，并为该 setting 引入了新值 `auto`，只有当数据包含可空性信息时，才会将列设为 `Nullable`。[#68298](https://github.com/ClickHouse/ClickHouse/pull/68298) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了 [#50868](https://github.com/ClickHouse/ClickHouse/issues/50868)。在分布式查询中的嵌套子查询返回较小的 DateTime64 常量值时，这些值会被错误地转换为 NULL，从而导致报错，并可能产生不正确的查询结果。[#68323](https://github.com/ClickHouse/ClickHouse/pull/68323) ([Shankar](https://github.com/shiyer7474)) 。
* 修复了查询 `SYSTEM SYNC REPLICA` 中缺少 sync replica 模式的问题。[#68326](https://github.com/ClickHouse/ClickHouse/pull/68326) ([Duc Canh Le](https://github.com/canhld94)) 。
* 修复 key 条件中的错误。[#68354](https://github.com/ClickHouse/ClickHouse/pull/68354) ([Han Fei](https://github.com/hanfei1991)) 。
* 修复了这样一个崩溃问题：当某个角色被 LDAP 外部用户目录使用时，删除或重命名该角色会导致崩溃。[#68355](https://github.com/ClickHouse/ClickHouse/pull/68355) ([Andrey Zvonov](https://github.com/zvonand)) 。
* 修复 system.view\_refreshes 中 Progress 列值大于 1 的问题 [#68377](https://github.com/ClickHouse/ClickHouse/issues/68377)。[#68378](https://github.com/ClickHouse/ClickHouse/pull/68378) ([megao](https://github.com/jetgm)).
* 正确处理正则表达式标志。 [#68389](https://github.com/ClickHouse/ClickHouse/pull/68389) ([Han Fei](https://github.com/hanfei1991)).
* PostgreSQL 风格的类型转换运算符 (`::`) 现已可正常工作，即使是 SQL 风格的十六进制和二进制字符串字面量也不例外 (例如 `SELECT x'414243'::String`) 。这解决了 [#68324](https://github.com/ClickHouse/ClickHouse/issues/68324)。[#68482](https://github.com/ClickHouse/ClickHouse/pull/68482) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 针对 [https://github.com/ClickHouse/ClickHouse/pull/68131](https://github.com/ClickHouse/ClickHouse/pull/68131) 的小补丁。[#68494](https://github.com/ClickHouse/ClickHouse/pull/68494) ([Chang chen](https://github.com/baibaichen)) 。
* 修复 [#68239](https://github.com/ClickHouse/ClickHouse/issues/68239) 中 `SAMPLE n` 在 n 为整数时出现的问题。[#68499](https://github.com/ClickHouse/ClickHouse/pull/68499) ([Denis Hananein](https://github.com/denis-hananein)) 。
* 修复了 mann-whitney-utest 在两个分布大小不相等时出现的错误。[#68556](https://github.com/ClickHouse/ClickHouse/pull/68556) ([Han Fei](https://github.com/hanfei1991)) 。
* 意外重启后，由于对被损坏分片覆盖的分片处理异常，ReplicatedMergeTree 无法启动复制。 [#68584](https://github.com/ClickHouse/ClickHouse/pull/68584) ([baolin](https://github.com/baolinhuang)).
* 修复了在将函数 `sipHash64Keyed`、`sipHash128Keyed` 或 `sipHash128ReferenceKeyed` 应用于空数组或 Tuple 时触发的 `LOGICAL_ERROR`。 [#68630](https://github.com/ClickHouse/ClickHouse/pull/68630) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 为多个列创建索引时，全文索引可能会误过滤错误的列，因为它在不同列之间没有重置 row\_id；复现步骤见 tests/queries/0\_stateless/03228\_full\_text\_with\_multi\_col.sql。修复前会出现该问题。 [#68644](https://github.com/ClickHouse/ClickHouse/pull/68644) ([siyuan](https://github.com/linkwk7)).
* 修复了在创建 Replicated 表时，`replica&#95;name` 中包含无效字符 '\t' 和 '\n' 会导致 LogEntry 中对 'source replica' 的解析错误的问题。该问题见 [#68640](https://github.com/ClickHouse/ClickHouse/issues/68640)。[#68645](https://github.com/ClickHouse/ClickHouse/pull/68645) ([Zhigao Hong](https://github.com/zghong)).
* 已将虚拟列 ` _table` 和 `_database` 重新添加到分布式表中。它们在 24.3 版本之前一直可用。[#68672](https://github.com/ClickHouse/ClickHouse/pull/68672) ([Anton Popov](https://github.com/CurtizJ)).
* 修复了在 Variant 列置换过程中可能出现的错误 `Size of permutation (0) is less than required (...)`。[#68681](https://github.com/ClickHouse/ClickHouse/pull/68681) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复在使用新的 JSON 列时可能出现的错误 `DB::Exception: Block structure mismatch in joined block stream: different columns:`。[#68686](https://github.com/ClickHouse/ClickHouse/pull/68686) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复函数 `sipHash(64/128)Keyed` 中对以数组为键的 Map 进行哈希计算时，已物化的常量键相关问题。[#68731](https://github.com/ClickHouse/ClickHouse/pull/68731) ([Salvatore Mesoraca](https://github.com/aiven-sal)) 。
* 使 `ColumnsDescription::toString` 在格式化每一列时使用同一个 `IAST::FormatState object`。这样可确保写入磁盘和 ZooKeeper 的列元数据保持统一。[#68733](https://github.com/ClickHouse/ClickHouse/pull/68733) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* 修复 grouping sets 中聚合数据的合并问题。[#68744](https://github.com/ClickHouse/ClickHouse/pull/68744) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复逻辑错误：创建 replicated merge tree、修改列后，再执行 modify statistics 时会出错。[#68820](https://github.com/ClickHouse/ClickHouse/pull/68820) ([Han Fei](https://github.com/hanfei1991)) 。
* 修复 analyzer 中对子查询动态子列的解析问题。[#68824](https://github.com/ClickHouse/ClickHouse/pull/68824) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复 DeltaLake 中复杂类型元数据的解析问题。关闭 [#68739](https://github.com/ClickHouse/ClickHouse/issues/68739)。[#68836](https://github.com/ClickHouse/ClickHouse/pull/68836) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 修复了异步插入中的一个问题：如果在插入之后、但在刷新到表之前，表元数据发生了变更 (由 `ALTER ADD/MODIFY COLUMN` 查询导致) ，则会出现异常。[#68837](https://github.com/ClickHouse/ClickHouse/pull/68837) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了向数组中传入空元组时出现的意外异常。此修复解决了 [#68618](https://github.com/ClickHouse/ClickHouse/issues/68618)。[#68848](https://github.com/ClickHouse/ClickHouse/pull/68848) ([Amos Bird](https://github.com/amosbird)).
* 修复了对纯元数据变更命令的解析问题。[#68935](https://github.com/ClickHouse/ClickHouse/pull/68935) ([János Benjamin Antal](https://github.com/antaljanosbenjamin)) 。
* 修复 anyHeavy 状态合并时可能产生错误结果的问题。[#68950](https://github.com/ClickHouse/ClickHouse/pull/68950) ([Raúl Marín](https://github.com/Algunenano)) 。
* 修复了启用设置 `optimize_functions_to_subcolumns` 时写入 Materialized Views 的问题。[#68951](https://github.com/ClickHouse/ClickHouse/pull/68951) ([Anton Popov](https://github.com/CurtizJ)).
* 不要在 const Dynamic 列方法中使用序列化缓存。这可能会在聚合过程中导致使用未初始化的值，甚至引发竞态条件。[#68953](https://github.com/ClickHouse/ClickHouse/pull/68953) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复在 JSON 类型解析过程中，某些情况下本应将 null 作为默认值插入时出现的解析错误。[#68955](https://github.com/ClickHouse/ClickHouse/pull/68955) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了某些压缩响应未发送 `Content-Encoding` 的问题。[#64802](https://github.com/ClickHouse/ClickHouse/issues/64802)。[#68975](https://github.com/ClickHouse/ClickHouse/pull/68975) ([Konstantin Bogdanov](https://github.com/thevar1able)) 。
* 在某些情况下，path 会被错误地拼接，导致其中包含 `//`；现已通过路径规范化解决该问题。[#69066](https://github.com/ClickHouse/ClickHouse/pull/69066) ([Yarik Briukhovetskyi](https://github.com/yariks5s)) 。
* 修复空 async insert 情况下的逻辑错误。[#69080](https://github.com/ClickHouse/ClickHouse/pull/69080) ([Han Fei](https://github.com/hanfei1991)) 。
* 修复了 `clickhouse-client` 在取消查询期间进度显示中的数据竞争问题。[#69081](https://github.com/ClickHouse/ClickHouse/pull/69081) ([Sergei Trifonov](https://github.com/serxa)) 。
* 修复了一个 bug：向量相似度索引 (当前处于 Experimental 阶段) 在使用余弦距离作为距离函数时未被使用。[#69090](https://github.com/ClickHouse/ClickHouse/pull/69090) ([flynn](https://github.com/ucasfl)).
* 此更改修复了一个问题：如果在初始创建过程中服务器发生故障，之后再次尝试创建 Replicated database 时可能会报错。[#69102](https://github.com/ClickHouse/ClickHouse/pull/69102) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)).
* 当 `input_format_csv_try_infer_numbers_from_strings = 1` 时，不要在 CSV 中将 String 推断为 Bool 类型，因为我们不允许从字符串读取 bool 值。[#69109](https://github.com/ClickHouse/ClickHouse/pull/69109) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了在启用 `--multiquery` 时，客户端解析 `explain ast insert` 查询时出现错误的问题。[#69123](https://github.com/ClickHouse/ClickHouse/pull/69123) ([wxybear](https://github.com/wxybear)).
* 子查询中的 `UNION` 子句在使用并行副本的查询中未被正确处理，并导致出现 LOGICAL\_ERROR `Duplicate announcement received for replica`。[#69146](https://github.com/ClickHouse/ClickHouse/pull/69146) ([Igor Nikonov](https://github.com/devcrafter)).
* 修复了 s3Cluster 中结构参数传递的问题。此前，将查询发送到 s3Cluster 的副本时，列的 `DEFAULT` 表达式可能会丢失。[#69147](https://github.com/ClickHouse/ClickHouse/pull/69147) ([Kruglov Pavel](https://github.com/Avogar)).
* 在将表达式转换为目标类型时，遵循 Values 格式中的格式设置。[#69149](https://github.com/ClickHouse/ClickHouse/pull/69149) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了 `clickhouse-client --queries-file` 在只读用户下无法使用的问题 (此前会因 `Cannot modify 'log_comment' setting in readonly mode` 而失败) 。[#69175](https://github.com/ClickHouse/ClickHouse/pull/69175) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了 `clickhouse-client` 在其输出通过管道传递给提前终止的进程时出现的数据竞争问题。[#69186](https://github.com/ClickHouse/ClickHouse/pull/69186) ([vdimir](https://github.com/vdimir)) 。
* 修复 JSON/Dynamic 类型下 `uniq` 和 GROUP BY 结果不正确的问题。[#69203](https://github.com/ClickHouse/ClickHouse/pull/69203) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复异步插入的 INFILE 格式识别问题。如果未在 FORMAT 子句中显式指定格式，则可根据 INFILE 文件扩展名识别该格式。[#69237](https://github.com/ClickHouse/ClickHouse/pull/69237) ([Julia Kartseva](https://github.com/jkartseva)) 。
* 在[此问题](https://github.com/ClickHouse/ClickHouse/pull/59946#issuecomment-1943653197)之后，生产环境中相当多的表副本都处于这样一种状态：其 `metadata_version` 节点的值既等于 `0`，又与对应表的 `metadata` 节点版本不一致。这会导致这些副本上的 `alter` 查询失败。[#69274](https://github.com/ClickHouse/ClickHouse/pull/69274) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)) 。
* 将 Dynamic 类型标记为不安全的主键类型，以避免 Fields 引发的问题。[#69311](https://github.com/ClickHouse/ClickHouse/pull/69311) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 改进了访问实体依赖关系的恢复。[#69346](https://github.com/ClickHouse/ClickHouse/pull/69346) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复了在为插入操作获取连接时，如果所有连接尝试都失败而导致的未定义行为。[#69390](https://github.com/ClickHouse/ClickHouse/pull/69390) ([Pablo Marcos](https://github.com/pamarcos)).
* 关闭 [#69135](https://github.com/ClickHouse/ClickHouse/issues/69135)。如果尝试将已 join 的数据复用于 `cross` join`，但目前在 ClickHouse 中还不会发生这种情况。最好在 `reuseJoinedData`中保留`have\_compressed\`。[#69404](https://github.com/ClickHouse/ClickHouse/pull/69404) ([lgbo](https://github.com/lgbo-ustc)) 。
* 使 `materialize()` 函数在参数为稀疏列时返回普通列。[#69429](https://github.com/ClickHouse/ClickHouse/pull/69429) ([Alexander Gololobov](https://github.com/davenger)) 。
* 修复了函数 `sqidDecode` 中的 `LOGICAL_ERROR` ([#69450](https://github.com/ClickHouse/ClickHouse/issues/69450)) 。[#69451](https://github.com/ClickHouse/ClickHouse/pull/69451) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 快速修复 24.6 中的 s3queue 问题，或在 Replicated 数据库中创建查询。[#69454](https://github.com/ClickHouse/ClickHouse/pull/69454) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复了在 `INSERT INTO ... SELECT` 或 `CREATE TABLE AS SELECT` 查询中，由于 squashing 过程导致内存占用过高的问题。[#69469](https://github.com/ClickHouse/ClickHouse/pull/69469) ([Yarik Briukhovetskyi](https://github.com/yariks5s)) 。
* 语句 `SHOW COLUMNS` 和 `SHOW INDEX` 现在即使在表名中包含点号的情况下也能正常工作。[#69514](https://github.com/ClickHouse/ClickHouse/pull/69514) ([Salvatore Mesoraca](https://github.com/aiven-sal)).
* 现已禁止对 overflow 模式 != 'throw' 的查询使用查询缓存。这样可防止可能被截断或不正确的查询结果被存入查询缓存。 (问题 [#67476](https://github.com/ClickHouse/ClickHouse/issues/67476)) 。[#69549](https://github.com/ClickHouse/ClickHouse/pull/69549) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 在移至 prewhere 时保留条件的原有顺序。此前顺序可能会发生变化，而在顺序很重要时，这可能导致查询失败。[#69560](https://github.com/ClickHouse/ClickHouse/pull/69560) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复 Keeper 在发生 ZNOAUTH 错误后多请求预处理的问题。[#69627](https://github.com/ClickHouse/ClickHouse/pull/69627) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 修复了在创建新副本时，DatabaseReplicated 中带有 WHERE 子句的生存时间 (TTL) 可能导致的 METADATA\_MISMATCH 问题。[#69736](https://github.com/ClickHouse/ClickHouse/pull/69736) ([Nikolay Degterinsky](https://github.com/evillique)).
* 修复 `StorageS3(Azure)Queue` 的设置项 `tracked_file_ttl_sec`。此前我们以键 `tracked_file_ttl_sec` 将其写入 keeper，但读取时却使用了 `tracked_files_ttl_sec`，这是个拼写错误。[#69742](https://github.com/ClickHouse/ClickHouse/pull/69742) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 在 `gethyperrectangleforrowgroup` 中改用 `tryconvertfieldtotype`。[#69745](https://github.com/ClickHouse/ClickHouse/pull/69745) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)) 。
* 回退“修复在没有列且没有自适应索引粒度时的 prewhere (几乎什么都没有) ”。由于回退了这些更改，读取由旧版 CH (可能是 2021 年或更早版本) 生成的数据分区片段时，可能会出现一些错误。[#68897](https://github.com/ClickHouse/ClickHouse/pull/68897) ([Alexander Gololobov](https://github.com/davenger)).

### <a id="248" /> ClickHouse 24.8 LTS 发行版，2024-08-20。[演示文稿](https://presentations.clickhouse.com/2024-release-24.8/)，[视频](https://www.youtube.com/watch?v=AeLmp2jc51k)

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

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

* `clickhouse-client` 和 `clickhouse-local` 现在默认启用多查询模式 (而非单查询模式) 。例如，`clickhouse-client -q "SELECT 1; SELECT 2"` 现在可直接运行，而此前用户必须添加 `--multiquery` (或 `-n`) 。`--multiquery/-n` 开关现已废弃。在多查询语句中，INSERT 查询会根据其 FORMAT 子句进行特殊处理：如果 FORMAT 为 `VALUES` (最常见的情况) ，则 INSERT 语句以查询末尾的分号 `;` 作为结束标志。对于其他所有 FORMAT (例如 `CSV` 或 `JSONEachRow`) ，INSERT 语句则以查询末尾的两个换行符 `\n\n` 作为结束标志。[#63898](https://github.com/ClickHouse/ClickHouse/pull/63898) ([FFish](https://github.com/wxybear)).
* 在之前的版本中，可以通过在 `LowCardinality` 数据类型名称后追加 `WithDictionary` 来使用一种替代语法。这只是一个初步可用的实现，从未写入文档，也从未对外公开。现在，该语法已废弃。如果你使用过这种语法，则必须对表执行 ALTER，并将这些数据类型重命名为 `LowCardinality`。[#66842](https://github.com/ClickHouse/ClickHouse/pull/66842) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 修复了存储 `Buffer` 与分布式目标表配合使用时的逻辑错误。这是一项向后不兼容的变更：如果该表在查询中出现多次 (例如在自连接中) ，那么使用分布式目标表的 `Buffer` 查询可能会无法继续工作。[#67015](https://github.com/ClickHouse/ClickHouse/pull/67015) ([vdimir](https://github.com/vdimir)).
* 在之前的版本中，调用基于伽马函数的随机分布函数 (例如 Chi-Squared、Student、Fisher) 时，如果传入接近零的负 argument，可能会导致长时间计算甚至无限循环。在新版本中，使用零或负 argument 调用这些函数将抛出异常。此更改关闭了 [#67297](https://github.com/ClickHouse/ClickHouse/issues/67297)。[#67326](https://github.com/ClickHouse/ClickHouse/pull/67326) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 系统表 `text_log` 默认启用。这与之前版本完全兼容，但你可能会注意到本地磁盘使用量略有增加 (这个系统表仅占用极少量磁盘空间) 。[#67428](https://github.com/ClickHouse/ClickHouse/pull/67428) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 在之前的版本中，如果要求 `arrayWithConstant` 生成非常大的数组，可能会比较慢。在新版本中，每个数组的大小被限制为 1 GB。此更改关闭了 [#32754](https://github.com/ClickHouse/ClickHouse/issues/32754)。[#67741](https://github.com/ClickHouse/ClickHouse/pull/67741) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 修复了 REPLACE 修饰符的格式问题 (禁止省略括号) 。[#67774](https://github.com/ClickHouse/ClickHouse/pull/67774) ([Azat Khuzhin](https://github.com/azat)).
* 已在 [#68349](https://github.com/ClickHouse/ClickHouse/issues/68349) 中回移：重新实现 `Dynamic` 类型。现在，当动态数据类型数量达到上限时，新类型不会再被转换为 String，而是以二进制格式存储在一种特殊的数据结构中，并使用二进制编码的数据类型。现在，任何曾插入到 `Dynamic` 列中的类型，都可以作为 subcolumn 从中读取。[#68132](https://github.com/ClickHouse/ClickHouse/pull/68132) ([Kruglov Pavel](https://github.com/Avogar)).

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

* 新增了一个 `MergeTree` 设置 `deduplicate_merge_projection_mode`，用于控制在合并期间 (针对特定引擎) 以及 `OPTIMIZE DEDUPLICATE` 查询中对 projections 的处理。支持的选项包括：`throw` (如果 projection 尚未对 \*MergeTree 引擎得到完全支持，则抛出异常) 、`drop` (如果 projection 自身无法被一致地合并，则在合并期间将其移除) 以及 `rebuild` (从头重建 projection，这是一项开销很大的操作) 。[#66672](https://github.com/ClickHouse/ClickHouse/pull/66672) ([jsc0218](https://github.com/jsc0218)) 。
* 为 S3 表引擎添加 `_etag` 虚拟列。修复 [#65312](https://github.com/ClickHouse/ClickHouse/issues/65312)。[#65386](https://github.com/ClickHouse/ClickHouse/pull/65386) ([skyoct](https://github.com/skyoct)) 。
* 为查询缓存新增了标签 (命名空间) 机制。带有不同标签的相同查询在查询缓存中会被视为不同的查询。示例：`SELECT 1 SETTINGS use_query_cache = 1, query_cache_tag = 'abc'` 和 `SELECT 1 SETTINGS use_query_cache = 1, query_cache_tag = 'def'` 现在会创建不同的查询缓存条目。[#68235](https://github.com/ClickHouse/ClickHouse/pull/68235) ([sakulali](https://github.com/sakulali)) 。
* 支持更多带有不等式条件 (涉及左右表列) 的 JOIN strictness 变体 (`LEFT/RIGHT SEMI/ANTI/ANY JOIN`) ，例如 `t1.y < t2.y` (参见设置 `allow_experimental_join_condition`) 。[#64281](https://github.com/ClickHouse/ClickHouse/pull/64281) ([lgbo](https://github.com/lgbo-ustc)) 。
* 支持在不同引擎 (`File`、`URL`、`S3`、`AzureBlobStorage`、`HDFS`) 中解析 Hive 风格分区。Hive 风格分区将数据组织到按分区划分的子目录中，从而提高对大型数据集进行查询和管理的效率。目前，它只会创建具有相应名称和数据的虚拟列。后续的 PR 将引入相应的数据过滤功能 (提升性能) 。[#65997](https://github.com/ClickHouse/ClickHouse/pull/65997) ([Yarik Briukhovetskyi](https://github.com/yariks5s)) 。
* 新增 `printf` 函数以兼容 Spark (但也可以使用现有的 `format` 函数) 。[#66257](https://github.com/ClickHouse/ClickHouse/pull/66257) ([李扬](https://github.com/taiyang-li)).
* 新增选项 `restore_replace_external_engines_to_null` 和 `restore_replace_external_table_functions_to_null`，可将 external engine 和 table\_engine 替换为 `Null` 引擎，便于测试。适用于 RESTORE 和显式创建表。[#66536](https://github.com/ClickHouse/ClickHouse/pull/66536) ([Ilya Yatsishin](https://github.com/qoega)) 。
* 新增了对使用函数 `readWKTLineString` 读取 `WKT` 格式 `MULTILINESTRING` 几何数据的支持。[#67647](https://github.com/ClickHouse/ClickHouse/pull/67647) ([Jacob Reckhard](https://github.com/jacobrec)).
* 新增表函数 `fuzzQuery`。该函数可对给定的查询字符串进行随机变体修改。示例：`SELECT query FROM fuzzQuery('SELECT 1') LIMIT 5;`。 [#67655](https://github.com/ClickHouse/ClickHouse/pull/67655) ([pufit](https://github.com/pufit)) 。
* 新增 `ALTER TABLE ... DROP DETACHED PARTITION ALL` 查询，用于删除所有 detached 分区。[#67885](https://github.com/ClickHouse/ClickHouse/pull/67885) ([Duc Canh Le](https://github.com/canhld94)).
* 当启用新设置 `rows_before_aggregation` 时，会在查询响应中新增 `rows_before_aggregation_at_least` 统计信息。该统计信息表示聚合前读取的行数。在分布式查询场景中，当使用 `group by` 或 `max` 聚合函数且未设置 `limit` 时，`rows_before_aggregation_at_least` 可以反映该查询命中的行数。[#66084](https://github.com/ClickHouse/ClickHouse/pull/66084) ([morning-color](https://github.com/morning-color)) 。
* 支持在 `Join` 表上执行 `OPTIMIZE` 查询，以减少其内存占用。[#67883](https://github.com/ClickHouse/ClickHouse/pull/67883) ([Duc Canh Le](https://github.com/canhld94)) 。
* 如果在 URL 中添加 `&run=1`，即可在 play 中立即运行查询 [#66457](https://github.com/ClickHouse/ClickHouse/pull/66457) ([Aleksandr Musorin](https://github.com/AVMusorin)) 。

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

* 实现了新的 `JSON` 数据类型。[#66444](https://github.com/ClickHouse/ClickHouse/pull/66444) ([Kruglov Pavel](https://github.com/Avogar))。
* 新增 `TimeSeries` 表引擎。[#64183](https://github.com/ClickHouse/ClickHouse/pull/64183) ([Vitaly Baranov](https://github.com/vitlibar))。
* 新增实验性的 `Kafka` 存储引擎，将偏移量存储在 Keeper 中，而不再依赖将其提交到 Kafka。这样一来，提交到 ClickHouse 表与从队列消费之间实现了原子性。[#57625](https://github.com/ClickHouse/ClickHouse/pull/57625) ([János Benjamin Antal](https://github.com/antaljanosbenjamin))。
* 并行副本采用自适应的读取任务大小计算方法 (这里的“自适应”是指它取决于读取列的大小) 。[#60377](https://github.com/ClickHouse/ClickHouse/pull/60377) ([Nikita Taranov](https://github.com/nickitat))。
* 新增统计信息类型 `count_min` (count-min sketches) ，可为 `col = 'val'` 这类等值谓词提供选择性估算。支持的数据类型包括字符串、日期、日期时间和数值类型。[#65521](https://github.com/ClickHouse/ClickHouse/pull/65521) ([JackyWoo](https://github.com/JackyWoo))。

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

* 设置 `optimize_functions_to_subcolumns` 默认启用。[#68053](https://github.com/ClickHouse/ClickHouse/pull/68053) ([Anton Popov](https://github.com/CurtizJ))。
* 将 `plain_rewritable` 磁盘目录的元数据以 `__meta` 布局存储，并与对象存储中的 MergeTree 数据分离。将 `plain_rewritable` 磁盘调整为扁平目录结构。[#65751](https://github.com/ClickHouse/ClickHouse/pull/65751) ([Julia Kartseva](https://github.com/jkartseva))。
* 通过为所有子列预先预留所需内存，改进了 `String`/`Array`/`Map`/`Variant`/`Dynamic` 类型列的 squashing (发生在 `INSERT` 查询中的一种操作) 。[#67043](https://github.com/ClickHouse/ClickHouse/pull/67043) ([Kruglov Pavel](https://github.com/Avogar))。
* 加快了 `SYSTEM FLUSH LOGS` 的执行速度，并在关闭时刷新日志。[#67472](https://github.com/ClickHouse/ClickHouse/pull/67472) ([Sema Checherinda](https://github.com/CheSema))。
* 通过减少合并操作调度阶段的开销，提升了 merges 的整体性能。[#68016](https://github.com/ClickHouse/ClickHouse/pull/68016) ([Anton Popov](https://github.com/CurtizJ))。
* 加快了 `DROP DATABASE` 查询中的表删除速度，并将 `database_catalog_drop_table_concurrency` 的默认值提高到 16。[#67228](https://github.com/ClickHouse/ClickHouse/pull/67228) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov))。
* 在写入 ORC 时，避免为数组列分配过多容量。对于 Array 列，性能提升了 15%。[#67879](https://github.com/ClickHouse/ClickHouse/pull/67879) ([李扬](https://github.com/taiyang-li))。
* 显著加快了非复制的 MergeTree 的变更速度。[#66911](https://github.com/ClickHouse/ClickHouse/pull/66911) [#66909](https://github.com/ClickHouse/ClickHouse/pull/66909) ([Alexey Milovidov](https://github.com/alexey-milovidov))。

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

* 设置 `allow_experimental_analyzer` 已重命名为 `enable_analyzer`。旧名称仍作为别名保留。这表明 Analyzer 已不再处于 Beta 阶段，而是已完全晋升为生产可用。 [#66438](https://github.com/ClickHouse/ClickHouse/pull/66438) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 改进了日期时间的 schema 推断。现在，只有当日期时间包含小数部分时才会使用 DateTime64，否则使用普通的 DateTime。现在对 Date/DateTime 的推断也更加严格，尤其是在 `date_time_input_format='best_effort'` 时，以避免在边界情况下从字符串推断出日期时间。[#68382](https://github.com/ClickHouse/ClickHouse/pull/68382) ([Kruglov Pavel](https://github.com/Avogar)) 。
* ClickHouse server 现已支持新设置 `max_keep_alive_requests`。对于与服务器之间的 keep-alive HTTP 连接，它会与 `keep_alive_timeout` 配合使用：如果空闲超时尚未到期，但某个连接上已处理的请求数超过 `max_keep_alive_requests`，服务器就会关闭该连接。[#61793](https://github.com/ClickHouse/ClickHouse/pull/61793) ([Nikita Taranov](https://github.com/nickitat)) 。
* 高级仪表板的多项改进。此项更改修复了 [#67697](https://github.com/ClickHouse/ClickHouse/issues/67697)。此项更改修复了 [#63407](https://github.com/ClickHouse/ClickHouse/issues/63407)。此项更改修复了 [#51129](https://github.com/ClickHouse/ClickHouse/issues/51129)。此项更改修复了 [#61204](https://github.com/ClickHouse/ClickHouse/issues/61204)。[#67701](https://github.com/ClickHouse/ClickHouse/pull/67701) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 创建分布式表时，无需再为 REMOTE 授权：拥有 Distributed 引擎的权限即可。 [#65419](https://github.com/ClickHouse/ClickHouse/pull/65419) ([jsc0218](https://github.com/jsc0218)).
* 不要在 Docker 镜像中显式指定 Keeper 的日志，以便后续覆盖。 [#65564](https://github.com/ClickHouse/ClickHouse/pull/65564) ([Azat Khuzhin](https://github.com/azat)).
* 为 `BACKUP` 和 `RESTORE` 查询引入了 `use_same_password_for_base_backup` 设置，从而支持将增量备份创建到受密码保护的归档中，并从中恢复。 [#66214](https://github.com/ClickHouse/ClickHouse/pull/66214) ([Samuele](https://github.com/sguerrini97)).
* 对 `ATTACH` 查询忽略 `async_load_databases` (此前，ATTACH 可能会在表尚未附加完成时就返回) 。[#66240](https://github.com/ClickHouse/ClickHouse/pull/66240) ([Azat Khuzhin](https://github.com/azat)).
* 新增了针对被拒绝连接 (即资源不足时) 的日志和指标。[#66410](https://github.com/ClickHouse/ClickHouse/pull/66410) ([Alexander Tokmakov](https://github.com/tavplubix)) 。
* 为 MongoDB 引擎提供对 `UUID` 类型的正确支持。[#66671](https://github.com/ClickHouse/ClickHouse/pull/66671) ([Azat Khuzhin](https://github.com/azat)) 。
* 新增复制延迟和恢复时间指标。[#66703](https://github.com/ClickHouse/ClickHouse/pull/66703) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)) 。
* 新增 `DiskS3NoSuchKeyErrors` 指标。[#66704](https://github.com/ClickHouse/ClickHouse/pull/66704) ([Miсhael Stetsyuk](https://github.com/mstetsyuk)) 。
* 确保 `COMMENT` 子句可用于所有表引擎。[#66832](https://github.com/ClickHouse/ClickHouse/pull/66832) ([Joe Lynch](https://github.com/joelynch)).
* 函数 `mapFromArrays` 现在接受 `Map(K, V)` 作为第一个参数，例如：`SELECT mapFromArrays(map('a', 4, 'b', 4), ['aa', 'bb'])` 现在可以正常运行，并返回 `{('a',4):'aa',('b',4):'bb'}`。此外，如果第 1 个参数是 `Array`，现在它也可以是 `Array(Nullable(T))` 或 `Array(LowCardinality(Nullable(T)))` 类型，只要数组中的实际值不是 `NULL` 即可。[#67103](https://github.com/ClickHouse/ClickHouse/pull/67103) ([李扬](https://github.com/taiyang-li)).
* 从 `~/.clickhouse-local` 读取 `clickhouse-local` 配置。[#67135](https://github.com/ClickHouse/ClickHouse/pull/67135) ([Azat Khuzhin](https://github.com/azat)) 。
* 将设置 `input_format_orc_read_use_writer_time_zone` 重命名为 `input_format_orc_reader_timezone`，并允许用户设置读取器的时区。[#67175](https://github.com/ClickHouse/ClickHouse/pull/67175) ([kevinyhzou](https://github.com/KevinyhZou)).
* 当 HTTP 连接建立后立即被对端重置时，将 `Socket is not connected` 错误降级，关闭 [#34218](https://github.com/ClickHouse/ClickHouse/issues/34218)。[#67177](https://github.com/ClickHouse/ClickHouse/pull/67177) ([vdimir](https://github.com/vdimir)) 。
* 新增了从配置为 `system.dashboards` 加载仪表盘的功能 (设置后，会覆盖默认的仪表盘预设) 。[#67232](https://github.com/ClickHouse/ClickHouse/pull/67232) ([Azat Khuzhin](https://github.com/azat)).
* SQL 中的窗口函数传统上采用蛇形命名法。ClickHouse 使用 `camelCase`，因此新增了别名 `denseRank()` 和 `percentRank()`。这些新函数的调用方式与原始的 `dense_rank()` 和 `percent_rank()` 函数完全相同。蛇形命名法和 `camelCase` 这两种语法仍然都可用。此外，还为每个函数新增了测试。这解决了 [#67042](https://github.com/ClickHouse/ClickHouse/issues/67042)。[#67334](https://github.com/ClickHouse/ClickHouse/pull/67334) ([Peter Nguyen](https://github.com/petern48)) 。
* 如果配置文件格式不是 `.xml`、`.yml` 或 `.yaml`，则会自动检测其格式。如果文件以 \< 开头，可能是 XML；否则，可能是 YAML。当通过管道提供配置文件时，这很有用：`clickhouse-server --config-file <(echo "hello: world")`。 [#67391](https://github.com/ClickHouse/ClickHouse/pull/67391) ([sakulali](https://github.com/sakulali)) 。
* 函数 `formatDateTime` 和 `formatDateTimeInJodaSyntax` 现在将其 format 参数视为可选。如果未指定，则默认使用格式字符串 `%Y-%m-%d %H:%i:%s` 和 `yyyy-MM-dd HH:mm:ss`。示例：`SELECT parseDateTime('2021-01-04 23:12:34')` 现在会返回 DateTime 值 `2021-01-04 23:12:34` (此前会抛出异常) 。[#67399](https://github.com/ClickHouse/ClickHouse/pull/67399) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 如果 KeeperMap 中的 Keeper 请求因超时或连接丢失而失败，系统会自动重试这些请求。[#67448](https://github.com/ClickHouse/ClickHouse/pull/67448) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 在 Aarch64 Linux 构建中添加 `-no-pie`，以便在 ClickHouse 重启后能够正确获取内部信息并对堆栈跟踪进行符号化。[#67916](https://github.com/ClickHouse/ClickHouse/pull/67916) ([filimonov](https://github.com/filimonov)).
* 为 merge 和变更新增了 profile events，以便更好地了解内部情况。 [#68015](https://github.com/ClickHouse/ClickHouse/pull/68015) ([Anton Popov](https://github.com/CurtizJ)).
* 移除非复制表 `MergeTree` 中不必要的日志。[#68238](https://github.com/ClickHouse/ClickHouse/pull/68238) ([Daniil Ivanik](https://github.com/divanik)) 。

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

* 集成测试的 flaky check 现在会在同一环境中借助 `pytest-repeat` 库对每个测试用例重复运行多次，以发现更多测试问题并提高可靠性。要通过该检查，务必在测试用例结束时清理表和其他实体。与多次运行 pytest 相比，这种重复运行方式快得多，因为只需启动一次所需容器。[#66986](https://github.com/ClickHouse/ClickHouse/pull/66986) ([Ilya Yatsishin](https://github.com/qoega)) 。
* 解除 CLion 与 ClickHouse 配合使用时的阻碍。在之前的版本中，CLion 每次按键都会卡顿一分钟。此更改关闭了 [#66994](https://github.com/ClickHouse/ClickHouse/issues/66994)。[#66995](https://github.com/ClickHouse/ClickHouse/pull/66995) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* getauxval：避免在较新的 Linux 内核中，因 ASLR 熵较高而在 sanitizer 重新执行时发生崩溃。[#67081](https://github.com/ClickHouse/ClickHouse/pull/67081) ([Raúl Marín](https://github.com/Algunenano)) 。
* 将部分客户端代码提取到单个文件中，并且即使在调试构建中也对其应用最高级别的优化。此更改关闭了 [#65745](https://github.com/ClickHouse/ClickHouse/issues/65745)。[#67215](https://github.com/ClickHouse/ClickHouse/pull/67215) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。

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

* 仅适用于 Experimental Variant 数据类型。修复了 Variant + AggregateFunction 类型引发的崩溃问题。[#67122](https://github.com/ClickHouse/ClickHouse/pull/67122) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了 DistributedAsyncInsert 在连接为空时发生崩溃的问题。[#67219](https://github.com/ClickHouse/ClickHouse/pull/67219) ([Pablo Marcos](https://github.com/pamarcos)) 。
* 修复了在使用 `tuple()` 参数时 `uniq` 和 `uniqTheta ` 崩溃的问题。关闭 [#67303](https://github.com/ClickHouse/ClickHouse/issues/67303)。[#67306](https://github.com/ClickHouse/ClickHouse/pull/67306) ([flynn](https://github.com/ucasfl)) 。
* 修复了 [#66026](https://github.com/ClickHouse/ClickHouse/issues/66026)。避免在 `ReplaceTableNodeToDummyVisitor` 中遍历未解析的表函数参数。[#67522](https://github.com/ClickHouse/ClickHouse/pull/67522) ([Dmitry Novik](https://github.com/novikd)).
* 修复了 `JSONMergePatch` 函数中可能存在的栈溢出问题。由于此前的名称有误，现将该函数从 `jsonMergePatch` 重命名为 `JSONMergePatch`。为保证兼容性，仍保留此前的名称。改进了该函数中错误的诊断信息。此更改关闭了 [#67304](https://github.com/ClickHouse/ClickHouse/issues/67304)。[#67756](https://github.com/ClickHouse/ClickHouse/pull/67756) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 修复了一个可由精心构造的查询触发的 NULL 指针解引用问题，该问题会通过 hopEnd、hopStart、tumbleEnd 和 tumbleStart 导致 server 崩溃。[#68098](https://github.com/ClickHouse/ClickHouse/pull/68098) ([Salvatore Mesoraca](https://github.com/aiven-sal)) 。
* 修复了在使用子查询作为过滤条件时，某些系统表中出现的 `Not-ready Set` 问题。[#66018](https://github.com/ClickHouse/ClickHouse/pull/66018) ([Michael Kolupaev](https://github.com/al13n321)).
* 修复了在执行 `ALTER ADD COLUMN` 查询后无法读取子列的问题。[#66243](https://github.com/ClickHouse/ClickHouse/pull/66243) ([Anton Popov](https://github.com/CurtizJ)).
* 修复发送到外部数据库的查询中的布尔字面量问题 (适用于 `PostgreSQL` 等引擎) 。[#66282](https://github.com/ClickHouse/ClickHouse/pull/66282) ([vdimir](https://github.com/vdimir)) 。
* 修复带别名的 JOIN ON 表达式查询的格式化问题，例如 `... JOIN t2 ON (x = y) AS e ORDER BY x` 应格式化为 `... JOIN t2 ON ((x = y) AS e) ORDER BY x`。[#66312](https://github.com/ClickHouse/ClickHouse/pull/66312) ([vdimir](https://github.com/vdimir)) 。
* 修复 inter-server secret 的 cluster() 问题 (和之前一样保留初始用户) 。[#66364](https://github.com/ClickHouse/ClickHouse/pull/66364) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了将包含 null 的 Array 字段转换为 Array(Variant) 时可能发生的运行时错误。 [#66727](https://github.com/ClickHouse/ClickHouse/pull/66727) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复了 Context::getDDLWorker 中偶发出现的死锁问题。[#66843](https://github.com/ClickHouse/ClickHouse/pull/66843) ([Alexander Gololobov](https://github.com/davenger)).
* 修复在未完全删除后创建 KeeperMap 表的问题。[#66865](https://github.com/ClickHouse/ClickHouse/pull/66865) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 修复向 `s3_plain_rewritable` 磁盘恢复时出现的损坏分片错误。[#66881](https://github.com/ClickHouse/ClickHouse/pull/66881) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 在极少数情况下，ClickHouse 可能会因磁盘上存在某些意外的 projections 而将 parts 判定为损坏。现已修复。 [#66898](https://github.com/ClickHouse/ClickHouse/pull/66898) ([alesapin](https://github.com/alesapin)).
* 修复了 schema 推断中对无效 format 的检测问题，该问题可能导致逻辑错误：Format {} 不支持 schema 推断。 [#66899](https://github.com/ClickHouse/ClickHouse/pull/66899) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复了在并行副本场景下取消查询时可能发生的死锁问题。[#66905](https://github.com/ClickHouse/ClickHouse/pull/66905) ([Nikita Taranov](https://github.com/nickitat)).
* 即使设置了 database\_replicated\_allow\_heavy\_create，也禁止使用 create as select。在 23.12 中，这一操作是无条件禁止的；而在尚未发布的 24.7 中，却意外地因该设置而被允许。[#66980](https://github.com/ClickHouse/ClickHouse/pull/66980) ([vdimir](https://github.com/vdimir)).
* 从 `numbers` 读取数据时，如果设置了 `max_rows_to_read` 限制，可能会误抛异常。此修复关闭了 [#66992](https://github.com/ClickHouse/ClickHouse/issues/66992)。[#66996](https://github.com/ClickHouse/ClickHouse/pull/66996) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 为 lagInFrame 和 leadInFrame 窗口函数添加正确的类型转换，修复 msan 测试。[#67091](https://github.com/ClickHouse/ClickHouse/pull/67091) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* TRUNCATE DATABASE 过去会像 DROP DATABASE 查询那样停止复制，现已修复该问题。[#67129](https://github.com/ClickHouse/ClickHouse/pull/67129) ([Alexander Tokmakov](https://github.com/tavplubix)) 。
* 在 `clickhouse-local` 中使用独立的客户端上下文。[#67133](https://github.com/ClickHouse/ClickHouse/pull/67133) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复了一类查询报错：当查询从位于 `Distriburted` 表之上的单分片 `Merge` 表读取数据时，会报错 `Cannot convert column because it is non constant in source stream but must be constant in result.`。[#67146](https://github.com/ClickHouse/ClickHouse/pull/67146) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 在禁用 `enable_order_by_all` 且使用并行副本时，修复 `ORDER BY all` 的行为 (分布式查询同样如此) 。[#67153](https://github.com/ClickHouse/ClickHouse/pull/67153) ([Igor Nikonov](https://github.com/devcrafter)) 。
* 修复了 schema 缓存中对 input\_format\_max\_bytes\_to\_read\_for\_schema\_inference 的错误使用。 [#67157](https://github.com/ClickHouse/ClickHouse/pull/67157) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复了在按单个 Nullable 键进行 group by 时，若期间抛出异常，`count distinct` 会发生内存泄漏的问题。[#67171](https://github.com/ClickHouse/ClickHouse/pull/67171) ([Jet He](https://github.com/compasses)).
* 修复了一个会将 OUTER JOIN 转换为 INNER JOIN 的优化错误。此修复关闭了 [#67156](https://github.com/ClickHouse/ClickHouse/issues/67156)。此修复关闭了 [#66447](https://github.com/ClickHouse/ClickHouse/issues/66447)。该缺陷由 [https://github.com/ClickHouse/ClickHouse/pull/62907](https://github.com/ClickHouse/ClickHouse/pull/62907) 引入。[#67178](https://github.com/ClickHouse/ClickHouse/pull/67178) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 修复错误 `Conversion from AggregateFunction(name, Type) to AggregateFunction(name, Nullable(Type)) is not supported`。该问题由 `optimize_rewrite_aggregate_function_with_if` 优化引起。修复 [#67112](https://github.com/ClickHouse/ClickHouse/issues/67112)。[#67229](https://github.com/ClickHouse/ClickHouse/pull/67229) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 修复将空元组用作 IN 函数左操作数时查询卡住的问题。[#67295](https://github.com/ClickHouse/ClickHouse/pull/67295) ([Duc Canh Le](https://github.com/canhld94)) 。
* 此前可以构造层级非常深的嵌套 JSON 数据，在跳过未知字段时会触发栈溢出。此修复已关闭 [#67292](https://github.com/ClickHouse/ClickHouse/issues/67292)。[#67324](https://github.com/ClickHouse/ClickHouse/pull/67324) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 修复了启动时发生异常后无法附加 ReplicatedMergeTree 表的问题。[#67360](https://github.com/ClickHouse/ClickHouse/pull/67360) ([Antonio Andelic](https://github.com/antonio2368)).
* 修复了 `Aggregator` 中因错误地脱离线程组而导致的段错误。[#67385](https://github.com/ClickHouse/ClickHouse/pull/67385) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 修复了在 PK 中指定非确定性函数时的另一种情况。[#67395](https://github.com/ClickHouse/ClickHouse/pull/67395) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了 `bloom_filter` 索引在遇到诸如 `(k=2)=(k=2)` 或 `has([1,2,3], k)` 这类稍显奇怪的条件时导致查询失败的问题。[#67423](https://github.com/ClickHouse/ClickHouse/pull/67423) ([Michael Kolupaev](https://github.com/al13n321)).
* 如果文件名/URI 中包含 `::` 且并非归档文件，则可被正确解析。 [#67433](https://github.com/ClickHouse/ClickHouse/pull/67433) ([Antonio Andelic](https://github.com/antonio2368)).
* 修复了在 WriteBuffer 被取消时，\~WriteBufferFromS3 中等待任务的问题。[#67459](https://github.com/ClickHouse/ClickHouse/pull/67459) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 防止在 RESTORE 期间删除临时 part 目录。[#67491](https://github.com/ClickHouse/ClickHouse/pull/67491) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复嵌套短路函数的执行问题。[#67520](https://github.com/ClickHouse/ClickHouse/pull/67520) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了 `Logical error: Expected the argument №N of type T to have X rows, but it has 0`。该错误可能发生在使用新 analyzer 的远程查询中，即 `GROUP BY` 包含常量表达式时。[#67536](https://github.com/ClickHouse/ClickHouse/pull/67536) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复在含 `NULL` 的 Tuple 上进行 join 的问题：某些使用新 analyzer，且在 `JOIN ON` 部分的 Tuple 中包含 `NULL` 的查询会返回错误结果。[#67538](https://github.com/ClickHouse/ClickHouse/pull/67538) ([vdimir](https://github.com/vdimir)).
* 修复在不可逐出的缓存已满时，FileCache::freeSpaceRatioKeepingThreadFunc() 被重复重新调度的问题。[#67540](https://github.com/ClickHouse/ClickHouse/pull/67540) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 修复了通过 HTTP interface 向 stream 类引擎 (Kafka、RabbitMQ、NATS) 插入数据的问题。[#67554](https://github.com/ClickHouse/ClickHouse/pull/67554) ([János Benjamin Antal](https://github.com/antaljanosbenjamin)) 。
* 修复了函数 `toStartOfWeek` 在较小的 `DateTime64` 值情况下返回错误结果的问题。[#67558](https://github.com/ClickHouse/ClickHouse/pull/67558) ([Yarik Briukhovetskyi](https://github.com/yariks5s)) 。
* 修复了使用递归 CTE 创建视图时出现的问题。[#67587](https://github.com/ClickHouse/ClickHouse/pull/67587) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)).
* 修复文件系统缓存中的 `Logical error: 'file_offset_of_buffer_end <= read_until_position'` 错误。关闭 [#57508](https://github.com/ClickHouse/ClickHouse/issues/57508)。[#67623](https://github.com/ClickHouse/ClickHouse/pull/67623) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复了 [#62282](https://github.com/ClickHouse/ClickHouse/issues/62282)。移除了对 `convertFieldToString()` 的调用，并添加了数据类型专用的序列化代码。此前，当参数值为返回数据类型实例的函数或表达式时，参数化视图替换在多种数据类型下会失效。[#67654](https://github.com/ClickHouse/ClickHouse/pull/67654) ([Shankar](https://github.com/shiyer7474)).
* 修复 `percent_rank` 崩溃。`percent_rank` 的默认窗口帧类型已改为 `range unbounded preceding and unbounded following`。现在已将 `IWindowFunction` 的默认窗口帧纳入考虑，因此，SQL 中未定义窗口帧的窗口函数现在也能被正确归入不同的 `WindowTransfomer`。[#67661](https://github.com/ClickHouse/ClickHouse/pull/67661) ([lgbo](https://github.com/lgbo-ustc)) 。
* 修复了包含 UNION 的 SQL UDFs 重新加载问题。此前，重启服务器可能会导致 UDF 失效。[#67665](https://github.com/ClickHouse/ClickHouse/pull/67665) ([Antonio Andelic](https://github.com/antonio2368)).
* 修复了在 `if` 函数中处理 Tuple 和 Map 时，Experimental Variant 类型以及启用设置 `use_variant_as_common_type ` 可能导致的逻辑错误 "Unexpected return type from if"。[#67687](https://github.com/ClickHouse/ClickHouse/pull/67687) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 由于 Linux 内核中的一个缺陷，查询可能会卡在 `TimerDescriptor::drain` 中。此修复关闭了 [#37686](https://github.com/ClickHouse/ClickHouse/issues/37686)。[#67702](https://github.com/ClickHouse/ClickHouse/pull/67702) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 修复 `RESTORE ON CLUSTER` 命令自动补全的问题。[#67720](https://github.com/ClickHouse/ClickHouse/pull/67720) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复字典在加载期间遇到 CANNOT\_SCHEDULE\_TASK 时卡死的问题。[#67751](https://github.com/ClickHouse/ClickHouse/pull/67751) ([Azat Khuzhin](https://github.com/azat)) 。
* 像 `SELECT count() FROM t WHERE cast(c = 1 or c = 9999 AS Bool) SETTINGS use_skip_indexes=1` 这样的查询，如今在 `c` 上存在 bloom filter 索引时也能正确工作。[#67781](https://github.com/ClickHouse/ClickHouse/pull/67781) ([jsc0218](https://github.com/jsc0218)).
* 修复某些使用无键聚合和过滤器的查询中聚合结果错误的问题，关闭 [#67419](https://github.com/ClickHouse/ClickHouse/issues/67419)。[#67804](https://github.com/ClickHouse/ClickHouse/pull/67804) ([vdimir](https://github.com/vdimir))。
* 对 ALTER ADD/MODIFY COLUMN 中的实验性/可疑数据类型进行校验。[#67911](https://github.com/ClickHouse/ClickHouse/pull/67911) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复分布式查询中常量折叠后 DateTime64 的解析问题，关闭 [#66773](https://github.com/ClickHouse/ClickHouse/issues/66773)。[#67920](https://github.com/ClickHouse/ClickHouse/pull/67920) ([vdimir](https://github.com/vdimir)).
* 当谓词中包含非确定性函数时，修复 `count()` 结果不正确的问题。[#67922](https://github.com/ClickHouse/ClickHouse/pull/67922) ([János Benjamin Antal](https://github.com/antaljanosbenjamin)) 。
* 修复了容器化环境中在可用 CPU 数量受限时最大线程软限制的计算问题。[#67963](https://github.com/ClickHouse/ClickHouse/pull/67963) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 现在，即使磁盘上不存在 projection，但 `checksums.txt` 中有记录，ClickHouse 也不再将该 part 视为损坏。[#68003](https://github.com/ClickHouse/ClickHouse/pull/68003) ([alesapin](https://github.com/alesapin)).
* 修复了在使用新的 analyzer 时，变更无法跳过未触及 parts 的问题。此前，在启用 analyzer 的情况下，即使根据谓词该变更不会影响此 part，part 中的数据也仍可能被变更重写。[#68052](https://github.com/ClickHouse/ClickHouse/pull/68052) ([Anton Popov](https://github.com/CurtizJ)).
* 移除了一个错误的优化：该优化会去掉使用 `OFFSET` 的子查询中的排序。修复了 [#67906](https://github.com/ClickHouse/ClickHouse/issues/67906)。[#68099](https://github.com/ClickHouse/ClickHouse/pull/68099) ([Graham Campbell](https://github.com/GrahamCampbell))。
* 尝试修复聚合投影优化中的 `Block structure mismatch in AggregatingStep stream: different types` 问题。[#68107](https://github.com/ClickHouse/ClickHouse/pull/68107) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 尝试修复查询取消时 Postgres 崩溃的问题。[#68288](https://github.com/ClickHouse/ClickHouse/pull/68288) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复了查询 `SYSTEM SYNC REPLICA` 缺少 sync replica 模式的问题。[#68326](https://github.com/ClickHouse/ClickHouse/pull/68326) ([Duc Canh Le](https://github.com/canhld94)) 。

### <a id="247" /> ClickHouse 24.7 发行版，2024-07-30。 [演示文稿](https://presentations.clickhouse.com/2024-release-24.7/), [视频](https://www.youtube.com/watch?v=GerQFdJCk7A)

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

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

* 禁止在 Replicated 数据库中使用 `CRATE MATERIALIZED VIEW ... ENGINE Replicated*MergeTree POPULATE AS SELECT ...`。 [#63963](https://github.com/ClickHouse/ClickHouse/pull/63963) ([vdimir](https://github.com/vdimir)).
* `clickhouse-keeper-client` 现在只接受字符串字面量中的路径，例如 `ls '/hello/world'`，不再接受未加引号的字符串，例如 `ls /hello/world`。 [#65494](https://github.com/ClickHouse/ClickHouse/pull/65494) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 指标 `KeeperOutstandingRequets` 已重命名为 `KeeperOutstandingRequests`。 [#66206](https://github.com/ClickHouse/ClickHouse/pull/66206) ([Robert Schulze](https://github.com/rschu1ze)).
* 从 `system.functions` 表中移除了 `is_deterministic` 字段。 [#66630](https://github.com/ClickHouse/ClickHouse/pull/66630) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 函数 `tuple` 现在会尝试在查询中构造命名元组 (由 `enable_named_columns_in_function_tuple` 控制) 。新增函数 `tupleNames`，用于从元组中提取名称。 [#54881](https://github.com/ClickHouse/ClickHouse/pull/54881) ([Amos Bird](https://github.com/amosbird)).
* 调整了 materialized view 的去重机制。修复了许多场景，例如：- 在目标表上：数据会被拆分为 2 个或更多块，而这些块在并行插入时会被视为重复。- 在 MV 目标表上：相同的块会被去重，这种情况会发生在 MV 因执行聚合而经常针对不同输入数据生成相同结果时。- 在 MV 目标表上：来自不同 MV 的相同块也会被去重。 [#61601](https://github.com/ClickHouse/ClickHouse/pull/61601) ([Sema Checherinda](https://github.com/CheSema)).
* 函数 `bitShiftLeft` 和 `bitShitfRight` 在移位位置越界时会返回错误。[#65838](https://github.com/ClickHouse/ClickHouse/pull/65838) ([Pablo Marcos](https://github.com/pamarcos)).

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

* 为 `full_sorting_join` 算法添加 `ASOF JOIN` 支持。[#55051](https://github.com/ClickHouse/ClickHouse/pull/55051) ([vdimir](https://github.com/vdimir)).
* `clickhouse-client` 支持 JWT 身份验证 (仅在 ClickHouse Cloud 中可用) 。[#62829](https://github.com/ClickHouse/ClickHouse/pull/62829) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* 添加 SQL 函数 `changeYear`、`changeMonth`、`changeDay`、`changeHour`、`changeMinute`、`changeSecond`。例如，`SELECT changeMonth(toDate('2024-06-14'), 7)` 返回日期 `2024-07-14`。[#63186](https://github.com/ClickHouse/ClickHouse/pull/63186) ([cucumber95](https://github.com/cucumber95)).
* 引入启动脚本，可在启动阶段执行预先配置的查询。[#64889](https://github.com/ClickHouse/ClickHouse/pull/64889) ([pufit](https://github.com/pufit)).
* 在客户端配置中支持 accept\_invalid\_certificate，允许客户端通过安全 TCP 连接到使用自签名证书的服务器；可作为对应 `openSSL` 客户端设置 `verificationMode=none` + `invalidCertificateHandler.name=AcceptCertificateHandler` 的简写。[#65238](https://github.com/ClickHouse/ClickHouse/pull/65238) ([peacewalker122](https://github.com/peacewalker122)).
* 添加 system.error\_log，其中包含系统表 system.errors 中错误值的历史记录，并会定期写入磁盘。[#65381](https://github.com/ClickHouse/ClickHouse/pull/65381) ([Pablo Marcos](https://github.com/pamarcos)).
* 添加聚合函数 `groupConcat`。其作用与 `arrayStringConcat( groupArray(column), ',')` 基本相同。可接收 2 个参数：字符串分隔符和要处理的元素数量。[#65451](https://github.com/ClickHouse/ClickHouse/pull/65451) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* 添加 AzureQueue 存储。[#65458](https://github.com/ClickHouse/ClickHouse/pull/65458) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 添加一个新设置，用于启用或禁用将页面索引写入 Parquet 文件。[#65475](https://github.com/ClickHouse/ClickHouse/pull/65475) ([lgbo](https://github.com/lgbo-ustc)).
* 引入 `logger.console_log_level` 服务器配置，用于控制输出到控制台的日志级别 (如果已启用) 。[#65559](https://github.com/ClickHouse/ClickHouse/pull/65559) ([Azat Khuzhin](https://github.com/azat)).
* 使用表函数 `file` 时，会自动在目录路径末尾追加通配符 `*`。[#66019](https://github.com/ClickHouse/ClickHouse/pull/66019) ([Zhidong (David) Guo](https://github.com/Gun9niR)).
* 在非交互模式下为客户端添加 `--memory-usage` 选项。[#66393](https://github.com/ClickHouse/ClickHouse/pull/66393) ([vdimir](https://github.com/vdimir)).
* 为 clickhouse-disks 提供交互式客户端，并支持从本地目录添加本地磁盘。[#64446](https://github.com/ClickHouse/ClickHouse/pull/64446) ([Daniil Ivanik](https://github.com/divanik)).
* 当对带有 projection 的表执行轻量级删除时，用户可以选择抛出异常 (默认) 或删除该 projection。[#65594](https://github.com/ClickHouse/ClickHouse/pull/65594) ([jsc0218](https://github.com/jsc0218)).
* 添加系统表，包含所有 detached 表的主要信息。[#65400](https://github.com/ClickHouse/ClickHouse/pull/65400) ([Konstantin Morozov](https://github.com/k-morozov)).

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

* 更改 `Variant` 数据类型的二进制序列化：新增 `compact` 模式，避免对仅包含单一 Variant 或仅包含 NULL 值的粒度重复写入相同的判别器。新增默认启用的 MergeTree setting `use_compact_variant_discriminators_serialization`。请注意，Variant 类型仍处于实验阶段，因此序列化中不向后兼容的变更是可以接受的。[#62774](https://github.com/ClickHouse/ClickHouse/pull/62774) ([Kruglov Pavel](https://github.com/Avogar)).
* 支持 clickhouse-keeper 的磁盘 backend 存储。[#56626](https://github.com/ClickHouse/ClickHouse/pull/56626) ([Han Fei](https://github.com/hanfei1991)).
* 重构 JSONExtract 函数，支持更多类型，包括实验性的 Dynamic 类型。[#66046](https://github.com/ClickHouse/ClickHouse/pull/66046) ([Kruglov Pavel](https://github.com/Avogar)).
* 为 `Variant` 和 `Dynamic` 子列支持 null map 子列。[#66178](https://github.com/ClickHouse/ClickHouse/pull/66178) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复从经 ALTER 修改后的 `Memory` 表中读取 `Dynamic` 子列的问题。此前，如果通过 alter 修改了 `Memory` 表中 Dynamic 类型的 `max_types` 参数，后续读取子列时可能返回错误结果。[#66066](https://github.com/ClickHouse/ClickHouse/pull/66066) ([Kruglov Pavel](https://github.com/Avogar)).
* 新增对使用自定义键的并行副本场景下 `cluster_for_parallel_replicas` 的支持。这样即可在 MergeTree 表中将并行副本与自定义键配合使用。[#65453](https://github.com/ClickHouse/ClickHouse/pull/65453) ([Antonio Andelic](https://github.com/antonio2368)).

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

* 将 int 转字符串的算法替换为更快的实现 (从修改版 amdn/itoa 改为修改版 jeaiii/itoa) 。[#61661](https://github.com/ClickHouse/ClickHouse/pull/61661) ([Raúl Marín](https://github.com/Algunenano)) 。
* 现在会收集并缓存由 join (`parallel_hash` 算法) 创建的哈希表大小。这些信息将用于在后续查询执行时为哈希表预分配空间，从而减少哈希表扩容耗时。[#64553](https://github.com/ClickHouse/ClickHouse/pull/64553) ([Nikita Taranov](https://github.com/nickitat)) 。
* 通过缓冲机制，优化了带有 `ORDER BY` 主键且 `WHERE` 条件具有高选择性的查询。此行为由设置 `read_in_order_use_buffering` 控制 (默认启用) ，并且可能会增加查询的内存使用量。[#64607](https://github.com/ClickHouse/ClickHouse/pull/64607) ([Anton Popov](https://github.com/CurtizJ)) 。
* 提升了加载 `plain_rewritable` 元数据的性能。[#65634](https://github.com/ClickHouse/ClickHouse/pull/65634) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 在只读磁盘上附加表时，通过不加载过期分区片段来减少资源消耗。[#65635](https://github.com/ClickHouse/ClickHouse/pull/65635) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 支持 Set 索引的 minmax 超矩形。[#65676](https://github.com/ClickHouse/ClickHouse/pull/65676) ([AntiTopQuark](https://github.com/AntiTopQuark)) 。
* 卸载过期分区片段的主索引，以减少整体内存使用量。[#65852](https://github.com/ClickHouse/ClickHouse/pull/65852) ([Anton Popov](https://github.com/CurtizJ)) 。
* 当 pattern 很简单，即不包含元字符、字符类、标志、分组字符等时，函数 `replaceRegexpAll` 和 `replaceRegexpOne` 的执行速度现在会显著提升。 (感谢 Taiyang Li) 。[#66185](https://github.com/ClickHouse/ClickHouse/pull/66185) ([Robert Schulze](https://github.com/rschu1ze)) 。
* S3 请求：缩短查询的重试时间，并增加备份的重试次数。查询为 8.5 分钟和 100 次重试，备份恢复为 1.2 小时和 1000 次重试。[#65232](https://github.com/ClickHouse/ClickHouse/pull/65232) ([Sema Checherinda](https://github.com/CheSema)) 。
* 支持查询计划中的 LIMIT 优化。支持 PostgreSQL 存储和表函数的 LIMIT 下推。[#65454](https://github.com/ClickHouse/ClickHouse/pull/65454) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 改进了 ZooKeeper 负载均衡。即使设置了 `fallback_session_lifetime`，当前会话也会保持有效，直到最优节点重新可用。新增对 AZ 感知均衡的支持。[#65570](https://github.com/ClickHouse/ClickHouse/pull/65570) ([Alexander Tokmakov](https://github.com/tavplubix)) 。
* DatabaseCatalog 通过最多使用 `database_catalog_drop_table_concurrency` 个线程，可以更快地删除表。[#66065](https://github.com/ClickHouse/ClickHouse/pull/66065) ([Sema Checherinda](https://github.com/CheSema)) 。

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

* 改进了 ZooKeeper 负载均衡。即使设置了 `fallback_session_lifetime`，当前会话也会一直保持，直到最优节点恢复可用。新增了对 AZ 感知型负载均衡的支持。[#65570](https://github.com/ClickHouse/ClickHouse/pull/65570) ([Alexander Tokmakov](https://github.com/tavplubix)).
* 设置 `optimize_trivial_insert_select` 默认是禁用的。在大多数情况下，启用它应该会有好处。不过，如果你发现 INSERT SELECT 变慢了，或者内存占用增加了，可以重新将其启用，或执行 `SET compatibility = '24.6'`。[#58970](https://github.com/ClickHouse/ClickHouse/pull/58970) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 如果 `clickhouse-client` 或 `clickhouse-local` 崩溃，将打印堆栈跟踪和诊断信息。[#61109](https://github.com/ClickHouse/ClickHouse/pull/61109) ([Alexander Tokmakov](https://github.com/tavplubix)).
* `SHOW INDEX | INDEXES | INDICES | KEYS` 的结果此前会按主键列名排序。由于这种方式不够直观，现在改为按主键列在主键中的位置排序。[#61131](https://github.com/ClickHouse/ClickHouse/pull/61131) ([Robert Schulze](https://github.com/rschu1ze)).
* 更改了 Materialized View 的去重机制。修复了大量如下情况：- 在目标端表上：数据会被拆分为 2 个或更多块，而这些块在并行插入时会被视为重复。- 在 MV 目标端表上：相同的块会被去重；当 MV 因执行聚合而对不同的输入数据经常产生相同结果时，就会发生这种情况。- 在 MV 目标端表上：来自不同 MV 的相同块会被去重。[#61601](https://github.com/ClickHouse/ClickHouse/pull/61601) ([Sema Checherinda](https://github.com/CheSema)) 。
* 支持读取 DeltaLake 分区数据。通过读取元数据而非实际数据来推断 DeltaLake schema。[#63201](https://github.com/ClickHouse/ClickHouse/pull/63201) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 在可组合协议中，TLS 层此前仅接受 `certificateFile` 和 `privateKeyFile` 参数。[https://clickhouse.com/docs/operations/settings/composable-protocols。](https://clickhouse.com/docs/operations/settings/composable-protocols。) [#63985](https://github.com/ClickHouse/ClickHouse/pull/63985) ([Anton Ivashkin](https://github.com/ianton-ru)) 。
* 新增了 profile 事件 `SelectQueriesWithPrimaryKeyUsage`，用于表示有多少个 SELECT 查询在计算 WHERE 子句时使用了主键。[#64492](https://github.com/ClickHouse/ClickHouse/pull/64492) ([0x01f](https://github.com/0xfei)) 。
* 与 `StorageS3Queue` 相关的修复与改进。根据服务器上的物理 CPU 核心数推导 `s3queue_processing_threads_num` 的默认值 (而不是此前默认值为 1) 。将 `s3queue_loading_retries` 的默认值设为 10。修复 `system.s3queue` 的 exception 列中可能出现的含糊 “Uncaught exception” 提示。在发生 `MEMORY_LIMIT_EXCEEDED` 异常时不增加重试次数。将文件提交移到数据完全插入表之后的阶段，以避免文件在尚未插入时就被提交。新增设置 `s3queue_max_processed_files_before_commit`、`s3queue_max_processed_rows_before_commit`、`s3queue_max_processed_bytes_before_commit`、`s3queue_max_processing_time_sec_before_commit`，以更好地控制提交和 flush 时机。[#65046](https://github.com/ClickHouse/ClickHouse/pull/65046) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 在参数化视图函数中支持别名 (仅适用于新的 analyzer) 。[#65190](https://github.com/ClickHouse/ClickHouse/pull/65190) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 已更新，在 azureBlobStorage 的日志中对账户密钥进行脱敏。[#65273](https://github.com/ClickHouse/ClickHouse/pull/65273) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)) 。
* 当过滤表达式是 `PARTITION BY` 表达式的一部分时，可对 `IN` 谓词进行分区裁剪。[#65335](https://github.com/ClickHouse/ClickHouse/pull/65335) ([Eduard Karacharov](https://github.com/korowa)) 。
* `arrayMin`/`arrayMax` 适用于所有可比较的数据类型。[#65455](https://github.com/ClickHouse/ClickHouse/pull/65455) ([pn](https://github.com/chloro-pn)) 。
* 改进了 cgroups v2 的内存核算，不再计入页缓存占用的内存。 [#65470](https://github.com/ClickHouse/ClickHouse/pull/65470) ([Nikita Taranov](https://github.com/nickitat)).
* 在将 chunks 序列化并插入 EmbeddedRocksDB 表时，不要为每一行都创建格式设置。[#65474](https://github.com/ClickHouse/ClickHouse/pull/65474) ([Duc Canh Le](https://github.com/canhld94)) 。
* 将 `clickhouse-local` 的提示符简化为仅 `:)`。`getFQDNOrHostName()` 在 macOS 上耗时过长，而且我们本来也不希望在 `clickhouse-local` 的提示符中包含主机名。[#65510](https://github.com/ClickHouse/ClickHouse/pull/65510) ([Konstantin Bogdanov](https://github.com/thevar1able)) 。
* 避免在低配虚拟机上输出 jemalloc 关于每 CPU Arena 的提示信息。[#65532](https://github.com/ClickHouse/ClickHouse/pull/65532) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 默认禁用文件系统缓存的后台下载。待修复使用后台下载线程时可能出现的 "Memory limit exceeded" 问题后，我们会重新启用该功能；这是因为内存释放发生在查询上下文之外 (而缓冲区是在查询上下文内分配的) 。此外，我们还需要新增一个单独的设置，用于定义后台工作线程的最大下载大小 (当前受 max\_file\_segment\_size 限制，而这个值可能过大) 。[#65534](https://github.com/ClickHouse/ClickHouse/pull/65534) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 在配置中新增选项 `<config_reload_interval_ms>`，用于指定 ClickHouse 重新加载配置的频率。[#65545](https://github.com/ClickHouse/ClickHouse/pull/65545) ([alesapin](https://github.com/alesapin)) 。
* 为 ClickHouse 数据类型实现二进制编码，并在文档中补充其规范说明。在 Dynamic 的二进制序列化中使用该编码，并允许通过设置在 RowBinaryWithNamesAndTypes 和 Native 格式中使用它。[#65546](https://github.com/ClickHouse/ClickHouse/pull/65546) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 服务器设置 `compiled_expression_cache_size` 和 `compiled_expression_cache_elements_size` 现已在 `system.server_settings` 中显示。[#65584](https://github.com/ClickHouse/ClickHouse/pull/65584) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 新增了基于 x509 SubjectAltName 扩展的用户身份识别支持。[#65626](https://github.com/ClickHouse/ClickHouse/pull/65626) ([Anton Kozlov](https://github.com/tonickkozlov)) 。
* `clickhouse-local` 将遵循配置文件中的 `max_server_memory_usage` 和 `max_server_memory_usage_to_ram_ratio`。它还会像 `clickhouse-server` 一样，默认将最大内存使用量设置为系统 RAM 的 90%。[#65697](https://github.com/ClickHouse/ClickHouse/pull/65697) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 添加了一个将文件备份到 ClickHouse 的脚本。[#65699](https://github.com/ClickHouse/ClickHouse/pull/65699) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* PostgreSQL 源现已支持取消查询。[#65722](https://github.com/ClickHouse/ClickHouse/pull/65722) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 使 `allow_experimental_analyzer` 由分布式查询的 initiator 来控制。这可确保在混合版本集群中执行操作时的兼容性和正确性。[#65777](https://github.com/ClickHouse/ClickHouse/pull/65777) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* Keeper 中现已遵循 cgroup CPU 限制。[#65819](https://github.com/ClickHouse/ClickHouse/pull/65819) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 允许 `concat` 函数使用空参数：`:) select concat();`。 [#65887](https://github.com/ClickHouse/ClickHouse/pull/65887) ([李扬](https://github.com/taiyang-li)).
* 允许在 `clickhouse-local` 中管理 named collections。[#65973](https://github.com/ClickHouse/ClickHouse/pull/65973) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 改进了与 Azure 相关的 profile events。[#65999](https://github.com/ClickHouse/ClickHouse/pull/65999) ([alesapin](https://github.com/alesapin)) 。
* 支持按写入端的时区读取 ORC 文件。 [#66025](https://github.com/ClickHouse/ClickHouse/pull/66025) ([kevinyhzou](https://github.com/KevinyhZou)).
* 新增了用于控制 PostgreSQL 连接的设置。设置 `postgresql_connection_attempt_timeout` 指定传递给连接 URL 中 `connect_timeout` 参数的值。设置 `postgresql_connection_pool_retries` 指定与 PostgreSQL 端点建立连接时的重试次数。[#66232](https://github.com/ClickHouse/ClickHouse/pull/66232) ([Dmitry Novik](https://github.com/novikd)) 。
* 降低 `system.processors_profile_log` 中 `input_wait_elapsed_us`/`elapsed_us` 的误差。[#66239](https://github.com/ClickHouse/ClickHouse/pull/66239) ([Azat Khuzhin](https://github.com/azat)) 。
* 改进文件系统缓存相关的 ProfileEvents。[#66249](https://github.com/ClickHouse/ClickHouse/pull/66249) ([zhukai](https://github.com/nauu)) 。
* 添加了相关设置，以便在使用带复制的存储进行命名集合管理时忽略查询中的 `ON CLUSTER` 子句。[#66288](https://github.com/ClickHouse/ClickHouse/pull/66288) ([MikhailBurdukov](https://github.com/MikhailBurdukov)) 。
* 函数 `generateSnowflakeID` 现在支持将机器 ID 作为参数指定，以避免在大型集群中发生冲突。[#66374](https://github.com/ClickHouse/ClickHouse/pull/66374) ([ZAWA\_ll](https://github.com/Zawa-ll)) 。
* 在 interactive mode 下禁用 `Ctrl+Z` 挂起功能。这是个常见陷阱，而且对几乎所有用户来说都不是预期行为。我想，或许只有极少数特别资深的重度用户会喜欢把终端应用挂到后台，但我一个也不认识。[#66511](https://github.com/ClickHouse/ClickHouse/pull/66511) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 新增了在字典中校验主键类型的选项。没有此选项时，对于简单布局，任何列类型都会被隐式转换为 UInt64。[#66595](https://github.com/ClickHouse/ClickHouse/pull/66595) ([MikhailBurdukov](https://github.com/MikhailBurdukov)).

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

* 检查 CREATE/REPLACE/RENAME/EXCHANGE 查询中的循环依赖，并在存在循环依赖时抛出异常。此前，这类循环依赖可能会在服务器启动期间导致死锁。此外，还修复了一些依赖创建过程中的问题。[#65405](https://github.com/ClickHouse/ClickHouse/pull/65405) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复函数调用中 `LowCardinality` 列大小不符合预期的问题。[#65298](https://github.com/ClickHouse/ClickHouse/pull/65298) ([Raúl Marín](https://github.com/Algunenano)) 。
* 修复了 maxIntersections 中的崩溃问题。[#65689](https://github.com/ClickHouse/ClickHouse/pull/65689) ([Raúl Marín](https://github.com/Algunenano)) 。
* 修复了用户定义中 `VALID UNTIL` 子句在重启后被重置的问题。[#66409](https://github.com/ClickHouse/ClickHouse/pull/66409) ([Nikolay Degterinsky](https://github.com/evillique)).
* 修复 `SHOW MERGES` 中剩余时间列的问题。[#66735](https://github.com/ClickHouse/ClickHouse/pull/66735) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* `Query was cancelled` 可能会在 clickhouse-client 中输出两次。此问题已修复。[#66005](https://github.com/ClickHouse/ClickHouse/pull/66005) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* 修复了在将 `MaterializedMySQL` (这是一个不受支持的 Experimental 功能) 与 TABLE OVERRIDE 配合使用时，如果把 MySQL 的 NULL 字段映射到 ClickHouse 的 NOT NULL 字段，会发生崩溃的问题。[#54649](https://github.com/ClickHouse/ClickHouse/pull/54649) ([Filipp Ozinov](https://github.com/bakwc)).
* 修复了以下逻辑错误：当 `PREWHERE` 表达式未读取任何列，且表不具备自适应索引粒度 (非常老的表) 时会触发该错误。[#59173](https://github.com/ClickHouse/ClickHouse/pull/59173) ([Alexander Gololobov](https://github.com/davenger)).
* 修复了取消查询时取消缓冲区相关的错误。[#64478](https://github.com/ClickHouse/ClickHouse/pull/64478) ([Sema Checherinda](https://github.com/CheSema)).
* 修复在 `columns.txt` 不存在时，从元数据填充 parts 列的问题。[#64757](https://github.com/ClickHouse/ClickHouse/pull/64757) ([Azat Khuzhin](https://github.com/azat)).
* 修复 `ALTER TABLE ... ON CLUSTER ... MODIFY SQL SECURITY` 导致的崩溃问题。 [#64957](https://github.com/ClickHouse/ClickHouse/pull/64957) ([pufit](https://github.com/pufit)).
* 修复销毁 AccessControl 时发生崩溃的问题：添加显式关闭。 [#64993](https://github.com/ClickHouse/ClickHouse/pull/64993) ([Vitaly Baranov](https://github.com/vitlibar)).
* 递归消除 `uniq*` 函数参数中的 injective function。此前该功能原本可正常工作，但在新的 analyzer 中失效了。[#65140](https://github.com/ClickHouse/ClickHouse/pull/65140) ([Duc Canh Le](https://github.com/canhld94)) 。
* 修复了在带 CTE 的查询中出现意外投影名称的问题。[#65267](https://github.com/ClickHouse/ClickHouse/pull/65267) ([wudidapaopao](https://github.com/wudidapaopao)).
* 通过直接查询或 `Dictionary` 表引擎访问字典时，需具备 `dictGet` 权限。[#65359](https://github.com/ClickHouse/ClickHouse/pull/65359) ([Joe Lynch](https://github.com/joelynch)) 。
* 修复增量备份中用户专属 S3 认证的问题。[#65481](https://github.com/ClickHouse/ClickHouse/pull/65481) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 如果启用了 `read-in-order` 优化，则对带有 `FINAL` 的查询禁用 `non-intersecting-parts` 优化，否则可能导致查询结果不正确。作为临时解决办法，在此修复合并前，请禁用 `do_not_merge_across_partitions_select_final` 和 `split_parts_ranges_into_intersecting_and_non_intersecting_final`。[#65505](https://github.com/ClickHouse/ClickHouse/pull/65505) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了在列表批次中的所有文件都被过滤掉时出现 `Index out of bound for blob metadata` 异常的问题。[#65523](https://github.com/ClickHouse/ClickHouse/pull/65523) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复投影去重合并时的 NOT\_FOUND\_COLUMN\_IN\_BLOCK 错误。[#65573](https://github.com/ClickHouse/ClickHouse/pull/65573) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* 修复了 MergeJoin 中的一个 bug。在稀疏序列化中，某列可能会被当作其嵌套类型的列处理，但实际上并未执行所需的转换。[#65632](https://github.com/ClickHouse/ClickHouse/pull/65632) ([Nikita Taranov](https://github.com/nickitat)).
* 修复了兼容性级别 '23.4' 未正确生效的问题。[#65737](https://github.com/ClickHouse/ClickHouse/pull/65737) ([cw5121](https://github.com/cw5121)) 。
* 修复了包含 Nullable 字段的 odbc 表问题。[#65738](https://github.com/ClickHouse/ClickHouse/pull/65738) ([Rodolphe Dugé de Bernonville](https://github.com/RodolpheDuge)).
* 修复了 `TCPHandler` 中可能在发生致命错误时出现的数据竞争问题。[#65744](https://github.com/ClickHouse/ClickHouse/pull/65744) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 修复函数 `parseDateTime` 在使用 `%F` 和 `%D` 占位符时抛出错误异常的问题。[#65768](https://github.com/ClickHouse/ClickHouse/pull/65768) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 对于从 `PostgreSQL` 读取数据的查询，如果 ClickHouse 查询已完成，则会取消内部的 `PostgreSQL` 查询。否则，在内部 `PostgreSQL` 查询完成之前，`ClickHouse` 查询无法取消。[#65771](https://github.com/ClickHouse/ClickHouse/pull/65771) ([Maksim Kita](https://github.com/kitaisreal)).
* 修复了在使用旧版 analyzer 和 `dictGetOrDefault` 时短路逻辑中的一个 bug。[#65802](https://github.com/ClickHouse/ClickHouse/pull/65802) ([jsc0218](https://github.com/jsc0218)).
* 修复了一个会导致启用生存时间 (TTL) 写入的 EmbeddedRocksDB 生成损坏 SST 文件的 bug。[#65816](https://github.com/ClickHouse/ClickHouse/pull/65816) ([Duc Canh Le](https://github.com/canhld94)) 。
* 函数 `bitTest`、`bitTestAll` 和 `bitTestAny` 现在会在指定的位索引越界时返回错误 [#65818](https://github.com/ClickHouse/ClickHouse/pull/65818) ([Pablo Marcos](https://github.com/pamarcos)) 。
* 设置 `join_any_take_last_row` 现已支持在任何使用哈希 join 的查询中使用。[#65820](https://github.com/ClickHouse/ClickHouse/pull/65820) ([vdimir](https://github.com/vdimir)).
* 更好地处理包含 `IS NULL` 检查的 JOIN 条件 (例如，`ON (a = b AND (a IS NOT NULL) AND (b IS NOT NULL) ) OR ( (a IS NULL) AND (b IS NULL) )` 会被重写为 `ON a <=> b`) ，修复了在存在 `IS NULL` 之外的其他条件时出现的错误优化问题。[#65835](https://github.com/ClickHouse/ClickHouse/pull/65835) ([vdimir](https://github.com/vdimir)) 。
* 修复 S3Queue 中内存占用持续增长的问题。[#65839](https://github.com/ClickHouse/ClickHouse/pull/65839) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 修复 `arrayAUC` 中并列值的处理问题，使其与 sklearn 保持一致。[#65840](https://github.com/ClickHouse/ClickHouse/pull/65840) ([gabrielmcg44](https://github.com/gabrielmcg44)) 。
* 修复 MySQL 服务器协议中 TLS 连接可能存在的问题。 [#65917](https://github.com/ClickHouse/ClickHouse/pull/65917) ([Azat Khuzhin](https://github.com/azat)).
* 修复 MySQL 客户端协议中 TLS 连接可能存在的问题。[#65938](https://github.com/ClickHouse/ClickHouse/pull/65938) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了在零超时情况下对 `SSL_ERROR_WANT_READ`/`SSL_ERROR_WANT_WRITE` 的处理问题。[#65941](https://github.com/ClickHouse/ClickHouse/pull/65941) ([Azat Khuzhin](https://github.com/azat)).
* 由于这些设置可能会改变最终的 schema，因此在 schema inference cache 中加入了缺失的设置 `input_format_csv_skip_first_lines/input_format_tsv_skip_first_lines/input_format_csv_try_infer_numbers_from_strings/input_format_csv_try_infer_strings_from_quoted_tuples`。这样可以避免在这些设置变更后，schema inference 产生错误结果。[#65980](https://github.com/ClickHouse/ClickHouse/pull/65980) ([Kruglov Pavel](https://github.com/Avogar)) 。
* S3 引擎和 S3 表函数中的列 \_size 表示的是归档内文件的大小，而不是归档本身的大小。[#65993](https://github.com/ClickHouse/ClickHouse/pull/65993) ([Daniil Ivanik](https://github.com/divanik)) 。
* 修复 analyzer 中动态子列的解析问题，并避免在读取动态子列时读取整列。[#66004](https://github.com/ClickHouse/ClickHouse/pull/66004) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复了使用 `replace` 覆盖时 `from_env` 的配置合并问题。[#66034](https://github.com/ClickHouse/ClickHouse/pull/66034) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了 `GRPCServer` 在关闭过程中可能卡住的问题。[#66061](https://github.com/ClickHouse/ClickHouse/pull/66061) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复了函数 `has` 在处理非常量 `LowCardinality` 参数时的若干问题。[#66088](https://github.com/ClickHouse/ClickHouse/pull/66088) ([Anton Popov](https://github.com/CurtizJ)).
* 修复了 `groupArrayIntersect`：其在 `merge()` 函数中的行为不正确。此外，还修复了 `deserialise()` 对数值和一般数据的处理行为。[#66103](https://github.com/ClickHouse/ClickHouse/pull/66103) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* 修复了 `unbin`/`unhex` 实现中的缓冲区溢出问题。[#66106](https://github.com/ClickHouse/ClickHouse/pull/66106) ([Nikita Taranov](https://github.com/nickitat)).
* 禁用在 [#64760](https://github.com/ClickHouse/ClickHouse/issues/64760) 中引入的 `merge-filters` 优化。如果该优化在合并两个过滤表达式时未采用短路求值，可能会引发异常。[#66126](https://github.com/ClickHouse/ClickHouse/pull/66126) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了一个问题：服务器在解析使用负块大小数组编码的 Avro 文件时会失败，而这种编码现已被 Avro 规范允许。[#66130](https://github.com/ClickHouse/ClickHouse/pull/66130) ([Serge Klochkov](https://github.com/slvrtrn)) 。
* 修复了 ZooKeeper 客户端中的一个缺陷：会话在收到来自 ZooKeeper 的硬件错误后，可能会卡在不可用状态。例如，这种情况可能是由 ClickHouse Keeper 中的 "软内存限制" 引起的。[#66140](https://github.com/ClickHouse/ClickHouse/pull/66140) ([Alexander Tokmakov](https://github.com/tavplubix)).
* 修复 SumIfToCountIfVisitor 和有符号整数相关问题。[#66146](https://github.com/ClickHouse/ClickHouse/pull/66146) ([Raúl Marín](https://github.com/Algunenano)) 。
* 修复了 Distributed 查询结果中罕见的数据缺失问题。[#66174](https://github.com/ClickHouse/ClickHouse/pull/66174) ([vdimir](https://github.com/vdimir)).
* 修复 StorageDeltaLake 中元数据字段的解析顺序。[#66211](https://github.com/ClickHouse/ClickHouse/pull/66211) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 对于 `distributed_ddl_output_mode` 的 `none_only_active` 模式，不再抛出 `TIMEOUT_EXCEEDED`。 [#66218](https://github.com/ClickHouse/ClickHouse/pull/66218) ([Alexander Tokmakov](https://github.com/tavplubix)).
* 修复了在无法使用索引时，`system.numbers_mt` 的 limit 处理问题。 [#66231](https://github.com/ClickHouse/ClickHouse/pull/66231) ([János Benjamin Antal](https://github.com/antaljanosbenjamin)).
* 修复了 ClickHouse server 在 Docker 等容器中运行时，无法按照 cgroups v2 的设置正确检测最大可用 CPU 核心数的问题。更具体地说，容器通常会在名称为空的根 cgroup 中运行其进程。在这种情况下，ClickHouse 会忽略 cgroups v2 设置的 CPU 限制。[#66237](https://github.com/ClickHouse/ClickHouse/pull/66237) ([filimonov](https://github.com/filimonov)) 。
* 修复了在约束条件中使用带有 `IN` 的子查询时出现的 `Not-ready set` 错误。[#66261](https://github.com/ClickHouse/ClickHouse/pull/66261) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复复制到 S3 或 AzureBlobStorage 时的报错问题。[#66295](https://github.com/ClickHouse/ClickHouse/pull/66295) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 防止 watchdog 持有已取消链接 (轮转后) 的日志文件描述符。[#66334](https://github.com/ClickHouse/ClickHouse/pull/66334) ([Aleksei Filatov](https://github.com/aalexfvk)) 。
* 修复了 logicalexpressionoptimizerpass 中常量逻辑类型丢失的问题。[#66344](https://github.com/ClickHouse/ClickHouse/pull/66344) ([pn](https://github.com/chloro-pn)).
* 修复在启用 `group_by_use_nulls=true` 和新版 analyzer 时出现的 `Column identifier is already registered` 错误。[#66400](https://github.com/ClickHouse/ClickHouse/pull/66400) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 修复了在对 external engine 表 (如 PostgreSQL) 执行连接和过滤时，由于过滤器下推过于激进，查询结果可能不正确的问题。从现在起，在与外部表进行外连接时，`where` 部分中的条件将不会发送到外部数据库。[#66402](https://github.com/ClickHouse/ClickHouse/pull/66402) ([vdimir](https://github.com/vdimir)).
* 为 cross join 补充了缺失的列物化。[#66413](https://github.com/ClickHouse/ClickHouse/pull/66413) ([lgbo](https://github.com/lgbo-ustc)).
* 修复了在启用新 analyzer 时，`GROUP BY` 键中包含常量表达式的查询报出 `Cannot find column` 错误的问题。[#66433](https://github.com/ClickHouse/ClickHouse/pull/66433) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 避免在数组嵌套层级不正确时从 Npy 格式导入可能导致的逻辑错误，并修复了对其他类型错误的测试。[#66461](https://github.com/ClickHouse/ClickHouse/pull/66461) ([Yarik Briukhovetskyi](https://github.com/yariks5s)) 。
* 修复谓词中包含非确定性函数时 count() 结果错误的问题。 [#66510](https://github.com/ClickHouse/ClickHouse/pull/66510) ([Duc Canh Le](https://github.com/canhld94)).
* 正确统计 `Allocator::realloc` 的内存使用情况。[#66548](https://github.com/ClickHouse/ClickHouse/pull/66548) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 修复了对空 Tuple 进行哈希计算时读取未初始化内存的问题。[#66562](https://github.com/ClickHouse/ClickHouse/pull/66562) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 修复了带有 `WINDOW` 的查询返回无效结果的问题。当 `PARTITION` 列采用稀疏序列化且窗口函数并行执行时，可能会出现这种情况。[#66579](https://github.com/ClickHouse/ClickHouse/pull/66579) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复删除本地存储中的命名集合时出现的问题。[#66599](https://github.com/ClickHouse/ClickHouse/pull/66599) ([János Benjamin Antal](https://github.com/antaljanosbenjamin)) 。
* 修复了 `ColumnTuple::insertManyFrom` 中 `column_length` 未更新的问题。[#66626](https://github.com/ClickHouse/ClickHouse/pull/66626) ([lgbo](https://github.com/lgbo-ustc)) 。
* 修复了包含表达式 `(column IS NULL).` 的查询中出现 `Unknown identifier` 和 `Column is not under aggregate function` 错误的问题。该缺陷由 [#65088](https://github.com/ClickHouse/ClickHouse/issues/65088) 引发，且仅在禁用 analyzer 时才会出现。[#66654](https://github.com/ClickHouse/ClickHouse/pull/66654) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了在将标量子查询用作 IN 的第一个参数时 (使用新的 analyzer) 出现的 `Method getResultType is not supported for QUERY query node` 错误。[#66655](https://github.com/ClickHouse/ClickHouse/pull/66655) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 修复读取 Variant 子列时可能发生的 PARAMETER\_OUT\_OF\_BOUND 错误。[#66659](https://github.com/ClickHouse/ClickHouse/pull/66659) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了删除列后合并操作卡住的罕见问题。[#66707](https://github.com/ClickHouse/ClickHouse/pull/66707) ([Raúl Marín](https://github.com/Algunenano)) 。
* 修复了从远程数据源执行 `insert select` 时的 `isUniqTypes` 断言问题。[#66722](https://github.com/ClickHouse/ClickHouse/pull/66722) ([Sema Checherinda](https://github.com/CheSema)) 。
* 修复了 PrometheusRequestHandler 中的逻辑错误。[#66621](https://github.com/ClickHouse/ClickHouse/pull/66621) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复了由 fuzzer 发现的 `indexHint` 函数大小写问题。[#66286](https://github.com/ClickHouse/ClickHouse/pull/66286) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复 'create table b empty as a' 的 AST 格式化问题。[#64951](https://github.com/ClickHouse/ClickHouse/pull/64951) ([Michael Kolupaev](https://github.com/al13n321)) 。

### <a id="246" /> ClickHouse 24.6 发行版，2024-07-01。[Presentation](https://presentations.clickhouse.com/2024-release-24.6/), [Video](https://www.youtube.com/watch?v=BK-x8lpvOQw)

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

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

* 默认启用数据库和表的异步加载。请参见 config.xml 中的 `async_load_databases`。虽然此更改本身完全兼容，但可能会带来行为上的差异。当 `async_load_databases` 为 false 时，与之前版本一样，服务器在所有表加载完成之前不会接受连接。当 `async_load_databases` 为 true 时，与新版本一样，服务器可以在所有表尚未全部加载完成前接受连接。如果对尚未加载的表发起查询，查询将等待该表加载完成，这可能需要相当长的时间。如果服务器是大型 Distributed 系统中由负载均衡器管理的一部分，这可能会改变系统行为。在第一种情况下，负载均衡器可能会收到连接被拒绝的响应，并快速故障转移到另一台服务器。在第二种情况下，负载均衡器可能会连接到一台仍在加载表的服务器，此时查询延迟会更高。此外，如果大量查询积压在等待状态，当它们同时开始处理时，可能会引发“惊群”问题。这种差异通常只会在高负载的分布式 backend 中体现。你可以将 `async_load_databases` 设置为 false 以避免该问题。[#57695](https://github.com/ClickHouse/ClickHouse/pull/57695) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 对于 `MergeTree` 表，默认启用设置 `replace_long_file_name_to_hash`。[#64457](https://github.com/ClickHouse/ClickHouse/pull/64457) ([Anton Popov](https://github.com/CurtizJ)). 此设置完全兼容，升级期间无需执行任何操作。从 23.9 开始的所有版本都支持新数据格式。启用此设置后，你将无法再降级到 23.8 或更早版本。
* 某些无效查询会在 parsing 阶段更早失败。注意：已禁用对内联 KQL expression (实验性的 Kusto 语言) 的支持，即当它们放在 `kql` table function 中但不是字符串字面量时，例如 `kql(garbage | trash)`，而不是 `kql('garbage | trash')` 或 `kql($$garbage | trash$$)`。此功能是无意中引入的，本不应存在。[#61500](https://github.com/ClickHouse/ClickHouse/pull/61500) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 重新设计了存储 `S3Queue` 的 `Ordered` 模式下的并行处理。如果你使用了设置 `s3queue_processing_threads_num` 或 `s3queue_total_shards_num`，则此 PR 对 Ordered 模式属于不向后兼容的更改。设置 `s3queue_total_shards_num` 已被删除；此前它只允许在 `s3queue_allow_experimental_sharded_mode` 下使用，而后者现已 Deprecated。新增了一个设置——`s3queue_buckets`。[#64349](https://github.com/ClickHouse/ClickHouse/pull/64349) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 新增了函数 `snowflakeIDToDateTime`、`snowflakeIDToDateTime64`、`dateTimeToSnowflakeID` 和 `dateTime64ToSnowflakeID`。与现有函数 `snowflakeToDateTime`、`snowflakeToDateTime64`、`dateTimeToSnowflake` 和 `dateTime64ToSnowflake` 不同，新函数与 `generateSnowflakeID` 兼容，也就是说，它们接受由 `generateSnowflakeID` 生成的 Snowflake ID，并生成与 `generateSnowflakeID` 相同类型的 Snowflake ID (即 `UInt64`) 。此外，新函数默认使用 UNIX 纪元 (即 1970-01-01) ，与 `generateSnowflakeID` 一致。如有需要，也可以传入不同的纪元，例如 Twitter/X 的纪元 2010-11-04，也就是自 UNIX 纪元以来的 1288834974657 毫秒。旧的 conversion functions 已 Deprecated，并将在过渡期后移除：如果仍需使用它们，请启用设置 `allow_deprecated_snowflake_conversion_functions`。[#64948](https://github.com/ClickHouse/ClickHouse/pull/64948) ([Robert Schulze](https://github.com/rschu1ze)).

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

* 支持将 named collections 存储在 ClickHouse Keeper 中。[#64574](https://github.com/ClickHouse/ClickHouse/pull/64574) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 支持空 Tuple。[#55061](https://github.com/ClickHouse/ClickHouse/pull/55061) ([Amos Bird](https://github.com/amosbird)) 。
* 新增希尔伯特曲线编码和解码函数。[#60156](https://github.com/ClickHouse/ClickHouse/pull/60156) ([Artem Mustafin](https://github.com/Artemmm91)) 。
* 新增对 `hilbertEncode` 的索引分析支持。[#64662](https://github.com/ClickHouse/ClickHouse/pull/64662) ([Artem Mustafin](https://github.com/Artemmm91)) 。
* 新增支持使用函数 `readWKTLineString` 读取 WKT 格式的 `LINESTRING` 几何类型。[#62519](https://github.com/ClickHouse/ClickHouse/pull/62519) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 允许附加来自其他磁盘的 parts。[#63087](https://github.com/ClickHouse/ClickHouse/pull/63087) ([Unalian](https://github.com/Unalian)) 。
* 新增了用于生成 Twitter 风格 Snowflake ID 的 SQL 函数 `generateSnowflakeID`。[#63577](https://github.com/ClickHouse/ClickHouse/pull/63577) ([Danila Puzov](https://github.com/kazalika)) 。
* 新增了 `merge_workload` 和 `mutation_workload` 设置，用于控制资源在合并、变更和其他工作负载之间的使用与共享方式。[#64061](https://github.com/ClickHouse/ClickHouse/pull/64061) ([Sergei Trifonov](https://github.com/serxa)) 。
* 新增了对使用 `=` 运算符比较 `IPv4` 和 `IPv6` 类型的支持。[#64292](https://github.com/ClickHouse/ClickHouse/pull/64292) ([Francisco J. Jurado Moreno](https://github.com/Beetelbrox)) 。
* 支持二元数学函数 (pow、atan2、max2、min2、hypot) 接受 decimal 类型参数。[#64582](https://github.com/ClickHouse/ClickHouse/pull/64582) ([Mikhail Gorshkov](https://github.com/mgorshkov)) 。
* 新增 SQL 函数 `parseReadableSize` (以及 `OrNull` 和 `OrZero` 变体) 。[#64742](https://github.com/ClickHouse/ClickHouse/pull/64742) ([Francisco J. Jurado Moreno](https://github.com/Beetelbrox)) 。
* 新增服务器级设置 `max_table_num_to_throw` 和 `max_database_num_to_throw`，用于限制 `CREATE` 查询中的数据库或表数量。[#64781](https://github.com/ClickHouse/ClickHouse/pull/64781) ([Xu Jia](https://github.com/XuJia0210)) 。
* 为文件类存储 (s3/file/hdfs/url/azureBlobStorage) 添加 `_time` 虚拟列。[#64947](https://github.com/ClickHouse/ClickHouse/pull/64947) ([Ilya Golshtein](https://github.com/ilejn)) 。
* 新增了函数 `base64URLEncode`、`base64URLDecode` 和 `tryBase64URLDecode`。[#64991](https://github.com/ClickHouse/ClickHouse/pull/64991) ([Mikhail Gorshkov](https://github.com/mgorshkov)) 。
* 新增函数 `editDistanceUTF8`，用于计算两个 UTF8 字符串之间的[编辑距离](https://en.wikipedia.org/wiki/Edit_distance)。[#65269](https://github.com/ClickHouse/ClickHouse/pull/65269) ([LiuNeng](https://github.com/liuneng1994)) 。
* 添加 `http_response_headers` 配置，以支持在自定义 HTTP 处理器中使用自定义响应头。[#63562](https://github.com/ClickHouse/ClickHouse/pull/63562) ([Grigorii](https://github.com/GSokol)) 。
* 新增了一个新的表函数 `loop`，支持以无限循环的方式返回查询结果。[#63452](https://github.com/ClickHouse/ClickHouse/pull/63452) ([Sariel](https://github.com/sarielwxm)) 。这在测试时很有用。
* 在 `system.query_log` 中新增了两个列：`used_privileges` 和 `missing_privileges`。`used_privileges` 会记录查询执行期间检查过的权限，`missing_privileges` 包含所需但缺失的权限。[#64597](https://github.com/ClickHouse/ClickHouse/pull/64597) ([Alexey Katsman](https://github.com/alexkats)) 。
* 新增了一个设置 `output_format_pretty_display_footer_column_names`。启用后，对于较长的表 (默认 50 行) ，会在表格末尾显示列名；最小行数阈值由 `output_format_pretty_display_footer_column_names_min_rows` 控制。[#65144](https://github.com/ClickHouse/ClickHouse/pull/65144) ([Shaun Struwig](https://github.com/Blargian)) 。

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

* 引入“不同值数量”类型的统计信息。[#59357](https://github.com/ClickHouse/ClickHouse/pull/59357) ([Han Fei](https://github.com/hanfei1991)).
* 支持在 ReplicatedMergeTree 中使用统计信息。[#64934](https://github.com/ClickHouse/ClickHouse/pull/64934) ([Han Fei](https://github.com/hanfei1991)).
* 如果为 `Replicated` 数据库配置了“副本组”，则会自动创建一个包含所有组中副本的集群。[#64312](https://github.com/ClickHouse/ClickHouse/pull/64312) ([Alexander Tokmakov](https://github.com/tavplubix)).
* 添加设置 `parallel_replicas_custom_key_range_lower` 和 `parallel_replicas_custom_key_range_upper`，用于控制带有动态分片的并行副本在使用范围过滤器时如何并行处理查询。[#64604](https://github.com/ClickHouse/ClickHouse/pull/64604) ([josh-hildred](https://github.com/josh-hildred)).

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

* 新增了在插入期间重排行顺序的功能，可在不违反 `PRIMARY KEY` 设定顺序的情况下优化数据大小。该功能由设置 `optimize_row_order` 控制 (默认关闭) 。[#63578](https://github.com/ClickHouse/ClickHouse/pull/63578) ([Igor Markelov](https://github.com/ElderlyPassionFruit)) 。
* 新增原生 Parquet 读取器，可将 Parquet 二进制数据直接读入 ClickHouse 列。由设置 `input_format_parquet_use_native_reader` 控制 (默认禁用) 。[#60361](https://github.com/ClickHouse/ClickHouse/pull/60361) ([ZhiHong Zhang](https://github.com/copperybean)) 。
* 当查询过滤器能够从 MergeTree 表中精确选取范围时，支持部分 trivial count 优化。[#60463](https://github.com/ClickHouse/ClickHouse/pull/60463) ([Amos Bird](https://github.com/amosbird)) 。
* 通过在单个转换中汇集多个线程的数据块，降低多线程 `INSERT` 的最大内存占用。[#61047](https://github.com/ClickHouse/ClickHouse/pull/61047) ([Yarik Briukhovetskyi](https://github.com/yariks5s)) 。
* 在使用 Azure 对象存储时，通过采用固定内存分配并避免分配额外缓冲区，减少内存占用。[#63160](https://github.com/ClickHouse/ClickHouse/pull/63160) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)).
* 减少 `ColumnNullable::size` 中的虚函数调用次数。[#60556](https://github.com/ClickHouse/ClickHouse/pull/60556) ([HappenLee](https://github.com/HappenLee)).
* 当正则表达式参数为单个字符时，提升 `splitByRegexp` 的速度。[#62696](https://github.com/ClickHouse/ClickHouse/pull/62696) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 通过跟踪已使用键的最小值和最大值，加快 8 位和 16 位键的聚合速度。这可以减少需要验证的槽位数量。[#62746](https://github.com/ClickHouse/ClickHouse/pull/62746) ([Jiebin Sun](https://github.com/jiebinn)) 。
* 当左侧操作数为 `LowCardinality`、右侧为常量集合时，优化 `IN` 运算符。[#64060](https://github.com/ClickHouse/ClickHouse/pull/64060) ([Zhiguo Zhou](https://github.com/ZhiguoZh)) 。
* 在线程池中初始化和销毁 `ConcurrentHashJoin` 内部的哈希表。[#64241](https://github.com/ClickHouse/ClickHouse/pull/64241) ([Nikita Taranov](https://github.com/nickitat)) 。
* 优化了稀疏列表的纵向合并。[#64311](https://github.com/ClickHouse/ClickHouse/pull/64311) ([Anton Popov](https://github.com/CurtizJ)) 。
* 启用了在垂直合并期间从远程文件系统预取数据的功能。这可改善数据存储在远程文件系统上的表在进行垂直合并时的延迟表现。[#64314](https://github.com/ClickHouse/ClickHouse/pull/64314) ([Anton Popov](https://github.com/CurtizJ)).
* 减少对 `ColumnSparse::filter` 中 `isDefault` 的冗余调用，以提升性能。[#64426](https://github.com/ClickHouse/ClickHouse/pull/64426) ([Jiebin Sun](https://github.com/jiebinn)) 。
* 通过发起多个异步 getChildren 请求，加快了 `find_super_nodes` 和 `find_big_family` keeper-client 命令的执行速度。[#64628](https://github.com/ClickHouse/ClickHouse/pull/64628) ([Alexander Gololobov](https://github.com/davenger)) 。
* 改进 `least`/`greatest` 对 Nullable 数值类型参数的处理。[#64668](https://github.com/ClickHouse/ClickHouse/pull/64668) ([KevinyhZou](https://github.com/KevinyhZou)) 。
* 允许合并查询计划中两个相邻的过滤步骤。如果过滤条件可以从父步骤下推，这将改进过滤器下推优化。[#64760](https://github.com/ClickHouse/ClickHouse/pull/64760) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 移除 vertical final 实现中的不当优化，并默认重新启用 vertical final 算法。[#64783](https://github.com/ClickHouse/ClickHouse/pull/64783) ([Duc Canh Le](https://github.com/canhld94)).
* 从过滤表达式中移除 ALIAS 节点。这样可略微提升带有 `PREWHERE` 的查询 (使用新的 analyzer 时) 的性能。[#64793](https://github.com/ClickHouse/ClickHouse/pull/64793) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 重新启用 OpenSSL 会话缓存。[#65111](https://github.com/ClickHouse/ClickHouse/pull/65111) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 新增了用于禁用在插入时物化跳过索引和统计信息的设置 (`materialize_skip_indexes_on_insert` 和 `materialize_statistics_on_insert`) 。[#64391](https://github.com/ClickHouse/ClickHouse/pull/64391) ([Anton Popov](https://github.com/CurtizJ)) 。
* 使用已分配的内存大小来计算行组大小，并降低单线程模式下 Parquet 写入器的峰值内存占用。[#64424](https://github.com/ClickHouse/ClickHouse/pull/64424) ([LiuNeng](https://github.com/liuneng1994)).
* 改进稀疏列的迭代器，减少对 `size` 的调用。[#64497](https://github.com/ClickHouse/ClickHouse/pull/64497) ([Jiebin Sun](https://github.com/jiebinn)) 。
* 更新条件，使备份在 Azure Blob 存储中使用服务器端复制。[#64518](https://github.com/ClickHouse/ClickHouse/pull/64518) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)) 。
* 优化了具有大量跳过索引的表在垂直合并时的内存占用。[#64580](https://github.com/ClickHouse/ClickHouse/pull/64580) ([Anton Popov](https://github.com/CurtizJ)) 。

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

* 现在，对系统表执行 `SHOW CREATE TABLE` 时，会显示每个表专有且非常实用的注释，用来说明为什么需要这张表。[#63788](https://github.com/ClickHouse/ClickHouse/pull/63788) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* 函数 `round()`、`roundBankers()`、`floor()`、`ceil()` 和 `trunc()` 的第二个参数 (标度) 现在不再要求是常量。[#64798](https://github.com/ClickHouse/ClickHouse/pull/64798) ([Mikhail Gorshkov](https://github.com/mgorshkov)) 。
* 新增磁盘时，支持对 `Distributed` 表的存储策略进行热重载。[#58285](https://github.com/ClickHouse/ClickHouse/pull/58285) ([Duc Canh Le](https://github.com/canhld94)).
* 避免在服务饱和时调度线程过程中，MergeTree 索引分析期间可能发生的死锁。[#59427](https://github.com/ClickHouse/ClickHouse/pull/59427) ([Sean Haynes](https://github.com/seandhaynes)) 。
* 修复了 S3 proxy 支持和隧道传输中的若干次要边缘场景问题。[#63427](https://github.com/ClickHouse/ClickHouse/pull/63427) ([Arthur Passos](https://github.com/arthurpassos)) 。
* 改进 io\_uring 重提交的可见性。将 profile 事件 `IOUringSQEsResubmits` 重命名为 `IOUringSQEsResubmitsAsync`，并新增一个 profile 事件 `IOUringSQEsResubmitsSync`。[#63699](https://github.com/ClickHouse/ClickHouse/pull/63699) ([Tomer Shafir](https://github.com/tomershafir)) 。
* 新增了一个新设置 `metadata_keep_free_space_bytes`，用于在元数据存储磁盘上保留空闲空间。[#64128](https://github.com/ClickHouse/ClickHouse/pull/64128) ([MikhailBurdukov](https://github.com/MikhailBurdukov)).
* 新增了指标，用于跟踪 `plain_rewritable` 元数据存储创建和删除的目录数量，以及本地到远程内存映射中的条目数。[#64175](https://github.com/ClickHouse/ClickHouse/pull/64175) ([Julia Kartseva](https://github.com/jkartseva)) 。
* 现在，查询缓存会将内容相同但设置不同的查询视为不同的查询。这在不同设置 (例如 `limit` 或 `additional_table_filters`) 会影响查询结果时，提高了稳健性。[#64205](https://github.com/ClickHouse/ClickHouse/pull/64205) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 支持将对象存储中的非标准错误代码 `QpsLimitExceeded` 视为可重试错误。[#64225](https://github.com/ClickHouse/ClickHouse/pull/64225) ([Sema Checherinda](https://github.com/CheSema)) 。
* 如果该表的 ZooKeeper 路径已存在，则禁止将 MergeTree 表转换为带副本的表。[#64244](https://github.com/ClickHouse/ClickHouse/pull/64244) ([Kirill](https://github.com/kirillgarbar)) 。
* 新增了一个新设置 `input_format_parquet_prefer_block_bytes`，用于控制平均输出块的字节数，并将 `input_format_parquet_max_block_size` 的默认值改为 65409。[#64427](https://github.com/ClickHouse/ClickHouse/pull/64427) ([LiuNeng](https://github.com/liuneng1994)) 。
* 允许绕过对 `no_proxy` 环境变量和 ClickHouse 代理配置中指定主机的代理设置。[#63314](https://github.com/ClickHouse/ClickHouse/pull/63314) ([Arthur Passos](https://github.com/arthurpassos)) 。
* 始终以全局线程池中充足的线程数启动 Keeper。[#64444](https://github.com/ClickHouse/ClickHouse/pull/64444) ([Duc Canh Le](https://github.com/canhld94)) 。
* 用户配置中的设置不会影响基于对象存储的 `MergeTree` 的合并和变更操作。[#64456](https://github.com/ClickHouse/ClickHouse/pull/64456) ([alesapin](https://github.com/alesapin)).
* 支持将对象存储中的非标准错误代码 `TotalQpsLimitExceeded` 识别为可重试错误。[#64520](https://github.com/ClickHouse/ClickHouse/pull/64520) ([Sema Checherinda](https://github.com/CheSema)) 。
* 已为开源版和 ClickHouse Cloud 版本更新高级仪表板，新增“最大并发网络连接数”图表。[#64610](https://github.com/ClickHouse/ClickHouse/pull/64610) ([Thom O'Connor](https://github.com/thomoco)).
* 优化 `zeros_mt` 和 `generateRandom` 的进度报告。[#64804](https://github.com/ClickHouse/ClickHouse/pull/64804) ([Raúl Marín](https://github.com/Algunenano)) 。
* 新增异步指标 `jemalloc.profile.active`，用于指示当前采样是否处于启用状态。这是除 prof.active 之外的另一种激活机制；调用线程要进行采样，两者都必须处于激活状态。[#64842](https://github.com/ClickHouse/ClickHouse/pull/64842) ([Unalian](https://github.com/Unalian)).
* 移除将 `allow_experimental_join_condition` 标记为重要的设置。该设置可能会导致混合版本集群中的分布式查询无法成功执行。[#65008](https://github.com/ClickHouse/ClickHouse/pull/65008) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 新增了服务器异步指标 `DiskGetObjectThrottler*` 和 `DiskGetObjectThrottler*`，用于反映磁盘设置 `s3_max_get_rps` 和 `s3_max_put_rps` 所定义的每秒请求速率限制，以及当前在不触发磁盘限流的情况下还能发送的请求数。对于每个配置了限流的磁盘，都会定义这些指标。[#65050](https://github.com/ClickHouse/ClickHouse/pull/65050) ([Sergei Trifonov](https://github.com/serxa)) 。
* 初始化 `Poco::ThreadPool` 的全局 trace collector (Keeper 等需要使用) 。[#65239](https://github.com/ClickHouse/ClickHouse/pull/65239) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 在使用 `bcrypt_hash` 创建用户时增加验证。[#65242](https://github.com/ClickHouse/ClickHouse/pull/65242) ([Raúl Marín](https://github.com/Algunenano)) 。
* 新增用于统计在 `PREWHERE` 期间/之后读取行数的 profile events。[#64198](https://github.com/ClickHouse/ClickHouse/pull/64198) ([Nikita Taranov](https://github.com/nickitat)) 。
* 在使用并行副本时，在 `EXPLAIN PLAN` 中显示查询。[#64298](https://github.com/ClickHouse/ClickHouse/pull/64298) ([vdimir](https://github.com/vdimir)).
* 将 `allow_deprecated_functions` 更名为 `allow_deprecated_error_prone_window_functions`。[#64358](https://github.com/ClickHouse/ClickHouse/pull/64358) ([Raúl Marín](https://github.com/Algunenano)) 。
* 在 `file` 表函数中，文件描述符现在也会遵循 `max_read_buffer_size` 设置。[#64532](https://github.com/ClickHouse/ClickHouse/pull/64532) ([Azat Khuzhin](https://github.com/azat)) 。
* 对于不受支持的存储，即使是 materialized view 也会禁用事务。[#64918](https://github.com/ClickHouse/ClickHouse/pull/64918) ([alesapin](https://github.com/alesapin)).
* 在旧 analyzer 中禁止使用 `QUALIFY` 子句。旧 analyzer 会忽略 `QUALIFY`，因此可能导致变更操作中发生意外的数据删除。[#65356](https://github.com/ClickHouse/ClickHouse/pull/65356) ([Dmitry Novik](https://github.com/novikd)).

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

* Apache ORC 库中的一个缺陷已修复：修复了 ORC 在写入时统计信息计算的问题，该问题影响所有平台上的无符号类型以及 ARM 上的 Int8。[#64563](https://github.com/ClickHouse/ClickHouse/pull/64563) ([Michael Kolupaev](https://github.com/al13n321)) 。
* 恢复了 ClickHouse 在 CSV format 中处理和解释 Tuples 的原有行为。此更改实际上回退了 [https://github.com/ClickHouse/ClickHouse/pull/60994，并且仅在少数几个设置下可用：\`output\_format\_csv\_serialize\_tuple\_into\_separate\_columns\`、\`input\_format\_csv\_deserialize\_separate\_columns\_into\_tuple\`](https://github.com/ClickHouse/ClickHouse/pull/60994，并且仅在少数几个设置下可用：`output_format_csv_serialize_tuple_into_separate_columns`、`input_format_csv_deserialize_separate_columns_into_tuple`) 和 `input_format_csv_try_infer_strings_from_quoted_tuples`。[#65170](https://github.com/ClickHouse/ClickHouse/pull/65170) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 修复了一个权限错误：在特定情况下，用户可在未获得必要授权的情况下提升其在默认 database 上的权限。[#64769](https://github.com/ClickHouse/ClickHouse/pull/64769) ([pufit](https://github.com/pufit)).
* 修复了与 UniqInjectiveFunctionsEliminationPass 和 uniqCombined 相关的崩溃问题。[#65188](https://github.com/ClickHouse/ClickHouse/pull/65188) ([Raúl Marín](https://github.com/Algunenano)) 。
* 修复了 ClickHouse Keeper 中一个在关闭 session 时会导致摘要不匹配的 bug。[#65198](https://github.com/ClickHouse/ClickHouse/pull/65198) ([Aleksei Filatov](https://github.com/aalexfvk)).
* 为 Distinct 组合器采用正确的内存对齐方式。此前，使用该组合器时可能会因无效的内存分配而发生崩溃。[#65379](https://github.com/ClickHouse/ClickHouse/pull/65379) ([Antonio Andelic](https://github.com/antonio2368)).
* 修复了 `DISTINCT` 与窗口函数同时使用时导致崩溃的问题。[#64767](https://github.com/ClickHouse/ClickHouse/pull/64767) ([Igor Nikonov](https://github.com/devcrafter)) 。
* 修复了 'set' 跳过索引无法与 IN 和 `indexHint()` 配合使用的问题。[#62083](https://github.com/ClickHouse/ClickHouse/pull/62083) ([Michael Kolupaev](https://github.com/al13n321)) 。
* 支持在为参数化视图参数赋值时执行函数。[#63502](https://github.com/ClickHouse/ClickHouse/pull/63502) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)).
* 修复了 Parquet 的内存跟踪问题。[#63584](https://github.com/ClickHouse/ClickHouse/pull/63584) ([Michael Kolupaev](https://github.com/al13n321)) 。
* 修复了读取 `Tuple(Map(LowCardinality(String), String), ...)` 类型列时的问题。[#63956](https://github.com/ClickHouse/ClickHouse/pull/63956) ([Anton Popov](https://github.com/CurtizJ)).
* 修复了不同类型 (表达式和函数) 的循环别名引发的 `Cyclic aliases` 错误。[#63993](https://github.com/ClickHouse/ClickHouse/pull/63993) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 此修复会在查询管道中为每个视图使用正确重新定义的上下文，并为其指定正确的定义者。[#64079](https://github.com/ClickHouse/ClickHouse/pull/64079) ([pufit](https://github.com/pufit)) 。
* 修复 analyzer：已修复使用 INTERPOLATE 时出现的"找不到列"错误。[#64096](https://github.com/ClickHouse/ClickHouse/pull/64096) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)).
* 修复了向使用与包含该文件的磁盘不同凭证的 S3 存储桶创建备份时出现的问题。[#64153](https://github.com/ClickHouse/ClickHouse/pull/64153) ([Antonio Andelic](https://github.com/antonio2368)).
* 现在，查询缓存会将针对不同数据库执行的两条相同查询视为不同的查询。此前的行为可能被用来绕过读取某个表所需但缺失的权限。[#64199](https://github.com/ClickHouse/ClickHouse/pull/64199) ([Robert Schulze](https://github.com/rschu1ze)).
* 修复了 StatusFile 中 \~WriteBufferFromFileDescriptor 遇到未捕获异常时可能导致中止的问题。[#64206](https://github.com/ClickHouse/ClickHouse/pull/64206) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复了分布式查询中使用 `ARRAY JOIN` 时出现的 `duplicate alias` 错误。[#64226](https://github.com/ClickHouse/ClickHouse/pull/64226) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复 `accurateCast` 从字符串到整数转换时的意外问题。[#64255](https://github.com/ClickHouse/ClickHouse/pull/64255) ([wudidapaopao](https://github.com/wudidapaopao)) 。
* 修复了 CNF 简化中的问题：当任一 OR 组包含互斥原子时会出现该问题。[#64256](https://github.com/ClickHouse/ClickHouse/pull/64256) ([Eduard Karacharov](https://github.com/korowa)).
* 修复 Query Tree 大小验证问题。[#64377](https://github.com/ClickHouse/ClickHouse/pull/64377) ([Dmitry Novik](https://github.com/novikd)) 。
* 修复了在 `Buffer` 表中使用 `PREWHERE` 时出现的 `Logical error: Bad cast` 问题。[#64388](https://github.com/ClickHouse/ClickHouse/pull/64388) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 避免将 `blob_storage_log` 存储在对象存储上时出现递归日志记录。[#64393](https://github.com/ClickHouse/ClickHouse/pull/64393) ([vdimir](https://github.com/vdimir)).
* 修复了对带默认表达式的表执行 `CREATE TABLE AS` 查询时的问题。[#64455](https://github.com/ClickHouse/ClickHouse/pull/64455) ([Anton Popov](https://github.com/CurtizJ)).
* 修复了在键为 Nullable 的表上，对 ORDER BY ... NULLS FIRST / LAST 使用 `optimize_read_in_order` 时的行为异常。[#64483](https://github.com/ClickHouse/ClickHouse/pull/64483) ([Eduard Karacharov](https://github.com/korowa)) 。
* 修复查询使用指向 `GLOBAL IN` 的别名时出现的 `Expression nodes list expected 1 projection names` 和 `Unknown expression or identifier` 错误。[#64517](https://github.com/ClickHouse/ClickHouse/pull/64517) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了分布式查询中 `GROUP BY` 键包含常量 CTE 时出现的 `Cannot find column` 错误。[#64519](https://github.com/ClickHouse/ClickHouse/pull/64519) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 修复了这样一个崩溃循环问题：从备份恢复时，如果因创建了其 definer 尚未恢复的 MV 而受阻，就会触发该问题。[#64595](https://github.com/ClickHouse/ClickHouse/pull/64595) ([pufit](https://github.com/pufit)) 。
* 修复了函数 `formatDateTimeInJodaSyntax` 的输出问题：当格式说明符生成的字符数为奇数且最后一个字符为 `0` 时，输出会出错。例如，`SELECT formatDateTimeInJodaSyntax(toDate('2012-05-29'), 'D')` 现在会正确返回 `150`，而此前返回的是 `15`。[#64614](https://github.com/ClickHouse/ClickHouse/pull/64614) ([LiuNeng](https://github.com/liuneng1994)) 。
* 如果已经使用了 `-If` 组合器，则不要重写聚合。[#64638](https://github.com/ClickHouse/ClickHouse/pull/64638) ([Dmitry Novik](https://github.com/novikd)) 。
* 修复 float 的类型推断问题 (在缓冲区较小的情况下，即 `--max_read_buffer_size 1`) 。[#64641](https://github.com/ClickHouse/ClickHouse/pull/64641) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了一个可能导致包含表达式的 TTL 无法生效的问题。[#64694](https://github.com/ClickHouse/ClickHouse/pull/64694) ([alesapin](https://github.com/alesapin)) 。
* 修复了新 analyzer 中错误移除始终为真的 `WHERE` 和 `PREWHERE` 表达式的问题。[#64695](https://github.com/ClickHouse/ClickHouse/pull/64695) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了在根据 `startsWith`、`endsWith`、`match`、`multiSearchAny` 的结果进行过滤时，基于标记的文本索引 (`ngrambf`、`full_text`) 造成分片过度剔除的问题。[#64720](https://github.com/ClickHouse/ClickHouse/pull/64720) ([Eduard Karacharov](https://github.com/korowa)) 。
* 修复了 `UTF8::computeWidth` 函数中 ANSI CSI 转义处理不正确的问题。[#64756](https://github.com/ClickHouse/ClickHouse/pull/64756) ([Shaun Struwig](https://github.com/Blargian)).
* 修复了子查询间错误移除 `ORDER BY` / `LIMIT BY` 的问题。[#64766](https://github.com/ClickHouse/ClickHouse/pull/64766) ([Raúl Marín](https://github.com/Algunenano)) 。
* 修复 (Experimental) 在混合 join 条件中，对其中的 Set 使用子查询执行不等 join 时的问题。[#64775](https://github.com/ClickHouse/ClickHouse/pull/64775) ([lgbo](https://github.com/lgbo-ustc)).
* 修复 `plain_rewritable` 磁盘上本地缓存引发的崩溃。[#64778](https://github.com/ClickHouse/ClickHouse/pull/64778) ([Julia Kartseva](https://github.com/jkartseva)) 。
* Keeper 修复：`mntr` 命令中的 `zk_latest_snapshot_size` 现返回正确的值。[#64784](https://github.com/ClickHouse/ClickHouse/pull/64784) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 修复在基于 `Nested` 列执行带有 `ARRAY JOIN` 的分布式查询时出现的 `Cannot find column` 报错。修复了 [#64755](https://github.com/ClickHouse/ClickHouse/issues/64755)。[#64801](https://github.com/ClickHouse/ClickHouse/pull/64801) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复 slru 缓存策略中的内存泄漏问题。[#64803](https://github.com/ClickHouse/ClickHouse/pull/64803) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 修复了多类查询中可能存在的内存跟踪错误：包括从 S3 读取任意数据的查询、通过 HTTP 协议发起的查询，以及异步插入。[#64844](https://github.com/ClickHouse/ClickHouse/pull/64844) ([Anton Popov](https://github.com/CurtizJ)).
* 修复了以下问题：当 materialized view 的列类型与源表不一致时，从 materialized view 使用 `PREWHERE` 读取的查询会报 `Block structure mismatch` 错误。修复 [#64611](https://github.com/ClickHouse/ClickHouse/issues/64611)。[#64855](https://github.com/ClickHouse/ClickHouse/pull/64855) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了在表的生存时间 (TTL) 中包含子查询，且数据库为 Replicated，并启用并行副本和 analyzer 时极少发生的崩溃。虽然这种情况极为罕见，但请不要在 TTL 中使用子查询。[#64858](https://github.com/ClickHouse/ClickHouse/pull/64858) ([alesapin](https://github.com/alesapin)).
* 修复在大批次删除时 `blob_storage_log` 中 `Delete` 事件重复的问题。[#64924](https://github.com/ClickHouse/ClickHouse/pull/64924) ([vdimir](https://github.com/vdimir)).
* 修复了来自 \[Zoo]Keeper 的 `Session moved to another server` error：当配置中包含来自 \[Zoo]Keeper 的 include 配置时，服务器启动后可能会出现该错误。[#64986](https://github.com/ClickHouse/ClickHouse/pull/64986) ([Alexander Tokmakov](https://github.com/tavplubix)).
* 修复了在 [https://github.com/ClickHouse/ClickHouse/pull/54211](https://github.com/ClickHouse/ClickHouse/pull/54211) 中被破坏的、针对参数化 VIEW 的 `ALTER MODIFY COMMENT` 查询。[#65031](https://github.com/ClickHouse/ClickHouse/pull/65031) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 当启用 `cluster_secure_connection` 参数时，修复了 DatabaseReplicated 中的 `host_id` 问题。此前，即使启用了该参数，由 DatabaseReplicated 在集群内创建的所有连接也都不是安全连接。[#65054](https://github.com/ClickHouse/ClickHouse/pull/65054) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 修复了 StorageMerge 在 `PREWHERE` 优化后出现的 `Not-ready Set` 错误。[#65057](https://github.com/ClickHouse/ClickHouse/pull/65057) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 避免在类似 File 的存储中向已完成的缓冲区写入。[#65063](https://github.com/ClickHouse/ClickHouse/pull/65063) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了在出现循环别名时，查询耗时可能无限增长的问题。修复了 [#64849](https://github.com/ClickHouse/ClickHouse/issues/64849)。[#65081](https://github.com/ClickHouse/ClickHouse/pull/65081) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了远程查询在使用 `INTERPOLATE (alias)` 时出现的 `Unknown expression identifier` 报错 (新 analyzer) 。修复 [#64636](https://github.com/ClickHouse/ClickHouse/issues/64636)。[#65090](https://github.com/ClickHouse/ClickHouse/pull/65090) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复将算术运算下推到聚合之外的问题。在新的 analyzer 中，该优化此前只应用了一次。[#65104](https://github.com/ClickHouse/ClickHouse/pull/65104) ([Dmitry Novik](https://github.com/novikd)).
* 修复新版 analyzer 中聚合函数名称重写错误。[#65110](https://github.com/ClickHouse/ClickHouse/pull/65110) ([Dmitry Novik](https://github.com/novikd)) 。
* 在从客户端套接字读取请求体 (部分内容) 时，如果发生接收超时，则返回 5xx 而不是 200 OK。[#65118](https://github.com/ClickHouse/ClickHouse/pull/65118) ([Julian Maicher](https://github.com/jmaicher)) 。
* 修复了对冲请求可能引发的崩溃。[#65206](https://github.com/ClickHouse/ClickHouse/pull/65206) ([Azat Khuzhin](https://github.com/azat)).
* 修复了 Hashed 和 Hashed\_Array 字典短路求值中的一个缺陷：该缺陷可能会读取未初始化的值，从而导致各种错误。[#65256](https://github.com/ClickHouse/ClickHouse/pull/65256) ([jsc0218](https://github.com/jsc0218)) 。
* 此 PR 确保在 IN 运算符的类型转换过程中，常量 (IN 运算符的第二个参数) 的类型始终可见。否则，类型信息丢失可能会导致某些转换失败，例如从 DateTime 转换为 Date。此更改修复了 ([#64487](https://github.com/ClickHouse/ClickHouse/issues/64487)) 。[#65315](https://github.com/ClickHouse/ClickHouse/pull/65315) ([pn](https://github.com/chloro-pn)) 。

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

* 增加对 LLVM XRay 的支持。[#64592](https://github.com/ClickHouse/ClickHouse/pull/64592) [#64837](https://github.com/ClickHouse/ClickHouse/pull/64837) ([Tomer Shafir](https://github.com/tomershafir)) 。
* 将 s3/hdfs/azure 的存储实现统一到一个基于 IObjectStorage 的类中。\*Cluster、数据湖和 Queue 存储也做了同样的统一。[#59767](https://github.com/ClickHouse/ClickHouse/pull/59767) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 重构数据分区片段写入器，移除对 MergeTreeData 和 DataPart 的依赖。[#63620](https://github.com/ClickHouse/ClickHouse/pull/63620) ([Alexander Gololobov](https://github.com/davenger)) 。
* 重构 `KeyCondition` 和键分析，以改进 PartitionPruner 和 trivial count 优化。这部分已从 [#60463](https://github.com/ClickHouse/ClickHouse/issues/60463) 中拆分出来。[#61459](https://github.com/ClickHouse/ClickHouse/pull/61459) ([Amos Bird](https://github.com/amosbird)) 。
* 引入断言，以验证所有函数在调用时传入的列大小都正确。[#63723](https://github.com/ClickHouse/ClickHouse/pull/63723) ([Raúl Marín](https://github.com/Algunenano)) 。
* 使用 `rc` init 脚本启动 ClickHouse server 守护进程时，将 `network` service 设为必需项。[#60650](https://github.com/ClickHouse/ClickHouse/pull/60650) ([Chun-Sheng, Li](https://github.com/peter279k)) 。
* 缩减部分慢速测试的规模。[#64387](https://github.com/ClickHouse/ClickHouse/pull/64387) [#64452](https://github.com/ClickHouse/ClickHouse/pull/64452) ([Raúl Marín](https://github.com/Algunenano)) 。
* 使用 keeper-bench 重放 ZooKeeper 日志。[#62481](https://github.com/ClickHouse/ClickHouse/pull/62481) ([Antonio Andelic](https://github.com/antonio2368)) 。

### <a id="245" /> ClickHouse 24.5 版本发布，2024-05-30。 [演示文稿](https://presentations.clickhouse.com/2024-release-24.5/), [视频](https://www.youtube.com/watch?v=dURnKjLuZLg)

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

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

* 将“倒排索引”重命名为“全文索引”，这一名称技术色彩更弱，也更便于用户理解。此更改还会修改内部表元数据，并导致包含现有 (实验性) 倒排索引的表不兼容。请务必在升级前删除此类索引，并在升级后重新创建。[#62884](https://github.com/ClickHouse/ClickHouse/pull/62884) ([Robert Schulze](https://github.com/rschu1ze)).
* 函数 `neighbor`、`runningAccumulate`、`runningDifferenceStartingWithFirstValue`、`runningDifference` 的用法已弃用 (因为容易出错) 。应改用正确的窗口函数。若要重新启用它们，请设置 `allow_deprecated_error_prone_window_functions = 1`，或将 `compatibility` 设为 `'24.4'` 或更低版本。[#63132](https://github.com/ClickHouse/ClickHouse/pull/63132) ([Nikita Taranov](https://github.com/nickitat)).
* 当列的数量很多、但对许多 database 或表未授予 `SHOW TABLES` 权限时，查询 `system.columns` 的速度会更快。请注意，在之前的版本中，如果你仅对单独的列授予 `SHOW COLUMNS`，而未对对应的表授予 `SHOW TABLES`，`system.columns` 表仍会显示这些列；但在新版本中，会直接跳过整张表。移除了会拖慢查询的 trace 日志消息“Access granted”和“Access denied”。[#63439](https://github.com/ClickHouse/ClickHouse/pull/63439) ([Alexey Milovidov](https://github.com/alexey-milovidov)).

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

* 新增 `Form` 格式，可按 `application/x-www-form-urlencoded` 格式读取和写入单条记录。[#60199](https://github.com/ClickHouse/ClickHouse/pull/60199) ([Shaun Struwig](https://github.com/Blargian)) 。
* 新增了在 CROSS JOIN 中启用压缩的能力。[#60459](https://github.com/ClickHouse/ClickHouse/pull/60459) ([p1rattttt](https://github.com/p1rattttt)).
* 新增了在大小超出限制时于临时 File 中执行 `CROSS JOIN` 的支持。[#63432](https://github.com/ClickHouse/ClickHouse/pull/63432) ([p1rattttt](https://github.com/p1rattttt)).
* 支持使用同时涉及左右两张表列的不等条件进行 join，例如 `t1.y < t2.y`。要启用此功能，请执行 `SET allow_experimental_join_condition = 1`。[#60920](https://github.com/ClickHouse/ClickHouse/pull/60920) ([lgbo](https://github.com/lgbo-ustc)) 。
* Map 现在支持使用 `Float32`、`Float64`、`Array(T)`、`Map(K, V)` 和 `Tuple(T1, T2, ...)` 作为键。修复了 [#54537](https://github.com/ClickHouse/ClickHouse/issues/54537)。[#59318](https://github.com/ClickHouse/ClickHouse/pull/59318) ([李扬](https://github.com/taiyang-li)) 。
* 通过创建并摄取 SST 文件，而不再依赖 RocksDB 内置的 memtable，为 `EmbeddedRocksDB` 引入了批量加载功能。这有助于提升导入速度，尤其是在向 StorageEmbeddedRocksDB 表执行长时间运行的插入查询时。同时，还引入了 `EmbeddedRocksDB` 表设置。[#59163](https://github.com/ClickHouse/ClickHouse/pull/59163) [#63324](https://github.com/ClickHouse/ClickHouse/pull/63324) ([Duc Canh Le](https://github.com/canhld94)) 。
* 用户现在可以通过设置 `input_format_tsv_crlf_end_of_line`，在 TSV 格式中解析 CRLF。关闭了 [#56257](https://github.com/ClickHouse/ClickHouse/issues/56257)。[#59747](https://github.com/ClickHouse/ClickHouse/pull/59747) ([Shaun Struwig](https://github.com/Blargian)) 。
* 新增设置 `input_format_force_null_for_omitted_fields`，可强制将省略的字段设为 NULL 值。[#60887](https://github.com/ClickHouse/ClickHouse/pull/60887) ([Constantine Peresypkin](https://github.com/pkit)) 。
* 此前，我们的 S3 存储和 S3 表函数不支持从 tar 包、zip、7z 等归档文件中读取数据。现在，它们已支持遍历 S3 中归档文件内的各个文件。[#62259](https://github.com/ClickHouse/ClickHouse/pull/62259) ([Daniil Ivanik](https://github.com/divanik)) 。
* 新增对条件函数 `clamp` 的支持。[#62377](https://github.com/ClickHouse/ClickHouse/pull/62377) ([skyoct](https://github.com/skyoct)) 。
* 新增 `NPy` 输出格式。[#62430](https://github.com/ClickHouse/ClickHouse/pull/62430) ([豪肥肥](https://github.com/HowePa)).
* 将 `Raw` 格式作为 `TSVRaw` 的同义词。[#63394](https://github.com/ClickHouse/ClickHouse/pull/63394) ([Unalian](https://github.com/Unalian)) 。
* 新增了一个 SQL 函数 `generateUUIDv7`，用于生成第 7 版 UUID，即带有随机部分的基于 timestamp 的 UUID。还新增了函数 `UUIDToNum`，用于从 UUID 中提取字节，以及函数 `UUIDv7ToDateTime`，用于从第 7 版 UUID 中提取 timestamp 部分。[#62852](https://github.com/ClickHouse/ClickHouse/pull/62852) ([Alexey Petrunyaka](https://github.com/pet74alex)) 。
* 在 Linux 和 MacOS 上，如果程序的 stdout 被重定向到带有压缩扩展名的文件，则会使用相应的压缩方法，而不是不压缩 (使其行为类似于 `INTO OUTFILE`) 。[#63662](https://github.com/ClickHouse/ClickHouse/pull/63662) ([v01dXYZ](https://github.com/v01dXYZ)) 。
* 将针对已附加表数量过多的警告修改为区分表、视图和字典。[#64180](https://github.com/ClickHouse/ClickHouse/pull/64180) ([Francisco J. Jurado Moreno](https://github.com/Beetelbrox)).
* 支持 ClickHouse server 中的 `azureBlobStorage` 函数使用 Azure Workload Identity 对 Azure Blob 存储进行身份验证。如果在配置中设置了 `use_workload_identity` 参数，则会使用 [Workload Identity](https://github.com/Azure/azure-sdk-for-cpp/tree/main/sdk/identity/azure-identity#authenticate-azure-hosted-applications) 进行身份验证。[#57881](https://github.com/ClickHouse/ClickHouse/pull/57881) ([Vinay Suryadevara](https://github.com/vinay92-ch)) 。
* 在 `system.parts_columns` 表中新增生存时间 (TTL) 信息。[#63200](https://github.com/ClickHouse/ClickHouse/pull/63200) ([litlig](https://github.com/litlig)).

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

* 实现了 `Dynamic` Data type，可在预先不知道所有类型的情况下，在其中存储任意类型的值。`Dynamic` type 可通过设置 `allow_experimental_dynamic_type` 启用。Reference: [#54864](https://github.com/ClickHouse/ClickHouse/issues/54864)。[#63058](https://github.com/ClickHouse/ClickHouse/pull/63058) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 允许在不连接 MySQL 的情况下创建 `MaterializedMySQL` database。[#63397](https://github.com/ClickHouse/ClickHouse/pull/63397) ([Kirill](https://github.com/kirillgarbar)) 。
* 如果某个 DDL task 连续因相同 error 失败超过 `max_retries_before_automatic_recovery` (默认 100) 次，则会自动将 Replicated database 的一个副本标记为丢失并开始恢复。此外，还修复了一个 bug：当在 entry 执行的早期阶段抛出 exception 时，可能会导致跳过 DDL entries。[#63549](https://github.com/ClickHouse/ClickHouse/pull/63549) ([Alexander Tokmakov](https://github.com/tavplubix)) 。
* 在 `StorageS3Queue` 中，失败的文件也会计入 `s3queue_tracked_file_ttl_sec` 和 `s3queue_traked_files_limit`。[#63638](https://github.com/ClickHouse/ClickHouse/pull/63638) ([Kseniia Sumarokova](https://github.com/kssenii)) 。

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

* 减少文件系统缓存中的争用 (第 4 部分) 。通过在后台执行额外的淘汰操作 (由 `keep_free_space_size(elements)_ratio` 控制) ，使文件系统缓存无需一直填满到上限。这可以缓解查询在预留空间 (`tryReserve` 方法) 时的压力。此外，该过程尽可能采用无锁方式实现，例如不应阻塞正常的缓存使用。[#61250](https://github.com/ClickHouse/ClickHouse/pull/61250) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 跳过在 `INSERT` 时合并新创建的 projection 块。[#59405](https://github.com/ClickHouse/ClickHouse/pull/59405) ([Nikita Taranov](https://github.com/nickitat)).
* 如果输入字符串全部为 ascii 字符，则按“ascii”方式处理 `...UTF8` 字符串函数。受 [https://github.com/apache/doris/pull/29799](https://github.com/apache/doris/pull/29799) 启发。整体提速 1.07x\~1.62x。注意，在某些情况下峰值内存占用也有所下降。[#61632](https://github.com/ClickHouse/ClickHouse/pull/61632) ([李扬](https://github.com/taiyang-li)).
* 提升了 StorageS3 中选择 (`{}`) 通配符的性能。[#62120](https://github.com/ClickHouse/ClickHouse/pull/62120) ([Andrey Zvonov](https://github.com/zvonand)).
* HostResolver 中每个 IP 地址会出现多次。如果远程主机有多个 IP，并且由于某些原因 (例如防火墙规则) 某些 IP 可访问、另一些不可访问，那么只会将第一个不可访问 IP 的记录标记为失败，因此这些 IP 在每次尝试时仍有可能被选中 (然后再次失败) 。即使修复了这一点，DNS 缓存每 120 秒也会被清空一次，这些 IP 仍可能再次被选中。[#62652](https://github.com/ClickHouse/ClickHouse/pull/62652) ([Anton Ivashkin](https://github.com/ianton-ru)).
* 新增配置 `prefer_merge_sort_block_bytes`，用于控制内存占用，并在列较多时将合并阶段的排序速度提升 2 倍。[#62904](https://github.com/ClickHouse/ClickHouse/pull/62904) ([LiuNeng](https://github.com/liuneng1994)).
* `clickhouse-local` 启动会更快。此前的版本中，它误未删除临时目录；现在会删除了。这关闭了 [#62941](https://github.com/ClickHouse/ClickHouse/issues/62941)。[#63074](https://github.com/ClickHouse/ClickHouse/pull/63074) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 对新的 analyzer 进行了微优化。[#63429](https://github.com/ClickHouse/ClickHouse/pull/63429) ([Raúl Marín](https://github.com/Algunenano)).
* 当 `DateTime` 与 `DateTime64` 比较时，索引分析也能正常工作。这关闭了 [#63441](https://github.com/ClickHouse/ClickHouse/issues/63441)。[#63443](https://github.com/ClickHouse/ClickHouse/pull/63443) [#63532](https://github.com/ClickHouse/ClickHouse/pull/63532) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 通过移除无用数据，小幅提升了 `set` 类型索引的速度 (约 1.5 倍) 。[#64098](https://github.com/ClickHouse/ClickHouse/pull/64098) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 去除了写入文件系统缓存时的数据拷贝。[#63401](https://github.com/ClickHouse/ClickHouse/pull/63401) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 现在，使用 Azure Blob 存储的备份将使用多重复制。[#64116](https://github.com/ClickHouse/ClickHouse/pull/64116) ([alesapin](https://github.com/alesapin)).
* 即使在不同容器之间，也允许 Azure 使用原生复制。[#64154](https://github.com/ClickHouse/ClickHouse/pull/64154) ([alesapin](https://github.com/alesapin)).
* 终于为 Azure 启用了原生复制。[#64182](https://github.com/ClickHouse/ClickHouse/pull/64182) ([alesapin](https://github.com/alesapin)).

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

* 允许将 `clickhouse-local` 及其快捷命令 `clickhouse` 和 `ch` 的查询或查询文件作为位置参数使用。示例：`ch "SELECT 1"`、`ch --param_test Hello "SELECT {test:String}"`、`ch query.sql`。此项变更修复了 [#62361](https://github.com/ClickHouse/ClickHouse/issues/62361)。[#63081](https://github.com/ClickHouse/ClickHouse/pull/63081) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 为本地和 Azure (azure\_blob\_storage) 对象存储启用 plain\_rewritable 元数据。[#63365](https://github.com/ClickHouse/ClickHouse/pull/63365) ([Julia Kartseva](https://github.com/jkartseva)) 。
* 支持英式 Unicode 引号，例如 “Hello”、'world'。总体来看，这一点是否合理还有待商榷，但当你在 Google Docs 等文字处理器中输入查询时会很有帮助。此改动修复了 [#58634](https://github.com/ClickHouse/ClickHouse/issues/58634)。[#63381](https://github.com/ClickHouse/ClickHouse/pull/63381) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 允许在 INSERT 查询的列名列表中使用尾随逗号。例如，`INSERT INTO test (a, b, c, ) VALUES ...`。 [#63803](https://github.com/ClickHouse/ClickHouse/pull/63803) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 改进了 `Regexp` 格式的异常信息。[#63804](https://github.com/ClickHouse/ClickHouse/pull/63804) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 允许在 `Values` 格式中使用末尾逗号。例如，以下查询是合法的：`INSERT INTO test (a, b, c) VALUES (4, 5, 6,);`。[#63810](https://github.com/ClickHouse/ClickHouse/pull/63810) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 使 RabbitMQ 对损坏的消息执行 nack。关闭 [#45350](https://github.com/ClickHouse/ClickHouse/issues/45350)。[#60312](https://github.com/ClickHouse/ClickHouse/pull/60312) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复了解析调试信息时异步栈展开发生的崩溃问题 (例如使用采样查询分析器时) 。这解决了 [#60460](https://github.com/ClickHouse/ClickHouse/issues/60460)。[#60468](https://github.com/ClickHouse/ClickHouse/pull/60468) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 针对磁盘和存储两种情况的 S3 错误 'no key'，分别提供了不同的消息。[#61108](https://github.com/ClickHouse/ClickHouse/pull/61108) ([Sema Checherinda](https://github.com/CheSema)) 。
* 对于从 `system.zeros`、`system.zeros_mt` 读取且带有 LIMIT 的简单查询，进度条将可正常工作 (`system.numbers` 和 `system.numbers_mt` 已经支持) ，`generateRandom` 表函数也是如此。作为额外收益，如果记录总数超过 `max_rows_to_read` 限制，它将更早抛出异常。这修复了 [#58183](https://github.com/ClickHouse/ClickHouse/issues/58183)。[#61823](https://github.com/ClickHouse/ClickHouse/pull/61823) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 支持 YAML 配置中的 "合并键" (这是 YAML 的一个奇怪特性，忽略即可) 。[#62685](https://github.com/ClickHouse/ClickHouse/pull/62685) ([Azat Khuzhin](https://github.com/azat)).
* 在 Replicated 源中使用非确定性函数时，改进错误信息。[#62896](https://github.com/ClickHouse/ClickHouse/pull/62896) ([Grégoire Pineau](https://github.com/lyrixx)).
* 修复从 `remote` 发起的 Distributed over Distributed 场景中的服务器间 secret 问题。[#63013](https://github.com/ClickHouse/ClickHouse/pull/63013) ([Azat Khuzhin](https://github.com/azat)).
* 支持在 YAML 文件中使用 `include_from`。不过，还是更建议使用 `config.d` [#63106](https://github.com/ClickHouse/ClickHouse/pull/63106) ([Eduard Karacharov](https://github.com/korowa)).
* 从 skim 建议中选择后，在终端中保留之前的数据。[#63261](https://github.com/ClickHouse/ClickHouse/pull/63261) ([FlameFactory](https://github.com/FlameFactory)).
* 字段宽度 (在 Pretty 格式或 `visibleWidth` 函数中) 现在能够正确忽略 ANSI 转义序列。[#63270](https://github.com/ClickHouse/ClickHouse/pull/63270) ([Shaun Struwig](https://github.com/Blargian)) 。
* 在适当情况下，将错误代码 `NUMBER_OF_ARGUMENTS_DOESNT_MATCH` 替换为更准确的错误代码。[#63406](https://github.com/ClickHouse/ClickHouse/pull/63406) ([Yohann Jardin](https://github.com/yohannj)) 。
* 现在，clickhouse-client 中用于命令行建议的查询会正确设置 `os_user` 和 `client_hostname`。这解决了 [#63430](https://github.com/ClickHouse/ClickHouse/issues/63430)。[#63433](https://github.com/ClickHouse/ClickHouse/pull/63433) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 如果 `max_block_size` 为 0，则自动将其修正为默认值。[#63587](https://github.com/ClickHouse/ClickHouse/pull/63587) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 向 trace\_log 添加一个 build\_id ALIAS 列，以便在检测到二进制文件变更时自动进行重命名。这是为了解决 [#52086](https://github.com/ClickHouse/ClickHouse/issues/52086)。[#63656](https://github.com/ClickHouse/ClickHouse/pull/63656) ([Zimu Li](https://github.com/woodlzm)) 。
* 为对象存储磁盘启用 TRUNCATE 操作。[#63693](https://github.com/ClickHouse/ClickHouse/pull/63693) ([MikhailBurdukov](https://github.com/MikhailBurdukov)) 。
* 现在，关键词列表的加载取决于服务器修订版本，并将对旧版本的 ClickHouse server 禁用。CC @azat。 [#63786](https://github.com/ClickHouse/ClickHouse/pull/63786) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* ClickHouse 磁盘必须读取服务器级设置，才能获取实际的元数据格式版本。[#63831](https://github.com/ClickHouse/ClickHouse/pull/63831) ([Sema Checherinda](https://github.com/CheSema)) 。
* 当 stdout 不是 TTY 时，禁用 Pretty 格式的限制 (`output_format_pretty_max_rows`/`output_format_pretty_max_value_width`) 。[#63942](https://github.com/ClickHouse/ClickHouse/pull/63942) ([Azat Khuzhin](https://github.com/azat)) 。
* 现在，在 AWS Lambda 中使用 ClickHouse 时，异常处理已可正常工作。作者：[Alexey Coolnev](https://github.com/acoolnev)。[#64014](https://github.com/ClickHouse/ClickHouse/pull/64014) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 对于通过 HTTP 传入的无效压缩数据，抛出 `CANNOT_DECOMPRESS` 异常，而不是 `CORRUPTED_DATA`。[#64036](https://github.com/ClickHouse/ClickHouse/pull/64036) ([vdimir](https://github.com/vdimir)) 。
* Pretty 格式中对单个大数值的提示现在也支持 Nullable 和 LowCardinality。这解决了 [#61993](https://github.com/ClickHouse/ClickHouse/issues/61993)。[#64084](https://github.com/ClickHouse/ClickHouse/pull/64084) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 为使用索引过滤 parts 新增了指标、日志和线程名称。[#64130](https://github.com/ClickHouse/ClickHouse/pull/64130) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 在 `ATTACH` 时忽略 `allow_suspicious_primary_key`，并在 `ALTER` 时校验。[#64202](https://github.com/ClickHouse/ClickHouse/pull/64202) ([Azat Khuzhin](https://github.com/azat)) 。

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

* ClickHouse 使用 clang-18 构建，并启用了 clang-tidy-18 中大量新的检查项。[#60469](https://github.com/ClickHouse/ClickHouse/pull/60469) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Experimental 支持 loongarch64 作为 ClickHouse 的新平台。[#63733](https://github.com/ClickHouse/ClickHouse/pull/63733) ([qiangxuhui](https://github.com/qiangxuhui)).
* Dockerfile 已在 [https://github.com/docker-library/official-images/pull/15846](https://github.com/docker-library/official-images/pull/15846) 中通过 Docker 官方镜像库的审查。[#63400](https://github.com/ClickHouse/ClickHouse/pull/63400) ([Mikhail f. Shiryaev](https://github.com/Felixoid)).
* CI 中的每次构建，都会将每个翻译单元中每个符号的信息收集到 CI database 中。此更改关闭了 [#63494](https://github.com/ClickHouse/ClickHouse/issues/63494)。[#63495](https://github.com/ClickHouse/ClickHouse/pull/63495) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 更新 Apache Datasketches 库，解决了 [#63858](https://github.com/ClickHouse/ClickHouse/issues/63858)。[#63923](https://github.com/ClickHouse/ClickHouse/pull/63923) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 在交叉编译 binary 时，为 aarch64 Linux 启用 GRPC 支持。[#64072](https://github.com/ClickHouse/ClickHouse/pull/64072) ([alesapin](https://github.com/alesapin)).
* 修复了 aarch64 上在 SIGSEGV 时的栈展开问题 (由于信号栈过小) 。[#64058](https://github.com/ClickHouse/ClickHouse/pull/64058) ([Azat Khuzhin](https://github.com/azat)).

<div id="bug-fix-1">
  #### 缺陷修复
</div>

* 默认禁用 `enable_vertical_final` 设置。由于该功能存在缺陷，不应使用：[#64543](https://github.com/ClickHouse/ClickHouse/issues/64543)。[#64544](https://github.com/ClickHouse/ClickHouse/pull/64544) ([Alexander Tokmakov](https://github.com/tavplubix)) 。
* 修复了使用多个分片时创建备份的问题 [#57684](https://github.com/ClickHouse/ClickHouse/pull/57684) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复从 CREATE 查询的列列表向 MV 内部表传递投影/索引/主键的问题 [#59183](https://github.com/ClickHouse/ClickHouse/pull/59183) ([Azat Khuzhin](https://github.com/azat)).
* 修复 `boundRatio` 合并不正确的问题 [#60532](https://github.com/ClickHouse/ClickHouse/pull/60532) ([Tao Wang](https://github.com/wangtZJU)).
* 修复对 const 低基数列调用某些函数时发生崩溃的问题 [#61966](https://github.com/ClickHouse/ClickHouse/pull/61966) ([Michael Kolupaev](https://github.com/al13n321)) 。
* 修复当表未使用自适应粒度时，带有 FINAL 的查询会返回错误结果的问题 [#62432](https://github.com/ClickHouse/ClickHouse/pull/62432) ([Duc Canh Le](https://github.com/canhld94)).
* 改进对 cgroups v2 内存控制器支持情况的检测 [#62903](https://github.com/ClickHouse/ClickHouse/pull/62903) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 修复了客户端中后续使用外部表时出现的问题 [#62964](https://github.com/ClickHouse/ClickHouse/pull/62964) ([Azat Khuzhin](https://github.com/azat)).
* 修复了 untuple 和未解析的 lambda 导致的崩溃问题 [#63131](https://github.com/ClickHouse/ClickHouse/pull/63131) ([Raúl Marín](https://github.com/Algunenano)).
* 修复服务器过早开始监听连接请求的问题 [#63181](https://github.com/ClickHouse/ClickHouse/pull/63181) ([alesapin](https://github.com/alesapin)).
* 修复执行 DROP PART 命令后重启时出现的 parts 重叠问题 [#63202](https://github.com/ClickHouse/ClickHouse/pull/63202) ([Han Fei](https://github.com/hanfei1991)).
* 在启动期间正确加载 SQL security 的默认值 [#63209](https://github.com/ClickHouse/ClickHouse/pull/63209) ([pufit](https://github.com/pufit)) 。
* 修复 JOIN 过滤器下推中的过滤器 JOIN 问题 [#63234](https://github.com/ClickHouse/ClickHouse/pull/63234) ([Maksim Kita](https://github.com/kitaisreal)).
* 修复 AzureObjectStorage::listObjects 中的无限循环问题 [#63257](https://github.com/ClickHouse/ClickHouse/pull/63257) ([Julia Kartseva](https://github.com/jkartseva)) 。
* CROSS join 会忽略 join\_algorithm 设置 [#63273](https://github.com/ClickHouse/ClickHouse/pull/63273) ([vdimir](https://github.com/vdimir)).
* 修复 WriteBufferToFileSegment 和 StatusFile 的 finalize 问题 [#63346](https://github.com/ClickHouse/ClickHouse/pull/63346) ([vdimir](https://github.com/vdimir)).
* 修复了极少数情况下在 ALTER 后执行 SELECT 查询时出现的逻辑错误 [#63353](https://github.com/ClickHouse/ClickHouse/pull/63353) ([alesapin](https://github.com/alesapin)).
* 使用 `session_timezone` 修复 `X-ClickHouse-Timezone` 请求头问题 [#63377](https://github.com/ClickHouse/ClickHouse/pull/63377) ([Andrey Zvonov](https://github.com/zvonand)) 。
* 修复使用 grouping WITH ROLLUP 和 LowCardinality 类型时触发的调试断言问题  [#63398](https://github.com/ClickHouse/ClickHouse/pull/63398) ([Raúl Marín](https://github.com/Algunenano)).
* 对 group\_by\_use\_nulls 的小幅修复 [#63405](https://github.com/ClickHouse/ClickHouse/pull/63405) ([vdimir](https://github.com/vdimir)) 。
* 修复了以下情况下投影分片的备份/恢复问题：投影已从表元数据中移除，但分片仍包含该投影 [#63426](https://github.com/ClickHouse/ClickHouse/pull/63426) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 修复 MySQL 字典源 [#63481](https://github.com/ClickHouse/ClickHouse/pull/63481) ([vdimir](https://github.com/vdimir)) 。
* 在无数据时，在 AsyncInsertFlush 中插入 QueryFinish [#63483](https://github.com/ClickHouse/ClickHouse/pull/63483) ([Raúl Marín](https://github.com/Algunenano)).
* 修复：system.query\_log 中 used\_dictionaries 为空的问题 [#63487](https://github.com/ClickHouse/ClickHouse/pull/63487) ([Eduard Karacharov](https://github.com/korowa)).
* 提升 `MergeTreePrefetchedReadPool` 的安全性 [#63513](https://github.com/ClickHouse/ClickHouse/pull/63513) ([Antonio Andelic](https://github.com/antonio2368)).
* 修复了在启用 sentry 时退出时崩溃的问题 (原因是 openssl 在 sentry 之前被销毁) [#63548](https://github.com/ClickHouse/ClickHouse/pull/63548) ([Azat Khuzhin](https://github.com/azat)).
* 修复 Keyed hashing 对 Array 和 Map 的支持问题 [#63628](https://github.com/ClickHouse/ClickHouse/pull/63628) ([Salvatore Mesoraca](https://github.com/aiven-sal)) 。
* 修复 Parquet，以及可能还有 StorageMerge 的过滤器下推问题 [#63642](https://github.com/ClickHouse/ClickHouse/pull/63642) ([Michael Kolupaev](https://github.com/al13n321)) 。
* 如果 zookeeper path 已存在，则禁止转换为 Replicated [#63670](https://github.com/ClickHouse/ClickHouse/pull/63670) ([Kirill](https://github.com/kirillgarbar)).
* analyzer：视图仅读取必要的列 [#63688](https://github.com/ClickHouse/ClickHouse/pull/63688) ([Maksim Kita](https://github.com/kitaisreal)).
* Analyzer：禁止重定义 WINDOW [#63694](https://github.com/ClickHouse/ClickHouse/pull/63694) ([Dmitry Novik](https://github.com/novikd)).
* flatten\_nested 在 Experimental Replicated 数据库中存在问题。[#63695](https://github.com/ClickHouse/ClickHouse/pull/63695) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了 [#63653](https://github.com/ClickHouse/ClickHouse/issues/63653) [#63722](https://github.com/ClickHouse/ClickHouse/pull/63722) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 允许将 Array(Nothing) 转换为 Map(Nothing, Nothing) [#63753](https://github.com/ClickHouse/ClickHouse/pull/63753) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复 partial\_merge join 中的 ILLEGAL\_COLUMN 错误 [#63755](https://github.com/ClickHouse/ClickHouse/pull/63755) ([vdimir](https://github.com/vdimir)).
* 修复：移除 window function 中多余的 distinct [#63776](https://github.com/ClickHouse/ClickHouse/pull/63776) ([Igor Nikonov](https://github.com/devcrafter)) 。
* 修复了 `SYSTEM UNLOAD PRIMARY KEY` 可能引发崩溃的问题 [#63778](https://github.com/ClickHouse/ClickHouse/pull/63778) ([Raúl Marín](https://github.com/Algunenano)).
* 修复了包含重复循环别名的查询问题。[#63791](https://github.com/ClickHouse/ClickHouse/pull/63791) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 使 `TokenIterator` 如预期那样变为惰性 [#63801](https://github.com/ClickHouse/ClickHouse/pull/63801) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 新增 `endpoint_subpath` S3 URI 设置 [#63806](https://github.com/ClickHouse/ClickHouse/pull/63806) ([Julia Kartseva](https://github.com/jkartseva)) 。
* 修复 `ParallelReadBuffer` 中的死锁问题 [#63814](https://github.com/ClickHouse/ClickHouse/pull/63814) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 修复 JOIN 过滤器下推中的等效列问题 [#63819](https://github.com/ClickHouse/ClickHouse/pull/63819) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 在 Lazy 数据库中执行 DROP 后，会从所有磁盘删除数据。[#63848](https://github.com/ClickHouse/ClickHouse/pull/63848) ([MikhailBurdukov](https://github.com/MikhailBurdukov)).
* 修复了在使用并行副本和新版 analyzer 从 MV 读取时结果错误的问题 [#63861](https://github.com/ClickHouse/ClickHouse/pull/63861) ([Nikita Taranov](https://github.com/nickitat)) 。
* 修复了 keeper-client 中 `find_super_nodes` 和 `find_big_family` 命令的问题 [#63862](https://github.com/ClickHouse/ClickHouse/pull/63862) ([Alexander Gololobov](https://github.com/davenger)) 。
* 更新 lambda 的执行名称 [#63864](https://github.com/ClickHouse/ClickHouse/pull/63864) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复由 CPU/Real 性能分析器导致的 SIGSEGV [#63865](https://github.com/ClickHouse/ClickHouse/pull/63865) ([Azat Khuzhin](https://github.com/azat)).
* 修复 `EXPLAIN CURRENT TRANSACTION` 查询的问题 [#63926](https://github.com/ClickHouse/ClickHouse/pull/63926) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复 analyzer：简直是“层层都是乌龟”…… [#63930](https://github.com/ClickHouse/ClickHouse/pull/63930) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)).
* 允许在 `plain_rewritable` 磁盘上执行某些 ALTER TABLE 命令 [#63933](https://github.com/ClickHouse/ClickHouse/pull/63933) ([Julia Kartseva](https://github.com/jkartseva)) 。
* 递归 CTE 的分布式问题修复 [#63939](https://github.com/ClickHouse/ClickHouse/pull/63939) ([Maksim Kita](https://github.com/kitaisreal)) 。
* Analyzer：修复 COLUMNS 解析问题 [#63962](https://github.com/ClickHouse/ClickHouse/pull/63962) ([Dmitry Novik](https://github.com/novikd)) 。
* analyzer 中的 LIMIT BY 与 skip\_unused\_shards [#63983](https://github.com/ClickHouse/ClickHouse/pull/63983) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了一些杂项问题 (Experimental Kusto) [#63992](https://github.com/ClickHouse/ClickHouse/pull/63992) ([Yong Wang](https://github.com/kashwy)) 。
* 以更安全的方式对不受信任的二进制输入进行反序列化 [#64024](https://github.com/ClickHouse/ClickHouse/pull/64024) ([Robert Schulze](https://github.com/rschu1ze)).
* 修复了在分布式表基于非 MergeTree 家族的表、且设置 `final` = 1 时的查询分析问题。[#64037](https://github.com/ClickHouse/ClickHouse/pull/64037) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 为 recoverLostReplica 补充缺失的设置 [#64040](https://github.com/ClickHouse/ClickHouse/pull/64040) ([Raúl Marín](https://github.com/Algunenano)) 。
* 修复 analyzer 中 SQL security 的访问检查问题 [#64079](https://github.com/ClickHouse/ClickHouse/pull/64079) ([pufit](https://github.com/pufit)) 。
* 修复 analyzer：对于 DAG，仅应使用 interpolate expression [#64096](https://github.com/ClickHouse/ClickHouse/pull/64096) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* 修复了 Azure 备份在非原生复制场景下按 1 MiB (读取缓冲区大小) 而不是 `max_upload_part_size` 写入多分片块的问题 [#64117](https://github.com/ClickHouse/ClickHouse/pull/64117) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 在备份复制期间可正确回退 [#64153](https://github.com/ClickHouse/ClickHouse/pull/64153) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 防止在使用 CREATE TABLE as materialized view 时发生 LOGICAL\_ERROR [#64174](https://github.com/ClickHouse/ClickHouse/pull/64174) ([Raúl Marín](https://github.com/Algunenano)).
* 查询缓存：对不同数据库执行的相同查询将被视为不同的查询 [#64199](https://github.com/ClickHouse/ClickHouse/pull/64199) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 在 Keeper 中忽略 `text_log` [#64218](https://github.com/ClickHouse/ClickHouse/pull/64218) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 修复逻辑错误：带有 prewhere 的 Buffer 表发生错误类型转换。[#64388](https://github.com/ClickHouse/ClickHouse/pull/64388) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。

### <a id="244" /> ClickHouse 24.4 版本发布，2024-04-30。 [演示文稿](https://presentations.clickhouse.com/2024-release-24.4/), [视频](https://www.youtube.com/watch?v=dtUqgcfOGmE)

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

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

* `clickhouse-odbc-bridge` 和 `clickhouse-library-bridge` 现已成为独立的软件包。这解决了 [#61677](https://github.com/ClickHouse/ClickHouse/issues/61677)。[#62114](https://github.com/ClickHouse/ClickHouse/pull/62114) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 不再允许将 max\_parallel\_replicas (用于从副本进行 Experimental 并行读取) 设置为 `0`，因为这没有实际意义。解决了 [#60140](https://github.com/ClickHouse/ClickHouse/issues/60140)。[#61201](https://github.com/ClickHouse/ClickHouse/pull/61201) ([Kruglov Pavel](https://github.com/Avogar)).
* 移除了对 `INSERT WATCH` 查询的支持 (它是已弃用的 `LIVE VIEW` 功能的一部分) 。[#62382](https://github.com/ClickHouse/ClickHouse/pull/62382) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 移除了 `optimize_monotonous_functions_in_order_by` 设置。[#63004](https://github.com/ClickHouse/ClickHouse/pull/63004) ([Raúl Marín](https://github.com/Algunenano)).
* 已从 `Replicated` 数据库引擎中移除 Experimental 标签。现在它处于 Beta 阶段。[#62937](https://github.com/ClickHouse/ClickHouse/pull/62937) ([Justin de Guzman](https://github.com/justindeguzman)).

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

* 支持递归 CTE。[#62074](https://github.com/ClickHouse/ClickHouse/pull/62074) ([Maksim Kita](https://github.com/kitaisreal))。
* 支持 `QUALIFY` 子句。已关闭 [#47819](https://github.com/ClickHouse/ClickHouse/issues/47819)。[#62619](https://github.com/ClickHouse/ClickHouse/pull/62619) ([Maksim Kita](https://github.com/kitaisreal))。
* 现在可以向表引擎授予权限，且不会影响现有用户的行为。[#60117](https://github.com/ClickHouse/ClickHouse/pull/60117) ([jsc0218](https://github.com/jsc0218))。
* 新增可重写的 S3 磁盘，支持 INSERT 操作，且无需在本地存储元数据。[#61116](https://github.com/ClickHouse/ClickHouse/pull/61116) ([Julia Kartseva](https://github.com/jkartseva))。其主要用例是系统表。
* 客户端在输入时的语法高亮现在将在语法层面生效 (此前是在词法分析层面生效) 。[#62123](https://github.com/ClickHouse/ClickHouse/pull/62123) ([Alexey Milovidov](https://github.com/alexey-milovidov))。
* 支持像 `DROP TABLE a, b, c`; 这样同时删除多个表。[#58705](https://github.com/ClickHouse/ClickHouse/pull/58705) ([zhongyuankai](https://github.com/zhongyuankai))。
* 现在支持通过 `ALTER MODIFY SETTING` 修改 Memory 表设置。例如：`ALTER TABLE memory MODIFY SETTING min_rows_to_keep = 100, max_rows_to_keep = 1000;`。[#62039](https://github.com/ClickHouse/ClickHouse/pull/62039) ([zhongyuankai](https://github.com/zhongyuankai))。
* 为 HTTP interface 新增了 `role` 查询参数。其工作方式类似于 `SET ROLE x`，会在语句执行前应用该角色。这样可以绕过 HTTP interface 的限制，因为它不允许多个语句，也无法同时发送 `SET ROLE x` 和语句本身。还可以通过这种方式设置多个角色，例如 `?role=x&role=y`，效果等同于 `SET ROLE x, y`。[#62669](https://github.com/ClickHouse/ClickHouse/pull/62669) ([Serge Klochkov](https://github.com/slvrtrn))。
* 新增 `SYSTEM UNLOAD PRIMARY KEY`，用于释放表主键占用的内存。[#62738](https://github.com/ClickHouse/ClickHouse/pull/62738) ([Pablo Marcos](https://github.com/pamarcos))。
* 为 `system.text_log` 新增了 `value1`、`value2`、...、`value10` 列。这些列包含用于格式化消息的值。[#59619](https://github.com/ClickHouse/ClickHouse/pull/59619) ([Alexey Katsman](https://github.com/alexkats))。
* 新增持久化虚拟列 `_block_offset`，用于存储插入时分配的块内原始行号。可通过 MergeTree setting `enable_block_offset_column` 启用列 `_block_offset` 的持久化。新增虚拟列 `_part_data_version`，其值为分片的最小块编号或变更版本。持久化虚拟列 `_block_number` 不再被视为 Experimental。[#60676](https://github.com/ClickHouse/ClickHouse/pull/60676) ([Anton Popov](https://github.com/CurtizJ))。
* 新增设置 `input_format_json_throw_on_bad_escape_sequence`，禁用后即可在 JSON input formats 中保存错误的转义序列。[#61889](https://github.com/ClickHouse/ClickHouse/pull/61889) ([Kruglov Pavel](https://github.com/Avogar))。

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

* 基于等价集合优化 JOIN 过滤器下推。[#61216](https://github.com/ClickHouse/ClickHouse/pull/61216) ([Maksim Kita](https://github.com/kitaisreal)).
* 如果 JOIN 后的过滤器始终会过滤掉默认值，则可将 OUTER JOIN 优化为 INNER JOIN。可通过设置 `query_plan_convert_outer_join_to_inner_join` 控制此优化，且默认启用。[#62907](https://github.com/ClickHouse/ClickHouse/pull/62907) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 针对 AWS S3 的改进。客户端必须向服务器发送请求头 'Keep-Alive: timeout=X'。如果客户端收到服务器返回的、带有该请求头的响应，则必须使用服务器提供的值。此外，客户端最好不要使用即将过期的连接，以避免出现连接关闭竞争。[#62249](https://github.com/ClickHouse/ClickHouse/pull/62249) ([Sema Checherinda](https://github.com/CheSema)) 。
* 降低变更操作对 `SELECT` 查询的开销 (v2) 。[#60856](https://github.com/ClickHouse/ClickHouse/pull/60856) ([Azat Khuzhin](https://github.com/azat)) 。
* PODArray 中调用更频繁的函数现已强制内联。[#61144](https://github.com/ClickHouse/ClickHouse/pull/61144) ([李扬](https://github.com/taiyang-li)).
* 在读取完所有必需列后跳过对象的其余部分，从而加快 JSON 解析速度。[#62210](https://github.com/ClickHouse/ClickHouse/pull/62210) ([lgbo](https://github.com/lgbo-ustc)) 。
* 优化在 file/s3/hdfs/url/... 表函数中从文件执行简单 insert select 的性能。新增独立的 max\_parsing\_threads 设置，用于控制并行解析时使用的线程数。[#62404](https://github.com/ClickHouse/ClickHouse/pull/62404) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 函数 `to_utc_timestamp` 和 `from_utc_timestamp` 现在的速度提升了约 2 倍。[#62583](https://github.com/ClickHouse/ClickHouse/pull/62583) ([KevinyhZou](https://github.com/KevinyhZou)) 。
* 当输入中大多是无法解析的值时，函数 `parseDateTimeOrNull`、`parseDateTimeOrZero`、`parseDateTimeInJodaSyntaxOrNull` 和 `parseDateTimeInJodaSyntaxOrZero` 的运行速度现已显著提升 (10 倍 - 1000 倍) 。[#62634](https://github.com/ClickHouse/ClickHouse/pull/62634) ([LiuNeng](https://github.com/liuneng1994)) 。
* 对 `system.query_cache` 执行 SELECT 现在明显更快了，尤其是在查询缓存包含大量条目时 (例如超过 100.000) 。[#62671](https://github.com/ClickHouse/ClickHouse/pull/62671) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 减少文件系统缓存中的争用 (第 3 部分) ：在尝试预留空间时，执行文件系统删除操作无需加锁。[#61163](https://github.com/ClickHouse/ClickHouse/pull/61163) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 加快文件系统缓存的动态扩容与缩容。[#61723](https://github.com/ClickHouse/ClickHouse/pull/61723) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 带有 `INVALIDATE_QUERY` 的字典源在启动时不会被重复加载两次。[#62050](https://github.com/ClickHouse/ClickHouse/pull/62050) ([vdimir](https://github.com/vdimir)).
* 修复了一个问题：当在涉及主键的布尔表达式后额外添加多余的 `= 1` 或 `= 0` 时，无法使用主索引。例如，`SELECT * FROM <table> WHERE <primary-key> IN (<value>) = 1` 和 `SELECT * FROM <table> WHERE <primary-key> NOT IN (<value>) = 0` 都会执行全表扫描，尽管实际上可以使用主索引。[#62142](https://github.com/ClickHouse/ClickHouse/pull/62142) ([josh-hildred](https://github.com/josh-hildred)).
* 从 `system.remote_data_paths` 返回 chunks 流，而不是先将整个结果累积成一个大的 chunk。这样可以减少内存占用、显示中间进度，并支持取消查询。[#62613](https://github.com/ClickHouse/ClickHouse/pull/62613) ([Alexander Gololobov](https://github.com/davenger)).

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

* 支持通过设置 `azure_allow_parallel_part_upload` 管理 Azure Blob 存储的并行写入缓冲。[#62534](https://github.com/ClickHouse/ClickHouse/pull/62534) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)).
* 用户态页缓存现已支持静态 Web 存储 (`disk(type = web)`) 。使用客户端设置 `use_page_cache_for_disks_without_file_cache=1` 启用。[#61911](https://github.com/ClickHouse/ClickHouse/pull/61911) ([Michael Kolupaev](https://github.com/al13n321)).
* 不再将 `Variant` 类型中的 Bool 和数值变体视为可疑。[#61999](https://github.com/ClickHouse/ClickHouse/pull/61999) ([Kruglov Pavel](https://github.com/Avogar)).
* 通过解析改进了从 String 到 `Variant` 的转换。[#62005](https://github.com/ClickHouse/ClickHouse/pull/62005) ([Kruglov Pavel](https://github.com/Avogar)).
* JSONExtract 函数现已支持 `Variant`。[#62014](https://github.com/ClickHouse/ClickHouse/pull/62014) ([Kruglov Pavel](https://github.com/Avogar)).
* 将 `Variant` 类型标记为可比较，因此可用于主键。[#62693](https://github.com/ClickHouse/ClickHouse/pull/62693) ([Kruglov Pavel](https://github.com/Avogar)).

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

* 为方便起见，`SELECT * FROM numbers() `的行为将与 `SELECT * FROM system.numbers` 相同——即不带 limit。[#61969](https://github.com/ClickHouse/ClickHouse/pull/61969) ([YenchangChan](https://github.com/YenchangChan)) 。
* 为 Kafka 配置引入单独的消费者/生产者标签。这样可避免 librdkafka (一个问题很多的糟糕 C 库) 发出警告，指出为生产者实例指定了消费者属性，反之亦然 (例如 `Configuration property session.timeout.ms is a consumer property and will be ignored by this producer instance`) 。关闭：[#58983](https://github.com/ClickHouse/ClickHouse/issues/58983)。[#58956](https://github.com/ClickHouse/ClickHouse/pull/58956) ([Aleksandr Musorin](https://github.com/AVMusorin)) 。
* 函数 `date_diff` 和 `age` 现在按纳秒精度而非微秒精度计算结果。它们现在还支持将 `nanosecond` (或 `nanoseconds` 或 `ns`) 作为 `unit` 参数的可选值。[#61409](https://github.com/ClickHouse/ClickHouse/pull/61409) ([Austin Kothig](https://github.com/kothiga)).
* 为 `date_trunc` 新增了纳秒、微秒和毫秒单位。[#62335](https://github.com/ClickHouse/ClickHouse/pull/62335) ([Misz606](https://github.com/Misz606)).
* 重新加载证书时，也会重新加载证书链。[#61671](https://github.com/ClickHouse/ClickHouse/pull/61671) ([Pervakov Grigorii](https://github.com/GrigoryPervakov)) 。
* 尝试通过在该副本路径存在活动副本时禁止附加表，避免错误 [#60432](https://github.com/ClickHouse/ClickHouse/issues/60432)。[#61876](https://github.com/ClickHouse/ClickHouse/pull/61876) ([Arthur Passos](https://github.com/arthurpassos)) 。
* 为 `clickhouse-local` 增加对 `input` 的支持。[#61923](https://github.com/ClickHouse/ClickHouse/pull/61923) ([Azat Khuzhin](https://github.com/azat)) 。
* `Join` 表引擎在 strictness 为 `ANY` 时，重载后的一致性得到保证。插入多行相同键的数据时，第一行的优先级最高 (此前会在表加载时随机选择) 。关闭 [#51027](https://github.com/ClickHouse/ClickHouse/issues/51027)。[#61972](https://github.com/ClickHouse/ClickHouse/pull/61972) ([vdimir](https://github.com/vdimir)).
* 从 Apache Arrow schema 自动推断 Nullable 列类型。 [#61984](https://github.com/ClickHouse/ClickHouse/pull/61984) ([Maksim Kita](https://github.com/kitaisreal)).
* 允许在聚合过程中取消对聚合状态的并行合并。示例：`uniqExact`。[#61992](https://github.com/ClickHouse/ClickHouse/pull/61992) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 使用 `system.keywords` 来填充建议项，并在内部所有位置统一使用它们。[#62000](https://github.com/ClickHouse/ClickHouse/pull/62000) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 用于 `ReplicatedMergeTree` 的 `OPTIMIZE FINAL` 现在会等待当前正在进行的合并完成，然后再次尝试调度最终合并。这使其行为更接近普通 `MergeTree`。[#62067](https://github.com/ClickHouse/ClickHouse/pull/62067) ([Nikita Taranov](https://github.com/nickitat)).
* 在从 Hive 文本文件中读取数据时，系统会使用该文件的第一行来调整输入字段数，但有时第一行的字段数与定义的 Hive 表并不一致。例如，Hive 表被定义为有 3 列，如 `test_tbl(a Int32, b Int32, c Int32)`，但文本文件的第一行只有 2 个字段。在这种情况下，输入字段数会被调整为 2；如果文本文件的下一行有 3 个字段，那么第三个字段将无法读取，而会被设为默认值 0，这显然不正确。 [#62086](https://github.com/ClickHouse/ClickHouse/pull/62086) ([KevinyhZou](https://github.com/KevinyhZou)).
* `CREATE AS` 会复制表注释。[#62117](https://github.com/ClickHouse/ClickHouse/pull/62117) ([Pablo Marcos](https://github.com/pamarcos)) 。
* 为 zookeeper 表添加查询进度信息。[#62152](https://github.com/ClickHouse/ClickHouse/pull/62152) ([JackyWoo](https://github.com/JackyWoo)).
* 新增了可在整个 server 范围内启用 trace 收集器 (Real 和 CPU) 的功能。[#62189](https://github.com/ClickHouse/ClickHouse/pull/62189) ([alesapin](https://github.com/alesapin)).
* 新增了设置 `lightweight_deletes_sync` (默认值：2——同步等待所有副本) 。它与设置 `mutations_sync` 类似，但只影响轻量级删除的行为。[#62195](https://github.com/ClickHouse/ClickHouse/pull/62195) ([Anton Popov](https://github.com/CurtizJ)) 。
* 在解析自定义设置的值时，区分布尔值和整数：`SET custom_a = true; SET custom_b = 1;`。[#62206](https://github.com/ClickHouse/ClickHouse/pull/62206) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 支持通过 AWS Private Link 接口端点访问 S3。解决了 [#60021](https://github.com/ClickHouse/ClickHouse/issues/60021)、[#31074](https://github.com/ClickHouse/ClickHouse/issues/31074) 和 [#53761](https://github.com/ClickHouse/ClickHouse/issues/53761)。[#62208](https://github.com/ClickHouse/ClickHouse/pull/62208) ([Arthur Passos](https://github.com/arthurpassos)) 。
* 如果 UDF 目录不存在，不要在 clickhouse-client 中创建它。此更改关闭了 [#59597](https://github.com/ClickHouse/ClickHouse/issues/59597)。[#62366](https://github.com/ClickHouse/ClickHouse/pull/62366) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 查询缓存现在不再缓存针对系统表 (`system.*`、`information_schema.*`、`INFORMATION_SCHEMA.*`) 的查询结果。[#62376](https://github.com/ClickHouse/ClickHouse/pull/62376) ([Robert Schulze](https://github.com/rschu1ze)) 。
* `MOVE PARTITION TO TABLE` 查询可能会被延迟，或抛出 `TOO_MANY_PARTS` 异常，以避免超出 parts 数量限制。其应用的设置和限制与 `INSERT` 查询相同 (参见 `max_parts_in_total`、`parts_to_delay_insert`、`parts_to_throw_insert`、`inactive_parts_to_throw_insert`、`inactive_parts_to_delay_insert`、`max_avg_part_size_for_too_many_parts`、`min_delay_to_insert_ms` 和 `max_delay_to_insert` 设置) 。[#62420](https://github.com/ClickHouse/ClickHouse/pull/62420) ([Sergei Trifonov](https://github.com/serxa)) 。
* 将 macOS 上的默认安装目录从 `/usr/bin` 更改为 `/usr/local/bin`。这是必要的，因为 Apple 在 macOS El Capitan (2015) 中引入的系统完整性保护 (System Integrity Protection) 会阻止向 `/usr/bin` 写入内容，即使使用 `sudo` 也不例外。[#62489](https://github.com/ClickHouse/ClickHouse/pull/62489) ([haohang](https://github.com/yokofly)).
* 让 `transform` 始终返回首个匹配项。[#62518](https://github.com/ClickHouse/ClickHouse/pull/62518) ([Raúl Marín](https://github.com/Algunenano)).
* 为系统表 `blob_storage_log` 补充了缺失的 `hostname` 列。[#62456](https://github.com/ClickHouse/ClickHouse/pull/62456) ([Jayme Bird](https://github.com/jaymebrd)).
* 为与其他系统表保持一致，`system.backup_log` 现已增加 `event_time` 列。[#62541](https://github.com/ClickHouse/ClickHouse/pull/62541) ([Jayme Bird](https://github.com/jaymebrd)) 。
* 表 `system.backup_log` 现在使用“默认”排序键，即 `event_date, event_time`，与其他 `_log` 表引擎相同。[#62667](https://github.com/ClickHouse/ClickHouse/pull/62667) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 在执行 `RESTORE` 时，避免对表的 DEFAULT 表达式求值。[#62601](https://github.com/ClickHouse/ClickHouse/pull/62601) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* S3 存储和备份也需要采用与 S3 磁盘相同的默认 Keep-Alive 设置。[#62648](https://github.com/ClickHouse/ClickHouse/pull/62648) ([Sema Checherinda](https://github.com/CheSema)) 。
* 将 librdkafka's (那个臭名昭著、bug 很多的 C 库) 的客户端标识符加入日志消息中，以便区分同一张表的不同消费者产生的日志消息。[#62813](https://github.com/ClickHouse/ClickHouse/pull/62813) ([János Benjamin Antal](https://github.com/antaljanosbenjamin)) 。
* 允许在 Replicated database 的 ZooKeeper 路径中使用特殊宏 `{uuid}` 和 `{database}`。[#62818](https://github.com/ClickHouse/ClickHouse/pull/62818) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 允许在 HTTP 请求中为配额键使用不同的身份验证方案。[#62842](https://github.com/ClickHouse/ClickHouse/pull/62842) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 降低了 `clickhouse client` 和 `clickhouse local` 中命令行参数 `--help` 输出的冗长程度。此前的输出现在可通过 `--help --verbose` 生成。[#62973](https://github.com/ClickHouse/ClickHouse/pull/62973) ([Yarik Briukhovetskyi](https://github.com/yariks5s)) 。
* `log_bin_use_v1_row_events` 已在 MySQL 8.3 中移除，我们已相应调整 Experimental `MaterializedMySQL` 引擎 [#60479](https://github.com/ClickHouse/ClickHouse/issues/60479)。[#63101](https://github.com/ClickHouse/ClickHouse/pull/63101) ([Eugene Klimov](https://github.com/Slach)) 。作者：Nikolay Yankin。

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

* 将 Rust 依赖项一并纳入，这样 Rust 代码 (我们用它来搞一些小功能，图个乐子) 就能像 C++ 一样以比较合理的方式构建。[#62297](https://github.com/ClickHouse/ClickHouse/pull/62297) ([Raúl Marín](https://github.com/Algunenano)).
* ClickHouse 现已改用 OpenSSL 3.2，不再使用 BoringSSL。[#59870](https://github.com/ClickHouse/ClickHouse/pull/59870) ([Robert Schulze](https://github.com/rschu1ze)) 。请注意，OpenSSL 的工程文化总体上较差 (例如存在一些 sanitizer 报告需要我们打补丁处理，构建系统复杂且包含生成文件等) ，但兼容性更好。
* 在压力测试中，以 1/2 的概率忽略 DROP 查询；并且在对 Memory/JOIN 表进行升级检查时，使用 TRUNCATE，而不是忽略 DROP。 [#61476](https://github.com/ClickHouse/ClickHouse/pull/61476) ([Kruglov Pavel](https://github.com/Avogar)).
* 从 Keeper Docker 镜像中移除了 /etc/clickhouse-keeper 和 /var/log/clickhouse-keeper 这两个卷。[#61683](https://github.com/ClickHouse/ClickHouse/pull/61683) ([Tristan](https://github.com/Tristan971)).
* 为所有在 analyzer 默认启用后不再适用的问题添加测试。 Closes: [#55794](https://github.com/ClickHouse/ClickHouse/issues/55794) Closes: [#49472](https://github.com/ClickHouse/ClickHouse/issues/49472) Closes: [#44414](https://github.com/ClickHouse/ClickHouse/issues/44414) Closes: [#13843](https://github.com/ClickHouse/ClickHouse/issues/13843) Closes: [#55803](https://github.com/ClickHouse/ClickHouse/issues/55803) Closes: [#48308](https://github.com/ClickHouse/ClickHouse/issues/48308) Closes: [#45535](https://github.com/ClickHouse/ClickHouse/issues/45535) Closes: [#44365](https://github.com/ClickHouse/ClickHouse/issues/44365) Closes: [#44153](https://github.com/ClickHouse/ClickHouse/issues/44153) Closes: [#42399](https://github.com/ClickHouse/ClickHouse/issues/42399) Closes: [#27115](https://github.com/ClickHouse/ClickHouse/issues/27115) Closes: [#23162](https://github.com/ClickHouse/ClickHouse/issues/23162) Closes: [#15395](https://github.com/ClickHouse/ClickHouse/issues/15395) Closes: [#15411](https://github.com/ClickHouse/ClickHouse/issues/15411) Closes: [#14978](https://github.com/ClickHouse/ClickHouse/issues/14978) Closes: [#17319](https://github.com/ClickHouse/ClickHouse/issues/17319) Closes: [#11813](https://github.com/ClickHouse/ClickHouse/issues/11813) Closes: [#13210](https://github.com/ClickHouse/ClickHouse/issues/13210) Closes: [#23053](https://github.com/ClickHouse/ClickHouse/issues/23053) Closes: [#37729](https://github.com/ClickHouse/ClickHouse/issues/37729) Closes: [#32639](https://github.com/ClickHouse/ClickHouse/issues/32639) Closes: [#9954](https://github.com/ClickHouse/ClickHouse/issues/9954) Closes: [#41964](https://github.com/ClickHouse/ClickHouse/issues/41964) Closes: [#54317](https://github.com/ClickHouse/ClickHouse/issues/54317) Closes: [#7520](https://github.com/ClickHouse/ClickHouse/issues/7520) Closes: [#36973](https://github.com/ClickHouse/ClickHouse/issues/36973) Closes: [#40955](https://github.com/ClickHouse/ClickHouse/issues/40955) Closes: [#19687](https://github.com/ClickHouse/ClickHouse/issues/19687) Closes: [#23104](https://github.com/ClickHouse/ClickHouse/issues/23104) Closes: [#21584](https://github.com/ClickHouse/ClickHouse/issues/21584) Closes: [#23344](https://github.com/ClickHouse/ClickHouse/issues/23344) Closes: [#22627](https://github.com/ClickHouse/ClickHouse/issues/22627) Closes: [#10276](https://github.com/ClickHouse/ClickHouse/issues/10276) Closes: [#19687](https://github.com/ClickHouse/ClickHouse/issues/19687) Closes: [#4567](https://github.com/ClickHouse/ClickHouse/issues/4567) Closes: [#17710](https://github.com/ClickHouse/ClickHouse/issues/17710) Closes: [#11068](https://github.com/ClickHouse/ClickHouse/issues/11068) Closes: [#24395](https://github.com/ClickHouse/ClickHouse/issues/24395) Closes: [#23416](https://github.com/ClickHouse/ClickHouse/issues/23416) Closes: [#23162](https://github.com/ClickHouse/ClickHouse/issues/23162) Closes: [#25655](https://github.com/ClickHouse/ClickHouse/issues/25655) Closes: [#11757](https://github.com/ClickHouse/ClickHouse/issues/11757) Closes: [#6571](https://github.com/ClickHouse/ClickHouse/issues/6571) Closes: [#4432](https://github.com/ClickHouse/ClickHouse/issues/4432) Closes: [#8259](https://github.com/ClickHouse/ClickHouse/issues/8259) Closes: [#9233](https://github.com/ClickHouse/ClickHouse/issues/9233) Closes: [#14699](https://github.com/ClickHouse/ClickHouse/issues/14699) Closes: [#27068](https://github.com/ClickHouse/ClickHouse/issues/27068) Closes: [#28687](https://github.com/ClickHouse/ClickHouse/issues/28687) Closes: [#28777](https://github.com/ClickHouse/ClickHouse/issues/28777) Closes: [#29734](https://github.com/ClickHouse/ClickHouse/issues/29734) Closes: [#61238](https://github.com/ClickHouse/ClickHouse/issues/61238) Closes: [#33825](https://github.com/ClickHouse/ClickHouse/issues/33825) Closes: [#35608](https://github.com/ClickHouse/ClickHouse/issues/35608) Closes: [#29838](https://github.com/ClickHouse/ClickHouse/issues/29838) Closes: [#35652](https://github.com/ClickHouse/ClickHouse/issues/35652) Closes: [#36189](https://github.com/ClickHouse/ClickHouse/issues/36189) Closes: [#39634](https://github.com/ClickHouse/ClickHouse/issues/39634) Closes: [#47432](https://github.com/ClickHouse/ClickHouse/issues/47432) Closes: [#54910](https://github.com/ClickHouse/ClickHouse/issues/54910) Closes: [#57321](https://github.com/ClickHouse/ClickHouse/issues/57321) Closes: [#59154](https://github.com/ClickHouse/ClickHouse/issues/59154) Closes: [#61014](https://github.com/ClickHouse/ClickHouse/issues/61014) Closes: [#61950](https://github.com/ClickHouse/ClickHouse/issues/61950) Closes: [#55647](https://github.com/ClickHouse/ClickHouse/issues/55647) Closes: [#61947](https://github.com/ClickHouse/ClickHouse/issues/61947). [#62185](https://github.com/ClickHouse/ClickHouse/pull/62185) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* 添加更多测试，以覆盖那些已不再相关或已由 analyzer 修复的问题。关闭：[#58985](https://github.com/ClickHouse/ClickHouse/issues/58985) 关闭：[#59549](https://github.com/ClickHouse/ClickHouse/issues/59549) 关闭：[#36963](https://github.com/ClickHouse/ClickHouse/issues/36963) 关闭：[#39453](https://github.com/ClickHouse/ClickHouse/issues/39453) 关闭：[#56521](https://github.com/ClickHouse/ClickHouse/issues/56521) 关闭：[#47552](https://github.com/ClickHouse/ClickHouse/issues/47552) 关闭：[#56503](https://github.com/ClickHouse/ClickHouse/issues/56503) 关闭：[#59101](https://github.com/ClickHouse/ClickHouse/issues/59101) 关闭：[#50271](https://github.com/ClickHouse/ClickHouse/issues/50271) 关闭：[#54954](https://github.com/ClickHouse/ClickHouse/issues/54954) 关闭：[#56466](https://github.com/ClickHouse/ClickHouse/issues/56466) 关闭：[#11000](https://github.com/ClickHouse/ClickHouse/issues/11000) 关闭：[#10894](https://github.com/ClickHouse/ClickHouse/issues/10894) 关闭：[https://github.com/ClickHouse/ClickHouse/issues/448](https://github.com/ClickHouse/ClickHouse/issues/448) 关闭：[#8030](https://github.com/ClickHouse/ClickHouse/issues/8030) 关闭：[#32139](https://github.com/ClickHouse/ClickHouse/issues/32139) 关闭：[#47288](https://github.com/ClickHouse/ClickHouse/issues/47288) 关闭：[#50705](https://github.com/ClickHouse/ClickHouse/issues/50705) 关闭：[#54511](https://github.com/ClickHouse/ClickHouse/issues/54511) 关闭：[#55466](https://github.com/ClickHouse/ClickHouse/issues/55466) 关闭：[#58500](https://github.com/ClickHouse/ClickHouse/issues/58500) 关闭：[#39923](https://github.com/ClickHouse/ClickHouse/issues/39923) 关闭：[#39855](https://github.com/ClickHouse/ClickHouse/issues/39855) 关闭：[#4596](https://github.com/ClickHouse/ClickHouse/issues/4596) 关闭：[#47422](https://github.com/ClickHouse/ClickHouse/issues/47422) 关闭：[#33000](https://github.com/ClickHouse/ClickHouse/issues/33000) 关闭：[#14739](https://github.com/ClickHouse/ClickHouse/issues/14739) 关闭：[#44039](https://github.com/ClickHouse/ClickHouse/issues/44039) 关闭：[#8547](https://github.com/ClickHouse/ClickHouse/issues/8547) 关闭：[#22923](https://github.com/ClickHouse/ClickHouse/issues/22923) 关闭：[#23865](https://github.com/ClickHouse/ClickHouse/issues/23865) 关闭：[#29748](https://github.com/ClickHouse/ClickHouse/issues/29748) 关闭：[#4222](https://github.com/ClickHouse/ClickHouse/issues/4222)。[#62457](https://github.com/ClickHouse/ClickHouse/pull/62457) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 修复了动态链接 OpenSSL 时的构建错误 (注意：这种情况通常不受支持，且仅 IBM 的 s390x 平台才需要这样做) 。[#62888](https://github.com/ClickHouse/ClickHouse/pull/62888) ([Harry Lee](https://github.com/HarryLeeIBM)) 。

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

* 修复回滚 quorum 插入事务时的逻辑错误。[#61953](https://github.com/ClickHouse/ClickHouse/pull/61953) ([Han Fei](https://github.com/hanfei1991)).
* 修复在使用 COUNT(\*) 和 FILTER 子句时出现的解析器错误 [#61357](https://github.com/ClickHouse/ClickHouse/pull/61357) ([Duc Canh Le](https://github.com/canhld94)).
* 修复 `group_by_use_nulls` + grouping sets + analyzer + materialize/constant 的逻辑错误 [#61567](https://github.com/ClickHouse/ClickHouse/pull/61567) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 在移除已移动的 parts 之前，先取消合并操作 [#61610](https://github.com/ClickHouse/ClickHouse/pull/61610) ([János Benjamin Antal](https://github.com/antaljanosbenjamin)).
* 修复 Apache Arrow 中的崩溃问题 [#61720](https://github.com/ClickHouse/ClickHouse/pull/61720) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 在与特定磁盘对应的正确 path 中查找 `convert_to_replicated` 标志 [#61769](https://github.com/ClickHouse/ClickHouse/pull/61769) ([Kirill](https://github.com/kirillgarbar)) 。
* 修复 distributed\_foreground\_insert/distributed\_background\_insert\_batch 中可能出现的连接数据竞争问题 [#61867](https://github.com/ClickHouse/ClickHouse/pull/61867) ([Azat Khuzhin](https://github.com/azat)).
* 将 CANNOT\_PARSE\_ESCAPE\_SEQUENCE error 标记为解析错误，以便在行输入格式中跳过该错误 [#61883](https://github.com/ClickHouse/ClickHouse/pull/61883) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复在 HTTP 中使用 http\_wait\_end\_of\_query 时异常消息被写入输出格式的问题 [#61951](https://github.com/ClickHouse/ClickHouse/pull/61951) ([Kruglov Pavel](https://github.com/Avogar)).
* 正确修复了 LowCardinality 与 JSONExtact 函数配合使用时的问题 [#61957](https://github.com/ClickHouse/ClickHouse/pull/61957) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 如果 Row Policy 没有表达式，Merge 引擎会崩溃 [#61971](https://github.com/ClickHouse/ClickHouse/pull/61971) ([Ilya Golshtein](https://github.com/ilejn)).
* 修复 WriteBufferAzureBlobStorage 析构函数中的未捕获异常 [#61988](https://github.com/ClickHouse/ClickHouse/pull/61988) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)) 。
* 修复了 ReplicatedMergeTree 在未定义列时执行 CREATE TABLE 的问题 [#62040](https://github.com/ClickHouse/ClickHouse/pull/62040) ([Azat Khuzhin](https://github.com/azat)).
* 修复复合分片键的 optimize\_skip\_unused\_shards\_rewrite\_in 重写问题 [#62047](https://github.com/ClickHouse/ClickHouse/pull/62047) ([Azat Khuzhin](https://github.com/azat)) 。
* ReadWriteBufferFromHTTP 在重定向时会设置正确的 host 请求头 [#62068](https://github.com/ClickHouse/ClickHouse/pull/62068) ([Sema Checherinda](https://github.com/CheSema)).
* 修复外部表无法解析 Bool 数据类型的问题 [#62115](https://github.com/ClickHouse/ClickHouse/pull/62115) ([Duc Canh Le](https://github.com/canhld94)) 。
* analyzer：修复查询参数解析问题 [#62186](https://github.com/ClickHouse/ClickHouse/pull/62186) ([Dmitry Novik](https://github.com/novikd)) 。
* 修复在 readonly 模式下恢复 parts 的问题 [#62207](https://github.com/ClickHouse/ClickHouse/pull/62207) ([Vitaly Baranov](https://github.com/vitlibar)).
* 修复索引定义中包含 SQL UDF 时发生的崩溃问题 [#62225](https://github.com/ClickHouse/ClickHouse/pull/62225) ([vdimir](https://github.com/vdimir)).
* 修复了 analyzer 中 generateRandom 使用 NULL 随机种子的问题。[#62248](https://github.com/ClickHouse/ClickHouse/pull/62248) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 在 Distinct Transfom 中正确处理 const 列 [#62250](https://github.com/ClickHouse/ClickHouse/pull/62250) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 修复带有 FINAL 修饰符的查询中的 Parts Splitter 问题 [#62268](https://github.com/ClickHouse/ClickHouse/pull/62268) ([Nikita Taranov](https://github.com/nickitat)) 。
* analyzer：修复别名解析为参数化视图的问题 [#62274](https://github.com/ClickHouse/ClickHouse/pull/62274) ([Dmitry Novik](https://github.com/novikd)) 。
* analyzer：修复父作用域中的名称解析问题 [#62281](https://github.com/ClickHouse/ClickHouse/pull/62281) ([Dmitry Novik](https://github.com/novikd)).
* 修复了 argMax 在 Nullable 非原生数值列上的问题 [#62285](https://github.com/ClickHouse/ClickHouse/pull/62285) ([Raúl Marín](https://github.com/Algunenano)).
* 修复 Ordinary 数据库中 materialized view 的备份和恢复问题 [#62295](https://github.com/ClickHouse/ClickHouse/pull/62295) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复 Context 中标量的数据竞争问题 [#62305](https://github.com/ClickHouse/ClickHouse/pull/62305) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复 materialized view 中的主键问题 [#62319](https://github.com/ClickHouse/ClickHouse/pull/62319) ([Murat Khairulin](https://github.com/mxwell)).
* 不要为不支持该功能的表构建多线程 insert 管道 [#62333](https://github.com/ClickHouse/ClickHouse/pull/62333) ([vdimir](https://github.com/vdimir)).
* 修复 analyzer 在分布式查询中处理位置参数时的问题 [#62362](https://github.com/ClickHouse/ClickHouse/pull/62362) ([flynn](https://github.com/ucasfl)).
* 修复 analyzer 中 Merge 引擎对 additional\_table\_filters 的过滤器下推问题 [#62398](https://github.com/ClickHouse/ClickHouse/pull/62398) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复 analyzer 处理 GLOBAL IN 表查询时的问题。[#62409](https://github.com/ClickHouse/ClickHouse/pull/62409) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 在 s3/hdfs/azure 引擎进行分区写入时，遵循设置 truncate\_on\_insert/create\_new\_file\_on\_insert [#62425](https://github.com/ClickHouse/ClickHouse/pull/62425) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复 AzureBlobStorage 的备份恢复路径问题 [#62447](https://github.com/ClickHouse/ClickHouse/pull/62447) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)) 。
* 修复了 SimpleSquashingChunksTransform [#62451](https://github.com/ClickHouse/ClickHouse/pull/62451) ([Nikita Taranov](https://github.com/nickitat)) 。
* 修复嵌套 lambda 的捕获问题。[#62462](https://github.com/ClickHouse/ClickHouse/pull/62462) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 避免读取具有递归类型的 protobuf 时发生崩溃 [#62506](https://github.com/ClickHouse/ClickHouse/pull/62506) ([Raúl Marín](https://github.com/Algunenano)).
* 修复将某个分区移动到其自身时的错误 [#62524](https://github.com/ClickHouse/ClickHouse/pull/62524) ([helifu](https://github.com/helifu)).
* 修复 `LIMIT` 中标量子查询的问题 [#62567](https://github.com/ClickHouse/ClickHouse/pull/62567) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了 Experimental 且不受支持的 Hive 引擎中的段错误，反正我们本来也不喜欢它 [#62578](https://github.com/ClickHouse/ClickHouse/pull/62578) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 修复 groupArraySorted 的内存泄漏问题 [#62597](https://github.com/ClickHouse/ClickHouse/pull/62597) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 修复 `largestTriangleThreeBuckets` 中的崩溃问题 [#62646](https://github.com/ClickHouse/ClickHouse/pull/62646) ([Raúl Marín](https://github.com/Algunenano)) 。
* 修复了在较高分辨率下 tumble\[Start,End] 和 hop\[Start,End] 的问题 [#62705](https://github.com/ClickHouse/ClickHouse/pull/62705) ([Jordi Villar](https://github.com/jrdi)) 。
* 修复 argMin/argMax 组合器的状态 [#62708](https://github.com/ClickHouse/ClickHouse/pull/62708) ([Raúl Marín](https://github.com/Algunenano)) 。
* 修复了因缓存锁竞争优化而导致缓存中的临时数据处理失败的问题 [#62715](https://github.com/ClickHouse/ClickHouse/pull/62715) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 修复函数 `mergeTreeIndex` 中导致崩溃的问题 [#62762](https://github.com/ClickHouse/ClickHouse/pull/62762) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复：更新：嵌套物化列：大小检查修复 [#62773](https://github.com/ClickHouse/ClickHouse/pull/62773) ([Eliot Hautefeuille](https://github.com/hileef)) 。
* 修复在启用 analyzer 的 CTE 中 FINAL 修饰符未生效的问题 [#62811](https://github.com/ClickHouse/ClickHouse/pull/62811) ([Duc Canh Le](https://github.com/canhld94)).
* 修复了在使用 `JSON` 格式和 HTTP 接口时，函数 `formatRow` 崩溃的问题 [#62840](https://github.com/ClickHouse/ClickHouse/pull/62840) ([Anton Popov](https://github.com/CurtizJ)).
* Azure：修复根据端点对象构建最终 URL 的问题 [#62850](https://github.com/ClickHouse/ClickHouse/pull/62850) ([Daniel Pozo Escalona](https://github.com/danipozo)) 。
* 修复 GCD 编解码器问题 [#62853](https://github.com/ClickHouse/ClickHouse/pull/62853) ([Nikita Taranov](https://github.com/nickitat)) 。
* 修复 hyperrectangle 中的 LowCardinality(Nullable) 键问题 [#62866](https://github.com/ClickHouse/ClickHouse/pull/62866) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了 `fromUnixtimestamp` 在 Joda 语法中处理超出 UInt32 范围的输入值时的问题 [#62901](https://github.com/ClickHouse/ClickHouse/pull/62901) ([KevinyhZou](https://github.com/KevinyhZou)).
* 禁用 sum(nullable) 的 optimize\_rewrite\_aggregate\_function\_with\_if [#62912](https://github.com/ClickHouse/ClickHouse/pull/62912) ([Raúl Marín](https://github.com/Algunenano)) 。
* 修复了 StorageBuffer 在源表列类型不同时的 PREWHERE 问题。 [#62916](https://github.com/ClickHouse/ClickHouse/pull/62916) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 修复了在缓存键目录创建失败时，对缓存中的临时数据处理不当的问题 [#62925](https://github.com/ClickHouse/ClickHouse/pull/62925) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* gRPC：修复 IPv6 对端连接导致的崩溃问题 [#62978](https://github.com/ClickHouse/ClickHouse/pull/62978) ([Konstantin Bogdanov](https://github.com/thevar1able)) 。
* 修复副本拉取期间可能出现的 CHECKSUM\_DOESNT\_MATCH (以及其他问题) [#62987](https://github.com/ClickHouse/ClickHouse/pull/62987) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了 cache 中临时数据因未捕获异常而终止的问题 [#62998](https://github.com/ClickHouse/ClickHouse/pull/62998) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 修复 optimize\_rewrite\_aggregate\_function\_with\_if 中的隐式类型转换问题 [#62999](https://github.com/ClickHouse/ClickHouse/pull/62999) ([Raúl Marín](https://github.com/Algunenano)) 。
* 修复 \~RestorerFromBackup 中未处理异常的问题 [#63040](https://github.com/ClickHouse/ClickHouse/pull/63040) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 对于次级查询，不要从 GROUP BY 键中移除服务器端常量。[#63047](https://github.com/ClickHouse/ClickHouse/pull/63047) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 修复对函数 abs 单调性的误判 [#63097](https://github.com/ClickHouse/ClickHouse/pull/63097) ([Duc Canh Le](https://github.com/canhld94)) 。
* 为 MongoDB 引擎中的 SSL 握手设置服务器名称 [#63122](https://github.com/ClickHouse/ClickHouse/pull/63122) ([Alexander Gololobov](https://github.com/davenger)).
* 在 MongoDB 线协议版本检查中，使用用户指定的 db，而不是 "config" [#63126](https://github.com/ClickHouse/ClickHouse/pull/63126) ([Alexander Gololobov](https://github.com/davenger)) 。

### <a id="243" /> ClickHouse 24.3 LTS 版本发布，2024-03-27 发布。[Presentation](https://presentations.clickhouse.com/2024-release-24.3/)、[Video](https://www.youtube.com/watch?v=FGhdXXXTuTg)

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

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

* 设置 `allow_experimental_analyzer` 默认启用，它会将查询分析切换到新的实现，该实现具有更好的兼容性和更完整的功能。功能 "analyzer" 现被视为 Beta，而非 Experimental。你可以将 `compatibility` 设置为 `24.2`，或禁用 `allow_experimental_analyzer` 设置，以恢复旧版行为。观看 [YouTube 视频](https://www.youtube.com/watch?v=zhrOYQpgvkk)。
* ClickHouse 允许 String 数据类型包含任意二进制数据，而该类型通常为 UTF-8。Parquet/ORC/Arrow 的 String 仅支持 UTF-8。因此，你可以为 ClickHouse 的 String 数据类型选择使用 Arrow 的哪种数据类型——String 或 Binary。这由以下设置控制：`output_format_parquet_string_as_string`、`output_format_orc_string_as_string`、`output_format_arrow_string_as_string`。虽然 Binary 在语义上更准确、兼容性也更好，但默认使用 String 在大多数情况下更符合用户预期。Parquet/ORC/Arrow 支持多种压缩方法，包括 lz4 和 zstd。ClickHouse 支持所有这些压缩方法。有些功能较弱的工具不支持速度更快的 `lz4` 压缩方法，因此我们默认使用 `zstd`。这由设置 `output_format_parquet_compression_method`、`output_format_orc_compression_method` 和 `output_format_arrow_compression_method` 控制。我们将 Parquet 和 ORC 的默认值改为 `zstd`，但 Arrow 没有更改 (它更侧重底层用法) 。[#61817](https://github.com/ClickHouse/ClickHouse/pull/61817) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 在新的 ClickHouse 版本中，如果所有参数均为 Float64，函数 `geoDistance`、`greatCircleDistance` 和 `greatCircleAngle` 将在内部计算和返回类型中使用 64 位双精度浮点数据类型。这修复了 [#58476](https://github.com/ClickHouse/ClickHouse/issues/58476)。在之前的版本中，这些函数始终使用 Float32。你可以将 `geo_distance_returns_float64_on_float64_arguments` 设置为 `false`，或将 `compatibility` 设置为 `24.2` 或更早版本，以切换回旧行为。[#61848](https://github.com/ClickHouse/ClickHouse/pull/61848) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。由 [Geet Patel](https://github.com/geetptl) 共同署名。
* 自 23.5 版本起，已废弃过时的内存中数据分区片段，并且自 23.10 版本起已不再受支持。现在，剩余代码也已被移除。这是 [#55186](https://github.com/ClickHouse/ClickHouse/issues/55186) 和 [#45409](https://github.com/ClickHouse/ClickHouse/issues/45409) 的后续工作。你大概率没有用过内存中数据分区片段，因为它们只在 23.5 之前的版本中可用，而且只有在为 MergeTree 表指定相应 SETTINGS 并手动启用时才会使用。要检查是否存在内存中数据分区片段，请运行以下查询：`SELECT part_type, count() FROM system.parts GROUP BY part_type ORDER BY part_type`。要禁用内存中数据分区片段，请执行 `ALTER TABLE ... MODIFY SETTING min_bytes_for_compact_part = DEFAULT, min_rows_for_compact_part = DEFAULT`。在从旧版 ClickHouse 发行版升级之前，请先确认不存在内存中数据分区片段。如果存在内存中数据分区片段，请先禁用它们，然后等待直到内存中数据分区片段全部消失后再继续升级。[#61127](https://github.com/ClickHouse/ClickHouse/pull/61127) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 将 `system.zookeeper` 表中的列名从 `duration_ms` 更改为 `duration_microseconds`，以反映该耗时实际采用的是微秒级分辨率。[#60774](https://github.com/ClickHouse/ClickHouse/pull/60774) ([Duc Canh Le](https://github.com/canhld94)) 。
* 当查询级设置 `async_insert` 和 `deduplicate_blocks_in_dependent_materialized_views` 同时启用时，将拒绝传入的 INSERT 查询。此行为由设置 `throw_if_deduplication_in_dependent_materialized_views_enabled_with_async_insert` 控制，且默认启用。这是对 [https://github.com/ClickHouse/ClickHouse/pull/59699](https://github.com/ClickHouse/ClickHouse/pull/59699) 的后续改动，旨在解除 [https://github.com/ClickHouse/ClickHouse/pull/59915](https://github.com/ClickHouse/ClickHouse/pull/59915) 的阻塞。[#60888](https://github.com/ClickHouse/ClickHouse/pull/60888) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* 工具 `clickhouse-copier` 已迁移到 GitHub 上的独立 repository：[https://github.com/ClickHouse/copier。它不再包含在捆绑包中，但仍可单独下载。此项关闭了：\[](https://github.com/ClickHouse/copier。它不再包含在捆绑包中，但仍可单独下载。此项关闭了：\[) #60734]\([https://github.com/ClickHouse/ClickHouse/issues/60734](https://github.com/ClickHouse/ClickHouse/issues/60734)) 此项关闭了：[#60540](https://github.com/ClickHouse/ClickHouse/issues/60540) 此项关闭了：[#60250](https://github.com/ClickHouse/ClickHouse/issues/60250) 此项关闭了：[#52917](https://github.com/ClickHouse/ClickHouse/issues/52917) 此项关闭了：[#51140](https://github.com/ClickHouse/ClickHouse/issues/51140) 此项关闭了：[#47517](https://github.com/ClickHouse/ClickHouse/issues/47517) 此项关闭了：[#47189](https://github.com/ClickHouse/ClickHouse/issues/47189) 此项关闭了：[#46598](https://github.com/ClickHouse/ClickHouse/issues/46598) 此项关闭了：[#40257](https://github.com/ClickHouse/ClickHouse/issues/40257) 此项关闭了：[#36504](https://github.com/ClickHouse/ClickHouse/issues/36504) 此项关闭了：[#35485](https://github.com/ClickHouse/ClickHouse/issues/35485) 此项关闭了：[#33702](https://github.com/ClickHouse/ClickHouse/issues/33702) 此项关闭了：[#26702](https://github.com/ClickHouse/ClickHouse/issues/26702)。
* 为提高与 MySQL 的兼容性，兼容性别名 `locate` 现在默认接受参数 `(needle, haystack[, start_pos])`。之前的行为 `(haystack, needle, [, start_pos])` 可通过将 `function_locate_has_mysql_compatible_argument_order = 0` 来恢复。[#61092](https://github.com/ClickHouse/ClickHouse/pull/61092) ([Robert Schulze](https://github.com/rschu1ze)).
* 默认禁止在 `MergeTree` 表的 `ORDER BY` 中使用 `SimpleAggregateFunction` (`AggregateFunction` 也同样被禁止，因为它们不可比较) ；如需允许，请使用 `allow_suspicious_primary_key`。[#61399](https://github.com/ClickHouse/ClickHouse/pull/61399) ([Azat Khuzhin](https://github.com/azat)) 。
* `Ordinary` database 引擎已弃用。如果你的服务器正在使用该引擎，你会在 clickhouse-client 中看到警告。此变更关闭了 [#52229](https://github.com/ClickHouse/ClickHouse/issues/52229)。[#56942](https://github.com/ClickHouse/ClickHouse/pull/56942) ([shabroo](https://github.com/shabroo)) 。

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

* 支持以 `tar` 格式读取和写入备份 (除 `zip` 外) 。[#59535](https://github.com/ClickHouse/ClickHouse/pull/59535) ([josh-hildred](https://github.com/josh-hildred)).
* 新增对 S3 Express bucket 的支持。[#59965](https://github.com/ClickHouse/ClickHouse/pull/59965) ([Nikita Taranov](https://github.com/nickitat)).
* 允许从不同磁盘挂载 parts (使用复制而非硬链接) 。[#60112](https://github.com/ClickHouse/ClickHouse/pull/60112) ([Unalian](https://github.com/Unalian)).
* 为 `Memory` 表增加大小上限：由其设置 `min_bytes_to_keep, max_bytes_to_keep, min_rows_to_keep` 和 `max_rows_to_keep` 控制。[#60612](https://github.com/ClickHouse/ClickHouse/pull/60612) ([Jake Bamrah](https://github.com/JakeBamrah)).
* 将等待中查询和执行中查询的数量限制分开。新增服务器设置 `max_waiting_queries`，用于限制因 `async_load_databases` 而处于等待状态的查询数量。现有对执行中查询数量的限制不再将等待中的查询计入其中。[#61053](https://github.com/ClickHouse/ClickHouse/pull/61053) ([Sergei Trifonov](https://github.com/serxa)).
* 新增表 `system.keywords`，包含 parser 中的所有关键字。主要用于改进模糊测试和语法高亮。[#51808](https://github.com/ClickHouse/ClickHouse/pull/51808) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* 新增对 `ATTACH PARTITION ALL` 的支持。[#61107](https://github.com/ClickHouse/ClickHouse/pull/61107) ([Kirill Nikiforov](https://github.com/allmazz)).
* 新增函数 `getClientHTTPHeader`。此更改解决了 [#54665](https://github.com/ClickHouse/ClickHouse/issues/54665)。与 @lingtaolf 共同完成。[#61820](https://github.com/ClickHouse/ClickHouse/pull/61820) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 新增 `generate_series` 表函数 (作为现有 `numbers` 函数的 PostgreSQL 兼容别名) 。该函数会生成一个由自然数组成的等差数列表。[#59390](https://github.com/ClickHouse/ClickHouse/pull/59390) ([divanik](https://github.com/divanik)).
* 为 `topK`/`topkWeighed` 新增一种支持模式，可返回值的计数及其误差。[#54508](https://github.com/ClickHouse/ClickHouse/pull/54508) ([UnamedRus](https://github.com/UnamedRus)).
* 新增函数 `toMillisecond`，返回 `DateTime` 或 `DateTime64` 类型值中的毫秒分量。[#60281](https://github.com/ClickHouse/ClickHouse/pull/60281) ([Shaun Struwig](https://github.com/Blargian)).
* 允许为 clickhouse-server 配置 HTTP 重定向处理器。例如，可以将 `/` 重定向到 play UI。[#60390](https://github.com/ClickHouse/ClickHouse/pull/60390) ([Alexey Milovidov](https://github.com/alexey-milovidov)).

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

* 优化了函数 `dotProduct`，避免了不必要且代价高昂的内存拷贝。[#60928](https://github.com/ClickHouse/ClickHouse/pull/60928) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 256 位整数的打印速度提高了 30 倍。[#61100](https://github.com/ClickHouse/ClickHouse/pull/61100) ([Raúl Marín](https://github.com/Algunenano)) 。
* 如果表的主键主要包含一些没什么用的列，就不要将它们保留在内存中。这由一个新设置 `primary_key_ratio_of_unique_prefix_values_to_skip_suffix_columns` 控制，其默认值为 `0.9`，也就是说：对于复合主键，如果某一列在至少 0.9 的情况下都会改变值，那么它后面的列将不会被加载。[#60255](https://github.com/ClickHouse/ClickHouse/pull/60255) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 在涉及多个 `Nullable` 列时，提升了序列化聚合方法的性能。[#55809](https://github.com/ClickHouse/ClickHouse/pull/55809) ([Amos Bird](https://github.com/amosbird)) 。
* 延迟构建 JSON 输出，以提升 ALL JOIN 性能。[#58278](https://github.com/ClickHouse/ClickHouse/pull/58278) ([LiuNeng](https://github.com/liuneng1994)).
* 使与外部服务 (如 AWS S3) 的 HTTP/HTTPS 连接可在所有使用场景中复用，即使响应为 3xx 或 4xx 也是如此。[#58845](https://github.com/ClickHouse/ClickHouse/pull/58845) ([Sema Checherinda](https://github.com/CheSema)).
* 优化了聚合函数 `argMin` / `argMax` / `any` / `anyLast` / `anyHeavy`，以及 `ORDER BY {u8/u16/u32/u64/i8/i16/u32/i64) LIMIT 1` 查询。 [#58640](https://github.com/ClickHouse/ClickHouse/pull/58640) ([Raúl Marín](https://github.com/Algunenano)).
* 对列过滤器进行了小幅优化。在某些情况下，峰值内存占用可降至原来的 44%。[#59698](https://github.com/ClickHouse/ClickHouse/pull/59698) ([李扬](https://github.com/taiyang-li)).
* 当结果类型的底层类型为数值时，`multiIf` 函数会以列式方式执行。 [#60384](https://github.com/ClickHouse/ClickHouse/pull/60384) ([李扬](https://github.com/taiyang-li)).
* 速度更快的 (接近 2 倍) 互斥锁。[#60823](https://github.com/ClickHouse/ClickHouse/pull/60823) ([Azat Khuzhin](https://github.com/azat)) 。
* 在分布式查询即将结束时，并行排空多个连接。[#60845](https://github.com/ClickHouse/ClickHouse/pull/60845) ([lizhuoyu5](https://github.com/lzydmxy)) 。
* 优化 Nullable 数值或 Nullable String 的列间数据移动，提升了部分微基准测试的表现。[#60846](https://github.com/ClickHouse/ClickHouse/pull/60846) ([李扬](https://github.com/taiyang-li)) 。
* 文件系统缓存相关操作受锁竞争的影响将有所减轻。[#61066](https://github.com/ClickHouse/ClickHouse/pull/61066) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 通过避免错误的编译器优化，优化 ARRAY JOIN 和其他 JOIN。关闭 [#61074](https://github.com/ClickHouse/ClickHouse/issues/61074)。  [#61075](https://github.com/ClickHouse/ClickHouse/pull/61075) ([李扬](https://github.com/taiyang-li)).
* 如果一个带有语法错误的查询中包含带正则表达式的 `COLUMNS` 匹配器，那么在解析器回溯过程中，正则表达式会在每次回溯时都重新编译，而不是只编译一次。这是一个根本性错误。编译后的正则表达式被放进了 AST。但 AST 中的 A 代表 “abstract”，也就是说它不应包含重量级对象。AST 的某些部分可能会在解析过程中被创建后又丢弃，其中包括大量回溯时产生的部分。这会导致解析变慢，从而使 readonly 用户能够发起 DoS。但更主要的问题是，这会妨碍模糊测试器取得进展。[#61543](https://github.com/ClickHouse/ClickHouse/pull/61543) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 新增一个 analyzer 处理阶段，用于优化单个值的 IN 运算符。[#61564](https://github.com/ClickHouse/ClickHouse/pull/61564) ([LiuNeng](https://github.com/liuneng1994)).
* DNSResolver 会对已解析出的 IP 集合进行随机打乱，这样才能均匀利用 AWS S3 的多个端点。[#60965](https://github.com/ClickHouse/ClickHouse/pull/60965) ([Sema Checherinda](https://github.com/CheSema)).

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

* 支持对 Azure Blob 存储进行并行读取。这提升了实验性 Azure object storage 的性能。[#61503](https://github.com/ClickHouse/ClickHouse/pull/61503) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)).
* 为 Azure Blob 存储添加了类似 S3 的异步 WriteBuffer。这提升了实验性 Azure object storage 的性能。[#59929](https://github.com/ClickHouse/ClickHouse/pull/59929) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)).
* 在使用 Azure Blob 存储时，备份 I/O 可使用托管身份。新增了一个设置，用于防止 ClickHouse 尝试创建不存在的容器，因为这需要存储账户级别的权限。[#61785](https://github.com/ClickHouse/ClickHouse/pull/61785) ([Daniel Pozo Escalona](https://github.com/danipozo)).
* 添加了一个设置 `parallel_replicas_allow_in_with_subquery = 1`，允许 IN 子查询与并行副本配合使用。[#60950](https://github.com/ClickHouse/ClickHouse/pull/60950) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 对“zero-copy”复制进行了一项更改：删除表时，必须同时删除所有与该表相关的 zero-copy 锁。包含这些锁的目录也必须一并删除。[#57575](https://github.com/ClickHouse/ClickHouse/pull/57575) ([Sema Checherinda](https://github.com/CheSema)).

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

* 默认表引擎使用 `MergeTree`。[#60524](https://github.com/ClickHouse/ClickHouse/pull/60524) ([Alexey Milovidov](https://github.com/alexey-milovidov))
* 默认启用 `output_format_pretty_row_numbers`，以提升易用性。[#61791](https://github.com/ClickHouse/ClickHouse/pull/61791) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 在之前的版本中，Pretty 格式里有些数字显示得还不够美观。[#61794](https://github.com/ClickHouse/ClickHouse/pull/61794) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 在 Pretty formats 中，如果长值是结果集中的唯一值，则不会被截断，例如 `SHOW CREATE TABLE` 查询的结果就是如此。[#61795](https://github.com/ClickHouse/ClickHouse/pull/61795) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 与 `clickhouse-local` 类似，`clickhouse-client` 也接受 `--output-format` 选项，将其作为 `--format` 选项的别名。这解决了 [#59848](https://github.com/ClickHouse/ClickHouse/issues/59848)。[#61797](https://github.com/ClickHouse/ClickHouse/pull/61797) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 如果 stdout 是终端且未指定 output format，`clickhouse-client` 和类似工具将默认使用 `PrettyCompact`，与 interactive mode 类似。`clickhouse-client` 和 `clickhouse-local` 将以统一方式处理 input and output formats 的命令行参数。此更改修复了 [#61272](https://github.com/ClickHouse/ClickHouse/issues/61272)。[#61800](https://github.com/ClickHouse/ClickHouse/pull/61800) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 在 Pretty 格式中，数字分组现在会以下划线分隔，以提升可读性。这由新设置 `output_format_pretty_highlight_digit_groups` 控制。[#61802](https://github.com/ClickHouse/ClickHouse/pull/61802) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 新增了可通过 `SYSTEM FLUSH DISTRIBUTED` 覆盖初始 INSERT 设置的功能。[#61832](https://github.com/ClickHouse/ClickHouse/pull/61832) ([Azat Khuzhin](https://github.com/azat)).
* 默认启用处理器性能分析 (排序、聚合等操作的耗时以及输入/输出字节数) 。[#61096](https://github.com/ClickHouse/ClickHouse/pull/61096) ([Azat Khuzhin](https://github.com/azat)) 。
* 支持 Filesystem 数据库中没有 format 扩展名的文件。[#60795](https://github.com/ClickHouse/ClickHouse/pull/60795) ([Kruglov Pavel](https://github.com/Avogar)).
* 使所有格式名称都变为大小写不敏感，例如 Tsv、TSV、tsv，甚至 rowbinary。 [#60420](https://github.com/ClickHouse/ClickHouse/pull/60420) ([豪肥肥](https://github.com/HowePa))。当然，我还是希望你继续按规范书写，比如写成 `JSON` 😇，而不是 `Json` 🤮；不过如果你更喜欢按自己的方式拼写，我们也不介意。
* 为 `distributed_ddl_output_mode` 设置新增了 `none_only_active` 模式。[#60340](https://github.com/ClickHouse/ClickHouse/pull/60340) ([Alexander Tokmakov](https://github.com/tavplubix)) 。
* 高级仪表板对多折线图的配色做了些许改进。[#60391](https://github.com/ClickHouse/ClickHouse/pull/60391) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 高级仪表板中的控件现在会在滚动时始终保持可见。这样一来，无需向上滚动即可添加新图表。[#60692](https://github.com/ClickHouse/ClickHouse/pull/60692) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 在对 materialized view 执行 `MODIFY COLUMN` 查询时，请检查内部表的结构，确保每一列都存在。[#47427](https://github.com/ClickHouse/ClickHouse/pull/47427) ([sunny](https://github.com/sunny19930321)).
* String 类型和枚举可用于同一上下文中，例如：数组、UNION 查询、条件表达式。此修复关闭了 [#60726](https://github.com/ClickHouse/ClickHouse/issues/60726)。[#60727](https://github.com/ClickHouse/ClickHouse/pull/60727) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 允许在用于查询处理的外部数据结构中声明枚举 (这是一个可为查询提供的即时临时表) 。[#57857](https://github.com/ClickHouse/ClickHouse/pull/57857) ([Duc Canh Le](https://github.com/canhld94)).
* 在选择要合并的 parts 时，会将轻量级删除的行纳入考虑，从而更准确地估算合并后 part 的磁盘大小。[#58223](https://github.com/ClickHouse/ClickHouse/pull/58223) ([Zhuo Qiu](https://github.com/jewelzqiu)).
* 为更多系统表中的列补充了注释。延续了 [https://github.com/ClickHouse/ClickHouse/pull/58356](https://github.com/ClickHouse/ClickHouse/pull/58356) 中的工作。[#59016](https://github.com/ClickHouse/ClickHouse/pull/59016) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 现在可以在 `PREWHERE` 中使用虚拟列了。这对 `_part_offset` 这类非常量虚拟列尤其有用。[#59033](https://github.com/ClickHouse/ClickHouse/pull/59033) ([Amos Bird](https://github.com/amosbird))。进一步提升了虚拟列的整体易用性。现在允许在 `PREWHERE` 中使用虚拟列 (对 `_part_offset` 这类非常量虚拟列尤其有用) 。现在，启用设置 `describe_include_virtual_columns` 后，可在 `DESCRIBE` 查询中通过列注释查看虚拟列的内置文档。[#60205](https://github.com/ClickHouse/ClickHouse/pull/60205) ([Anton Popov](https://github.com/CurtizJ)).
* 现在，对象存储不再使用固定键，而是会生成一个键来判断是否具备删除对象的能力。[#59495](https://github.com/ClickHouse/ClickHouse/pull/59495) ([Sema Checherinda](https://github.com/CheSema)) 。
* 允许将 "local" 用作对象存储类型，而非 "local\_blob\_storage"。[#60165](https://github.com/ClickHouse/ClickHouse/pull/60165) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 在执行 `DETACH`/服务器关闭以及 `SYSTEM FLUSH DISTRIBUTED` 时，并行刷写 Distributed engine 中待处理的 INSERT 块 (只有当表使用多磁盘策略时，并行处理才会生效 (目前 Distributed engine 中的所有功能都是如此) ) 。[#60225](https://github.com/ClickHouse/ClickHouse/pull/60225) ([Azat Khuzhin](https://github.com/azat)) 。
* 新增一项设置，可强制在合并操作中使用 read-through 缓存。[#60308](https://github.com/ClickHouse/ClickHouse/pull/60308) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 对 MySQL 兼容协议的一项改进。问题 [#57598](https://github.com/ClickHouse/ClickHouse/issues/57598) 提到了一种与事务处理相关的行为差异：在没有活动事务时执行 COMMIT/ROLLBACK，会被报告为错误，这与 MySQL 的行为不一致。[#60338](https://github.com/ClickHouse/ClickHouse/pull/60338) ([PapaToemmsn](https://github.com/PapaToemmsn)) 。
* 函数 `substring` 现在新增了一个别名 `byteSlice`。[#60494](https://github.com/ClickHouse/ClickHouse/pull/60494) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 将服务器级设置 `dns_cache_max_size` 重命名为 `dns_cache_max_entries`，以减少歧义。[#60500](https://github.com/ClickHouse/ClickHouse/pull/60500) ([Kirill Nikiforov](https://github.com/allmazz)) 。
* `SHOW INDEX | INDEXES | INDICES | KEYS` 不再按主键列进行排序 (此前这种行为并不直观) 。[#60514](https://github.com/ClickHouse/ClickHouse/pull/60514) ([Robert Schulze](https://github.com/rschu1ze)) 。
* Keeper 改进：为避免数据丢失，如果在启动期间检测到无效快照，将中止启动。[#60537](https://github.com/ClickHouse/ClickHouse/pull/60537) ([Antonio Andelic](https://github.com/antonio2368)).
* 将 tzdata 升级到 2024a。[#60768](https://github.com/ClickHouse/ClickHouse/pull/60768) ([Raúl Marín](https://github.com/Algunenano)) 。
* Keeper 改进：在 Keeper 设置中支持 `leadership_expiry_ms`。[#60806](https://github.com/ClickHouse/ClickHouse/pull/60806) ([Brokenice0415](https://github.com/Brokenice0415)) 。
* 无论 `input_format_try_infer_exponent_floats` 设置如何，始终在 JSON 格式中推断指数表示的数字。新增设置 `input_format_json_use_string_type_for_ambiguous_paths_in_named_tuples_inference_from_objects`，允许在从 JSON 对象推断命名元组时，对歧义路径使用 String 类型，而不是抛出异常。[#60808](https://github.com/ClickHouse/ClickHouse/pull/60808) ([Kruglov Pavel](https://github.com/Avogar)).
* 新增对 MySQL 中常用的 `START TRANSACTION` 语法的支持，解决了 [https://github.com/ClickHouse/ClickHouse/discussions/60865。](https://github.com/ClickHouse/ClickHouse/discussions/60865。) [#60886](https://github.com/ClickHouse/ClickHouse/pull/60886) ([Zach Naimon](https://github.com/ArctypeZach))。
* 为 full-sorting merge join algorithm 添加了一个标志，用于将 null 视为最大值或最小值。这样，其行为就能与 Apache Spark 等其他 SQL 系统兼容。[#60896](https://github.com/ClickHouse/ClickHouse/pull/60896) ([loudongfeng](https://github.com/loudongfeng)).
* 支持在 `clickhouse-client` 和 `clickhouse-local` 中根据文件扩展名识别输出格式。[#61036](https://github.com/ClickHouse/ClickHouse/pull/61036) ([豪肥肥](https://github.com/HowePa)) 。
* 当 Linux 的 CGroups 值发生变化时，更新 runtime 中的内存限制。[#61049](https://github.com/ClickHouse/ClickHouse/pull/61049) ([Han Fei](https://github.com/hanfei1991)) 。
* 补充了此前误漏的函数 `toUInt128OrZero` (该错误与 [https://github.com/ClickHouse/ClickHouse/pull/945](https://github.com/ClickHouse/ClickHouse/pull/945) 有关) 。兼容性别名 `FROM_UNIXTIME` 和 `DATE_FORMAT` (它们并非 ClickHouse 原生，而是仅用于兼容 MySQL) 现已改为大小写不敏感，这也符合 SQL 兼容性别名的预期。[#61114](https://github.com/ClickHouse/ClickHouse/pull/61114) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 改进了访问检查：即使目标用户也没有执行撤销所需的授权，也允许撤销其并未持有的权限。Example：`GRANT SELECT ON *.* TO user1; REVOKE SELECT ON system.* FROM user1;`。[#61115](https://github.com/ClickHouse/ClickHouse/pull/61115) ([pufit](https://github.com/pufit)).
* 修复 `has()` 函数处理 `Nullable` 列时的问题 (见 [#60214](https://github.com/ClickHouse/ClickHouse/issues/60214)) 。[#61249](https://github.com/ClickHouse/ClickHouse/pull/61249) ([Mikhail Koviazin](https://github.com/mkmkme)) 。
* 现在，可以在子树 `<include from_zk="/path" merge="true">` 的配置替换中指定 `merge="true"` 属性。如果指定了该属性，ClickHouse 会将该子树与现有配置合并；否则，默认行为是将新内容追加到配置中。[#61299](https://github.com/ClickHouse/ClickHouse/pull/61299) ([alesapin](https://github.com/alesapin)).
* 新增用于虚拟内存映射的异步指标：`VMMaxMapCount` & `VMNumMaps`。关闭 [#60662](https://github.com/ClickHouse/ClickHouse/issues/60662)。[#61354](https://github.com/ClickHouse/ClickHouse/pull/61354) ([Tuan Pham Anh](https://github.com/tuanpavn)) 。
* 在所有会创建临时数据的场景中都使用 `temporary_files_codec` 设置，例如外部内存排序和外部内存 GROUP BY。此前它仅在 `partial_merge` JOIN 算法中起作用。[#61456](https://github.com/ClickHouse/ClickHouse/pull/61456) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 新增设置 `max_parser_backtracks`，可用于限制查询解析的复杂度。[#61502](https://github.com/ClickHouse/ClickHouse/pull/61502) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 动态调整文件系统缓存大小时，争用更少。[#61524](https://github.com/ClickHouse/ClickHouse/pull/61524) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 禁用 StorageS3 队列的分片模式，因为该模式将被重写。[#61537](https://github.com/ClickHouse/ClickHouse/pull/61537) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复了一个笔误：将 `use_leagcy_max_level` 更正为 `use_legacy_max_level`。[#61545](https://github.com/ClickHouse/ClickHouse/pull/61545) ([William Schoeffel](https://github.com/wiledusc)).
* 移除了 `system.blob_storage_log` 中的部分重复条目。[#61622](https://github.com/ClickHouse/ClickHouse/pull/61622) ([YenchangChan](https://github.com/YenchangChan)) 。
* 新增了 `current_user` 函数，作为 MySQL 兼容性别名。 [#61770](https://github.com/ClickHouse/ClickHouse/pull/61770) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* 修复混合 x86-64 / ARM 集群中浮点聚合函数状态不一致的问题 [#60610](https://github.com/ClickHouse/ClickHouse/pull/60610) ([Harry Lee](https://github.com/HarryLeeIBM)).

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

* 实时查询分析器现已支持在 AArch64 上运行。在之前的版本中，只有当程序未将时间耗费在 syscall 内时，它才能正常工作。[#60807](https://github.com/ClickHouse/ClickHouse/pull/60807) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Docker 标记中已添加 ClickHouse 版本信息。关闭 [#54224](https://github.com/ClickHouse/ClickHouse/issues/54224)。[#60949](https://github.com/ClickHouse/ClickHouse/pull/60949) ([Nikolay Monkov](https://github.com/nikmonkov)).
* 将 `prqlc` 升级到 0.11.3。[#60616](https://github.com/ClickHouse/ClickHouse/pull/60616) ([Maximilian Roos](https://github.com/max-sixty)).
* 在 `clickhouse-local` 中添加了通用查询文本 fuzzer。[#61508](https://github.com/ClickHouse/ClickHouse/pull/61508) ([Alexey Milovidov](https://github.com/alexey-milovidov)).

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

* 修复 MergeTree 中 finished\_mutations\_to\_keep=0 的问题 (如文档所述，0 表示保留全部内容) [#60031](https://github.com/ClickHouse/ClickHouse/pull/60031) ([Azat Khuzhin](https://github.com/azat)) 。
* FINAL 优化存在问题，作者是这样描述的："PartsSplitter invalid ranges for the same part"。[#60041](https://github.com/ClickHouse/ClickHouse/pull/60041) ([Maksim Kita](https://github.com/kitaisreal)).
* Apache Hive 出现了一些问题；它目前处于 Experimental 状态，且不受支持。[#60262](https://github.com/ClickHouse/ClickHouse/pull/60262) ([shanfengp](https://github.com/Aed-p)).
* 对 Experimental 并行副本的一项改进：如果并行副本发生变化，则强制重新进行分析 [#60362](https://github.com/ClickHouse/ClickHouse/pull/60362) ([Raúl Marín](https://github.com/Algunenano)) 。
* 修复了在新的磁盘配置选项中使用普通元数据类型时出现的问题 [#60396](https://github.com/ClickHouse/ClickHouse/pull/60396) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 尝试修复 mapContainsKeyLike 中的逻辑错误 '无法捕获该列，因为其类型不兼容' [#60451](https://github.com/ClickHouse/ClickHouse/pull/60451) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 避免在 CREATE TABLE 中计算标量子查询。[#60464](https://github.com/ClickHouse/ClickHouse/pull/60464) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复并行解析期间因错误导致跳过大量行时出现的死锁问题 [#60516](https://github.com/ClickHouse/ClickHouse/pull/60516) ([Kruglov Pavel](https://github.com/Avogar)).
* Experimental KQL (Kusto) 支持存在问题：修复 `max_query_size_for_kql_compound_operator`：[#60534](https://github.com/ClickHouse/ClickHouse/pull/60534) ([Yong Wang](https://github.com/kashwy)) 。
* Keeper 修复：等待提交日志时添加超时设置 [#60544](https://github.com/ClickHouse/ClickHouse/pull/60544) ([Antonio Andelic](https://github.com/antonio2368)).
* 不要为日期类型输出数值提示 [#60577](https://github.com/ClickHouse/ClickHouse/pull/60577) ([Raúl Marín](https://github.com/Algunenano)).
* 修复了在过滤器中使用非确定性函数时，从 MergeTree 读取数据的问题 [#60586](https://github.com/ClickHouse/ClickHouse/pull/60586) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复兼容性设置值类型不正确时的逻辑错误 [#60596](https://github.com/ClickHouse/ClickHouse/pull/60596) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复(prql)：健壮的 panic 处理程序 [#60615](https://github.com/ClickHouse/ClickHouse/pull/60615) ([Maximilian Roos](https://github.com/max-sixty)).
* 修复 `intDiv` 在 Decimal 和 Date 参数上的问题 [#60672](https://github.com/ClickHouse/ClickHouse/pull/60672) ([Yarik Briukhovetskyi](https://github.com/yariks5s)) 。
* 修复：在 ALTER MODIFY 查询中展开 CTE [#60682](https://github.com/ClickHouse/ClickHouse/pull/60682) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* 修复非 Atomic/Ordinary 数据库引擎 (即 Memory) 中的 system.parts 问题 [#60689](https://github.com/ClickHouse/ClickHouse/pull/60689) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复参数化视图中“metadata file 中的 storage 定义无效”问题 [#60708](https://github.com/ClickHouse/ClickHouse/pull/60708) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复 CompressionCodecMultiple 中的缓冲区溢出 [#60731](https://github.com/ClickHouse/ClickHouse/pull/60731) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 移除 SQL/JSON 中的无用内容 [#60738](https://github.com/ClickHouse/ClickHouse/pull/60738) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 移除聚合函数 quantileGK 中错误的断言。[#60740](https://github.com/ClickHouse/ClickHouse/pull/60740) ([李扬](https://github.com/taiyang-li)) 。
* 通过将流数设为 1，修复 insert-select + insert\_deduplication\_token 的 bug [#60745](https://github.com/ClickHouse/ClickHouse/pull/60745) ([Jordi Villar](https://github.com/jrdi)) 。
* 防止在不受支持的分段上传操作中设置自定义元数据请求头 [#60748](https://github.com/ClickHouse/ClickHouse/pull/60748) ([Francisco J. Jurado Moreno](https://github.com/Beetelbrox)).
* 修复了 toStartOfInterval [#60763](https://github.com/ClickHouse/ClickHouse/pull/60763) ([Andrey Zvonov](https://github.com/zvonand)) 。
* 修复 arrayEnumerateRanked 中导致崩溃的问题 [#60764](https://github.com/ClickHouse/ClickHouse/pull/60764) ([Raúl Marín](https://github.com/Algunenano)).
* 修复在 INSERT SELECT JOIN 中使用 input() 时崩溃的问题 [#60765](https://github.com/ClickHouse/ClickHouse/pull/60765) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复子查询中 allow\_experimental\_analyzer 取值不同时导致的崩溃 [#60770](https://github.com/ClickHouse/ClickHouse/pull/60770) ([Dmitry Novik](https://github.com/novikd)) 。
* 读取 S3 时移除递归 [#60849](https://github.com/ClickHouse/ClickHouse/pull/60849) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 修复 HashedDictionaryParallelLoader 在出错时可能卡死的问题 [#60926](https://github.com/ClickHouse/ClickHouse/pull/60926) ([vdimir](https://github.com/vdimir)).
* 修复 Replicated 数据库的异步 RESTORE (实验性功能) [#60934](https://github.com/ClickHouse/ClickHouse/pull/60934) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 修复了通过原生协议向 `Log` 表执行异步插入时出现的死锁问题 [#61055](https://github.com/ClickHouse/ClickHouse/pull/61055) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了 RangeHashedDictionary 中 dictGetOrDefault 的默认参数延迟执行问题 [#61196](https://github.com/ClickHouse/ClickHouse/pull/61196) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了 groupArraySorted 中的多个缺陷 [#61203](https://github.com/ClickHouse/ClickHouse/pull/61203) ([Raúl Marín](https://github.com/Algunenano)) 。
* 修复独立二进制程序中 Keeper 重新配置的问题 [#61233](https://github.com/ClickHouse/ClickHouse/pull/61233) ([Antonio Andelic](https://github.com/antonio2368)).
* 修复了 S3 引擎中 session\_token 的使用问题 [#61234](https://github.com/ClickHouse/ClickHouse/pull/61234) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复聚合函数 `uniqExact` 可能产生错误结果的问题 [#61257](https://github.com/ClickHouse/ClickHouse/pull/61257) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复 show database 中的问题 [#61269](https://github.com/ClickHouse/ClickHouse/pull/61269) ([Raúl Marín](https://github.com/Algunenano)) 。
* 修复 RabbitMQ 存储中 MATERIALIZED 列相关的逻辑错误 [#61320](https://github.com/ClickHouse/ClickHouse/pull/61320) ([vdimir](https://github.com/vdimir)).
* 修复 CREATE OR REPLACE DICTIONARY 的问题 [#61356](https://github.com/ClickHouse/ClickHouse/pull/61356) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复带有外部 ON CLUSTER 子句的 ATTACH 查询 [#61365](https://github.com/ClickHouse/ClickHouse/pull/61365) ([Nikolay Degterinsky](https://github.com/evillique)).
* 修复 Nullable 键的连续键优化问题 [#61393](https://github.com/ClickHouse/ClickHouse/pull/61393) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复 actions dag split 问题 [#61458](https://github.com/ClickHouse/ClickHouse/pull/61458) ([Raúl Marín](https://github.com/Algunenano)).
* 修复失败的 RESTORE 操作在完成阶段的问题 [#61466](https://github.com/ClickHouse/ClickHouse/pull/61466) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 通过兼容性设置正确地禁用 async\_insert\_use\_adaptive\_busy\_timeout [#61468](https://github.com/ClickHouse/ClickHouse/pull/61468) ([Raúl Marín](https://github.com/Algunenano)) 。
* 支持在恢复池中排队 [#61475](https://github.com/ClickHouse/ClickHouse/pull/61475) ([Nikita Taranov](https://github.com/nickitat)) 。
* 修复了使用 UUID 读取 system.parts 时的不一致问题。[#61479](https://github.com/ClickHouse/ClickHouse/pull/61479) ([Dan Wu](https://github.com/wudanzy)).
* 修复 ALTER QUERY MODIFY SQL SECURITY 的问题 [#61480](https://github.com/ClickHouse/ClickHouse/pull/61480) ([pufit](https://github.com/pufit)).
* 修复 window view (实验性功能) 中的崩溃问题 [#61526](https://github.com/ClickHouse/ClickHouse/pull/61526) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 修复 `repeat` 处理非原生整数时的问题 [#61527](https://github.com/ClickHouse/ClickHouse/pull/61527) ([Antonio Andelic](https://github.com/antonio2368)).
* 修复 client 的 `-s` 参数问题 [#61530](https://github.com/ClickHouse/ClickHouse/pull/61530) ([Mikhail f. Shiryaev](https://github.com/Felixoid)) 。
* 修复 arrayPartialReverseSort 中的崩溃问题 [#61539](https://github.com/ClickHouse/ClickHouse/pull/61539) ([Raúl Marín](https://github.com/Algunenano)) 。
* 修复 const 位置下的字符串搜索问题 [#61547](https://github.com/ClickHouse/ClickHouse/pull/61547) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 修复 `addDays` 与 DateTime64 一起使用时会导致错误的问题 [#61561](https://github.com/ClickHouse/ClickHouse/pull/61561) ([Shuai li](https://github.com/loneylee)).
* 禁止 JSONExtract 接受 LowCardinality 输入类型 [#61617](https://github.com/ClickHouse/ClickHouse/pull/61617) ([Julia Kartseva](https://github.com/jkartseva)).
* 修复启用去重的 async insert 中的 `system.part_log` 问题 [#61620](https://github.com/ClickHouse/ClickHouse/pull/61620) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 修复 system.parts 中的 `Non-ready set` 异常。[#61666](https://github.com/ClickHouse/ClickHouse/pull/61666) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复 REPLACE\_RANGE 的 actual\_part\_name 问题 (`Entry actual part isn't empty yet`) [#61675](https://github.com/ClickHouse/ClickHouse/pull/61675) ([Alexander Tokmakov](https://github.com/tavplubix))。
* 修复了 `multiSearchAllPositionsCaseInsensitiveUTF8` 在错误 UTF-8 输入下触发的 sanitizer 报告 [#61749](https://github.com/ClickHouse/ClickHouse/pull/61749) ([pufit](https://github.com/pufit)) 。
* 修复了一个问题：RANGE 窗口帧此前不支持 Nullable 列。[#61766](https://github.com/ClickHouse/ClickHouse/pull/61766) ([YuanLiu](https://github.com/ditgittube)) 。

### <a id="242" /> ClickHouse 24.2 发布，2024-02-29。[演示文稿](https://presentations.clickhouse.com/2024-release-24.2/)，[视频](https://www.youtube.com/watch?v=iN2y-TK8f3A)

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

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

* 在嵌套类型中校验可疑/实验性类型。此前，我们不会在 Array/Tuple/Map 等嵌套类型中校验这类类型 (JSON 除外) 。[#59385](https://github.com/ClickHouse/ClickHouse/pull/59385) ([Kruglov Pavel](https://github.com/Avogar)).
* 为线程数和块大小添加合理性检查。[#60138](https://github.com/ClickHouse/ClickHouse/pull/60138) ([Raúl Marín](https://github.com/Algunenano)).
* 默认不再推断指数表示法的浮点数。新增设置 `input_format_try_infer_exponent_floats`，可恢复之前的行为 (默认禁用) 。关闭 [#59476](https://github.com/ClickHouse/ClickHouse/issues/59476)。[#59500](https://github.com/ClickHouse/ClickHouse/pull/59500) ([Kruglov Pavel](https://github.com/Avogar)).
* 允许用括号包裹 ALTER 操作。是否输出括号可由 `format_alter_operations_with_parentheses` 配置控制。默认情况下，在格式化查询中会输出括号，因为在某些地方我们会将格式化后的 ALTER 操作作为元数据存储 (例如：mutations) 。新语法让某些以列表结尾的 ALTER 操作查询更清晰。例如：`ALTER TABLE x MODIFY TTL date GROUP BY a, b, DROP COLUMN c` 在旧语法下无法被正确解析。而在新语法中，查询 `ALTER TABLE x (MODIFY TTL date GROUP BY a, b), (DROP COLUMN c)` 的含义就很明确。旧版本无法读取新语法，因此如果在同一集群中混用新旧版本的 ClickHouse，使用新语法可能会导致问题。[#59532](https://github.com/ClickHouse/ClickHouse/pull/59532) ([János Benjamin Antal](https://github.com/antaljanosbenjamin)).
* 修复了 materialized view 的安全问题。此前，该问题允许用户在没有所需授权的情况下向表中插入数据。此修复会校验用户不仅对 materialized view 具有插入权限，还对所有底层表具有插入权限。这意味着某些以前可正常工作的查询，现在可能会因 `Not enough privileges` 而失败。为解决这个问题，此版本为视图引入了一项新的 SQL security 功能：[https://clickhouse.com/docs/sql-reference/statements/create/view#sql\&#95;security。\[#54901](https://clickhouse.com/docs/sql-reference/statements/create/view#sql\&#95;security。\[#54901)]\([https://github.com/ClickHouse/ClickHouse/pull/54901](https://github.com/ClickHouse/ClickHouse/pull/54901)) [#60439](https://github.com/ClickHouse/ClickHouse/pull/60439) ([pufit](https://github.com/pufit)).

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

* 新增了可在 view/materialized view 中指定 definer 用户的新语法。这样一来，无需对底层表显式授予授权，也可以通过视图执行查询/插入。因此，View 将封装这些授权。[#54901](https://github.com/ClickHouse/ClickHouse/pull/54901) [#60439](https://github.com/ClickHouse/ClickHouse/pull/60439) ([pufit](https://github.com/pufit)).
* 如果 `file/s3/hdfs/url/azureBlobStorage` 引擎中的文件 format 未知，则在进行 schema inference 时尝试自动检测文件 format。关闭 [#50576](https://github.com/ClickHouse/ClickHouse/issues/50576)。[#59092](https://github.com/ClickHouse/ClickHouse/pull/59092) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 实现异步插入超时的自动调节。新增以下设置：async\_insert\_poll\_timeout\_ms、async\_insert\_use\_adaptive\_busy\_timeout、async\_insert\_busy\_timeout\_min\_ms、async\_insert\_busy\_timeout\_max\_ms、async\_insert\_busy\_timeout\_increase\_rate、async\_insert\_busy\_timeout\_decrease\_rate。[#58486](https://github.com/ClickHouse/ClickHouse/pull/58486) ([Julia Kartseva](https://github.com/jkartseva)) 。
* 允许设置连续登录失败次数上限的配额。[#54737](https://github.com/ClickHouse/ClickHouse/pull/54737) ([Alexey Gerasimchuck](https://github.com/Demilivor)) 。
* 新增聚合函数 `groupArrayIntersect`。后续跟进：[#49862](https://github.com/ClickHouse/ClickHouse/issues/49862)。[#59598](https://github.com/ClickHouse/ClickHouse/pull/59598) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* 新增对 `AzureBlobStorage` 的备份和恢复支持。解决了 [#50747](https://github.com/ClickHouse/ClickHouse/issues/50747)。[#56988](https://github.com/ClickHouse/ClickHouse/pull/56988) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)) 。
* 现在，用户可以直接在查询中使用 `format_schema_rows_template` 指定模板字符串，作为 `format_template_row` 的替代。已关闭 [#31363](https://github.com/ClickHouse/ClickHouse/issues/31363)。[#59088](https://github.com/ClickHouse/ClickHouse/pull/59088) ([Shaun Struwig](https://github.com/Blargian)) 。
* 已支持将不同类型的 merge tree 表自动转换为 Replicated 表引擎。请在表的数据目录 (`/clickhouse/store/xxx/xxxyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy/`) 中创建一个空的 `convert_to_replicated` 文件，该表将在服务器下次启动时自动完成转换。[#57798](https://github.com/ClickHouse/ClickHouse/pull/57798) ([Kirill](https://github.com/kirillgarbar)) 。
* 新增了查询 `ALTER TABLE table FORGET PARTITION partition`，用于删除与空分区相关的 ZooKeeper 节点。[#59507](https://github.com/ClickHouse/ClickHouse/pull/59507) ([Sergei Trifonov](https://github.com/serxa)) 。这是一项面向专家用户的功能。
* NATS 表引擎现已支持 JWT 凭据文件。[#59543](https://github.com/ClickHouse/ClickHouse/pull/59543) ([Nickolaj Jepsen](https://github.com/nickolaj-jepsen)) 。
* 已实现 `system.dns_cache` 表，可用于调试 DNS 问题。[#59856](https://github.com/ClickHouse/ClickHouse/pull/59856) ([Kirill Nikiforov](https://github.com/allmazz)) 。
* `LZ4HC` codec 现支持新的 2 级，该级别比此前最低的 3 级更快，但压缩率会更低。在之前的版本中，`LZ4HC(2)` 及更低级别与 `LZ4HC(3)` 等同。作者：[Cyan4973](https://github.com/Cyan4973)。[#60090](https://github.com/ClickHouse/ClickHouse/pull/60090) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 已实现 `system.dns_cache` 表，可用于调试 DNS 问题。新增服务器级设置 dns\_cache\_max\_size。[#60257](https://github.com/ClickHouse/ClickHouse/pull/60257) ([Kirill Nikiforov](https://github.com/allmazz)) 。
* 支持 `merge` 表函数的单参数形式，即 `merge(['db_name', ] 'tables_regexp')`。[#60372](https://github.com/ClickHouse/ClickHouse/pull/60372) ([豪肥肥](https://github.com/HowePa)) 。
* 支持负数位置参数。关闭了 [#57736](https://github.com/ClickHouse/ClickHouse/issues/57736)。[#58292](https://github.com/ClickHouse/ClickHouse/pull/58292) ([flynn](https://github.com/ucasfl)) 。
* 支持在配置中通过 `user` 键，为特定 S3 设置指定一组允许使用的用户。[#60144](https://github.com/ClickHouse/ClickHouse/pull/60144) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 新增了表函数 `mergeTreeIndex`。它表示 `MergeTree` 表的索引文件和标记文件的内容，可用于内部信息查看。语法：`mergeTreeIndex(database, table, [with_marks = true])`，其中 `database.table` 是使用 `MergeTree` 引擎的现有表。[#58140](https://github.com/ClickHouse/ClickHouse/pull/58140) ([Anton Popov](https://github.com/CurtizJ)) 。

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

* 新增函数 `seriesOutliersDetectTukey`，使用 Tukey 围栏算法检测序列数据中的离群值。[#58632](https://github.com/ClickHouse/ClickHouse/pull/58632) ([Bhavna Jindal](https://github.com/bhavnajindal)) 。请注意，其行为将在下一个补丁版本中发生变化。
* 新增函数 `variantType`，为每一行返回表示 Variant 类型名称的 Enum。[#59398](https://github.com/ClickHouse/ClickHouse/pull/59398) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 为并行副本支持 `LEFT JOIN`、`ALL INNER JOIN` 和简单子查询 (仅限 analyzer) 。新设置 `parallel_replicas_prefer_local_join` 用于选择执行本地 `JOIN` (默认) 还是 `GLOBAL JOIN`。`cluster_for_parallel_replicas` 中的每个副本上都必须存在所有表。新设置 `min_external_table_block_size_rows` 和 `min_external_table_block_size_bytes` 用于将发送到临时表的小块合并为更大的块 (仅限 analyzer) 。[#58916](https://github.com/ClickHouse/ClickHouse/pull/58916) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 在添加或恢复新副本期间，允许在 `Replicated` 数据库中并发创建表。[#59277](https://github.com/ClickHouse/ClickHouse/pull/59277) ([Konstantin Bogdanov](https://github.com/thevar1able)) 。
* 为 `Variant` 值实现比较运算符，并支持将 Field 正确插入 `Variant` 列。默认不允许创建包含相似 Variant 类型的 `Variant` 类型 (可通过设置 `allow_suspicious_variant_types` 允许) 。关闭 [#59996](https://github.com/ClickHouse/ClickHouse/issues/59996)。关闭 [#59850](https://github.com/ClickHouse/ClickHouse/issues/59850)。[#60198](https://github.com/ClickHouse/ClickHouse/pull/60198) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 禁用在使用 CTE 时的并行副本 JOIN (不适用于 analyzer) [#59239](https://github.com/ClickHouse/ClickHouse/pull/59239) ([Raúl Marín](https://github.com/Algunenano)) 。

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

* 主键占用的内存将更少。[#60049](https://github.com/ClickHouse/ClickHouse/pull/60049) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 改进了主键及其他一些操作的内存占用。[#60050](https://github.com/ClickHouse/ClickHouse/pull/60050) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 这些表的主键将在首次访问时按需加载到内存中。这由新的 MergeTree 设置 `primary_key_lazy_load` 控制，且默认启用。这样做有几个优点：- 对于未使用的表，不会加载；- 如果内存不足，将在首次使用时抛出异常，而不是在服务器启动时抛出。这也有几个缺点：- 加载主键的延迟会体现在首次查询上，而不是在接受连接之前；理论上，这可能会引发惊群问题。此项改动关闭了 [#11188](https://github.com/ClickHouse/ClickHouse/issues/11188)。[#60093](https://github.com/ClickHouse/ClickHouse/pull/60093) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 用于向量搜索的向量化距离函数。[#58866](https://github.com/ClickHouse/ClickHouse/pull/58866) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 向量化函数 `dotProduct`，可用于向量搜索。[#60202](https://github.com/ClickHouse/ClickHouse/pull/60202) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 为 `dictGetOrDefault` 函数增加短路求值能力。解决了 [#52098](https://github.com/ClickHouse/ClickHouse/issues/52098)。[#57767](https://github.com/ClickHouse/ClickHouse/pull/57767) ([jsc0218](https://github.com/jsc0218)) 。
* Keeper 改进：仅在内存中缓存一定数量的日志，缓存量由 `latest_logs_cache_size_threshold` 和 `commit_logs_cache_size_threshold` 控制。[#59460](https://github.com/ClickHouse/ClickHouse/pull/59460) ([Antonio Andelic](https://github.com/antonio2368)).
* Keeper 改进：进一步缩减数据节点大小。[#59592](https://github.com/ClickHouse/ClickHouse/pull/59592) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 继续优化 `if` 函数在结果类型为 `Float*/Decimal*/*Int*` 时的分支未命中问题，作为对 [https://github.com/ClickHouse/ClickHouse/pull/57885](https://github.com/ClickHouse/ClickHouse/pull/57885) 的后续改进。[#59148](https://github.com/ClickHouse/ClickHouse/pull/59148) ([李扬](https://github.com/taiyang-li)) 。
* 当输入类型为 `Map` 时，`if` 函数经过优化后，速度最高可提升约 10 倍。[#59413](https://github.com/ClickHouse/ClickHouse/pull/59413) ([李扬](https://github.com/taiyang-li)).
* 通过实现严格别名机制来提升 `Int8` 类型的性能 (我们已在 `UInt8` 和所有其他整数类型中实现了这一机制) 。[#59485](https://github.com/ClickHouse/ClickHouse/pull/59485) ([Raúl Marín](https://github.com/Algunenano)) 。
* 通过减少分支预测失误，优化 bigint 和大 decimal 类型在条件 sum/avg 计算时的性能。[#59504](https://github.com/ClickHouse/ClickHouse/pull/59504) ([李扬](https://github.com/taiyang-li)).
* 提升存在进行中变更时的 SELECT 查询性能。[#59531](https://github.com/ClickHouse/ClickHouse/pull/59531) ([Azat Khuzhin](https://github.com/azat)) 。
* 使用 AVX2 对函数 `isNotNull` 进行了优化。[#59621](https://github.com/ClickHouse/ClickHouse/pull/59621) ([李扬](https://github.com/taiyang-li)) 。
* 提升已排序或近乎有序数据的 ASOF JOIN 性能。[#59731](https://github.com/ClickHouse/ClickHouse/pull/59731) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 之前 `async_insert_max_data_size` 的默认值为 1 MB，后来发现这个值太小了。新的默认值将调整为 10 MiB。[#59536](https://github.com/ClickHouse/ClickHouse/pull/59536) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 在执行 `RESTORE` 命令、读取备份中的表元数据时，现可使用多个线程。[#60040](https://github.com/ClickHouse/ClickHouse/pull/60040) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 现在，如果 `StorageBuffer` 有超过 1 个分片 (`num_layers` > 1) ，后台刷写会在多个线程中同时对所有分片进行。[#60111](https://github.com/ClickHouse/ClickHouse/pull/60111) ([alesapin](https://github.com/alesapin)) 。

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

* 当输出格式为 `Pretty`，且一个块仅包含单个超过一百万的数值时，会在表的右侧显示一个更易读的数字。 [#60379](https://github.com/ClickHouse/ClickHouse/pull/60379) ([rogeryk](https://github.com/rogeryk)).
* 新增了设置 `split_parts_ranges_into_intersecting_and_non_intersecting_final` 和 `split_intersecting_parts_ranges_into_layers_final`。这些设置用于禁用带有 `FINAL` 的查询优化，仅在调试时需要。[#59705](https://github.com/ClickHouse/ClickHouse/pull/59705) ([Maksim Kita](https://github.com/kitaisreal))。实际上，它们不只用于此——还可以通过牺牲性能来降低内存使用量。
* 将设置 `extract_kvp_max_pairs_per_row` 重命名为 `extract_key_value_pairs_max_pairs_per_row`。该问题 (设置名称中使用了不必要的缩写) 是在 [https://github.com/ClickHouse/ClickHouse/pull/43606](https://github.com/ClickHouse/ClickHouse/pull/43606) 中引入的。修正文档中对此设置的说明。[#59683](https://github.com/ClickHouse/ClickHouse/pull/59683) ([Alexey Milovidov](https://github.com/alexey-milovidov))。[#59960](https://github.com/ClickHouse/ClickHouse/pull/59960) ([jsc0218](https://github.com/jsc0218))。
* 现在，对带有 `DEFAULT` 或 `MATERIALIZED` 表达式的列运行 `ALTER COLUMN MATERIALIZE` 将会精确遵循其语义。[#58023](https://github.com/ClickHouse/ClickHouse/pull/58023) ([Duc Canh Le](https://github.com/canhld94)) 。
* 为变更期间发生的错误启用了指数退避逻辑。这将降低 CPU 使用率、内存占用和日志文件大小。[#58036](https://github.com/ClickHouse/ClickHouse/pull/58036) ([MikhailBurdukov](https://github.com/MikhailBurdukov)).
* 新增优化，以统计 `InitialQuery` Profile Event。[#58195](https://github.com/ClickHouse/ClickHouse/pull/58195) ([Unalian](https://github.com/Unalian)) 。
* 支持在 `storage_configuration` 中定义 `volume_priority`。[#58533](https://github.com/ClickHouse/ClickHouse/pull/58533) ([Andrey Zvonov](https://github.com/zvonand)) 。
* 为 `T64` codec 添加对 `Date32` 类型的支持。[#58738](https://github.com/ClickHouse/ClickHouse/pull/58738) ([Hongbin Ma](https://github.com/binmahone)) 。
* 允许在包含多个项的类型中使用末尾逗号。[#59119](https://github.com/ClickHouse/ClickHouse/pull/59119) ([Aleksandr Musorin](https://github.com/AVMusorin)) 。
* 现在可以在服务器配置文件中指定 Distributed 表引擎的设置 (类似于 MergeTree 的设置) ，例如 `<distributed> <flush_on_detach>false</flush_on_detach> </distributed>`。[#59291](https://github.com/ClickHouse/ClickHouse/pull/59291) ([Azat Khuzhin](https://github.com/azat)) 。
* 读取 `system.zookeeper` 时，遇到断连和会话过期会自动重试。这在从 `system.zookeeper` 表中读取大量行时尤其有用，特别是在存在故障注入导致的断连情况下。 [#59388](https://github.com/ClickHouse/ClickHouse/pull/59388) ([Alexander Gololobov](https://github.com/davenger)) 。
* 当 `input_format_values_interpret_expressions=0` 时，不要将带前导零的数字按八进制解释。[#59403](https://github.com/ClickHouse/ClickHouse/pull/59403) ([Joanna Hulboj](https://github.com/jh0x)).
* 在启动时以及每当配置文件发生更改时，ClickHouse 都会更新其总内存跟踪器的硬性内存上限。这些上限是根据各种服务器级设置以及 cgroups 限制 (在 Linux 上) 计算得出的。此前，`/sys/fs/cgroup/memory.max` (用于 cgroups v2) 被硬编码了。因此，为嵌套组 (层级) 配置的 cgroup v2 内存限制 (例如 `/sys/fs/cgroup/my/nested/group/memory.max`) 会被忽略。这个问题现已修复。v1 内存限制的行为保持不变。[#59435](https://github.com/ClickHouse/ClickHouse/pull/59435) ([Robert Schulze](https://github.com/rschu1ze)).
* 新增了 profile events，用于观测 `INSERT` 期间计算 PK/projections/secondary indices 所耗费的时间。[#59436](https://github.com/ClickHouse/ClickHouse/pull/59436) ([Nikita Taranov](https://github.com/nickitat)) 。
* 允许在创建时通过设置 `s3queue_last_processed_path`，为处于 Ordered 模式的 S3Queue 指定起始点。[#59446](https://github.com/ClickHouse/ClickHouse/pull/59446) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 在 `clickhouse-local` 中，`system.tables` 现也提供系统表的注释。[#59493](https://github.com/ClickHouse/ClickHouse/pull/59493) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* `system.zookeeper` 表：此前，整个结果会先累积在内存中，再作为一个大块返回。此更改有助于在从 `system.zookeeper` 读取大量行时降低内存消耗，支持显示中间进度 (到目前为止已读取多少行) ，并在结果集较大时避免发生连接超时。[#59545](https://github.com/ClickHouse/ClickHouse/pull/59545) ([Alexander Gololobov](https://github.com/davenger)) 。
* 现在，仪表板能够同时识别 URL #哈希的压缩和未压缩状态 (向后兼容) 。[#59124](https://github.com/ClickHouse/ClickHouse/issues/59124) 的延续。[#59548](https://github.com/ClickHouse/ClickHouse/pull/59548) ([Amos Bird](https://github.com/amosbird)) 。
* 将 Intel QPL (由编解码器 `DEFLATE_QPL` 使用) 从 v1.3.1 升级到 v1.4.0。同时还修复了轮询超时机制中的一个问题；我们观察到在某些情况下，超时机制无法正常生效，一旦发生超时，IAA 和 CPU 可能会并发处理缓冲区。目前，最好确保 IAA 编解码器状态不是 QPL\_STS\_BEING\_PROCESSED，然后再回退到 SW 编解码器。[#59551](https://github.com/ClickHouse/ClickHouse/pull/59551) ([jasperzhu](https://github.com/jinjunzh)).
* 在 ClickHouse Cloud 中，不要显示有关 server 版本的警告，因为 ClickHouse Cloud 会自动无缝升级。[#59657](https://github.com/ClickHouse/ClickHouse/pull/59657) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 自解压完成后，临时二进制文件会被移动，而不是复制。[#59661](https://github.com/ClickHouse/ClickHouse/pull/59661) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)).
* 修复 Apple macOS 上的栈展开故障。此更改解决了 [#53653](https://github.com/ClickHouse/ClickHouse/issues/53653)。[#59690](https://github.com/ClickHouse/ClickHouse/pull/59690) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 即使用户将 `max_parser_depth` 设置误配为非常大的值，也会在解析器中检查栈溢出。这解决了 [#59622](https://github.com/ClickHouse/ClickHouse/issues/59622)。[#59697](https://github.com/ClickHouse/ClickHouse/pull/59697) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。[#60434](https://github.com/ClickHouse/ClickHouse/pull/60434)
* 统一 Kafka 存储中通过 XML 和 SQL 创建的 named collection 的行为。[#59710](https://github.com/ClickHouse/ClickHouse/pull/59710) ([Pervakov Grigorii](https://github.com/GrigoryPervakov)) 。
* 当 `merge_max_block_size_bytes` 足够小时，如果表中包含宽行 (字符串或元组) ，后台合并可能会陷入死循环。此问题已修复。后续跟进见 [https://github.com/ClickHouse/ClickHouse/pull/59340。\[#59812](https://github.com/ClickHouse/ClickHouse/pull/59340。\[#59812)]\([https://github.com/ClickHouse/ClickHouse/pull/59812](https://github.com/ClickHouse/ClickHouse/pull/59812)) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 如果在 CREATE TABLE 中已显式指定 uuid，则允许在 replica\_path 中使用 uuid。[#59908](https://github.com/ClickHouse/ClickHouse/pull/59908) ([Azat Khuzhin](https://github.com/azat)) 。
* 在 `system.tables` 系统表中为 ReplicatedMergeTree 表新增 `metadata_version` 列。[#59942](https://github.com/ClickHouse/ClickHouse/pull/59942) ([Maksim Kita](https://github.com/kitaisreal)) 。
* Keeper 改进：对于 Prometheus，仅发送与 Keeper 相关的指标/事件。[#59945](https://github.com/ClickHouse/ClickHouse/pull/59945) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 即使升级后系统表结构发生变化，仪表板仍可显示不同 ClickHouse 版本中的指标。[#59967](https://github.com/ClickHouse/ClickHouse/pull/59967) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 支持从文件中加载 AZ 信息。 [#59976](https://github.com/ClickHouse/ClickHouse/pull/59976) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* Keeper 改进：为磁盘相关操作在失败时增加重试。[#59980](https://github.com/ClickHouse/ClickHouse/pull/59980) ([Antonio Andelic](https://github.com/antonio2368)).
* 新增配置设置 `backups.remove_backup_files_after_failure`：`<clickhouse> <backups> <remove_backup_files_after_failure>true</remove_backup_files_after_failure> </backups> </clickhouse>`。[#60002](https://github.com/ClickHouse/ClickHouse/pull/60002) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 当 GCP 返回带有 `GATEWAY_TIMEOUT` HTTP 错误码的 `Internal Error` 时，复制 S3 文件会回退为缓冲区复制。[#60164](https://github.com/ClickHouse/ClickHouse/pull/60164) ([Maksim Kita](https://github.com/kitaisreal)).
* `ULIDStringToDateTime` 现已支持短路执行。[#60211](https://github.com/ClickHouse/ClickHouse/pull/60211) ([Juan Madurga](https://github.com/jlmadurga)) 。
* 为 `system.backups` 和 `system.backup_log` 表新增了 `query_id` 列。`error` 列中新增了错误堆栈跟踪信息。[#60220](https://github.com/ClickHouse/ClickHouse/pull/60220) ([Maksim Kita](https://github.com/kitaisreal)).
* 通过 MySQL 端口建立的连接现在会自动使用设置 `prefer_column_name_to_alias = 1` 运行，从而开箱即用地支持 QuickSight。此外，设置 `mysql_map_string_to_text_in_show_columns` 和 `mysql_map_fixed_string_to_text_in_show_columns` 现已默认启用，且同样仅影响 MySQL 连接。这进一步提升了与更多 BI 工具的兼容性。[#60365](https://github.com/ClickHouse/ClickHouse/pull/60365) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 修复了 JavaScript 代码中的一个竞态条件，避免重复图表相互叠加。 [#60392](https://github.com/ClickHouse/ClickHouse/pull/60392) ([Alexey Milovidov](https://github.com/alexey-milovidov)).

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

* 新增了支持收集覆盖率和内部信息的构建与测试。延续 [#56102](https://github.com/ClickHouse/ClickHouse/issues/56102)。[#58792](https://github.com/ClickHouse/ClickHouse/pull/58792) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 当设置了 CMake 交叉编译工具链变量时，更新 `corrosion-cmake` 中的 Rust 工具链。[#59309](https://github.com/ClickHouse/ClickHouse/pull/59309) ([Aris Tritas](https://github.com/aris-aiven)).
* 为 ASTLiterals 增加了一些模糊测试。[#59383](https://github.com/ClickHouse/ClickHouse/pull/59383) ([Raúl Marín](https://github.com/Algunenano)).
* 如果你希望在 ClickHouse 容器每次启动时都运行 initdb 脚本，应设置环境变量 CLICKHOUSE\_ALWAYS\_RUN\_INITDB\_SCRIPTS。[#59808](https://github.com/ClickHouse/ClickHouse/pull/59808) ([Alexander Nikolaev](https://github.com/AlexNik)).
* 移除了禁用通用 ClickHouse 组件 (如 server/client/...) 的能力，但保留了一些需要额外库的组件 (如 ODBC 或 Keeper) 。[#59857](https://github.com/ClickHouse/ClickHouse/pull/59857) ([Azat Khuzhin](https://github.com/azat)).
* 查询 fuzzer 现在会对查询中的 SETTINGS 进行模糊测试。[#60087](https://github.com/ClickHouse/ClickHouse/pull/60087) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 新增了使用 clang-19 (master) 构建 ClickHouse 的支持。[#60448](https://github.com/ClickHouse/ClickHouse/pull/60448) ([Alexey Milovidov](https://github.com/alexey-milovidov)).

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

* 修复 TTL WHERE 中的 "Non-ready set" 错误。 [#57430](https://github.com/ClickHouse/ClickHouse/pull/57430) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了 `quantilesGK` 函数中的一个问题 [#58216](https://github.com/ClickHouse/ClickHouse/pull/58216) ([李扬](https://github.com/taiyang-li)) 。
* 修复了 `intDiv` 在 Decimal 参数上的错误行为 [#59243](https://github.com/ClickHouse/ClickHouse/pull/59243) ([Yarik Briukhovetskyi](https://github.com/yariks5s)) 。
* 修复 `translate` 在使用 FixedString 输入时的问题 [#59356](https://github.com/ClickHouse/ClickHouse/pull/59356) ([Raúl Marín](https://github.com/Algunenano)).
* 修复 Keeper 中的摘要值计算问题 [#59439](https://github.com/ClickHouse/ClickHouse/pull/59439) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 修复不含调试符号的二进制文件的调用栈问题 [#59444](https://github.com/ClickHouse/ClickHouse/pull/59444) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复 `ASTAlterCommand::formatImpl` 在列级设置场景下的问题... [#59445](https://github.com/ClickHouse/ClickHouse/pull/59445) ([János Benjamin Antal](https://github.com/antaljanosbenjamin)).
* 修复了 analyzer 中 `SELECT * FROM [...] ORDER BY ALL` 的问题 [#59462](https://github.com/ClickHouse/ClickHouse/pull/59462) ([zhongyuankai](https://github.com/zhongyuankai)) 。
* 修复取消分布式查询时可能发生的未捕获异常 [#59487](https://github.com/ClickHouse/ClickHouse/pull/59487) ([Azat Khuzhin](https://github.com/azat)).
* 让 MAX 在复杂类型上使用与 permutation 相同的规则 [#59498](https://github.com/ClickHouse/ClickHouse/pull/59498) ([Raúl Marín](https://github.com/Algunenano)) 。
* 修复传递 `update_insert_deduplication_token_in_dependent_materialized_views` 时的边缘情况问题 [#59544](https://github.com/ClickHouse/ClickHouse/pull/59544) ([Jordi Villar](https://github.com/jrdi)).
* 修复 arrayElement / map 处理空值时结果不正确的问题 [#59594](https://github.com/ClickHouse/ClickHouse/pull/59594) ([Raúl Marín](https://github.com/Algunenano)).
* 修复 topK 在合并空状态时崩溃的问题 [#59603](https://github.com/ClickHouse/ClickHouse/pull/59603) ([Raúl Marín](https://github.com/Algunenano)).
* 修复分片键为常量的分布式表问题 [#59606](https://github.com/ClickHouse/ClickHouse/pull/59606) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复了由 WingFuzz 发现的 KQL 问题 [#59626](https://github.com/ClickHouse/ClickHouse/pull/59626) ([Yong Wang](https://github.com/kashwy)) 。
* 修复 AsynchronousBoundedReadBuffer 中的“Read beyond last offset”错误 [#59630](https://github.com/ClickHouse/ClickHouse/pull/59630) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 在 RewriteSumFunctionWithSumAndCountVisitor 中保留函数别名 [#59658](https://github.com/ClickHouse/ClickHouse/pull/59658) ([Raúl Marín](https://github.com/Algunenano)).
* 修复非初始查询的开始时间 [#59662](https://github.com/ClickHouse/ClickHouse/pull/59662) ([Raúl Marín](https://github.com/Algunenano)) 。
* 对 `minmax` 跳过索引的参数类型进行验证 [#59733](https://github.com/ClickHouse/ClickHouse/pull/59733) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复 leftPad / rightPad 函数在输入为 FixedString 时的问题 [#59739](https://github.com/ClickHouse/ClickHouse/pull/59739) ([Raúl Marín](https://github.com/Algunenano)).
* 修复函数 `countMatches` 的 AST fuzzer 问题 [#59752](https://github.com/ClickHouse/ClickHouse/pull/59752) ([Robert Schulze](https://github.com/rschu1ze)) 。
* RabbitMQ：修复消息既未被 ack，也未被 nack 的问题 [#59775](https://github.com/ClickHouse/ClickHouse/pull/59775) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 修复 StorageURL 的部分查询仅在单线程中执行的问题 [#59833](https://github.com/ClickHouse/ClickHouse/pull/59833) ([Michael Kolupaev](https://github.com/al13n321)) 。
* S3Queue：修复未初始化值的问题 [#59897](https://github.com/ClickHouse/ClickHouse/pull/59897) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复了被括号包裹的分区表达式的解析问题 [#59901](https://github.com/ClickHouse/ClickHouse/pull/59901) ([János Benjamin Antal](https://github.com/antaljanosbenjamin)) 。
* 修复通过 HTTP 使用 JSONColumnsWithMetadata 格式时出现的崩溃问题 [#59925](https://github.com/ClickHouse/ClickHouse/pull/59925) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 如果在 Analyzer 中返回值会不同，则不要将 sum 重写为 count [#59926](https://github.com/ClickHouse/ClickHouse/pull/59926) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复 UniqExactSet 读取时崩溃的问题 [#59928](https://github.com/ClickHouse/ClickHouse/pull/59928) ([Maksim Kita](https://github.com/kitaisreal)).
* 修复 ReplicatedMergeTree 中无效的 metadata\_version 问题 [#59946](https://github.com/ClickHouse/ClickHouse/pull/59946) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 修复 `StorageDistributed` 中的竞态条件 [#59987](https://github.com/ClickHouse/ClickHouse/pull/59987) ([Nikita Taranov](https://github.com/nickitat)) 。
* Docker：将初始化脚本改为在启用该选项时运行，而不是在禁用时运行 [#59991](https://github.com/ClickHouse/ClickHouse/pull/59991) ([jktng](https://github.com/jktng)) 。
* 修复向 `SQLite` 执行包含单引号的 INSERT 时的问题 (通过使用单引号而不是反斜杠来转义单引号) [#60015](https://github.com/ClickHouse/ClickHouse/pull/60015) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复 `arrayFold` 中的多个逻辑错误 [#60022](https://github.com/ClickHouse/ClickHouse/pull/60022) ([Raúl Marín](https://github.com/Algunenano)) 。
* 修复 optimize\_uniq\_to\_count 删除列别名的问题 [#60026](https://github.com/ClickHouse/ClickHouse/pull/60026) ([Raúl Marín](https://github.com/Algunenano)).
* 修复删除 S3Queue 表时可能出现的异常 [#60036](https://github.com/ClickHouse/ClickHouse/pull/60036) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 修复 NOT 与单个字面量一起使用时的格式化问题 [#60042](https://github.com/ClickHouse/ClickHouse/pull/60042) ([Raúl Marín](https://github.com/Algunenano)) 。
* 将 DDLLogEntry 中的 max\_query\_size 改为使用上下文中的值，而不是写死为 4096 [#60083](https://github.com/ClickHouse/ClickHouse/pull/60083) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复了包含名为 `table` 的表的查询格式不一致的问题。修复了带有 `UNION ALL`、`INTERSECT` 和 `EXCEPT` 的查询在结构不是线性时的错误格式化问题。此更改关闭了 #52349。修复了 `SYSTEM` 查询的错误格式化，包括 `SYSTEM ... DROP FILESYSTEM CACHE`、`SYSTEM ... REFRESH/START/STOP/CANCEL/TEST VIEW`、`SYSTEM ENABLE/DISABLE FAILPOINT`。修复了参数化 DDL 查询的格式化问题。修复了 `DESCRIBE FILESYSTEM CACHE` 查询的格式化问题。修复了 `SET param_...` (用于设置参数的查询) 的错误格式化问题。修复了 `CREATE INDEX` 查询的错误格式化问题。修复了 `CREATE USER` 及类似查询的格式不一致问题。修复了 `CREATE SETTINGS PROFILE` 的格式不一致问题。修复了 `ALTER ... MODIFY REFRESH` 的错误格式化问题。修复了窗口函数在窗口帧偏移量为表达式时的格式不一致问题。修复了 `RESPECT NULLS` 和 `IGNORE NULLS` 在用于实现运算符的函数 (例如 `plus`) 之后使用时的格式不一致问题。修复了 `SYSTEM SYNC REPLICA ... LIGHTWEIGHT FROM ...` 这种离谱的格式化问题。修复了无效查询 `GROUP BY GROUPING SETS ... WITH ROLLUP/CUBE/TOTALS` 的格式不一致问题。修复了 `GRANT CURRENT GRANTS` 的格式不一致问题。修复了 `CREATE TABLE (... COLLATE)` 的格式不一致问题。另外，我还修复了子查询中 `EXPLAIN` 的错误格式化问题 (#60102) 。修复了 lambda function 的错误格式化问题 (#60012) 。新增了一项 check，以确保今后不会再漏掉这些离谱情况。[#60095](https://github.com/ClickHouse/ClickHouse/pull/60095) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 修复子查询中 `explain` 格式不一致的问题 [#60102](https://github.com/ClickHouse/ClickHouse/pull/60102) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 修复 `cosineDistance` 与 Nullable 一同使用时崩溃的问题 [#60150](https://github.com/ClickHouse/ClickHouse/pull/60150) ([Raúl Marín](https://github.com/Algunenano)).
* 允许将以字符串表示的 bool 值转换为真正的 bool 值 [#60160](https://github.com/ClickHouse/ClickHouse/pull/60160) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 修复了 `system.s3queue_log` [#60166](https://github.com/ClickHouse/ClickHouse/pull/60166) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复 arrayReduce 在聚合函数名称为 Nullable 时的问题 [#60188](https://github.com/ClickHouse/ClickHouse/pull/60188) ([Raúl Marín](https://github.com/Algunenano)) 。
* 隐藏 `S3Queue` 中的敏感信息 [#60233](https://github.com/ClickHouse/ClickHouse/pull/60233) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复 HTTP 异常码。 [#60252](https://github.com/ClickHouse/ClickHouse/pull/60252) ([Austin Kothig](https://github.com/kothiga)).
* S3Queue：修复了一个 bug (同时也修复了易发失败的测试 test\_storage\_s3\_queue/test.py::test\_shards\_distributed) [#60282](https://github.com/ClickHouse/ClickHouse/pull/60282) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复 IPv6 哈希函数中使用未初始化值及返回无效结果的问题 [#60359](https://github.com/ClickHouse/ClickHouse/pull/60359) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复了 OptimizeDateOrDateTimeConverterWithPreimageVisitor 处理 null 参数时的问题 [#60453](https://github.com/ClickHouse/ClickHouse/pull/60453) ([Raúl Marín](https://github.com/Algunenano)) 。
* 修复了一个小缺陷：此前，从 KQL 或 PRQL dialect 客户端发送的分布式表查询无法在副本上执行。[#59674](https://github.com/ClickHouse/ClickHouse/issues/59674)。[#60470](https://github.com/ClickHouse/ClickHouse/pull/60470) ([Alexey Milovidov](https://github.com/alexey-milovidov)) [#59674](https://github.com/ClickHouse/ClickHouse/pull/59674) ([Austin Kothig](https://github.com/kothiga)) 。

### <a id="241" /> ClickHouse 24.1 发布，2024-01-30。[演示文稿](https://presentations.clickhouse.com/2024-release-24.1/)，[视频](https://www.youtube.com/watch?v=pBF9g0wGAGs)

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

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

* 设置 `print_pretty_type_names` 现默认启用。你可以将其关闭以保留旧行为，或执行 `SET compatibility = '23.12'`。 [#57726](https://github.com/ClickHouse/ClickHouse/pull/57726) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* MergeTree setting `clean_deleted_rows` 已弃用，现已不再生效。默认不允许对 `OPTIMIZE` 使用 `CLEANUP` 关键字 (除非启用了 `allow_experimental_replacing_merge_with_cleanup`) 。 [#58316](https://github.com/ClickHouse/ClickHouse/pull/58316) ([Alexander Tokmakov](https://github.com/tavplubix)).
* 函数 `reverseDNSQuery` 已不再可用。此更改关闭了 [#58368](https://github.com/ClickHouse/ClickHouse/issues/58368)。 [#58369](https://github.com/ClickHouse/ClickHouse/pull/58369) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 启用了多项变更，以改进 configuration file 中的 access control。这些变更会影响行为，请查看 `config.xml` 中的 `access_control_improvements` 部分。如果你没有把握，请保持 configuration file 中的值与上一版本一致。 [#58584](https://github.com/ClickHouse/ClickHouse/pull/58584) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 改进了 `sumMapFiltered` 对 NaN 值的处理。现在 NaN 值会排在末尾 (而不是随机位置) ，并且被视为与任何值都不同。现在 `-0` 也被视为等于 `0`；由于值为 0 的项会被丢弃，因此 `-0` 的项也会被丢弃。 [#58959](https://github.com/ClickHouse/ClickHouse/pull/58959) ([Raúl Marín](https://github.com/Algunenano)).
* 函数 `visibleWidth` 的行为将与文档描述一致。在以前的版本中，它只是像 `lengthUTF8` 函数一样，在字符串序列化后统计码点数量，但不会考虑零宽字符、组合字符、全宽字符、制表符和删除字符。现在其行为已相应调整。如果你想保留旧行为，请将 `function_visible_width_behavior` 设为 `0`，或者将 `compatibility` 设为 `23.12` 或更低版本。 [#59022](https://github.com/ClickHouse/ClickHouse/pull/59022) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* `Kusto` dialect 已被禁用，直到以下两个缺陷修复为止：[#59037](https://github.com/ClickHouse/ClickHouse/issues/59037) 和 [#59036](https://github.com/ClickHouse/ClickHouse/issues/59036)。 [#59305](https://github.com/ClickHouse/ClickHouse/pull/59305) ([Alexey Milovidov](https://github.com/alexey-milovidov)). 任何尝试使用 `Kusto` 的操作都会导致异常。
* `FINAL` modifier 采用了更高效的实现，因此即使 `max_threads = 1`，也不再保证保留顺序。如果你依赖之前的行为，请将 `enable_vertical_final` 设为 0，或将 `compatibility` 设为 `23.12`。

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

* 实现了 Variant 数据类型，用于表示其他数据类型的联合。类型 `Variant(T1, T2, ..., TN)` 表示该类型的每一行的值可以是 `T1`、`T2`、……、`TN` 中的任意一种，也可以都不是 (即 `NULL` 值) 。Variant 类型可通过设置 `allow_experimental_variant_type` 启用。参考：[#54864](https://github.com/ClickHouse/ClickHouse/issues/54864)。[#58047](https://github.com/ClickHouse/ClickHouse/pull/58047) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 某些设置 (当前为 `min_compress_block_size` 和 `max_compress_block_size`) 现在可以在列级别指定，其优先级高于对应的表级设置。例如：`CREATE TABLE tab (col String SETTINGS (min_compress_block_size = 81920, max_compress_block_size = 163840)) ENGINE = MergeTree ORDER BY tuple();`。[#55201](https://github.com/ClickHouse/ClickHouse/pull/55201) ([Duc Canh Le](https://github.com/canhld94)) 。
* 新增 `quantileDD` 聚合函数，以及相应的 `quantilesDD` 和 `medianDD`。它基于 DDSketch：[https://www.vldb.org/pvldb/vol12/p2195-masson.pdf。###](https://www.vldb.org/pvldb/vol12/p2195-masson.pdf。###) 面向用户的变更文档条目。[#56342](https://github.com/ClickHouse/ClickHouse/pull/56342) ([Srikanth Chekuri](https://github.com/srikanthccv)) 。
* 支持为任意类型的 object storage 配置任意类型的元数据。[#58357](https://github.com/ClickHouse/ClickHouse/pull/58357) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 为 `distributed_ddl_output_mode` 新增了 `null_status_on_timeout_only_active` 和 `throw_only_active` 模式，可避免等待非活跃副本。[#58350](https://github.com/ClickHouse/ClickHouse/pull/58350) ([Alexander Tokmakov](https://github.com/tavplubix)) 。
* 新增函数 `arrayShingles`，用于计算子数组，例如 `arrayShingles([1, 2, 3, 4, 5], 3)` 返回 `[[1,2,3],[2,3,4],[3,4,5]]`。[#58396](https://github.com/ClickHouse/ClickHouse/pull/58396) ([Zheng Miao](https://github.com/zenmiao7)) 。
* 新增函数 `punycodeEncode`、`punycodeDecode`、`idnaEncode` 和 `idnaDecode`，可用于按照 IDNA 标准将国际化域名转换为 ASCII 表示形式。[#58454](https://github.com/ClickHouse/ClickHouse/pull/58454) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 新增了字符串相似度函数 `dramerauLevenshteinDistance`、`jaroSimilarity` 和 `jaroWinklerSimilarity`。[#58531](https://github.com/ClickHouse/ClickHouse/pull/58531) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 新增两个设置：`output_format_compression_level`，用于调整输出压缩级别；`output_format_compression_zstd_window_log`，用于在输出压缩方法为 `zstd` 时显式设置压缩窗口大小，并启用 zstd 压缩的长距离模式。适用于 `INTO OUTFILE`，以及写入表函数 `file`、`url`、`hdfs`、`s3` 和 `azureBlobStorage` 时。[#58539](https://github.com/ClickHouse/ClickHouse/pull/58539) ([Duc Canh Le](https://github.com/canhld94)) 。
* 当输出不是终端时，在 Pretty formats 中自动禁用 ANSI 转义序列。为设置 `output_format_pretty_color` 新增 `auto` 模式。[#58614](https://github.com/ClickHouse/ClickHouse/pull/58614) ([Shaun Struwig](https://github.com/Blargian)) 。
* 新增函数 `sqidDecode`，用于解码 [Sqids](https://sqids.org/)。[#58544](https://github.com/ClickHouse/ClickHouse/pull/58544) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 允许在 JSON input formats 中将 Bool 值读入为 String。这是通过设置 `input_format_json_read_bools_as_strings` 实现的，该设置默认已启用。 [#58561](https://github.com/ClickHouse/ClickHouse/pull/58561) ([Kruglov Pavel](https://github.com/Avogar)).
* 新增函数 `seriesDecomposeSTL`，可将时间序列分解为季节项、趋势项和残差项。[#57078](https://github.com/ClickHouse/ClickHouse/pull/57078) ([Bhavna Jindal](https://github.com/bhavnajindal)) 。
* 为 MaterializedMySQL 引入了 MySQL Binlog Client：一个 binlog 连接即可用于多个数据库。[#57323](https://github.com/ClickHouse/ClickHouse/pull/57323) ([Val Doroshchuk](https://github.com/valbok)) 。
* Intel QuickAssist Technology (QAT) 提供硬件加速的压缩和加密功能。ClickHouse 新增了压缩编解码器 `ZSTD_QAT`，可利用 QAT 进行 zstd 压缩。该编解码器使用 [Intel's QATlib](https://github.com/intel/qatlib) 和 [Inte's QAT ZSTD Plugin](https://github.com/intel/QAT-ZSTD-Plugin)。目前，只有压缩支持硬件加速 (如果 QAT 无法初始化，则会回退到软件实现) ，而解压缩始终由软件执行。[#57509](https://github.com/ClickHouse/ClickHouse/pull/57509) ([jasperzhu](https://github.com/jinjunzh)).
* 实现了 S3 磁盘对象存储键生成的新方式。现在可在磁盘描述中使用 `key_template` 选项，按 `re2` 正则表达式语法定义其格式。[#57663](https://github.com/ClickHouse/ClickHouse/pull/57663) ([Sema Checherinda](https://github.com/CheSema)) 。
* 表 system.dropped\_tables\_parts 包含 system.dropped\_tables 表中的 parts (已删除但尚未移除的表) 。[#58038](https://github.com/ClickHouse/ClickHouse/pull/58038) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* 新增设置 `max_materialized_views_size_for_table`，用于限制挂接到表上的 materialized view 数量。[#58068](https://github.com/ClickHouse/ClickHouse/pull/58068) ([zhongyuankai](https://github.com/zhongyuankai)) 。
* `clickhouse-format` 改进：支持带有 `VALUES` 的 INSERT 查询；支持注释输出 (使用 `--comments`) ；支持 `--max_line_length` 选项，仅将较长的查询格式化为多行。[#58246](https://github.com/ClickHouse/ClickHouse/pull/58246) ([vdimir](https://github.com/vdimir)).
* 在 `clickhouse-local` 中 Attach 所有系统表，包括 `system.parts`。此更改修复了 [#58312](https://github.com/ClickHouse/ClickHouse/issues/58312)。[#58359](https://github.com/ClickHouse/ClickHouse/pull/58359) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 函数 `transform` 新增了对 `Enum` 数据类型的支持。这修复了 [#58241](https://github.com/ClickHouse/ClickHouse/issues/58241)。[#58360](https://github.com/ClickHouse/ClickHouse/pull/58360) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 新增表 `system.database_engines`。[#58390](https://github.com/ClickHouse/ClickHouse/pull/58390) ([Bharat Nallan](https://github.com/bharatnc)) 。支持在代码库中独立注册数据库引擎。[#58365](https://github.com/ClickHouse/ClickHouse/pull/58365) ([Bharat Nallan](https://github.com/bharatnc)) 。支持独立注册解释器。[#58443](https://github.com/ClickHouse/ClickHouse/pull/58443) ([Bharat Nallan](https://github.com/bharatnc)) 。
* 为 `SYSTEM SYNC REPLICA LIGHTWEIGHT` 查询新增了 `FROM <Replicas>` 修饰符。使用 `FROM` 修饰符可确保仅对指定源副本，以及任何不在 zookeeper 中或 source\_replica 为空的副本，等待拉取操作和 drop-ranges。[#58393](https://github.com/ClickHouse/ClickHouse/pull/58393) ([Jayme Bird](https://github.com/jaymebrd)).
* 新增设置 `update_insert_deduplication_token_in_dependent_materialized_views`。该设置允许在依赖的 materialized view 中执行 insert 时，使用表标识符更新插入去重标记。关闭 [#59165](https://github.com/ClickHouse/ClickHouse/issues/59165)。[#59238](https://github.com/ClickHouse/ClickHouse/pull/59238) ([Maksim Kita](https://github.com/kitaisreal)).
* 新增了语句 `SYSTEM RELOAD ASYNCHRONOUS METRICS`，用于更新异步指标。该语句主要适用于测试和开发。[#53710](https://github.com/ClickHouse/ClickHouse/pull/53710) ([Robert Schulze](https://github.com/rschu1ze)) 。

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

* 并行副本的协调机制已重写，以提升并行度和缓存局部性。该机制已在数百个副本上验证过，具备线性扩展能力。现还支持按顺序读取。[#57968](https://github.com/ClickHouse/ClickHouse/pull/57968) ([Nikita Taranov](https://github.com/nickitat)) 。
* 将基于 HTTP 的出站缓冲机制替换为 ClickHouse 原生缓冲区。为接口添加字节计数指标。 [#56064](https://github.com/ClickHouse/ClickHouse/pull/56064) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)).
* `uniqExact` 的较大聚合状态将在分布式查询中并行合并。[#59009](https://github.com/ClickHouse/ClickHouse/pull/59009) ([Nikita Taranov](https://github.com/nickitat)) 。
* 降低从 `MergeTree` 表读取后的内存占用。[#59290](https://github.com/ClickHouse/ClickHouse/pull/59290) ([Anton Popov](https://github.com/CurtizJ)) 。
* 减少纵向合并中的内存占用。[#59340](https://github.com/ClickHouse/ClickHouse/pull/59340) ([Anton Popov](https://github.com/CurtizJ)) 。
* 在更多场景下避免 Keeper 启动期间占用大量内存。[#58455](https://github.com/ClickHouse/ClickHouse/pull/58455) ([Antonio Andelic](https://github.com/antonio2368)) 。
* Keeper 改进：降低 Keeper 存储节点的内存占用。[#59002](https://github.com/ClickHouse/ClickHouse/pull/59002) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 更利于缓存的 FINAL 实现。关于这一行为变更：此前，带有 `FINAL` 修饰符且以单个 stream 读取的查询 (例如 `max_threads = 1`) ，即使未显式指定 `ORDER BY` 子句，也会输出已排序的结果。而当 `enable_vertical_final = true` 时，这一点将不再得到保证 (并且默认就是如此) 。[#54366](https://github.com/ClickHouse/ClickHouse/pull/54366) ([Duc Canh Le](https://github.com/canhld94)) 。
* 避免了 `ReadBufferFromIStream` 中额外的复制操作；例如，该组件可用于从 S3 读取。 [#56961](https://github.com/ClickHouse/ClickHouse/pull/56961) ([Nikita Taranov](https://github.com/nickitat)).
* 当输入为 Array(Map)/Array(Array(Num)/Array(Array(String))/Array(BigInt)/Array(Decimal) 时，对 array element function 进行了优化。此前的实现会产生超出所需的内存分配。优化后速度最高可提升约 6 倍，尤其是在输入类型为 Array(Map) 时。[#56403](https://github.com/ClickHouse/ClickHouse/pull/56403) ([李扬](https://github.com/taiyang-li)).
* 在 compact parts 中，从同一列读取多个子列时，该列只需读取一次。[#57631](https://github.com/ClickHouse/ClickHouse/pull/57631) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 重写 `sum(column + constant)` 函数的 AST。该功能现已作为 Analyzer 中的一项优化流程提供 [#57853](https://github.com/ClickHouse/ClickHouse/pull/57853) ([Jiebin Sun](https://github.com/jiebinn)) 。
* 函数 `match` 的计算现已利用 skipping indices `ngrambf_v1` 和 `tokenbf_v1`。[#57882](https://github.com/ClickHouse/ClickHouse/pull/57882) ([凌涛](https://github.com/lingtaolf)) 。
* 函数 `match` 现已利用倒排索引进行求值。[#58284](https://github.com/ClickHouse/ClickHouse/pull/58284) ([凌涛](https://github.com/lingtaolf)) 。
* MergeTree `FINAL` 不会比较同一非 L0 part 中的行。[#58142](https://github.com/ClickHouse/ClickHouse/pull/58142) ([Duc Canh Le](https://github.com/canhld94)) 。
* 加快 iota 调用 (以连续数字填充数组) 的速度。[#58271](https://github.com/ClickHouse/ClickHouse/pull/58271) ([Raúl Marín](https://github.com/Algunenano)).
* 提升非数值类型的 MIN/MAX 性能。 [#58334](https://github.com/ClickHouse/ClickHouse/pull/58334) ([Raúl Marín](https://github.com/Algunenano)).
* 使用 BMI2/SSE intrinsic 函数优化过滤器组合 (如多阶段 PREWHERE 中) [#58800](https://github.com/ClickHouse/ClickHouse/pull/58800) ([Zhiguo Zhou](https://github.com/ZhiguoZh)) 。
* 在 `clickhouse-local` 中少用一个线程。[#58968](https://github.com/ClickHouse/ClickHouse/pull/58968) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 改进类型为 Nullable 时 `multiIf` 函数的性能。[#57745](https://github.com/ClickHouse/ClickHouse/pull/57745) ([KevinyhZou](https://github.com/KevinyhZou)).
* 新增 `SYSTEM JEMALLOC PURGE`，用于清理未使用的 jemalloc 页；新增 `SYSTEM JEMALLOC [ ENABLE | DISABLE | FLUSH ] PROFILE`，用于在 Profiler 已启用时控制 jemalloc profile。还在 Keeper 中新增了与 jemalloc 相关的 4LW 命令：`jmst` 用于转储 jemalloc 统计信息，`jmfp`、`jmep`、`jmdp` 用于在 Profiler 已启用时控制 jemalloc profile。[#58665](https://github.com/ClickHouse/ClickHouse/pull/58665) ([Antonio Andelic](https://github.com/antonio2368)).
* 降低备份到 S3 时的内存占用。[#58962](https://github.com/ClickHouse/ClickHouse/pull/58962) ([Vitaly Baranov](https://github.com/vitlibar)) 。

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

* 为所有系统表的列都添加了注释 (简短说明) 。这样做有几个原因：- 我们经常使用系统表，但有时开发者很难理解某个特定列的用途和含义。- 我们经常会变更系统表 (新增或修改现有系统表) ，而相关文档总是过期的。例如，看看 [`system.parts`](/zh/reference/system-tables/parts) 的文档页面。里面缺了很多列 - 我们希望最终能够直接从 ClickHouse 生成文档。[#58356](https://github.com/ClickHouse/ClickHouse/pull/58356) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* 允许 `PASTE JOIN` 的子查询不使用别名。[#58654](https://github.com/ClickHouse/ClickHouse/pull/58654) ([Yarik Briukhovetskyi](https://github.com/yariks5s)) 。
* 在 macOS 上启用 `MySQL`/`MariaDB` integration。此更改修复了 [#21191](https://github.com/ClickHouse/ClickHouse/issues/21191)。[#46316](https://github.com/ClickHouse/ClickHouse/pull/46316) ([Alexey Milovidov](https://github.com/alexey-milovidov))  ([Robert Schulze](https://github.com/rschu1ze)) 。
* 默认关闭 `max_rows_in_set_to_optimize_join`。[#56396](https://github.com/ClickHouse/ClickHouse/pull/56396) ([vdimir](https://github.com/vdimir)) 。
* 新增 `<host_name>` 配置参数，用于在 ON CLUSTER DDL 查询和 Replicated 数据库引擎中避免解析主机名。这可降低因集群定义发生变化而导致队列阻塞的可能性。关闭 [#57573](https://github.com/ClickHouse/ClickHouse/issues/57573)。[#57603](https://github.com/ClickHouse/ClickHouse/pull/57603) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 将文件系统缓存的 `load_metadata_threads` 增加到 16，可加快服务器启动速度。[#57732](https://github.com/ClickHouse/ClickHouse/pull/57732) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 新增了对合并/变更进行限流的功能 (`max_mutations_bandwidth_for_server`/`max_merges_bandwidth_for_server`) 。[#57877](https://github.com/ClickHouse/ClickHouse/pull/57877) ([Azat Khuzhin](https://github.com/azat)) 。
* 将系统表 `system.server_settings` 中原本未被文档记录的 (boolean) 列 `is_hot_reloadable` 替换为 (Enum8) 列 `changeable_without_restart`，其可能值为 `No`、`Yes`、`IncreaseOnly` 和 `DecreaseOnly`。此外，还补充了该列的文档说明。[#58029](https://github.com/ClickHouse/ClickHouse/pull/58029) ([skyoct](https://github.com/skyoct)).
* 集群发现现已支持设置用户名和密码，详见 [#58063](https://github.com/ClickHouse/ClickHouse/issues/58063)。[#58123](https://github.com/ClickHouse/ClickHouse/pull/58123) ([vdimir](https://github.com/vdimir)) 。
* 支持在 `ALTER TABLE ... PART` 中使用查询参数。[#58297](https://github.com/ClickHouse/ClickHouse/pull/58297) ([Azat Khuzhin](https://github.com/azat)) 。
* 动态为 Kafka 表创建消费者 (但会自上次使用后保留一段时间——`kafka_consumers_pool_ttl_ms`) ，这应该能修复 `system.kafka_consumers` 统计信息的问题 (当没有人读取 Kafka 表时就不会消费，从而导致持续性的内存泄漏以及表 detach 缓慢) ，并且此 PR 还会再次默认启用 `system.kafka_consumers` 的统计信息。[#58310](https://github.com/ClickHouse/ClickHouse/pull/58310) ([Azat Khuzhin](https://github.com/azat)).
* 将 `sparkBar` 设为 `sparkbar` 的别名。[#58335](https://github.com/ClickHouse/ClickHouse/pull/58335) ([凌涛](https://github.com/lingtaolf)) 。
* 避免在上传到 `GCS` 后再发送 `ComposeObject` 请求。[#58343](https://github.com/ClickHouse/ClickHouse/pull/58343) ([Azat Khuzhin](https://github.com/azat)).
* 正确处理配置 XML 中名称带点的键。[#58354](https://github.com/ClickHouse/ClickHouse/pull/58354) ([Azat Khuzhin](https://github.com/azat)) 。
* 使函数 `format` 在参数为常量时返回常量。这解决了 [#58355](https://github.com/ClickHouse/ClickHouse/issues/58355)。[#58358](https://github.com/ClickHouse/ClickHouse/pull/58358) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 新增设置 `max_estimated_execution_time`，将 `max_execution_time` 与 `max_estimated_execution_time` 区分开来。[#58402](https://github.com/ClickHouse/ClickHouse/pull/58402) ([Zhang Yifan](https://github.com/zhangyifan27)) 。
* 使用无效的数据库引擎名称时，会给出提示。 [#58444](https://github.com/ClickHouse/ClickHouse/pull/58444) ([Bharat Nallan](https://github.com/bharatnc)).
* 为 Arrow 字典中的索引类型添加了设置，以便更好地控制。根据 Arrow 的建议，默认对索引使用有符号整数类型。关闭 [#57401](https://github.com/ClickHouse/ClickHouse/issues/57401)。[#58519](https://github.com/ClickHouse/ClickHouse/pull/58519) ([Kruglov Pavel](https://github.com/Avogar)).
* 实现 [#58575](https://github.com/ClickHouse/ClickHouse/issues/58575)：运行 Docker 镜像时支持 `CLICKHOUSE_PASSWORD_FILE ` 环境变量。[#58583](https://github.com/ClickHouse/ClickHouse/pull/58583) ([Eyal Halpern Shalev](https://github.com/Eyal-Shalev)) 。
* 执行某些需要大量流来读取数据的查询时，此前会抛出错误 `"Paste JOIN requires sorted tables only"`。现在在这种情况下，流的数量会改为 1。[#58608](https://github.com/ClickHouse/ClickHouse/pull/58608) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* 改进了 INVALID\_IDENTIFIER 错误的提示信息。[#58703](https://github.com/ClickHouse/ClickHouse/pull/58703) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* 改进了 `normalizeQuery` 对有符号数字字面量的处理。[#58710](https://github.com/ClickHouse/ClickHouse/pull/58710) ([Salvatore Mesoraca](https://github.com/aiven-sal)) 。
* 支持 MySQL 的 Point 类型。[#58721](https://github.com/ClickHouse/ClickHouse/pull/58721) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 比较 Float32 列与常量字符串时，将该字符串按 Float32 读取 (而不是按 Float64) 。[#58724](https://github.com/ClickHouse/ClickHouse/pull/58724) ([Raúl Marín](https://github.com/Algunenano)) 。
* 改进 S3 兼容性，新增对 ECloud EOS 存储的支持。[#58786](https://github.com/ClickHouse/ClickHouse/pull/58786) ([xleoken](https://github.com/xleoken)) 。
* 允许使用 `KILL QUERY` 取消备份/恢复。此 PR 还让正在进行的备份和恢复会显示在 `system.processes` 中。此外，服务器配置中现已新增一个设置——`shutdown_wait_backups_and_restores` (默认=true) ，用于控制服务器关闭时是等待所有正在进行的备份和恢复完成，还是直接将其取消。[#58804](https://github.com/ClickHouse/ClickHouse/pull/58804) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* Avro 格式支持 ZSTD 编解码器。已关闭 [#58735](https://github.com/ClickHouse/ClickHouse/issues/58735)。[#58805](https://github.com/ClickHouse/ClickHouse/pull/58805) ([flynn](https://github.com/ucasfl)) 。
* MySQL 接口现已支持 `net_write_timeout` 和 `net_read_timeout` 设置。`net_write_timeout` 会映射为 ClickHouse 原生的 `send_timeout` 设置，同样，`net_read_timeout` 会映射为 `receive_timeout`。修复了一个问题：此前仅当整个语句均为大写时，才能设置 MySQL 的 `sql_select_limit`。[#58835](https://github.com/ClickHouse/ClickHouse/pull/58835) ([Serge Klochkov](https://github.com/slvrtrn)) 。
* 在创建同名字典和表时如发生冲突，现会提供更清晰的异常消息。[#58841](https://github.com/ClickHouse/ClickHouse/pull/58841) ([Yarik Briukhovetskyi](https://github.com/yariks5s)) 。
* 请确保对于自定义 (通过 SQL 创建的) 磁盘，在 server 配置中指定了 `filesystem_caches_path` (所有文件系统缓存共用的目录前缀) 或 `custom_cached_disks_base_directory` (仅由自定义磁盘创建的文件系统缓存共用的目录前缀) 。对于自定义磁盘，`custom_cached_disks_base_directory` 的优先级高于 `filesystem_caches_path`；如果前者未指定，则使用后者。文件系统缓存设置 `path` 必须位于该目录内，否则会抛出异常以阻止磁盘创建。这不会影响在旧版本中创建、之后 server 升级的磁盘——在这种情况下不会抛出异常，以便 server 能够成功启动。`custom_cached_disks_base_directory` 已作为 `/var/lib/clickhouse/caches/` 添加到默认 server 配置中。关闭 [#57825](https://github.com/ClickHouse/ClickHouse/issues/57825)。[#58869](https://github.com/ClickHouse/ClickHouse/pull/58869) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* MySQL interface 现已兼容 `SHOW WARNINGS`/`SHOW COUNT(*) WARNINGS` 查询，但返回结果始终为空集。[#58929](https://github.com/ClickHouse/ClickHouse/pull/58929) ([Serge Klochkov](https://github.com/slvrtrn)) 。
* 执行并行分布式 `INSERT SELECT` 时跳过不可用副本。[#58931](https://github.com/ClickHouse/ClickHouse/pull/58931) ([Alexander Tokmakov](https://github.com/tavplubix)) 。
* 在 json 中启用结构化日志格式化时，显示文字描述的日志级别。[#58936](https://github.com/ClickHouse/ClickHouse/pull/58936) ([Tim Liou](https://github.com/wheatdog)) 。
* MySQL 接口现已通过数据类型别名支持 `CAST(x AS SIGNED)` 和 `CAST(x AS UNSIGNED)` 语句：`SIGNED` 对应 Int64，`UNSIGNED` 对应 UInt64。这提高了与 Looker Studio 等 BI 工具的兼容性。[#58954](https://github.com/ClickHouse/ClickHouse/pull/58954) ([Serge Klochkov](https://github.com/slvrtrn)) 。
* 将工作目录切换到 docker 容器中的数据路径。[#58975](https://github.com/ClickHouse/ClickHouse/pull/58975) ([cangyin](https://github.com/cangyin)) 。
* 新增了 Azure Blob 存储设置 `azure_max_unexpected_write_error_retries`，也可以在配置文件的 azure 部分中设置。[#59001](https://github.com/ClickHouse/ClickHouse/pull/59001) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)).
* 允许服务器在数据湖表损坏时启动。关闭了 [#58625](https://github.com/ClickHouse/ClickHouse/issues/58625)。[#59080](https://github.com/ClickHouse/ClickHouse/pull/59080) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 允许在 `Iceberg` 表引擎中忽略 schema 演进，并使用建表时用户指定的 schema，或建表时从元数据中解析出的最新 schema 来读取所有数据。这通过设置 `iceberg_engine_ignore_schema_evolution` 实现，该设置默认处于禁用状态。请注意，启用此设置可能会导致结果不正确，因为在 schema 已演进的情况下，所有数据文件都会按同一个 schema 读取。[#59133](https://github.com/ClickHouse/ClickHouse/pull/59133) ([Kruglov Pavel](https://github.com/Avogar)).
* 在只读/一次写入存储上禁止可变更操作 (`INSERT`/`ALTER`/`OPTIMIZE`/...) ，并返回适当的 `TABLE_IS_READ_ONLY` 错误 (以避免残留) 。避免在一次写入磁盘上因 `CREATE`/`ATTACH` 留下残留 (`format_version.txt`) 。对 `ReplicatedMergeTree` 忽略 `DROP` (`MergeTree` 也是如此) 。修复遍历 `s3_plain` 时的问题 (`MetadataStorageFromPlainObjectStorage::iterateDirectory`) 。请注意，只读的是 `web` 磁盘，而一次写入的是 `s3_plain`。[#59170](https://github.com/ClickHouse/ClickHouse/pull/59170) ([Azat Khuzhin](https://github.com/azat)).
* 修复了 Experimental `_block_number` 列中的一个缺陷，该缺陷可能在复杂组合使用 `ALTER` 和 `merge` 时导致逻辑错误。修复 [#56202](https://github.com/ClickHouse/ClickHouse/issues/56202)。替换 [#58601](https://github.com/ClickHouse/ClickHouse/issues/58601)。[#59295](https://github.com/ClickHouse/ClickHouse/pull/59295) ([alesapin](https://github.com/alesapin)) 。
* Play UI 现在能够识别 JSON 中返回的异常。针对 [#52853](https://github.com/ClickHouse/ClickHouse/issues/52853) 的调整。[#59303](https://github.com/ClickHouse/ClickHouse/pull/59303) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* `/binary` HTTP 处理器支持在查询字符串中指定用户、主机，以及可选的密码。[#59311](https://github.com/ClickHouse/ClickHouse/pull/59311) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 支持为压缩内存表进行备份。这修复了 [#57893](https://github.com/ClickHouse/ClickHouse/issues/57893)。[#59315](https://github.com/ClickHouse/ClickHouse/pull/59315) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 为 `BACKUP` 和 `RESTORE` 查询增加了对 `FORMAT` 子句的支持。[#59338](https://github.com/ClickHouse/ClickHouse/pull/59338) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 函数 `concatWithSeparator` 现在支持任意类型的参数 (而不再仅限于 `String` 和 `FixedString` 类型的参数) 。例如，`SELECT concatWithSeparator('.', 'number', 1)` 现在会返回 `number.1`。[#59341](https://github.com/ClickHouse/ClickHouse/pull/59341) ([Robert Schulze](https://github.com/rschu1ze)) 。

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

* 改进 `clickhouse` 二进制文件的别名 (现在 `ch`/`clickhouse` 会根据参数解析为 `clickhouse-local` 或 `clickhouse`) ，并为新别名添加 bash 自动补全。 [#58344](https://github.com/ClickHouse/ClickHouse/pull/58344) ([Azat Khuzhin](https://github.com/azat)).
* 在 CI 中添加设置变更检查，确保所有设置变更都反映在设置变更历史中。 [#58555](https://github.com/ClickHouse/ClickHouse/pull/58555) ([Kruglov Pavel](https://github.com/Avogar)).
* 在有状态测试中使用直接从 S3 Attach 的表。 [#58791](https://github.com/ClickHouse/ClickHouse/pull/58791) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 将整个 `fuzzer.log` 保存为归档文件，而不是仅保存最后 100k 行。`tail -n 100000` 经常会截掉包含表定义的行。示例：. [#58821](https://github.com/ClickHouse/ClickHouse/pull/58821) ([Dmitry Novik](https://github.com/novikd)).
* 在 macOS Aarch64 上启用 Rust (这会在客户端中加入基于 skim 的模糊搜索以及 PRQL 语言，不过我觉得应该没人会在 darwin 上托管 ClickHouse，所以我认为这主要还是为了客户端中的模糊搜索) 。 [#59272](https://github.com/ClickHouse/ClickHouse/pull/59272) ([Azat Khuzhin](https://github.com/azat)).
* 修复混合 x86\_64 和 ARM 集群中的 aggregation 问题 [#59132](https://github.com/ClickHouse/ClickHouse/pull/59132) ([Harry Lee](https://github.com/HarryLeeIBM)).

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

* 为嵌套的 LowCardinality 添加连接键转换 [#51550](https://github.com/ClickHouse/ClickHouse/pull/51550) ([vdimir](https://github.com/vdimir)) 。
* 仅在 `flatten&#95;nested=1` 时展平真正的 Nested 类型，而不是所有的 Array(Tuple) [#56132](https://github.com/ClickHouse/ClickHouse/pull/56132) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复了插入数据时 projections 与 `aggregate_functions_null_for_empty` 设置配合使用时的一个错误。 [#56944](https://github.com/ClickHouse/ClickHouse/pull/56944) ([Amos Bird](https://github.com/amosbird)).
* 修复了由失效的 profile UUID 导致的潜在异常 [#57263](https://github.com/ClickHouse/ClickHouse/pull/57263) ([Vasily Nemkov](https://github.com/Enmk)) 。
* 修复 StreamingFormatExecutor 中 read buffer 的相关问题 [#57438](https://github.com/ClickHouse/ClickHouse/pull/57438) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 在向视图推送时，忽略目标表已删除的 MV [#57520](https://github.com/ClickHouse/ClickHouse/pull/57520) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 消除 ALTER\_METADATA 与 MERGE\_PARTS 之间可能出现的竞态 [#57755](https://github.com/ClickHouse/ClickHouse/pull/57755) ([Azat Khuzhin](https://github.com/azat)).
* 修复 `group by with rollup` 中表达式顺序出错的问题 [#57786](https://github.com/ClickHouse/ClickHouse/pull/57786) ([Chen768959](https://github.com/Chen768959)).
* 针对已废弃的 "zero-copy" 复制功能的修复：修复删除带有损坏 detached parts 的副本后 blob 丢失的问题 [#58333](https://github.com/ClickHouse/ClickHouse/pull/58333) ([Alexander Tokmakov](https://github.com/tavplubix)) 。
* 允许用户在 user\_files\_path 下使用符号链接 [#58447](https://github.com/ClickHouse/ClickHouse/pull/58447) ([Duc Canh Le](https://github.com/canhld94)).
* 修复了 graphite 表在没有 agg 函数时发生崩溃的问题 [#58453](https://github.com/ClickHouse/ClickHouse/pull/58453) ([Duc Canh Le](https://github.com/canhld94)).
* 延迟从 StorageKafka 读取，以支持在 materialized views 中进行多次读取 [#58477](https://github.com/ClickHouse/ClickHouse/pull/58477) ([János Benjamin Antal](https://github.com/antaljanosbenjamin)).
* 修复一个莫名其妙的 parts 重叠问题 [#58482](https://github.com/ClickHouse/ClickHouse/pull/58482) ([Alexander Tokmakov](https://github.com/tavplubix)) 。
* 针对仅含 LIMIT 的查询禁用 MergeTreePrefetchedReadPool [#58505](https://github.com/ClickHouse/ClickHouse/pull/58505) ([Maksim Kita](https://github.com/kitaisreal)).
* 在恢复过程中启用 Ordinary 数据库 [#58520](https://github.com/ClickHouse/ClickHouse/pull/58520) ([Jihyuk Bok](https://github.com/tomahawk28)) 。
* 修复 Apache Hive 读取 ORC/Parquet/... 时的线程池问题 [#58537](https://github.com/ClickHouse/ClickHouse/pull/58537) ([sunny](https://github.com/sunny19930321)).
* 隐藏 `system.backup_log` 的 `base_backup_name` 列中的凭据 [#58550](https://github.com/ClickHouse/ClickHouse/pull/58550) ([Daniel Pozo Escalona](https://github.com/danipozo)).
* `toStartOfInterval` 支持对毫秒和微秒值进行舍入 [#58557](https://github.com/ClickHouse/ClickHouse/pull/58557) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* 在 ConcurrentHashJoin 中关闭 `max_joined_block_rows` [#58595](https://github.com/ClickHouse/ClickHouse/pull/58595) ([vdimir](https://github.com/vdimir)) 。
* 修复旧版 analyzer 中使用 Nullable 的 join 问题 [#58596](https://github.com/ClickHouse/ClickHouse/pull/58596) ([vdimir](https://github.com/vdimir)) 。
* `makeDateTime64`：允许 `fraction` 参数为非常量 [#58597](https://github.com/ClickHouse/ClickHouse/pull/58597) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 修复在对内联帧进行符号化时可能出现的 NULL 解引用问题 [#58607](https://github.com/ClickHouse/ClickHouse/pull/58607) ([Azat Khuzhin](https://github.com/azat)) 。
* 改进在重新创建的用户或切换角色时查询缓存条目的隔离性 [#58611](https://github.com/ClickHouse/ClickHouse/pull/58611) ([Robert Schulze](https://github.com/rschu1ze)).
* 修复执行投影优化时分区键分析失效的问题 [#58638](https://github.com/ClickHouse/ClickHouse/pull/58638) ([Amos Bird](https://github.com/amosbird)) 。
* 查询缓存：修复按用户配额的问题 [#58731](https://github.com/ClickHouse/ClickHouse/pull/58731) ([Robert Schulze](https://github.com/rschu1ze)).
* 修复并行窗口函数中的流式分区问题 [#58739](https://github.com/ClickHouse/ClickHouse/pull/58739) ([Dmitry Novik](https://github.com/novikd)) 。
* 修复了 addBatchLookupTable8 中抛出异常时重复调用 destroy 的问题 [#58745](https://github.com/ClickHouse/ClickHouse/pull/58745) ([Raúl Marín](https://github.com/Algunenano)).
* 在关闭期间，Keeper 不处理请求 [#58765](https://github.com/ClickHouse/ClickHouse/pull/58765) ([Antonio Andelic](https://github.com/antonio2368)).
* 修复 `SlabsPolygonIndex::find` 中空指针解引用的问题 [#58771](https://github.com/ClickHouse/ClickHouse/pull/58771) ([Yarik Briukhovetskyi](https://github.com/yariks5s)) 。
* 修复 LowCardinality(Nullable) 列中 JSONExtract 函数的问题 [#58808](https://github.com/ClickHouse/ClickHouse/pull/58808) ([vdimir](https://github.com/vdimir)) 。
* 修复了通过 CREATE 和 DROP 操作创建和删除大量表时内存使用量意外累积的问题。[#58831](https://github.com/ClickHouse/ClickHouse/pull/58831) ([Maksim Kita](https://github.com/kitaisreal)) 。
* mv 中可多次读取文件日志存储 [#58877](https://github.com/ClickHouse/ClickHouse/pull/58877) ([János Benjamin Antal](https://github.com/antaljanosbenjamin)) 。
* 对 S3 的 Access Key ID 的限制。[#58900](https://github.com/ClickHouse/ClickHouse/pull/58900) ([MikhailBurdukov](https://github.com/MikhailBurdukov)).
* 修复 `clickhouse-local` 在加载建议时可能出现的崩溃问题 [#58907](https://github.com/ClickHouse/ClickHouse/pull/58907) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了使用 `indexHint` 时发生崩溃的问题 [#58911](https://github.com/ClickHouse/ClickHouse/pull/58911) ([Dmitry Novik](https://github.com/novikd)) 。
* 修复了 server 重启时 StorageURL 丢失请求头的问题 [#58933](https://github.com/ClickHouse/ClickHouse/pull/58933) ([Michael Kolupaev](https://github.com/al13n321)) 。
* analyzer：修复使用插入块替换存储时的问题 [#58958](https://github.com/ClickHouse/ClickHouse/pull/58958) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* 修复 ReadBufferFromZipArchive 中的寻道问题 [#58966](https://github.com/ClickHouse/ClickHouse/pull/58966) ([Michael Kolupaev](https://github.com/al13n321)) 。
* 针对 Experimental 倒排索引的修复 (请勿在生产环境中使用) ：倒排索引的 `DROP INDEX` 现在会从持久化存储中删除所有相关文件 [#59040](https://github.com/ClickHouse/ClickHouse/pull/59040) ([mochi](https://github.com/MochiXu)).
* 修复 query\_factories\_info 中的数据竞争问题 [#59049](https://github.com/ClickHouse/ClickHouse/pull/59049) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 禁用对 "Too many redirects" 错误的重试 [#59099](https://github.com/ClickHouse/ClickHouse/pull/59099) ([skyoct](https://github.com/skyoct)) 。
* 修复未启动的数据库在关闭时发生死锁的问题 [#59137](https://github.com/ClickHouse/ClickHouse/pull/59137) ([Sergei Trifonov](https://github.com/serxa)) 。
* 修复：分布式查询中 LIMIT BY 和 LIMIT 的问题 [#59153](https://github.com/ClickHouse/ClickHouse/pull/59153) ([Igor Nikonov](https://github.com/devcrafter)) 。
* 修复 `toString` 处理 Nullable 时区时发生的崩溃问题 [#59190](https://github.com/ClickHouse/ClickHouse/pull/59190) ([Yarik Briukhovetskyi](https://github.com/yariks5s)) 。
* 修复错误文件路径导致 Iceberg 元数据处理中止的问题 [#59275](https://github.com/ClickHouse/ClickHouse/pull/59275) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复 Rust 目标选择项中的架构名称 [#59307](https://github.com/ClickHouse/ClickHouse/pull/59307) ([p1rattttt](https://github.com/p1rattttt)).
* 修复了在 IN 子句中使用子查询从 `system.tables` 进行查询时与“未就绪集合”相关的逻辑错误。[#59351](https://github.com/ClickHouse/ClickHouse/pull/59351) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。

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