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

# 2023 更新日志

> 2023 年更新日志

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

**[ClickHouse 发布 v23.12，2023-12-28](#2312)**<br />
**[ClickHouse 发布 v23.11，2023-12-06](#2311)**<br />
**[ClickHouse 发布 v23.10，2023-11-02](#2310)**<br />
**[ClickHouse 发布 v23.9，2023-09-28](#239)**<br />
**[ClickHouse 发布 v23.8 LTS，2023-08-31](#238)**<br />
**[ClickHouse 发布 v23.7，2023-07-27](#237)**<br />
**[ClickHouse 发布 v23.6，2023-06-30](#236)**<br />
**[ClickHouse 发布 v23.5，2023-06-08](#235)**<br />
**[ClickHouse 发布 v23.4，2023-04-26](#234)**<br />
**[ClickHouse 发布 v23.3 LTS，2023-03-30](#233)**<br />
**[ClickHouse 发布 v23.2，2023-02-23](#232)**<br />
**[ClickHouse 发布 v23.1，2023-01-25](#231)**<br />
**[2022 年更新日志](/zh/resources/changelogs/oss/2022)**<br />

### <a id="2312" /> ClickHouse 发布 23.12，2023-12-28。 [演示文稿](https://presentations.clickhouse.com/2023-release-23.12/), [视频](https://www.youtube.com/watch?v=7TLuT6gt0PQ)

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

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

* 修复了对生存时间 (TTL) 表达式中非确定性函数的检查。此前，在某些情况下可以创建包含非确定性函数的生存时间 (TTL) 表达式，这可能会在后续导致未定义行为。此更改修复了 [#37250](https://github.com/ClickHouse/ClickHouse/issues/37250)。现在默认禁止不依赖表中任何列的生存时间 (TTL) 表达式。可通过 `SET allow_suspicious_ttl_expressions = 1` 或 `SET compatibility = '23.11'` 重新启用。关闭了 [#37286](https://github.com/ClickHouse/ClickHouse/issues/37286)。[#51858](https://github.com/ClickHouse/ClickHouse/pull/51858) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* MergeTree setting `clean_deleted_rows` 已弃用，现已不再生效。`OPTIMIZE` 的 `CLEANUP` 关键字默认不允许使用 (可通过 `allow_experimental_replacing_merge_with_cleanup` 设置解锁) 。[#58267](https://github.com/ClickHouse/ClickHouse/pull/58267) ([Alexander Tokmakov](https://github.com/tavplubix))。此更改修复了 [#57930](https://github.com/ClickHouse/ClickHouse/issues/57930)，并关闭了 [#54988](https://github.com/ClickHouse/ClickHouse/issues/54988)、[#54570](https://github.com/ClickHouse/ClickHouse/issues/54570)、[#50346](https://github.com/ClickHouse/ClickHouse/issues/50346) 和 [#47579](https://github.com/ClickHouse/ClickHouse/issues/47579)。该功能必须移除，因为它存在设计问题，而且没有其他可行方案，因此需要尽快删除。[#57932](https://github.com/ClickHouse/ClickHouse/pull/57932) ([Alexey Milovidov](https://github.com/alexey-milovidov)).

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

* 实现了 Refreshable Materialized Views，这是 [#33919](https://github.com/ClickHouse/ClickHouse/issues/33919) 中提出的需求。[#56946](https://github.com/ClickHouse/ClickHouse/pull/56946) ([Michael Kolupaev](https://github.com/al13n321)、[Michael Guzov](https://github.com/koloshmet)) 。
* 引入 `PASTE JOIN`，允许用户仅按行号对表进行 join，而无需 `ON` 子句。示例：`SELECT * FROM (SELECT number AS a FROM numbers(2)) AS t1 PASTE JOIN (SELECT number AS a FROM numbers(2) ORDER BY a DESC) AS t2`。[#57995](https://github.com/ClickHouse/ClickHouse/pull/57995) ([Yarik Briukhovetskyi](https://github.com/yariks5s)) 。
* `ORDER BY` 子句现已支持指定 `ALL`，这表示 ClickHouse 会按 `SELECT` 子句中的所有列进行排序。示例：`SELECT col1, col2 FROM tab WHERE [...] ORDER BY ALL`。[#57875](https://github.com/ClickHouse/ClickHouse/pull/57875) ([zhongyuankai](https://github.com/zhongyuankai)) 。
* 新增了一个新的变更命令 `ALTER TABLE <table> APPLY DELETED MASK`，可强制应用轻量级删除写入的掩码，并从磁盘中移除被标记为已删除的行。[#57433](https://github.com/ClickHouse/ClickHouse/pull/57433) ([Anton Popov](https://github.com/CurtizJ)).
* 处理器 `/binary` 会打开一个用于查看 ClickHouse 可执行文件中符号的可视化界面。[#58211](https://github.com/ClickHouse/ClickHouse/pull/58211) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 新增了一个用于生成 Sqids ([https://sqids.org/](https://sqids.org/)) 的 SQL 函数 `sqid`，示例：`SELECT sqid(125, 126)`。[#57512](https://github.com/ClickHouse/ClickHouse/pull/57512) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 新增函数 `seriesPeriodDetectFFT`，用于使用 FFT 检测序列周期。[#57574](https://github.com/ClickHouse/ClickHouse/pull/57574) ([Bhavna Jindal](https://github.com/bhavnajindal)) 。
* 添加一个 HTTP 端点，用于检查 Keeper 是否已就绪并可接收流量。[#55876](https://github.com/ClickHouse/ClickHouse/pull/55876) ([Konstantin Bogdanov](https://github.com/thevar1able)) 。
* 为 schema 推断新增 'union' 模式。在此模式下，结果表的 schema 是所有文件 schema 的并集 (即会从每个文件分别推断 schema) 。schema 推断模式由设置 `schema_inference_mode` 控制，可取两个值：`default` 和 `union`。关闭 [#55428](https://github.com/ClickHouse/ClickHouse/issues/55428)。[#55892](https://github.com/ClickHouse/ClickHouse/pull/55892) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 新增设置 `input_format_csv_try_infer_numbers_from_strings`，允许在 CSV 格式中从字符串推断出数值。关闭了 [#56455](https://github.com/ClickHouse/ClickHouse/issues/56455)。[#56859](https://github.com/ClickHouse/ClickHouse/pull/56859) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 当数据库或表的数量超过可配置的阈值时，向用户发出警告。 [#57375](https://github.com/ClickHouse/ClickHouse/pull/57375) ([凌涛](https://github.com/lingtaolf)).
* 采用 `HASHED_ARRAY` (以及 `COMPLEX_KEY_HASHED_ARRAY`) 布局的字典现已像 `HASHED` 一样支持 `SHARDS` 分片。[#57544](https://github.com/ClickHouse/ClickHouse/pull/57544) ([vdimir](https://github.com/vdimir)) 。
* 新增用于统计主键总字节数以及内存中已分配主键总字节数的异步指标。[#57551](https://github.com/ClickHouse/ClickHouse/pull/57551) ([Bharat Nallan](https://github.com/bharatnc)) 。
* 新增 `SHA512_256` 函数。[#57645](https://github.com/ClickHouse/ClickHouse/pull/57645) ([Bharat Nallan](https://github.com/bharatnc)) 。
* 新增 `FORMAT_BYTES`，作为 `formatReadableSize` 的别名。[#57592](https://github.com/ClickHouse/ClickHouse/pull/57592) ([Bharat Nallan](https://github.com/bharatnc)) 。
* 允许向 `s3` 表函数传入可选的会话令牌。[#57850](https://github.com/ClickHouse/ClickHouse/pull/57850) ([Shani Elharrar](https://github.com/shanielh)) 。
* 新增设置 `http_make_head_request`。关闭后，URL 表引擎将不会发送 HEAD 请求来确定文件大小。这是为支持低效、配置不当或不支持此功能的 HTTP 服务器所必需的。[#54602](https://github.com/ClickHouse/ClickHouse/pull/54602) ([Fionera](https://github.com/fionera)).
* 现在，在索引 (非主键) 定义中也可以引用 ALIAS 列了 (见问题 [#55650](https://github.com/ClickHouse/ClickHouse/issues/55650)) 。例如：`CREATE TABLE tab(col UInt32, col_alias ALIAS col + 1, INDEX idx (col_alias) TYPE minmax) ENGINE = MergeTree ORDER BY col;`。[#57546](https://github.com/ClickHouse/ClickHouse/pull/57546) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 新增了一个设置 `readonly`，可用于将 S3 磁盘指定为只读。在 `s3_plain` 类型的磁盘上创建表时，即使对底层 S3 存储桶只有只读访问权限，这一设置也很有用。[#57977](https://github.com/ClickHouse/ClickHouse/pull/57977) ([Pengyuan Bian](https://github.com/bianpengyuan)) 。
* MergeTree 表中的主键分析现在也会应用于包含虚拟列 `_part_offset` (可选同时包含 `_part`) 的谓词。此功能可用作一种特殊的二级索引。[#58224](https://github.com/ClickHouse/ClickHouse/pull/58224) ([Amos Bird](https://github.com/amosbird)) 。

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

* 在对 MergeTree 表执行 FINAL 处理时，提取不相交的 parts 范围。这样便可避免对这些不相交的 parts 范围额外应用 FINAL 逻辑。若具有相同主键的重复值较少，性能将几乎与不使用 FINAL 时相同。在设置 `do_not_merge_across_partitions_select_final` 时，提升了 MergeTree FINAL 的读取性能。[#58120](https://github.com/ClickHouse/ClickHouse/pull/58120) ([Maksim Kita](https://github.com/kitaisreal)).
* 在 s3 磁盘之间复制时，改为使用 s3 服务器端复制，而不是通过 buffer 进行复制。改进了 `BACKUP/RESTORE` 操作和 `clickhouse-disks copy` 命令。[#56744](https://github.com/ClickHouse/ClickHouse/pull/56744) ([MikhailBurdukov](https://github.com/MikhailBurdukov)) 。
* Hash JOIN 现会遵循设置 `max_joined_block_size_rows`，并且不会为 `ALL JOIN` 生成过大的块。 [#56996](https://github.com/ClickHouse/ClickHouse/pull/56996) ([vdimir](https://github.com/vdimir)).
* 更早释放聚合所用内存。这可以避免不必要的外部聚合。[#57691](https://github.com/ClickHouse/ClickHouse/pull/57691) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 提升字符串序列化性能。[#57717](https://github.com/ClickHouse/ClickHouse/pull/57717) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 支持 `Merge` 引擎表的简单计数优化。[#57867](https://github.com/ClickHouse/ClickHouse/pull/57867) ([skyoct](https://github.com/skyoct)) 。
* 优化了某些情况下的聚合性能。[#57872](https://github.com/ClickHouse/ClickHouse/pull/57872) ([Anton Popov](https://github.com/CurtizJ)).
* `hasAny` 函数现在可以利用全文跳数索引了。[#57878](https://github.com/ClickHouse/ClickHouse/pull/57878) ([Jpnock](https://github.com/Jpnock)).
* 函数 `if(cond, then, else)` (及其别名 `cond ? then : else`) 已优化为采用无分支求值。[#57885](https://github.com/ClickHouse/ClickHouse/pull/57885) ([zhanglistar](https://github.com/zhanglistar)) 。
* 如果分区键表达式仅包含主键表达式中的列，MergeTree 会自动确定 `do_not_merge_across_partitions_select_final` 设置。[#58218](https://github.com/ClickHouse/ClickHouse/pull/58218) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 提升原生类型上 `MIN` 和 `MAX` 的性能。[#58231](https://github.com/ClickHouse/ClickHouse/pull/58231) ([Raúl Marín](https://github.com/Algunenano)) 。
* 为文件系统缓存引入 `SLRU` 缓存策略。[#57076](https://github.com/ClickHouse/ClickHouse/pull/57076) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 用于后台拉取的每个端点的连接数上限已从 `15` 提高到设置 `background_fetches_pool_size` 的值。- MergeTree 级别设置 `replicated_max_parallel_fetches_for_host` 已过时 - MergeTree 级别设置 `replicated_fetches_http_connection_timeout`、`replicated_fetches_http_send_timeout` 和 `replicated_fetches_http_receive_timeout` 已移至服务器级别。- 设置 `keep_alive_timeout` 已添加到服务器级别设置列表中。[#57523](https://github.com/ClickHouse/ClickHouse/pull/57523) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 降低查询 `system.filesystem_cache` 时的内存占用。[#57687](https://github.com/ClickHouse/ClickHouse/pull/57687) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 降低字符串反序列化时的内存占用。[#57787](https://github.com/ClickHouse/ClickHouse/pull/57787) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 更高效的 Enum 构造函数——在 Enum 拥有大量取值时尤其有用。[#57887](https://github.com/ClickHouse/ClickHouse/pull/57887) ([Duc Canh Le](https://github.com/canhld94)) 。
* 改进了从文件系统缓存读取时的机制：始终使用 `pread` 方法。[#57970](https://github.com/ClickHouse/ClickHouse/pull/57970) ([Nikita Taranov](https://github.com/nickitat)) 。
* 为逻辑 expression 优化器新增了对 AND notEquals 事件链的优化。此优化仅在启用 Experimental analyzer 时可用。[#58214](https://github.com/ClickHouse/ClickHouse/pull/58214) ([Kevin Mingtarja](https://github.com/kevinmingtarja)).

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

* 支持 Keeper 的软内存限制。当内存使用量接近上限时，它将拒绝请求。[#57271](https://github.com/ClickHouse/ClickHouse/pull/57271) ([Han Fei](https://github.com/hanfei1991)). [#57699](https://github.com/ClickHouse/ClickHouse/pull/57699) ([Han Fei](https://github.com/hanfei1991)).
* 使向分布式表执行插入时能够正确处理已更新的集群配置。当集群节点列表发生动态更新时，分布式表的 Directory Monitor 会更新该列表。[#42826](https://github.com/ClickHouse/ClickHouse/pull/42826) ([zhongyuankai](https://github.com/zhongyuankai)).
* 不允许创建 merge 参数不一致的复制表。[#56833](https://github.com/ClickHouse/ClickHouse/pull/56833) ([Duc Canh Le](https://github.com/canhld94)) 。
* 显示 `system.tables` 中的未压缩大小。[#56618](https://github.com/ClickHouse/ClickHouse/issues/56618)。[#57186](https://github.com/ClickHouse/ClickHouse/pull/57186) ([Chen Lixiang](https://github.com/chenlx0)) 。
* 为 `Distributed` 表新增 `skip_unavailable_shards` 设置，其行为与对应的查询级设置类似。关闭 [#43666](https://github.com/ClickHouse/ClickHouse/issues/43666)。[#57218](https://github.com/ClickHouse/ClickHouse/pull/57218) ([Gagan Goel](https://github.com/tntnatbry)) 。
* 函数 `substring` (别名：`substr`、`mid`) 现在也可用于 `Enum` 类型。此前，该函数的第一个参数必须是 `String` 或 `FixedString` 类型的值。这提高了 Tableau 等第三方工具通过 MySQL interface 访问时的兼容性。[#57277](https://github.com/ClickHouse/ClickHouse/pull/57277) ([Serge Klochkov](https://github.com/slvrtrn)) 。
* 函数 `format` 现在支持任意参数类型 (不再仅限于 `String` 和 `FixedString` 参数) 。这对于计算 `SELECT format('The {0} to all questions is {1}', 'answer', 42)` 非常重要。[#57549](https://github.com/ClickHouse/ClickHouse/pull/57549) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 允许在 `date_trunc` 函数中使用不区分大小写的第一个参数。现在两种写法都已受支持：`SELECT date_trunc('day', now())` 和 `SELECT date_trunc('DAY', now())`。[#57624](https://github.com/ClickHouse/ClickHouse/pull/57624) ([Yarik Briukhovetskyi](https://github.com/yariks5s)) 。
* 当表不存在时，提供更明确的提示。[#57342](https://github.com/ClickHouse/ClickHouse/pull/57342) ([Bharat Nallan](https://github.com/bharatnc)) 。
* 允许在查询时覆盖 `max_partition_size_to_drop` 和 `max_table_size_to_drop` 这两个服务器级设置。[#57452](https://github.com/ClickHouse/ClickHouse/pull/57452) ([Jordi Villar](https://github.com/jrdi)) 。
* 在 JSON formats 中，对未命名元组的推断能力略有提升。[#57751](https://github.com/ClickHouse/ClickHouse/pull/57751) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 新增了连接到 Keeper 时对 read-only 标志的支持 (修复了 [#53749](https://github.com/ClickHouse/ClickHouse/issues/53749)) 。[#57479](https://github.com/ClickHouse/ClickHouse/pull/57479) ([Mikhail Koviazin](https://github.com/mkmkme)) 。
* 修复了因 "No such file or directory" (从磁盘恢复批次期间) 可能导致 Distributed 发送卡住的问题。修复了 `system.distribution_queue` 中 `error_count` 可能出现的问题 (当 `distributed_directory_monitor_max_sleep_time_ms` > 5 分钟时) 。新增用于跟踪 async INSERT 失败的 profile 事件：`DistributedAsyncInsertionFailures`。[#57480](https://github.com/ClickHouse/ClickHouse/pull/57480) ([Azat Khuzhin](https://github.com/azat)) 。
* 在 `MaterializedPostgreSQL` 中支持 PostgreSQL 生成列和列默认值 (实验性功能) 。关闭 [#40449](https://github.com/ClickHouse/ClickHouse/issues/40449)。[#57568](https://github.com/ClickHouse/ClickHouse/pull/57568) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 允许在无需重启服务器的情况下应用某些文件系统缓存配置更改。[#57578](https://github.com/ClickHouse/ClickHouse/pull/57578) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 正确处理包含空数组的 PostgreSQL 表结构。[#57618](https://github.com/ClickHouse/ClickHouse/pull/57618) ([Mike Kot](https://github.com/myrrc)) 。
* 将自上次服务器重启以来发生的错误总数作为 `ClickHouseErrorMetric_ALL` 指标对外暴露。[#57627](https://github.com/ClickHouse/ClickHouse/pull/57627) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 允许在配置文件中使用带有 `from_env`/`from_zk` 引用的节点，以及带有 `replace=1` 的非空元素。[#57628](https://github.com/ClickHouse/ClickHouse/pull/57628) ([Azat Khuzhin](https://github.com/azat)).
* 新增表函数 `fuzzJSON`，可用于生成大量格式不正确的 JSON 以进行模糊测试。[#57646](https://github.com/ClickHouse/ClickHouse/pull/57646) ([Julia Kartseva](https://github.com/jkartseva)) 。
* 允许将 IPv6 转换为 UInt128，并支持二元算术运算。[#57707](https://github.com/ClickHouse/ClickHouse/pull/57707) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)).
* 为 `async inserts deduplication cache` 新增一个设置，用于指定等待缓存更新的时长。弃用设置 `async_block_ids_cache_min_update_interval_ms`。现在仅在发生冲突时才会更新缓存。[#57743](https://github.com/ClickHouse/ClickHouse/pull/57743) ([alesapin](https://github.com/alesapin)).
* `sleep()` 函数现在可通过 `KILL QUERY` 中止。[#57746](https://github.com/ClickHouse/ClickHouse/pull/57746) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 由于实验性 `Replicated` 数据库不支持 `Replicated` 表引擎的 `CREATE TABLE ... AS SELECT` 查询，因此已禁止使用。参见 [#35408](https://github.com/ClickHouse/ClickHouse/issues/35408)。[#57796](https://github.com/ClickHouse/ClickHouse/pull/57796) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 修复并改进面向外部数据库的查询转换，以递归获取所有兼容的谓词。[#57888](https://github.com/ClickHouse/ClickHouse/pull/57888) ([flynn](https://github.com/ucasfl)).
* 支持动态重新加载文件系统缓存大小。修复了 [#57866](https://github.com/ClickHouse/ClickHouse/issues/57866)。[#57897](https://github.com/ClickHouse/ClickHouse/pull/57897) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 正确支持对阻塞了 SIGRTMIN 的线程使用 `system.stack_trace` (这类线程可能出现在一些质量较差的外部库中，例如 Apache rdkafka) 。[#57907](https://github.com/ClickHouse/ClickHouse/pull/57907) ([Azat Khuzhin](https://github.com/azat)) 。此外，仅在线程未阻塞该信号时才向其发送信号，以避免在毫无意义的情况下等待 `storage_system_stack_trace_pipe_read_timeout_ms`。[#58136](https://github.com/ClickHouse/ClickHouse/pull/58136) ([Azat Khuzhin](https://github.com/azat)) 。
* 在 quorum 插入检查中可容忍 Keeper 故障。[#57986](https://github.com/ClickHouse/ClickHouse/pull/57986) ([Raúl Marín](https://github.com/Algunenano))。
* 将最大/峰值 RSS (`MemoryResidentMax`) 纳入 system.asynchronous\_metrics。[#58095](https://github.com/ClickHouse/ClickHouse/pull/58095) ([Azat Khuzhin](https://github.com/azat)) 。
* 此 PR 允许你在使用 S3 风格链接 (`https://` 和 `s3://`) 时不必指定区域，即使该区域不是默认区域也可以。此外，如果用户指定了错误的区域，还会自动识别出正确的区域。[#58148](https://github.com/ClickHouse/ClickHouse/pull/58148) ([Yarik Briukhovetskyi](https://github.com/yariks5s)) 。
* `clickhouse-format --obfuscate` 现已识别 Settings、MergeTreeSettings 和时区，并保持其名称不变。[#58179](https://github.com/ClickHouse/ClickHouse/pull/58179) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 在 `ZipArchiveWriter` 中新增了显式的 `finalize()` 函数，并简化了其中过于复杂的代码。此更改修复了 [#58074](https://github.com/ClickHouse/ClickHouse/issues/58074)。[#58202](https://github.com/ClickHouse/ClickHouse/pull/58202) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 让具有相同路径的缓存共享同一个缓存对象。此前一直是这种行为，但在 23.4 中被破坏了。如果这类具有相同路径的缓存使用了不同的缓存设置组合，则会抛出异常，提示这是不允许的。[#58264](https://github.com/ClickHouse/ClickHouse/pull/58264) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 并行副本 (Experimental 功能) ：更易用的设置 [#57542](https://github.com/ClickHouse/ClickHouse/pull/57542) ([Igor Nikonov](https://github.com/devcrafter)) 。
* 并行副本 (实验性功能) ：通知响应处理改进 [#57749](https://github.com/ClickHouse/ClickHouse/pull/57749) ([Igor Nikonov](https://github.com/devcrafter)).
* 并行副本 (实验性功能) ：在 `ParallelReplicasReadingCoordinator` 中更严格遵循 `min_number_of_marks` [#57763](https://github.com/ClickHouse/ClickHouse/pull/57763) ([Nikita Taranov](https://github.com/nickitat)).
* 并行副本 (Experimental 功能) ：在使用 IN (子查询) 时禁用并行副本 [#58133](https://github.com/ClickHouse/ClickHouse/pull/58133) ([Igor Nikonov](https://github.com/devcrafter)) 。
* 并行副本 (Experimental 功能) ：新增 profile 事件 'ParallelReplicasUsedCount' [#58173](https://github.com/ClickHouse/ClickHouse/pull/58173) ([Igor Nikonov](https://github.com/devcrafter)) 。
* HEAD 等非 POST 请求将与 GET 一样为只读。 [#58060](https://github.com/ClickHouse/ClickHouse/pull/58060) ([San](https://github.com/santrancisco)).
* 为 `system.part_log` 新增 `bytes_uncompressed` 列 [#58167](https://github.com/ClickHouse/ClickHouse/pull/58167) ([Jordi Villar](https://github.com/jrdi)) 。
* 向 `system.backups` 和 `system.backup_log` 表中添加基础备份名称 [#58178](https://github.com/ClickHouse/ClickHouse/pull/58178) ([Pradeep Chhetri](https://github.com/chhetripradeep)) 。
* clickhouse-local 新增支持通过命令行指定查询参数 [#58210](https://github.com/ClickHouse/ClickHouse/pull/58210) ([Pradeep Chhetri](https://github.com/chhetripradeep)) 。

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

* 对更多设置进行随机化处理 [#39663](https://github.com/ClickHouse/ClickHouse/pull/39663) ([Anton Popov](https://github.com/CurtizJ)).
* 在 CI 中对已禁用的优化项进行随机化处理 [#57315](https://github.com/ClickHouse/ClickHouse/pull/57315) ([Raúl Marín](https://github.com/Algunenano)).
* 允许在 macOS 上使用与 Azure 相关的表引擎/函数。[#51866](https://github.com/ClickHouse/ClickHouse/pull/51866) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* ClickHouse 快速测试现已改用 Musl 而非 GLibc。[#57711](https://github.com/ClickHouse/ClickHouse/pull/57711) ([Alexey Milovidov](https://github.com/alexey-milovidov)). 可从 CI 下载完全静态链接的 Musl 构建版本。
* 每次提交都会运行 ClickBench。这修复了 [#57708](https://github.com/ClickHouse/ClickHouse/issues/57708)。[#57712](https://github.com/ClickHouse/ClickHouse/pull/57712) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 移除了外部库中有害的 C/POSIX `select` 函数用法。[#57467](https://github.com/ClickHouse/ClickHouse/pull/57467) ([Igor Nikonov](https://github.com/devcrafter)).
* 为方便使用，原本仅在 ClickHouse Cloud 中可用的设置也将出现在开源版 ClickHouse 构建中。[#57638](https://github.com/ClickHouse/ClickHouse/pull/57638) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).

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

* 修复了 TTL GROUP BY 中排序顺序可能发生错乱的问题 [#49103](https://github.com/ClickHouse/ClickHouse/pull/49103) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* 修复：拆分 `lttb` 分桶策略时，首个桶和最后一个桶都应只包含一个点 [#57003](https://github.com/ClickHouse/ClickHouse/pull/57003) ([FFish](https://github.com/wxybear)).
* 修复了发生 error 后同步过程中 `Template` format 可能出现的死锁问题 [#57004](https://github.com/ClickHouse/ClickHouse/pull/57004) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了解析文件时在跳过大量错误后过早停止的问题 [#57006](https://github.com/ClickHouse/ClickHouse/pull/57006) ([Kruglov Pavel](https://github.com/Avogar)).
* 防止通过 `dictionary` 表函数绕过字典 ACL [#57362](https://github.com/ClickHouse/ClickHouse/pull/57362) ([Salvatore Mesoraca](https://github.com/aiven-sal)) 。
* 修复了由 Fuzzer 发现的另一种“non-ready set”错误。[#57423](https://github.com/ClickHouse/ClickHouse/pull/57423) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了 PostgreSQL `array_ndims` 用法中的多个问题。[#57436](https://github.com/ClickHouse/ClickHouse/pull/57436) ([Ryan Jacobs](https://github.com/ryanmjacobs)) 。
* 修复写锁超时后 RWLock 状态不一致的问题 [#57454](https://github.com/ClickHouse/ClickHouse/pull/57454) ([Vitaly Baranov](https://github.com/vitlibar))。再次修复写锁超时后 RWLock 状态不一致的问题 [#57733](https://github.com/ClickHouse/ClickHouse/pull/57733) ([Vitaly Baranov](https://github.com/vitlibar))。
* 修复：在构建向视图链推送时，不应排除临时列 [#57461](https://github.com/ClickHouse/ClickHouse/pull/57461) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)).
* MaterializedPostgreSQL (Experimental 问题) ：修复 [#41922](https://github.com/ClickHouse/ClickHouse/issues/41922) 问题，为 [#41923](https://github.com/ClickHouse/ClickHouse/issues/41923) 添加测试 [#57515](https://github.com/ClickHouse/ClickHouse/pull/57515) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 在管理复制访问实体时，忽略 grant/revoke 查询中的 ON CLUSTER 子句。  [#57538](https://github.com/ClickHouse/ClickHouse/pull/57538) ([MikhailBurdukov](https://github.com/MikhailBurdukov)).
* 修复 `clickhouse-local` 崩溃问题 [#57553](https://github.com/ClickHouse/ClickHouse/pull/57553) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 修复了 Hash JOIN 的问题。[#57564](https://github.com/ClickHouse/ClickHouse/pull/57564) ([vdimir](https://github.com/vdimir)) 。
* 修复 PostgreSQL 源中可能存在的错误 [#57567](https://github.com/ClickHouse/ClickHouse/pull/57567) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复 Hash JOIN 处理中嵌套 LowCardinality 时的类型修正问题。[#57614](https://github.com/ClickHouse/ClickHouse/pull/57614) ([vdimir](https://github.com/vdimir)) 。
* 通过正确禁止并行读取 `system.stack_trace`，避免其发生卡死。[#57641](https://github.com/ClickHouse/ClickHouse/pull/57641) ([Azat Khuzhin](https://github.com/azat)).
* 修复了对稀疏列进行 `any(...) RESPECT NULL` 聚合时出现的错误 [#57710](https://github.com/ClickHouse/ClickHouse/pull/57710) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复一元运算符的解析问题 [#57713](https://github.com/ClickHouse/ClickHouse/pull/57713) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 修复 Experimental 表引擎 `MaterializedPostgreSQL` 的依赖加载问题。[#57754](https://github.com/ClickHouse/ClickHouse/pull/57754) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复了已断开连接节点在 BACKUP/RESTORE ON CLUSTER 中的重试问题 [#57764](https://github.com/ClickHouse/ClickHouse/pull/57764) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复投影仅部分物化时外部聚合结果异常的问题 [#57790](https://github.com/ClickHouse/ClickHouse/pull/57790) ([Anton Popov](https://github.com/CurtizJ)).
* 修复使用 `*Map` 组合器的聚合函数中的合并问题 [#57795](https://github.com/ClickHouse/ClickHouse/pull/57795) ([Anton Popov](https://github.com/CurtizJ)).
* 由于存在一个 bug，禁用 `system.kafka_consumers`。[#57822](https://github.com/ClickHouse/ClickHouse/pull/57822) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复 Merge JOIN 对 LowCardinality 键的支持问题。[#57827](https://github.com/ClickHouse/ClickHouse/pull/57827) ([vdimir](https://github.com/vdimir)) 。
* 修复了 `InterpreterCreateQuery` 中与样本块相关的问题。[#57855](https://github.com/ClickHouse/ClickHouse/pull/57855) ([Maksim Kita](https://github.com/kitaisreal)) 。
* PostgreSQL 的 named collections 会忽略 `addresses_expr`。[#57874](https://github.com/ClickHouse/ClickHouse/pull/57874) ([joelynch](https://github.com/joelynch)) 。
* 修复了 BLAKE3 (Rust) 中的无效内存访问问题 [#57876](https://github.com/ClickHouse/ClickHouse/pull/57876) ([Raúl Marín](https://github.com/Algunenano)) 。随后，又为提升[内存安全性](https://www.memorysafety.org/)，将其从 Rust 重写为 C++。[#57994](https://github.com/ClickHouse/ClickHouse/pull/57994) ([Raúl Marín](https://github.com/Algunenano)) 。
* 统一 `CREATE INDEX` 中的函数名称 [#57906](https://github.com/ClickHouse/ClickHouse/pull/57906) ([Alexander Tokmakov](https://github.com/tavplubix)) 。
* 修复了在首次请求发生前对不可用副本处理不当的问题 [#57933](https://github.com/ClickHouse/ClickHouse/pull/57933) ([Nikita Taranov](https://github.com/nickitat)).
* 修复将字面量别名误分类的问题 [#57988](https://github.com/ClickHouse/ClickHouse/pull/57988) ([Chen768959](https://github.com/Chen768959)).
* 修复 Keeper 中无效的预处理问题 [#58069](https://github.com/ClickHouse/ClickHouse/pull/58069) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 修复 `Poco` 库中与 `UTF32Encoding` 相关的整数溢出 [#58073](https://github.com/ClickHouse/ClickHouse/pull/58073) ([Andrey Fedotov](https://github.com/anfedotoff)) 。
* 修复了在存在带有大整数值的标量子查询时，并行副本 (Experimental 功能) 的问题 [#58118](https://github.com/ClickHouse/ClickHouse/pull/58118) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 修复 `accurateCastOrNull` 在超出范围的 `DateTime` 上的问题 [#58139](https://github.com/ClickHouse/ClickHouse/pull/58139) ([Andrey Zvonov](https://github.com/zvonand)).
* 修复从 MergeTree 的宽格式分片读取子列时可能触发的 `PARAMETER_OUT_OF_BOUND` 错误 [#58175](https://github.com/ClickHouse/ClickHouse/pull/58175) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了在包含海量子查询时 CREATE VIEW 变慢的问题 [#58220](https://github.com/ClickHouse/ClickHouse/pull/58220) ([Tao Wang](https://github.com/wangtZJU)).
* 修复 JSONCompactEachRow 的并行解析问题 [#58181](https://github.com/ClickHouse/ClickHouse/pull/58181) ([Alexey Milovidov](https://github.com/alexey-milovidov)). [#58250](https://github.com/ClickHouse/ClickHouse/pull/58250) ([Kruglov Pavel](https://github.com/Avogar)).

### <a id="2311" /> ClickHouse 发布 23.11，2023-12-06。 [演示文稿](https://presentations.clickhouse.com/2023-release-23.11/), [视频](https://www.youtube.com/watch?v=1HJdjOH4Eis)

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

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

* ClickHouse server 的默认配置文件现已默认对 `default` 用户启用 `access_management` (通过 SQL 查询进行用户管理) 和 `named_collection_control` (通过 SQL 查询管理 named collection) 。这解决了 [#56482](https://github.com/ClickHouse/ClickHouse/issues/56482)。[#56619](https://github.com/ClickHouse/ClickHouse/pull/56619) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 对窗口函数的 `RESPECT NULLS`/`IGNORE NULLS` 进行了多项改进。如果你将它们当作聚合函数使用，并存储带有这些修饰符的聚合函数状态，则这些状态可能会变得不兼容。[#57189](https://github.com/ClickHouse/ClickHouse/pull/57189) ([Raúl Marín](https://github.com/Algunenano)) 。
* 移除了优化 `optimize_move_functions_out_of_any`。[#57190](https://github.com/ClickHouse/ClickHouse/pull/57190) ([Raúl Marín](https://github.com/Algunenano)) 。
* 函数 `parseDateTime` 中的格式说明符 `%l`/`%k`/`%c` 现在可以解析不带前导零的小时/月，例如 `select parseDateTime('2023-11-26 8:14', '%F %k:%i')` 现在已可正常工作。将 `parsedatetime_parse_without_leading_zeros = 0` 可恢复为此前要求两位数字的行为。函数 `formatDateTime` 现在也可以输出不带前导零的小时/月。这由设置 `formatdatetime_format_without_leading_zeros` 控制，但默认关闭，以免破坏现有用例。[#55872](https://github.com/ClickHouse/ClickHouse/pull/55872) ([Azat Khuzhin](https://github.com/azat)) 。
* 你将无法再把聚合函数 `avgWeighted` 用于 `Decimal` 类型参数。变通方法：将参数转换为 `Float64`。这解决了 [#43928](https://github.com/ClickHouse/ClickHouse/issues/43928)。这解决了 [#31768](https://github.com/ClickHouse/ClickHouse/issues/31768)。这解决了 [#56435](https://github.com/ClickHouse/ClickHouse/issues/56435)。如果你曾在 materialized views 或 projections 中使用带有 `Decimal` 参数的此函数，请联系 [support@clickhouse.com](mailto:support@clickhouse.com)。修复了聚合函数 `sumMap` 中的错误，但其速度也因此降低了约 1.5 到 2 倍。不过这无关紧要，因为这个函数本来就很差。这解决了 [#54955](https://github.com/ClickHouse/ClickHouse/issues/54955)。这解决了 [#53134](https://github.com/ClickHouse/ClickHouse/issues/53134)。这解决了 [#55148](https://github.com/ClickHouse/ClickHouse/issues/55148)。修复了函数 `groupArraySample` 中的一个错误——当一个查询中生成多个聚合状态时，它会使用相同的随机种子。[#56350](https://github.com/ClickHouse/ClickHouse/pull/56350) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。

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

* 新增服务器设置 `async_load_databases`，用于异步加载数据库和表，可加快服务器启动速度。适用于使用 `Ordinary`、`Atomic` 和 `Replicated` 引擎的数据库，其表元数据会以异步方式加载。对表发起查询时，会提高加载作业的优先级并等待其完成。新增用于内部信息查看的表 `system.asynchronous_loader`。[#49351](https://github.com/ClickHouse/ClickHouse/pull/49351) ([Sergei Trifonov](https://github.com/serxa)) 。
* 新增系统表 `blob_storage_log`。该表可用于审计写入 S3 和其他对象存储的所有数据。[#52918](https://github.com/ClickHouse/ClickHouse/pull/52918) ([vdimir](https://github.com/vdimir)).
* 使用统计信息，更合理地对 prewhere 条件进行排序。[#53240](https://github.com/ClickHouse/ClickHouse/pull/53240) ([Han Fei](https://github.com/hanfei1991)) 。
* 为 Keeper 协议新增了压缩支持。可在 ClickHouse 端的 `zookeeper` 部分中使用 `use_compression` 标志来启用。请注意，只有 ClickHouse Keeper 支持压缩，Apache ZooKeeper 不支持。解决了 [#49507](https://github.com/ClickHouse/ClickHouse/issues/49507)。[#54957](https://github.com/ClickHouse/ClickHouse/pull/54957) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)) 。
* 引入功能 `storage_metadata_write_full_object_key`。如果将其设置为 `true`，元数据文件将按新格式写入。采用该格式后，ClickHouse 会在元数据文件中存储远程对象的完整 key，从而带来更好的灵活性和优化空间。[#55566](https://github.com/ClickHouse/ClickHouse/pull/55566) ([Sema Checherinda](https://github.com/CheSema)).
* 新增了设置和语法，以防止 named collections 的字段被覆盖。此举旨在防止恶意用户未获授权访问敏感信息。[#55782](https://github.com/ClickHouse/ClickHouse/pull/55782) ([Salvatore Mesoraca](https://github.com/aiven-sal)) 。
* 为所有系统日志表添加 `hostname` 列——如果将系统表设置为复制、共享或分布式，这会很有用。[#55894](https://github.com/ClickHouse/ClickHouse/pull/55894) ([Bharat Nallan](https://github.com/bharatnc)) 。
* 新增 `CHECK ALL TABLES` 查询。[#56022](https://github.com/ClickHouse/ClickHouse/pull/56022) ([vdimir](https://github.com/vdimir)) 。
* 新增函数 `fromDaysSinceYearZero`，其作用与 MySQL 的 `FROM_DAYS` 类似。例如，`SELECT fromDaysSinceYearZero(739136)` 将返回 `2023-09-08`。[#56088](https://github.com/ClickHouse/ClickHouse/pull/56088) ([Joanna Hulboj](https://github.com/jh0x)) 。
* 新增了一个外部 Python 工具，可在不使用 ClickHouse 的情况下查看备份并从中提取信息。[#56268](https://github.com/ClickHouse/ClickHouse/pull/56268) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 新增一个名为 `preferred_optimize_projection_name` 的设置。如果将其设为非空字符串，则会在可能的情况下使用指定的投影，而不是从所有候选项中选择。[#56309](https://github.com/ClickHouse/ClickHouse/pull/56309) ([Yarik Briukhovetskyi](https://github.com/yariks5s)) 。
* 新增用于主动让出/辞去 leader 角色的 4 字母命令 ([https://github.com/ClickHouse/ClickHouse/issues/56352](https://github.com/ClickHouse/ClickHouse/issues/56352)) 。[#56354](https://github.com/ClickHouse/ClickHouse/pull/56354) ([Pradeep Chhetri](https://github.com/chhetripradeep))。[#56620](https://github.com/ClickHouse/ClickHouse/pull/56620) ([Pradeep Chhetri](https://github.com/chhetripradeep))。
* 新增了一个 SQL 函数 `arrayRandomSample(arr, k)`，可从输入数组中返回一个包含 k 个元素的样本。此前，类似功能只能通过不太便捷的语法实现，例如 `SELECT arrayReduce('groupArraySample(3)', range(10))`。[#56416](https://github.com/ClickHouse/ClickHouse/pull/56416) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 新增支持在 `.npy` 文件中使用 `Float16` 类型数据。关闭 [#56344](https://github.com/ClickHouse/ClickHouse/issues/56344)。[#56424](https://github.com/ClickHouse/ClickHouse/pull/56424) ([Yarik Briukhovetskyi](https://github.com/yariks5s)) 。
* 新增系统视图 `information_schema.statistics`，以便更好地兼容 Tableau Online。[#56425](https://github.com/ClickHouse/ClickHouse/pull/56425) ([Serge Klochkov](https://github.com/slvrtrn)) 。
* 新增了 `system.symbols` 表，可用于检查二进制文件的内部信息。[#56548](https://github.com/ClickHouse/ClickHouse/pull/56548) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 可配置的仪表盘。图表查询现已通过查询方式加载，默认使用新的 `system.dashboards` 表。[#56771](https://github.com/ClickHouse/ClickHouse/pull/56771) ([Sergei Trifonov](https://github.com/serxa)) 。
* 新增 `fileCluster` 表函数——如果将共享文件系统 (如 NFS) 挂载到 `user_files` 目录，它就会很有用。[#56868](https://github.com/ClickHouse/ClickHouse/pull/56868) ([Andrey Zvonov](https://github.com/zvonand)) 。
* 为 `s3/file/hdfs/url/azureBlobStorage` 引擎添加 `_size` 虚拟列，用于表示以字节为单位的文件大小。[#57126](https://github.com/ClickHouse/ClickHouse/pull/57126) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 通过 Prometheus 端点暴露服务器自上次重启以来各错误代码对应的错误次数。[#57209](https://github.com/ClickHouse/ClickHouse/pull/57209) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* ClickHouse Keeper 会在 `/keeper/availability-zone` 路径中报告其当前运行所在的可用区。可通过 `<availability_zone><value>us-west-1a</value></availability_zone>` 进行配置。[#56715](https://github.com/ClickHouse/ClickHouse/pull/56715) ([Jianfei Hu](https://github.com/incfly)) 。
* 将 ALTER materialized\_view MODIFY QUERY 取消 Experimental 状态，并弃用 `allow_experimental_alter_materialized_view_structure` 设置。修复 [#15206](https://github.com/ClickHouse/ClickHouse/issues/15206)。[#57311](https://github.com/ClickHouse/ClickHouse/pull/57311) ([alesapin](https://github.com/alesapin)) 。
* 设置 `join_algorithm` 时会遵循指定顺序 [#51745](https://github.com/ClickHouse/ClickHouse/pull/51745) ([vdimir](https://github.com/vdimir)) 。
* 在 Protobuf 格式中增加了对[众所周知的 Protobuf 类型](https://protobuf.dev/reference/protobuf/google.protobuf/)的支持。[#56741](https://github.com/ClickHouse/ClickHouse/pull/56741) ([János Benjamin Antal](https://github.com/antaljanosbenjamin)) 。

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

* 与 S3 交互时的自适应超时时间。首次尝试会使用较短的发送和接收超时时间。[#56314](https://github.com/ClickHouse/ClickHouse/pull/56314) ([Sema Checherinda](https://github.com/CheSema)).
* 将 `max_concurrent_queries` 的默认值从 100 提高到 1000。当有大量客户端连接，且它们以较慢速度发送或接收数据，因此 server 不受 CPU 限制时，或者当 CPU 核心数超过 100 时，这样设置是合理的。此外，默认启用并发控制，并将查询处理线程的目标总数设置为 CPU 核心数的两倍。这提升了在并发查询数量非常多的场景下的性能。 [#46927](https://github.com/ClickHouse/ClickHouse/pull/46927) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 支持窗口函数并行执行。修复了 [#34688](https://github.com/ClickHouse/ClickHouse/issues/34688)。[#39631](https://github.com/ClickHouse/ClickHouse/pull/39631) ([Dmitry Novik](https://github.com/novikd)) 。
* `Numbers` 表引擎 (即 `system.numbers` 表所使用的引擎) 现在会分析条件，只生成所需的数据子集，类似于表索引的作用。[#50909](https://github.com/ClickHouse/ClickHouse/pull/50909) ([JackyWoo](https://github.com/JackyWoo)) 。
* 优化了 `Merge` 表引擎中 `IN (...)` 条件过滤的性能。[#54905](https://github.com/ClickHouse/ClickHouse/pull/54905) ([Nikita Taranov](https://github.com/nickitat)) 。
* 当文件系统缓存已满且发生大块读取时的一项改进。[#55158](https://github.com/ClickHouse/ClickHouse/pull/55158) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 新增了可禁用 S3 校验和的功能，以避免对文件进行额外的多次扫描 (由设置 `s3_disable_checksum` 控制) 。[#55559](https://github.com/ClickHouse/ClickHouse/pull/55559) ([Azat Khuzhin](https://github.com/azat)) 。
* 现在，当数据已在页缓存中时，我们会像处理本地表一样，以同步方式从远程表读取数据。这样速度更快，无需在线程池内部进行同步，在本地 FS 上执行 `seek` 操作也不会成为负担，还能减少 CPU 等待时间。[#55841](https://github.com/ClickHouse/ClickHouse/pull/55841) ([Nikita Taranov](https://github.com/nickitat)) 。
* 针对从 `map`、`arrayElement` 中获取值进行了优化。可带来约 30% 的性能提升。- 减少预留内存 - 减少 `resize` 调用。[#55957](https://github.com/ClickHouse/ClickHouse/pull/55957) ([lgbo](https://github.com/lgbo-ustc)).
* 使用 AVX-512 优化多阶段过滤。在 ICX 设备 (Intel Xeon Platinum 8380 CPU，80 核，160 线程) 上对 OnTime 数据集进行的性能实验表明，此项变更可分别将查询 Q2、Q3、Q4、Q5 和 Q6 的 QPS 提升 7.4%、5.9%、4.7%、3.0% 和 4.6%，对其他查询则没有影响。[#56079](https://github.com/ClickHouse/ClickHouse/pull/56079) ([Zhiguo Zhou](https://github.com/ZhiguoZh)) 。
* 限制查询分析器内处于忙碌状态的线程数量。超过该数量的线程将跳过性能分析。 [#56105](https://github.com/ClickHouse/ClickHouse/pull/56105) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 减少 window function 中的虚函数调用次数。[#56120](https://github.com/ClickHouse/ClickHouse/pull/56120) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 支持在 ORC 数据格式中对 Tuple 字段进行递归裁剪，以加快扫描速度。[#56122](https://github.com/ClickHouse/ClickHouse/pull/56122) ([李扬](https://github.com/taiyang-li)) 。
* 针对 `Npy` 数据格式的简单 count 优化：像 `select count() from 'data.npy'` 这样的查询会因结果缓存而快得多。[#56304](https://github.com/ClickHouse/ClickHouse/pull/56304) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* 带有聚合且流数量较多的查询在构建执行计划期间会占用更少的内存。[#57074](https://github.com/ClickHouse/ClickHouse/pull/57074) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 通过优化对 ProcessList 的访问，提升了多用户且查询高度并发 (>2000 QPS) 场景下的查询执行性能。[#57106](https://github.com/ClickHouse/ClickHouse/pull/57106) ([Andrej Hoos](https://github.com/adikus)) 。
* 对 array join 做了小幅优化，复用了一些中间结果。[#57183](https://github.com/ClickHouse/ClickHouse/pull/57183) ([李扬](https://github.com/taiyang-li)).
* 某些情况下，堆栈回溯过去比较慢，现在已经不是问题了。[#57221](https://github.com/ClickHouse/ClickHouse/pull/57221) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 现在，当 `max_streams = 1` 时，我们会使用默认读取池从外部存储中读取数据。在启用读取预取时，这样做更有利。[#57334](https://github.com/ClickHouse/ClickHouse/pull/57334) ([Nikita Taranov](https://github.com/nickitat)) 。
* Keeper 改进：通过延后日志预处理，优化启动期间的内存占用。[#55660](https://github.com/ClickHouse/ClickHouse/pull/55660) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 优化了 `File` 和 `HDFS` 存储的通配符匹配性能。[#56141](https://github.com/ClickHouse/ClickHouse/pull/56141) ([Andrey Zvonov](https://github.com/zvonand)) 。
* Experimental 全文索引中的倒排列表现已支持压缩，体积可缩小 10-30%。[#56226](https://github.com/ClickHouse/ClickHouse/pull/56226) ([Harry Lee](https://github.com/HarryLeeIBM)) 。
* 将备份中的 `BackupEntriesCollector` 并行化。[#56312](https://github.com/ClickHouse/ClickHouse/pull/56312) ([Kseniia Sumarokova](https://github.com/kssenii)) 。

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

* 新增 `MergeTree` 设置 `add_implicit_sign_column_constraint_for_collapsing_engine` (默认禁用) 。启用后，会为 `CollapsingMergeTree` 表添加隐式 CHECK 约束，将 `Sign` 列的值限制为仅可取 -1 或 1。[#56701](https://github.com/ClickHouse/ClickHouse/issues/56701)。[#56986](https://github.com/ClickHouse/ClickHouse/pull/56986) ([Kevin Mingtarja](https://github.com/kevinmingtarja)) 。
* 支持在不重启的情况下向存储配置中添加新磁盘。[#56367](https://github.com/ClickHouse/ClickHouse/pull/56367) ([Duc Canh Le](https://github.com/canhld94)) 。
* 支持在同一条 ALTER 查询中创建并物化索引，也支持在同一条查询中执行 "modify TTL" 和 "materialize TTL"。已关闭 [#55651](https://github.com/ClickHouse/ClickHouse/issues/55651)。[#56331](https://github.com/ClickHouse/ClickHouse/pull/56331) ([flynn](https://github.com/ucasfl)) 。
* 新增一个名为 `fuzzJSON` 的表函数，其各行包含对源 JSON 字符串施加随机扰动后生成的变体。[#56490](https://github.com/ClickHouse/ClickHouse/pull/56490) ([Julia Kartseva](https://github.com/jkartseva)) 。
* `Merge` 引擎会根据底层表的行策略对记录进行过滤，因此无需在 `Merge` 表上另外创建行策略。[#50209](https://github.com/ClickHouse/ClickHouse/pull/50209) ([Ilya Golshtein](https://github.com/ilejn)) 。
* 添加设置 `max_execution_time_leaf`，用于限制分布式查询在分片上的执行时间；添加 `timeout_overflow_mode_leaf`，用于控制超时时的行为。[#51823](https://github.com/ClickHouse/ClickHouse/pull/51823) ([Duc Canh Le](https://github.com/canhld94)).
* 新增 ClickHouse 设置，用于禁用通过 HTTP 代理发起 HTTPS 请求时的隧道传输。[#55033](https://github.com/ClickHouse/ClickHouse/pull/55033) ([Arthur Passos](https://github.com/arthurpassos)) 。
* 将 `background_fetches_pool_size` 设置为 16，将 background\_schedule\_pool\_size 设置为 512，这更适合生产环境中频繁的小批量插入场景。[#54327](https://github.com/ClickHouse/ClickHouse/pull/54327) ([Denny Crane](https://github.com/den-crane)) 。
* 在从 `CSV format` 文件读取数据时，如果行尾是 `\r`，且后面没有跟 `\n`，就会遇到如下异常：`Cannot parse CSV format: found \r (CR) not followed by \n (LF). Line must end by \n (LF) or \r\n (CR LF) or \n\r.`。在 ClickHouse 中，CSV 的行结束符必须是 `\n`、`\r\n` 或 `\n\r`，因此 `\r` 后面必须跟着 `\n`；但在某些情况下，输入的 CSV 数据可能不符合规范，例如上述 `\r` 位于行尾的情况。[#54340](https://github.com/ClickHouse/ClickHouse/pull/54340) ([KevinyhZou](https://github.com/KevinyhZou)).
* 将 Arrow 库升级到支持新编码的 release-13.0.0 版本。关闭 [#44505](https://github.com/ClickHouse/ClickHouse/issues/44505)。[#54800](https://github.com/ClickHouse/ClickHouse/pull/54800) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 通过移除在 DDL 条目主机列表中查找本地 IP 地址时，为获取所有网络接口而执行的高开销系统调用，提升了 ON CLUSTER 查询的性能。[#54909](https://github.com/ClickHouse/ClickHouse/pull/54909) ([Duc Canh Le](https://github.com/canhld94)).
* 修复了将线程关联到查询或用户之前所分配内存的统计问题。[#56089](https://github.com/ClickHouse/ClickHouse/pull/56089) ([Nikita Taranov](https://github.com/nickitat)) 。
* 在 Apache Arrow 格式中添加了对 `LARGE_LIST` 的支持。[#56118](https://github.com/ClickHouse/ClickHouse/pull/56118) ([edef](https://github.com/edef1c)) 。
* 允许通过 `OPTIMIZE` 查询手动对 `EmbeddedRocksDB` 执行合并整理。[#56225](https://github.com/ClickHouse/ClickHouse/pull/56225) ([Azat Khuzhin](https://github.com/azat)).
* 为 `EmbeddedRocksDB` 表新增了指定 BlockBasedTableOptions 的功能。[#56264](https://github.com/ClickHouse/ClickHouse/pull/56264) ([Azat Khuzhin](https://github.com/azat)) 。
* 现在，当通过 MySQL 协议建立连接时，`SHOW COLUMNS` 会显示 MySQL 对应的数据类型名称。此前，只有在设置 `use_mysql_types_in_show_columns = 1` 时才会这样。该设置仍然保留，但已废弃。 [#56277](https://github.com/ClickHouse/ClickHouse/pull/56277) ([Robert Schulze](https://github.com/rschu1ze)).
* 修复了这样一个可能出现的错误：如果在执行 `TRUNCATE` 或 `DROP PARTITION` 后立即重启服务器，可能会报出 `The local set of parts of table doesn't look like the set of parts in ZooKeeper`。[#56282](https://github.com/ClickHouse/ClickHouse/pull/56282) ([Alexander Tokmakov](https://github.com/tavplubix)).
* 修复了函数 `formatQuery`/ `formatQuerySingleLine` 对非常量查询字符串的处理问题。还为这两个函数新增了 `OrNull` 变体：当查询无法解析时，会返回 NULL，而不是抛出异常。[#56327](https://github.com/ClickHouse/ClickHouse/pull/56327) ([Robert Schulze](https://github.com/rschu1ze)).
* 允许备份内部表已被删除的 materialized view，而不是直接导致备份失败。[#56387](https://github.com/ClickHouse/ClickHouse/pull/56387) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 查询 `system.replicas` 时，如果涉及某些列，会向 ZooKeeper 发起请求。当表达到数千个时，这些请求可能会给 ZooKeeper 带来相当大的负载。如果同时有多个对 `system.replicas` 的查询，就会多次发出相同的请求。这项变更旨在对并发查询发出的请求进行“去重”。[#56420](https://github.com/ClickHouse/ClickHouse/pull/56420) ([Alexander Gololobov](https://github.com/davenger)) 。
* 修复了将外部数据库查询转换为兼容 MySQL 的查询时的问题。[#56456](https://github.com/ClickHouse/ClickHouse/pull/56456) ([flynn](https://github.com/ucasfl)).
* 新增了对使用 `KeeperMap` engine 备份和还原表的支持。[#56460](https://github.com/ClickHouse/ClickHouse/pull/56460) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 对于 CompleteMultipartUpload 返回的 404 响应，需要重新确认。即使客户端出现超时或其他网络错误，操作也可能已经在服务器端完成。之后再次重试 CompleteMultipartUpload 时会收到 404 响应。如果对象 key 存在，则该操作视为成功。[#56475](https://github.com/ClickHouse/ClickHouse/pull/56475) ([Sema Checherinda](https://github.com/CheSema)) 。
* 默认启用 HTTP OPTIONS 方法，这样从 Web 浏览器请求 ClickHouse 会更方便。[#56483](https://github.com/ClickHouse/ClickHouse/pull/56483) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* `dns_max_consecutive_failures` 的值曾在 [#46550](https://github.com/ClickHouse/ClickHouse/issues/46550) 中被误改——现已撤销该更改，并调整为更合适的值。此外，还将 HTTP keep-alive timeout 提高到了生产环境中较为合理的值。[#56485](https://github.com/ClickHouse/ClickHouse/pull/56485) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 按需惰性加载基础备份 (仅在需要时才会加载基础备份) 。此外，还为备份添加了一些日志信息和 profile events。 [#56516](https://github.com/ClickHouse/ClickHouse/pull/56516) ([Vitaly Baranov](https://github.com/vitlibar)).
* 设置 `query_cache_store_results_of_queries_with_nondeterministic_functions` (取值为 `false` 或 `true`) 已被标记为已过时。该设置已由 `query_cache_nondeterministic_function_handling` 取代；后者是一个三值枚举，用于控制查询缓存如何处理包含非确定性函数的查询：a) 抛出异常 (默认行为) ，b) 无论如何都保存非确定性查询结果，或 c) 忽略，即不抛出异常，也不缓存结果。[#56519](https://github.com/ClickHouse/ClickHouse/pull/56519) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 在 JOIN ON 部分中，将等值条件重写为带有 `is null` 检查的形式。Experimental *仅限 analyzer*。[#56538](https://github.com/ClickHouse/ClickHouse/pull/56538) ([vdimir](https://github.com/vdimir)).
* 函数`concat`现在支持任意类型的参数 (不再仅限于 String 和 FixedString 参数) 。这样一来，它的行为更接近 MySQL 对 `concat` 的实现。例如，`SELECT concat('ab', 42)` 现在会返回 `ab42`。[#56540](https://github.com/ClickHouse/ClickHouse/pull/56540) ([Serge Klochkov](https://github.com/slvrtrn)) 。
* 支持从配置中的 'named\_collection' 部分或通过 SQL 创建的命名集合中获取缓存配置。[#56541](https://github.com/ClickHouse/ClickHouse/pull/56541) ([Kseniia Sumarokova](https://github.com/kssenii)).
* PostgreSQL 数据库引擎：在 postgres 连接失败时，减少对过期表删除操作的激进性。[#56609](https://github.com/ClickHouse/ClickHouse/pull/56609) ([jsc0218](https://github.com/jsc0218)).
* 当 URL 不正确时，连接到 PG 会耗费过长时间，导致相关查询卡在那里，随后被取消。[#56648](https://github.com/ClickHouse/ClickHouse/pull/56648) ([jsc0218](https://github.com/jsc0218)) 。
* Keeper 改进：默认在 Keeper 中禁用压缩日志。[#56763](https://github.com/ClickHouse/ClickHouse/pull/56763) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 新增配置项 `wait_dictionaries_load_at_startup`。[#56782](https://github.com/ClickHouse/ClickHouse/pull/56782) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 早期版本的 ClickHouse 中存在一个潜在漏洞：如果某个用户已建立连接，并尝试使用 "interserver secret" 方法进行身份验证但未成功，服务器不会立即终止该连接，而是会继续接收并忽略来自客户端的剩余数据包。虽然这些数据包会被忽略，但仍会被解析；如果它们使用了另一种存在已知漏洞的压缩方法，就可能在无需身份验证的情况下利用该漏洞。该问题由 [https://twitter.com/malacupa](https://twitter.com/malacupa) 通过 [ClickHouse Bug Bounty Program](https://github.com/ClickHouse/ClickHouse/issues/38986) 发现。[#56794](https://github.com/ClickHouse/ClickHouse/pull/56794) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 当某个 part 在远程副本上完全提交后，拉取该 part 会等待。最好不要发送处于 PreActive 状态的 part。对于零拷贝，这是一个强制限制。[#56808](https://github.com/ClickHouse/ClickHouse/pull/56808) ([Sema Checherinda](https://github.com/CheSema)) 。
* 修复了在使用 Experimental `MaterializedPostgreSQL` 时可能出现的 PostgreSQL 逻辑复制转换错误。[#53721](https://github.com/ClickHouse/ClickHouse/pull/53721) ([takakawa](https://github.com/takakawa)).
* 实现了用户级设置 `alter_move_to_space_execute_async`，可异步执行查询 `ALTER TABLE ... MOVE PARTITION|PART TO DISK|VOLUME`。后台执行线程池的大小由 `background_move_pool_size` 控制。默认行为是同步执行。修复了 [#47643](https://github.com/ClickHouse/ClickHouse/issues/47643)。[#56809](https://github.com/ClickHouse/ClickHouse/pull/56809) ([alesapin](https://github.com/alesapin)) 。
* 扫描 system.tables 时可按引擎进行过滤，从而避免不必要的 (且可能非常耗时的) 连接操作。[#56813](https://github.com/ClickHouse/ClickHouse/pull/56813) ([jsc0218](https://github.com/jsc0218)).
* 在 RocksDB 存储的系统表中显示 `total_bytes` 和 `total_rows`。[#56816](https://github.com/ClickHouse/ClickHouse/pull/56816) ([Aleksandr Musorin](https://github.com/AVMusorin)) 。
* 允许在 TEMPORARY 表的 ALTER 语句中使用基本命令。[#56892](https://github.com/ClickHouse/ClickHouse/pull/56892) ([Sergey](https://github.com/icuken)) 。
* LZ4 压缩。在极少数情况下，如果 out 缓冲区容量不足，无法将压缩块直接写入其缓冲区，则先将压缩块暂存到缓冲区中。[#56938](https://github.com/ClickHouse/ClickHouse/pull/56938) ([Sema Checherinda](https://github.com/CheSema)).
* 新增了用于统计队列中作业数量的指标，这对 IO 线程池很有帮助。[#56958](https://github.com/ClickHouse/ClickHouse/pull/56958) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 在配置文件中新增了 PostgreSQL table engine 的相关设置。新增了对此设置的检查，并补充了该附加设置的相关文档。[#56959](https://github.com/ClickHouse/ClickHouse/pull/56959) ([Peignon Melvyn](https://github.com/melvynator)) 。
* 函数 `concat` 现在支持仅用一个参数调用，例如 `SELECT concat('abc')`。这使其行为与 MySQL 中 concat 的实现更加一致。[#57000](https://github.com/ClickHouse/ClickHouse/pull/57000) ([Serge Klochkov](https://github.com/slvrtrn)).
* 按 AWS S3 文档要求，对所有 `x-amz-*` 请求头进行签名。[#57001](https://github.com/ClickHouse/ClickHouse/pull/57001) ([Arthur Passos](https://github.com/arthurpassos)) 。
* 函数 `fromDaysSinceYearZero` (别名：`FROM_DAYS`) 现在可用于无符号和有符号整数类型 (此前仅支持无符号整数) 。这提升了与 Tableau Online 等第三方工具的兼容性。[#57002](https://github.com/ClickHouse/ClickHouse/pull/57002) ([Serge Klochkov](https://github.com/slvrtrn)) 。
* 在默认配置中加入 `system.s3queue_log`。[#57036](https://github.com/ClickHouse/ClickHouse/pull/57036) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 将 `wait_dictionaries_load_at_startup` 的默认值改为 true，并且仅当 `dictionaries_lazy_load` 为 false 时才使用此设置。[#57133](https://github.com/ClickHouse/ClickHouse/pull/57133) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 即使启用了 `dictionaries_lazy_load`，也会在创建时检查字典源类型。[#57134](https://github.com/ClickHouse/ClickHouse/pull/57134) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 现在可以单独启用/禁用计划级优化。此前只能将其全部禁用。此前用于此用途的设置 (`query_plan_enable_optimizations`) 已被保留，仍可用于禁用所有优化。[#57152](https://github.com/ClickHouse/ClickHouse/pull/57152) ([Robert Schulze](https://github.com/rschu1ze)) 。
* server 的退出码将与异常码对应。例如，如果 server 因内存限制而无法启动，将以代码 241 = MEMORY\_LIMIT\_EXCEEDED 退出。在之前的版本中，异常的退出码始终为 70 = Poco::Util::ExitCode::EXIT\_SOFTWARE。[#57153](https://github.com/ClickHouse/ClickHouse/pull/57153) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 不要对来自 `functional` C++ 头文件的栈帧进行反混淆和符号化。[#57201](https://github.com/ClickHouse/ClickHouse/pull/57201) ([Mike Kot](https://github.com/myrrc)) 。
* HTTP 服务器的 `/dashboard` 页面现在支持多条折线的图表。[#57236](https://github.com/ClickHouse/ClickHouse/pull/57236) ([Sergei Trifonov](https://github.com/serxa)) 。
* 命令行选项 `max_memory_usage_in_client` 支持带后缀 (K、M、G 等) 的字符串值。已关闭 [#56879](https://github.com/ClickHouse/ClickHouse/issues/56879)。[#57273](https://github.com/ClickHouse/ClickHouse/pull/57273) ([Yarik Briukhovetskyi](https://github.com/yariks5s)) 。
* 将 Intel QPL (由 `DEFLATE_QPL` 编解码器使用) 从 v1.2.0 升级至 v1.3.1。另修复了 BOF (Block On Fault) = 0 时的一个问题，改为在发生缺页故障时回退到软件路径进行处理。[#57291](https://github.com/ClickHouse/ClickHouse/pull/57291) ([jasperzhu](https://github.com/jinjunzh)) 。
* 将 MergeTree Settings 中默认的 `replicated_deduplication_window` 从 100 提高到 1k。[#57335](https://github.com/ClickHouse/ClickHouse/pull/57335) ([sichenzhao](https://github.com/sichenzhao)) 。
* 减少使用 `INCONSISTENT_METADATA_FOR_BACKUP`。如果可以，尽量继续扫描，而不是停止后再从头开始扫描备份。[#57385](https://github.com/ClickHouse/ClickHouse/pull/57385) ([Vitaly Baranov](https://github.com/vitlibar)) 。

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

* 添加 SQLLogic 测试。[#56078](https://github.com/ClickHouse/ClickHouse/pull/56078) ([Han Fei](https://github.com/hanfei1991)) 。
* 为提升易用性，使 `clickhouse-local` 和 `clickhouse-client` 支持短名称 (`ch`、`chl`、`chc`) 。[#56634](https://github.com/ClickHouse/ClickHouse/pull/56634) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 通过移除外部库中的未使用代码，进一步减小构建体积。[#56786](https://github.com/ClickHouse/ClickHouse/pull/56786) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 添加自动检查，确保不存在过大的编译单元。[#56559](https://github.com/ClickHouse/ClickHouse/pull/56559) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 减小单一二进制发行版的体积。此更改关闭了 [#55181](https://github.com/ClickHouse/ClickHouse/issues/55181)。[#56617](https://github.com/ClickHouse/ClickHouse/pull/56617) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 每次构建后，都会将各个编译单元和二进制文件的大小信息发送到 ClickHouse Cloud 中的 CI 数据库。此更改关闭了 [#56107](https://github.com/ClickHouse/ClickHouse/issues/56107)。[#56636](https://github.com/ClickHouse/ClickHouse/pull/56636) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* “Apache Arrow” 库中的某些文件 (我们仅将其用于一些非关键功能，例如解析 Arrow format) 此前无论构建缓存状态如何都会反复重建。现已修复。[#56657](https://github.com/ClickHouse/ClickHouse/pull/56657) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 避免重新编译依赖自动生成的版本源文件的编译单元。[#56660](https://github.com/ClickHouse/ClickHouse/pull/56660) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 链接器调用的跟踪数据将发送到 ClickHouse Cloud 中的 CI 数据库。[#56725](https://github.com/ClickHouse/ClickHouse/pull/56725) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 为 `clickhouse` 可执行文件使用 DWARF 5 调试符号 (此前为 DWARF 4) 。[#56770](https://github.com/ClickHouse/ClickHouse/pull/56770) ([Michael Kolupaev](https://github.com/al13n321)) 。
* 添加新的构建选项 `SANITIZE_COVERAGE`。启用后，将对代码进行插桩以跟踪覆盖率。采集到的信息可在 ClickHouse 内通过以下方式获取： (1) 新增函数 `coverage`，返回自上次重置覆盖率以来在代码中发现的唯一地址数组； (2) 使用 `SYSTEM RESET COVERAGE` 查询重置累计数据。这使我们能够比较不同测试的覆盖率，包括差异化代码覆盖率。这是 [#20539](https://github.com/ClickHouse/ClickHouse/issues/20539) 的后续工作。[#56102](https://github.com/ClickHouse/ClickHouse/pull/56102) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 在收集调用栈时，某些栈帧可能无法解析。在这种情况下，原始地址可能会有所帮助。[#56267](https://github.com/ClickHouse/ClickHouse/pull/56267) ([Alexander Gololobov](https://github.com/davenger)) 。
* 添加可禁用 `libssh` 的选项。[#56333](https://github.com/ClickHouse/ClickHouse/pull/56333) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 在 CI 的 S3 测试中启用 temporary\_data\_in\_cache。[#48425](https://github.com/ClickHouse/ClickHouse/pull/48425) ([vdimir](https://github.com/vdimir)) 。
* 在 CI 中为 `clickhouse-client` 设置最大内存使用量 (`1G`) 。[#56873](https://github.com/ClickHouse/ClickHouse/pull/56873) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。

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

* 修复实验性 analyzer——在从 `select` 插入时，如果子查询引用了插入目标表，则应仅处理插入块。[#50857](https://github.com/ClickHouse/ClickHouse/pull/50857) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* 修复了 `str_to_map` 函数中的一个缺陷。[#56423](https://github.com/ClickHouse/ClickHouse/pull/56423) ([Arthur Passos](https://github.com/arthurpassos)) 。
* Keeper `reconfig`：在让出/接任 leader 之前添加 timeout [#53481](https://github.com/ClickHouse/ClickHouse/pull/53481) ([Mike Kot](https://github.com/myrrc)) 。
* 修复 grace hash join 和过滤器下推中的错误请求头 [#53922](https://github.com/ClickHouse/ClickHouse/pull/53922) ([vdimir](https://github.com/vdimir)).
* 当表基于表函数时，支持从系统表中查询。 [#55540](https://github.com/ClickHouse/ClickHouse/pull/55540) ([MikhailBurdukov](https://github.com/MikhailBurdukov)).
* RFC：修复带有 LIMIT BY 的分布式查询中“在源流中找不到列 X”的问题 [#55836](https://github.com/ClickHouse/ClickHouse/pull/55836) ([Azat Khuzhin](https://github.com/azat)).
* 修复客户端在后台运行时出现的 'Cannot read from file:' 问题 [#55976](https://github.com/ClickHouse/ClickHouse/pull/55976) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复了 `send_logs_level` 设置不当时 clickhouse-local 退出的问题 [#55994](https://github.com/ClickHouse/ClickHouse/pull/55994) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复 EXPLAIN AST 在参数化视图中的问题 [#56004](https://github.com/ClickHouse/ClickHouse/pull/56004) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)).
* 修复了启动时加载表期间发生的崩溃问题 [#56232](https://github.com/ClickHouse/ClickHouse/pull/56232) ([Nikolay Degterinsky](https://github.com/evillique)).
* 修复了带显式查询的 ClickHouse 源字典的问题 [#56236](https://github.com/ClickHouse/ClickHouse/pull/56236) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 修复 Keeper 信号处理函数中的段错误 [#56266](https://github.com/ClickHouse/ClickHouse/pull/56266) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 修复 `view()` 函数中 UNION 查询结果不完整的问题。[#56274](https://github.com/ClickHouse/ClickHouse/pull/56274) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复 "cast('0' as DateTime64(3))" 与 "cast('0' as Nullable(DateTime64(3)))" 之间不一致的问题 [#56286](https://github.com/ClickHouse/ClickHouse/pull/56286) ([李扬](https://github.com/taiyang-li)).
* 修复了与内存分配失败相关的罕见竞态条件 [#56303](https://github.com/ClickHouse/ClickHouse/pull/56303) ([alesapin](https://github.com/alesapin)).
* 修复了在使用 `flatten_nested` 和 `data_type_default_nullable` 时从备份中恢复的问题 [#56306](https://github.com/ClickHouse/ClickHouse/pull/56306) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 修复了添加 `Object(JSON)` 类型列时发生崩溃的问题 [#56307](https://github.com/ClickHouse/ClickHouse/pull/56307) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* 修复 filterPushDown 中发生的崩溃 [#56380](https://github.com/ClickHouse/ClickHouse/pull/56380) ([vdimir](https://github.com/vdimir)) 。
* 修复了从备份中恢复带有物化视图且源表已删除的数据时的问题 [#56383](https://github.com/ClickHouse/ClickHouse/pull/56383) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 修复 Kerberos 初始化期间发生的段错误 [#56401](https://github.com/ClickHouse/ClickHouse/pull/56401) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 修复 T64 中的缓冲区溢出 [#56434](https://github.com/ClickHouse/ClickHouse/pull/56434) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 修复 FINAL 中 Nullable 主键的问题 (2)  [#56452](https://github.com/ClickHouse/ClickHouse/pull/56452) ([Amos Bird](https://github.com/amosbird)) 。
* 修复初始节点上未指定数据库的 ON CLUSTER 查询问题 [#56484](https://github.com/ClickHouse/ClickHouse/pull/56484) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 修复因生存时间 (TTL) 依赖问题导致的启动失败 [#56489](https://github.com/ClickHouse/ClickHouse/pull/56489) ([Nikolay Degterinsky](https://github.com/evillique)).
* 修复 ALTER COMMENT ON CLUSTER 查询 [#56491](https://github.com/ClickHouse/ClickHouse/pull/56491) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 修复带有 ALIAS 的 ALTER COLUMN 问题 [#56493](https://github.com/ClickHouse/ClickHouse/pull/56493) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 修复空 NAMED COLLECTIONs 的问题 [#56494](https://github.com/ClickHouse/ClickHouse/pull/56494) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 修复了投影分析中的两处问题。[#56502](https://github.com/ClickHouse/ClickHouse/pull/56502) ([Amos Bird](https://github.com/amosbird)) 。
* 修复查询缓存中别名处理的问题 [#56545](https://github.com/ClickHouse/ClickHouse/pull/56545) ([Robert Schulze](https://github.com/rschu1ze)).
* 修复 `Nullable(Enum)` 到 `Nullable(String)` 的转换问题 [#56644](https://github.com/ClickHouse/ClickHouse/pull/56644) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 改进 Keeper 中日志处理的可靠性 [#56670](https://github.com/ClickHouse/ClickHouse/pull/56670) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 修复带有替换属性的节点在配置合并中的问题 [#56694](https://github.com/ClickHouse/ClickHouse/pull/56694) ([Konstantin Bogdanov](https://github.com/thevar1able)) 。
* 修复表函数 input() 被重复使用的问题。[#56695](https://github.com/ClickHouse/ClickHouse/pull/56695) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复：RabbitMQ OpenSSL 动态加载问题 [#56703](https://github.com/ClickHouse/ClickHouse/pull/56703) ([Igor Nikonov](https://github.com/devcrafter)) 。
* 修复了数据中存在零时 GCD 编解码器崩溃的问题 [#56704](https://github.com/ClickHouse/ClickHouse/pull/56704) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* 修复 clickhouse-local 在对 function 执行 insert 时出现的 'mutex lock failed: Invalid argument' 问题 [#56710](https://github.com/ClickHouse/ClickHouse/pull/56710) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复了 optimistic path 中 Date 文本解析问题 [#56765](https://github.com/ClickHouse/ClickHouse/pull/56765) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复 FPC codec 中的崩溃 [#56795](https://github.com/ClickHouse/ClickHouse/pull/56795) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* DatabaseReplicated：修复了副本恢复后 DDL 查询超时的问题 [#56796](https://github.com/ClickHouse/ClickHouse/pull/56796) ([Alexander Tokmakov](https://github.com/tavplubix)) 。
* 修复 MySQL 二进制协议中可空列信息报告错误的问题 [#56799](https://github.com/ClickHouse/ClickHouse/pull/56799) ([Serge Klochkov](https://github.com/slvrtrn)) 。
* 支持 metastore 表的 Iceberg 元数据文件 [#56810](https://github.com/ClickHouse/ClickHouse/pull/56810) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复 transform 中的 TSAN 报告问题 [#56817](https://github.com/ClickHouse/ClickHouse/pull/56817) ([Raúl Marín](https://github.com/Algunenano)) 。
* 修复 SET 查询和 SETTINGS 的格式 [#56825](https://github.com/ClickHouse/ClickHouse/pull/56825) ([Nikolay Degterinsky](https://github.com/evillique)).
* 修复了因 joinGet 中的表依赖导致无法启动的问题 [#56828](https://github.com/ClickHouse/ClickHouse/pull/56828) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 修复在 ADD COLUMN 时对现有 Nested 列进行扁平化的问题 [#56830](https://github.com/ClickHouse/ClickHouse/pull/56830) ([Nikolay Degterinsky](https://github.com/evillique)).
* 修复了 CSV 行尾允许使用 CR 的问题 [#56901](https://github.com/ClickHouse/ClickHouse/pull/56901) ([KevinyhZou](https://github.com/KevinyhZou)) 。
* 修复 `tryBase64Decode` 处理无效输入时的问题 [#56913](https://github.com/ClickHouse/ClickHouse/pull/56913) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 修复了在 CapnProto/Protobuf schema 中生成深层嵌套列的问题 [#56941](https://github.com/ClickHouse/ClickHouse/pull/56941) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 防止对投影列执行不兼容的 ALTER [#56948](https://github.com/ClickHouse/ClickHouse/pull/56948) ([Amos Bird](https://github.com/amosbird)).
* 修复 SQLite 文件路径验证问题 [#56984](https://github.com/ClickHouse/ClickHouse/pull/56984) ([San](https://github.com/santrancisco)) 。
* S3Queue：修复元数据引用计数递增问题 [#56990](https://github.com/ClickHouse/ClickHouse/pull/56990) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* S3Queue 小修复 [#56999](https://github.com/ClickHouse/ClickHouse/pull/56999) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复 DatabaseFileSystem 的文件路径校验问题 [#57029](https://github.com/ClickHouse/ClickHouse/pull/57029) ([San](https://github.com/santrancisco)).
* 修复 `fuzzBits` 在与 `ARRAY JOIN` 一起使用时的问题 [#57033](https://github.com/ClickHouse/ClickHouse/pull/57033) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 修复 partial merge join 中 joined\_subquery\_re... 导致的 Nullptr 解引用问题。 [#57048](https://github.com/ClickHouse/ClickHouse/pull/57048) ([vdimir](https://github.com/vdimir)).
* 修复 RemoteSource 中的竞态条件 [#57052](https://github.com/ClickHouse/ClickHouse/pull/57052) ([Raúl Marín](https://github.com/Algunenano)) 。
* 为大整数实现 `bitHammingDistance` [#57073](https://github.com/ClickHouse/ClickHouse/pull/57073) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* S3 风格链接问题修复 [#57075](https://github.com/ClickHouse/ClickHouse/pull/57075) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* 修复 JSON\_QUERY 函数处理多个数字路径时的问题 [#57096](https://github.com/ClickHouse/ClickHouse/pull/57096) ([KevinyhZou](https://github.com/KevinyhZou)).
* 修复 Gorilla 编解码器中的缓冲区溢出问题 [#57107](https://github.com/ClickHouse/ClickHouse/pull/57107) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 在身份验证前，如发生任何异常则关闭服务器间连接 [#57142](https://github.com/ClickHouse/ClickHouse/pull/57142) ([Antonio Andelic](https://github.com/antonio2368)).
* 修复对带有 Nullable MATERIALIZED 列执行 ALTER UPDATE 后出现的段错误 [#57147](https://github.com/ClickHouse/ClickHouse/pull/57147) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 修复普通投影部分物化时 JOIN 计划优化不正确的问题 [#57196](https://github.com/ClickHouse/ClickHouse/pull/57196) ([Amos Bird](https://github.com/amosbird)).
* 比较列描述时忽略注释 [#57259](https://github.com/ClickHouse/ClickHouse/pull/57259) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 修复 `ReadonlyReplica` 指标在所有情况下的问题 [#57267](https://github.com/ClickHouse/ClickHouse/pull/57267) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 后台合并现可正确使用缓存中的临时数据存储 [#57275](https://github.com/ClickHouse/ClickHouse/pull/57275) ([vdimir](https://github.com/vdimir)).
* 修复 Keeper 的更新日志和快照问题 [#57299](https://github.com/ClickHouse/ClickHouse/pull/57299) ([Antonio Andelic](https://github.com/antonio2368)).
* 如果主机名已更改，则忽略已完成的 ON CLUSTER 任务 [#57339](https://github.com/ClickHouse/ClickHouse/pull/57339) ([Alexander Tokmakov](https://github.com/tavplubix)).
* MergeTree 变更会复用源数据片段的索引粒度 [#57352](https://github.com/ClickHouse/ClickHouse/pull/57352) ([Maksim Kita](https://github.com/kitaisreal)).
* FS 缓存：增加后台下载限制 [#57424](https://github.com/ClickHouse/ClickHouse/pull/57424) ([Kseniia Sumarokova](https://github.com/kssenii)) 。

### <a id="2310" /> ClickHouse 发布 23.10，2023-11-02。 [演示文稿](https://presentations.clickhouse.com/2023-release-23.10/), [视频](https://www.youtube.com/watch?v=PGQS6uPb970)

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

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

* 不再提供自动删除损坏数据分区片段的选项。此项关闭了 [#55174](https://github.com/ClickHouse/ClickHouse/issues/55174)。[#55184](https://github.com/ClickHouse/ClickHouse/pull/55184) ([Alexey Milovidov](https://github.com/alexey-milovidov))。[#55557](https://github.com/ClickHouse/ClickHouse/pull/55557) ([Jihyuk Bok](https://github.com/tomahawk28))。
* 已废弃的内存中数据分区片段将无法再从预写日志中读取。如果你之前配置过内存中的 parts，则必须在升级前将其删除。[#55186](https://github.com/ClickHouse/ClickHouse/pull/55186) ([Alexey Milovidov](https://github.com/alexey-milovidov))。
* 移除了与 Meilisearch 的 integration。原因是它仅兼容旧版 0.18。较新的 Meilisearch 版本更改了协议，因此已无法使用。注意：如果你愿意帮助恢复该 integration，我们将不胜感激。[#55189](https://github.com/ClickHouse/ClickHouse/pull/55189) ([Alexey Milovidov](https://github.com/alexey-milovidov))。
* 将 directory monitor 的概念重命名为后台 INSERT。所有 `*directory_monitor*` 设置均已重命名为 `distributed_background_insert*`。*应保留向后兼容性* (因为旧设置已作为别名保留) 。[#55978](https://github.com/ClickHouse/ClickHouse/pull/55978) ([Azat Khuzhin](https://github.com/azat))。
* 不再将客户端侧设置的 `send_timeout` 解释为服务端侧的 `receive_timeout`，反之亦然。[#56035](https://github.com/ClickHouse/ClickHouse/pull/56035) ([Azat Khuzhin](https://github.com/azat))。
* 比较不同单位的时间间隔时将抛出异常。此项关闭了 [#55942](https://github.com/ClickHouse/ClickHouse/issues/55942)。你可能偶尔依赖过之前的行为，即无论单位如何都直接比较底层数值。[#56090](https://github.com/ClickHouse/ClickHouse/pull/56090) ([Alexey Milovidov](https://github.com/alexey-milovidov))。
* 完全重写了 Experimental `S3Queue` 表引擎：更改了在 zookeeper 中保存信息的方式，从而减少 zookeeper 请求；在已知状态不会变化时，增加了对 zookeeper 状态的 caching；改进了从 S3 轮询的流程，使其不再那么激进；调整了对已跟踪文件的 TTL 和最大集合的维护方式，现在这变成了后台进程。新增了 `system.s3queue` 和 `system.s3queue_log` 表。此项关闭了 [#54998](https://github.com/ClickHouse/ClickHouse/issues/54998)。[#54422](https://github.com/ClickHouse/ClickHouse/pull/54422) ([Kseniia Sumarokova](https://github.com/kssenii))。
* HTTP 端点上的任意路径不再被解释为发往 `/query` 端点的请求。[#55521](https://github.com/ClickHouse/ClickHouse/pull/55521) ([Konstantin Bogdanov](https://github.com/thevar1able))。

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

* 新增函数 `arrayFold(accumulator, x1, ..., xn -> expression, initial, array1, ..., arrayn)`，可将 lambda function 应用于多个长度相同的数组，并将结果累积到累加器中。[#49794](https://github.com/ClickHouse/ClickHouse/pull/49794) ([Lirikl](https://github.com/Lirikl)).
* 新增对 `Npy` 格式的支持。`SELECT * FROM file('example_array.npy', Npy)`。[#55982](https://github.com/ClickHouse/ClickHouse/pull/55982) ([Yarik Briukhovetskyi](https://github.com/yariks5s)) 。
* 如果某个表的键中包含空间填充曲线，例如 `ORDER BY mortonEncode(x, y)`，则其参数上的条件 (例如 `x >= 10 AND x <= 20 AND y >= 20 AND y <= 30`) 可用于索引。新增了设置 `analyze_index_with_space_filling_curves`，用于启用或禁用此分析。此更改解决了 [#41195](https://github.com/ClickHouse/ClickHouse/issue/41195)。延续自 [#4538](https://github.com/ClickHouse/ClickHouse/pull/4538)。延续自 [#6286](https://github.com/ClickHouse/ClickHouse/pull/6286)。延续自 [#28130](https://github.com/ClickHouse/ClickHouse/pull/28130)。延续自 [#41753](https://github.com/ClickHouse/ClickHouse/pull/#41753)。[#55642](https://github.com/ClickHouse/ClickHouse/pull/55642) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 新增了一个名为 `force_optimize_projection_name` 的设置，该设置接受 projection 名称作为参数。如果其值设置为非空字符串，ClickHouse 会检查该 projection 是否至少在查询中使用过一次。关闭 [#55331](https://github.com/ClickHouse/ClickHouse/issues/55331)。[#56134](https://github.com/ClickHouse/ClickHouse/pull/56134) ([Yarik Briukhovetskyi](https://github.com/yariks5s)) 。
* 支持通过原生协议对外部数据进行异步插入。此前，只有将数据内联到查询中时才支持这一功能。[#54730](https://github.com/ClickHouse/ClickHouse/pull/54730) ([Anton Popov](https://github.com/CurtizJ)).
* 新增聚合函数 `lttb`，使用 [Largest-Triangle-Three-Buckets](https://skemman.is/bitstream/1946/15343/3/SS_MSthesis.pdf) 算法对数据进行降采样，以便用于可视化。[#53145](https://github.com/ClickHouse/ClickHouse/pull/53145) ([Sinan](https://github.com/sinsinan)) 。
* `CHECK TABLE` 查询具有更好的性能和可用性 (会发送进度更新，并支持取消) 。支持使用 `CHECK TABLE ... PART 'part_name'` 检查特定分片。[#53404](https://github.com/ClickHouse/ClickHouse/pull/53404) ([vdimir](https://github.com/vdimir)).
* 添加了函数 `jsonMergePatch`。在将 JSON 数据作为字符串处理时，它提供了一种将这些字符串 (JSON 对象字符串) 合并起来的方法，从而生成一个仅包含单个 JSON 对象的字符串。[#54364](https://github.com/ClickHouse/ClickHouse/pull/54364) ([Memo](https://github.com/Joeywzr)) 。
* Kusto Query Language 方言支持的第二部分。[第 1 阶段实现](https://github.com/ClickHouse/ClickHouse/pull/37961)已完成合并。[#42510](https://github.com/ClickHouse/ClickHouse/pull/42510) ([larryluogit](https://github.com/larryluogit)) 。
* 新增了一个新的 SQL 函数 `arrayRandomSample(arr, k)`，可从输入数组中返回包含 k 个元素的样本。此前，类似功能只能通过不太便捷的语法实现，例如 "SELECT arrayReduce('groupArraySample(3)', range(10))"。[#54391](https://github.com/ClickHouse/ClickHouse/pull/54391) ([itayisraelov](https://github.com/itayisraelov)) 。
* 引入 `-ArgMin`/`-ArgMax` 聚合组合器，使其仅基于最小/最大值进行聚合。相关用例见 [#54818](https://github.com/ClickHouse/ClickHouse/issues/54818)。此 PR 还将组合器重新整理到专用文件夹中。[#54947](https://github.com/ClickHouse/ClickHouse/pull/54947) ([Amos Bird](https://github.com/amosbird)) 。
* 允许通过 `SYSTEM DROP SCHEMA FORMAT CACHE [FOR Protobuf]` 清除 Protobuf format 的缓存。[#55064](https://github.com/ClickHouse/ClickHouse/pull/55064) ([Aleksandr Musorin](https://github.com/AVMusorin)) 。
* 新增外部 HTTP Basic 认证器。[#55199](https://github.com/ClickHouse/ClickHouse/pull/55199) ([Aleksei Filatov](https://github.com/aalexfvk)) 。
* 新增了函数 `byteSwap`，可将无符号整数的字节顺序颠倒。这对于颠倒那些在内部以无符号整数形式表示的类型的值特别有用，例如 IPv4。[#55211](https://github.com/ClickHouse/ClickHouse/pull/55211) ([Priyansh Agrawal](https://github.com/Priyansh121096)) 。
* 新增函数 `formatQuery`，用于返回 SQL 查询字符串的格式化版本 (可能为多行) 。同时还新增了函数 `formatQuerySingleLine`，作用相同，但返回的字符串不包含换行符。[#55239](https://github.com/ClickHouse/ClickHouse/pull/55239) ([Salvatore Mesoraca](https://github.com/aiven-sal)).
* 新增了 `DWARF` 输入格式，可从 ELF 可执行文件/库/目标文件中读取调试符号。[#55450](https://github.com/ClickHouse/ClickHouse/pull/55450) ([Michael Kolupaev](https://github.com/al13n321)) 。
* 允许在 RabbitMQ、NATS 和 FileLog 引擎中保存未解析的记录和错误。新增虚拟列 `_error` 以及 `_raw_message` (用于 NATS 和 RabbitMQ) 和 `_raw_record` (用于 FileLog) ；当 ClickHouse 无法解析新记录时，这些列会被填充。该行为由存储设置控制：NATS 使用 `nats_handle_error_mode`，RabbitMQ 使用 `rabbitmq_handle_error_mode`，FileLog 使用 `handle_error_mode`，与 `kafka_handle_error_mode` 类似。如果将其设置为 `default`，当 ClickHouse 无法解析记录时会抛出异常；如果设置为 `stream`，则错误和原始记录会保存到虚拟列中。关闭 [#36035](https://github.com/ClickHouse/ClickHouse/issues/36035)。[#55477](https://github.com/ClickHouse/ClickHouse/pull/55477) ([Kruglov Pavel](https://github.com/Avogar)) 。
* Keeper 客户端改进：新增 `get_all_children_number command`，用于返回特定路径下所有子节点的数量。[#55485](https://github.com/ClickHouse/ClickHouse/pull/55485) ([guoxiaolong](https://github.com/guoxiaolongzte)) 。
* Keeper 客户端改进：新增 `get_direct_children_number` 命令，返回某个路径下直接子节点的数量。[#55898](https://github.com/ClickHouse/ClickHouse/pull/55898) ([xuzifu666](https://github.com/xuzifu666)).
* 新增语句 `SHOW SETTING setting_name`，作为现有语句 `SHOW SETTINGS` 的简化版本。[#55979](https://github.com/ClickHouse/ClickHouse/pull/55979) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 向 `system.parts_columns` 表中新增了字段 `substreams` 和 `filenames`。[#55108](https://github.com/ClickHouse/ClickHouse/pull/55108) ([Anton Popov](https://github.com/CurtizJ)) 。
* 新增了对 `SHOW MERGES` 查询的支持。[#55815](https://github.com/ClickHouse/ClickHouse/pull/55815) ([megao](https://github.com/jetgm)).
* 引入设置 `create_table_empty_primary_key_by_default`，将默认 `ORDER BY` 设为 `()`。[#55899](https://github.com/ClickHouse/ClickHouse/pull/55899) ([Srikanth Chekuri](https://github.com/srikanthccv)) 。

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

* 添加选项 `query_plan_preserve_num_streams_after_window_functions`，用于在计算窗口函数后保留流的数量，以支持并行流处理。[#50771](https://github.com/ClickHouse/ClickHouse/pull/50771) ([frinkr](https://github.com/frinkr)).
* 如果数据量较小，则释放更多流。[#53867](https://github.com/ClickHouse/ClickHouse/pull/53867) ([Jiebin Sun](https://github.com/jiebinn)) 。
* 在序列化前优化 RoaringBitmaps。[#55044](https://github.com/ClickHouse/ClickHouse/pull/55044) ([UnamedRus](https://github.com/UnamedRus)).
* 倒排索引中的倒排列表现已优化，内部 bitmap 会采用尽可能紧凑的表示形式。根据数据的重复程度，这可能会显著降低倒排索引的空间占用。 [#55069](https://github.com/ClickHouse/ClickHouse/pull/55069) ([Harry Lee](https://github.com/HarryLeeIBM)).
* 修复了 Context 锁竞争问题，显著提升了大量短时运行的并发查询性能。 [#55121](https://github.com/ClickHouse/ClickHouse/pull/55121) ([Maksim Kita](https://github.com/kitaisreal)).
* 将倒排索引的创建性能提升了 30%。这是通过将 `std::unordered_map` 替换为 `absl::flat_hash_map` 实现的。[#55210](https://github.com/ClickHouse/ClickHouse/pull/55210) ([Harry Lee](https://github.com/HarryLeeIBM)) 。
* 支持 ORC 过滤器下推 (行组级) 。[#55330](https://github.com/ClickHouse/ClickHouse/pull/55330) ([李扬](https://github.com/taiyang-li)).
* 改进在存在大量临时 File 时的外部聚合性能。[#55489](https://github.com/ClickHouse/ClickHouse/pull/55489) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 默认将二级索引的标记缓存设为合理的大小，以避免反复加载标记。[#55654](https://github.com/ClickHouse/ClickHouse/pull/55654) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 读取跳过索引时，避免不必要地重建索引粒度。这修复了 [#55653](https://github.com/ClickHouse/ClickHouse/issues/55653#issuecomment-1763766009)。[#55683](https://github.com/ClickHouse/ClickHouse/pull/55683) ([Amos Bird](https://github.com/amosbird)).
* 在执行期间缓存集合中的 CAST 函数，以便在集合元素类型与列类型不完全匹配时提升 `IN` 函数的性能。[#55712](https://github.com/ClickHouse/ClickHouse/pull/55712) ([Duc Canh Le](https://github.com/canhld94)).
* 提升了 `ColumnVector::insertMany` 和 `ColumnVector::insertManyFrom` 的性能。[#55714](https://github.com/ClickHouse/ClickHouse/pull/55714) ([frinkr](https://github.com/frinkr)) 。
* 通过预测下一行中键的位置并减少比较次数，优化了 Map 下标操作。[#55929](https://github.com/ClickHouse/ClickHouse/pull/55929) ([lgbo](https://github.com/lgbo-ustc)) 。
* 支持 Parquet 中结构体字段裁剪 (此前的版本在某些情况下无法生效) 。[#56117](https://github.com/ClickHouse/ClickHouse/pull/56117) ([lgbo](https://github.com/lgbo-ustc)).
* 新增了可根据预计待读取的行数调整查询执行中所用并行副本数量的能力。[#51692](https://github.com/ClickHouse/ClickHouse/pull/51692) ([Raúl Marín](https://github.com/Algunenano)).
* 在生成大量临时 File 时，优化了外部聚合的内存消耗。[#54798](https://github.com/ClickHouse/ClickHouse/pull/54798) ([Nikita Taranov](https://github.com/nickitat)) 。
* 以 `async_socket_for_remote` 模式 (默认) 执行的分布式查询现在会遵循 `max_threads` 限制。此前，某些查询可能会创建过多的线程 (最多可达 `max_distributed_connections`) ，从而导致服务器性能问题。[#53504](https://github.com/ClickHouse/ClickHouse/pull/53504) ([filimonov](https://github.com/filimonov)).
* 在执行来自 Zookeeper 分布式 DDL 队列的 DDL 时，缓存可跳过的条目。[#54828](https://github.com/ClickHouse/ClickHouse/pull/54828) ([Duc Canh Le](https://github.com/canhld94)) 。
* Experimental 倒排索引不会存储匹配项过多的标记 (即倒排列表中的行 id) 。这样可以节省空间，并避免在顺序扫描同样快甚至更快时进行低效的索引查找。此前用于控制何时不存储标记的启发式规则 (传递给索引定义的 `density` 参数) 让用户颇感困惑。现在引入了一种简单得多的启发式规则，基于参数 `max_rows_per_postings_list` (默认值：64k) ，可直接控制倒排列表中允许包含的最大行 id 数量。[#55616](https://github.com/ClickHouse/ClickHouse/pull/55616) ([Harry Lee](https://github.com/HarryLeeIBM)).
* 改进了 `EmbeddedRocksDB` 表的写入性能。[#55732](https://github.com/ClickHouse/ClickHouse/pull/55732) ([Duc Canh Le](https://github.com/canhld94)) 。
* 提升了 ClickHouse 在分区内存在大量 parts (超过 1000 个) 时的整体稳定性。这可能会减少 `TOO_MANY_PARTS` 错误。[#55526](https://github.com/ClickHouse/ClickHouse/pull/55526) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 降低了加载层次结构字典时的内存占用。[#55838](https://github.com/ClickHouse/ClickHouse/pull/55838) ([Nikita Taranov](https://github.com/nickitat)) 。
* 所有字典均支持设置 `dictionary_use_async_executor`。 [#55839](https://github.com/ClickHouse/ClickHouse/pull/55839) ([vdimir](https://github.com/vdimir)).
* 防止在反序列化 AggregateFunctionTopKGenericData 时内存占用过高。[#55947](https://github.com/ClickHouse/ClickHouse/pull/55947) ([Raúl Marín](https://github.com/Algunenano)).
* 在具有大量 watch 的 Keeper 上，AsyncMetrics 线程可能会在 `DB::KeeperStorage::getSessionsWithWatchesCount` 中持续一段明显的时间占满 100% CPU。该修复通过避免遍历开销较大的 `watches` 和 `list_watches` 集合来解决此问题。[#56054](https://github.com/ClickHouse/ClickHouse/pull/56054) ([Alexander Gololobov](https://github.com/davenger)).
* 新增设置 `optimize_trivial_approximate_count_query`，使存储引擎 EmbeddedRocksDB 可使用 `count` 近似计数。为 StorageJoin 启用 trivial count。[#55806](https://github.com/ClickHouse/ClickHouse/pull/55806) ([Duc Canh Le](https://github.com/canhld94)).

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

* 函数 `toDayOfWeek` (MySQL 别名：`DAYOFWEEK`) 、`toYearWeek` (`YEARWEEK`) 和 `toWeek` (`WEEK`) 现已支持 `String` 参数。这使其行为与 MySQL 保持一致。[#55589](https://github.com/ClickHouse/ClickHouse/pull/55589) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 引入了设置 `date_time_overflow_behavior`，可选值为 `ignore`、`throw`、`saturate`，用于控制从 Date、Date32、DateTime64、Integer 或 Float 转换为 Date、Date32、DateTime 或 DateTime64 时的溢出处理行为。 [#55696](https://github.com/ClickHouse/ClickHouse/pull/55696) ([Andrey Zvonov](https://github.com/zvonand)).
* 为 `ALTER TABLE ... ACTION PARTITION [ID] {parameter_name:ParameterType}` 添加了查询参数支持。合并了 [#49516](https://github.com/ClickHouse/ClickHouse/issues/49516)。关闭了 [#49449](https://github.com/ClickHouse/ClickHouse/issues/49449)。[#55604](https://github.com/ClickHouse/ClickHouse/pull/55604) ([alesapin](https://github.com/alesapin)) 。
* 在 EXPLAIN 中以更美观的方式显示处理器 ID。[#48852](https://github.com/ClickHouse/ClickHouse/pull/48852) ([Vlad Seliverstov](https://github.com/behebot)) 。
* 创建包含 `lifetime` 字段的直接字典时会在创建阶段被拒绝 (因为 `lifetime` 对直接字典没有意义) 。修复：[#27861](https://github.com/ClickHouse/ClickHouse/issues/27861)。[#49043](https://github.com/ClickHouse/ClickHouse/pull/49043) ([Rory Crispin](https://github.com/RoryCrispin)) 。
* 允许在带有分区子句的查询中使用参数，例如 `ALTER TABLE t DROP PARTITION`。关闭 [#49449](https://github.com/ClickHouse/ClickHouse/issues/49449)。[#49516](https://github.com/ClickHouse/ClickHouse/pull/49516) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 为 `system.zookeeper_connection` 新增 `xid` 列。[#50702](https://github.com/ClickHouse/ClickHouse/pull/50702) ([helifu](https://github.com/helifu)) 。
* 配置重新加载后，在 `system.server_settings` 中显示正确的服务器设置。[#53774](https://github.com/ClickHouse/ClickHouse/pull/53774) ([helifu](https://github.com/helifu)) 。
* 在查询中新增了对数学减号字符 `−` 的支持，其行为与 `-` 类似。[#54100](https://github.com/ClickHouse/ClickHouse/pull/54100) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 为 Experimental `Replicated` 数据库引擎添加副本组。关闭 [#53620](https://github.com/ClickHouse/ClickHouse/issues/53620)。[#54421](https://github.com/ClickHouse/ClickHouse/pull/54421) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 与其让查询直接失败，不如对可重试的 S3 错误进行重试。默认增大 s3\_retry\_attempts 的值。[#54770](https://github.com/ClickHouse/ClickHouse/pull/54770) ([Sema Checherinda](https://github.com/CheSema)).
* 新增了负载均衡模式 `hostname_levenshtein_distance`。[#54826](https://github.com/ClickHouse/ClickHouse/pull/54826) ([JackyWoo](https://github.com/JackyWoo)) 。
* 改进了在日志中隐藏敏感信息的功能。 [#55089](https://github.com/ClickHouse/ClickHouse/pull/55089) ([Vitaly Baranov](https://github.com/vitlibar)).
* 目前，投影分析将仅基于查询计划执行。设置 `query_plan_optimize_projection` 已废弃 (很久以前就已默认启用) 。[#55112](https://github.com/ClickHouse/ClickHouse/pull/55112) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 现在，当函数 `untuple` 用于具有命名元素的 Tuple，且该函数本身也带有别名时 (例如 `select untuple(tuple(1)::Tuple(element_alias Int)) AS untuple_alias`) ，结果列名将根据 untuple 的别名和 Tuple 元素的别名生成 (在此示例中为："untuple\_alias.element\_alias") 。[#55123](https://github.com/ClickHouse/ClickHouse/pull/55123) ([garcher22](https://github.com/garcher22)) 。
* 新增设置 `describe_include_virtual_columns`，可将表的虚拟列包含在 `DESCRIBE` 查询结果中。新增设置 `describe_compact_output`。如果设为 `true`，`DESCRIBE` 查询将仅返回列名和类型，不包含额外信息。[#55129](https://github.com/ClickHouse/ClickHouse/pull/55129) ([Anton Popov](https://github.com/CurtizJ)) 。
* 有时，带有 `optimize_throw_if_noop=1` 的 `OPTIMIZE` 可能会因 `unknown reason` 错误而失败，而真正原因是不同 parts 中存在不同的 projections。此问题已修复。[#55130](https://github.com/ClickHouse/ClickHouse/pull/55130) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* 允许多个 `MaterializedPostgreSQL` 表对应同一个 Postgres 表。默认情况下，此行为未启用 (出于兼容性考虑，因为这是一项向后不兼容的更改) ，但可通过设置 `materialized_postgresql_use_unique_replication_consumer_identifier` 启用。关闭 [#54918](https://github.com/ClickHouse/ClickHouse/issues/54918)。[#55145](https://github.com/ClickHouse/ClickHouse/pull/55145) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 允许从较短的字符串中解析带小数部分的负 `DateTime64` 和 `DateTime`。[#55146](https://github.com/ClickHouse/ClickHouse/pull/55146) ([Andrey Zvonov](https://github.com/zvonand)) 。
* 为了提升与 MySQL 的兼容性，1. `information_schema.tables` 现已新增字段 `table_rows`，2. `information_schema.columns` 现已新增字段 `extra`。[#55215](https://github.com/ClickHouse/ClickHouse/pull/55215) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 如果结果为 0 且抛出了异常，Clickhouse-client 将不会显示 "0 rows in set"。[#55240](https://github.com/ClickHouse/ClickHouse/pull/55240) ([Salvatore Mesoraca](https://github.com/aiven-sal)) 。
* 支持在不带 `TABLE` 关键字的情况下重命名表，例如 `RENAME db.t1 to db.t2`。[#55373](https://github.com/ClickHouse/ClickHouse/pull/55373) ([凌涛](https://github.com/lingtaolf)) 。
* 在 `system.clusters` 中添加 `internal_replication`。[#55377](https://github.com/ClickHouse/ClickHouse/pull/55377) ([Konstantin Morozov](https://github.com/k-morozov)) 。
* 根据请求协议选择远程代理解析器，补充代理功能文档，并移除 `DB::ProxyConfiguration::Protocol::ANY`。[#55430](https://github.com/ClickHouse/ClickHouse/pull/55430) ([Arthur Passos](https://github.com/arthurpassos)) 。
* 避免在表关闭后于 INSERT 过程中重试 Keeper 操作。[#55519](https://github.com/ClickHouse/ClickHouse/pull/55519) ([Azat Khuzhin](https://github.com/azat)) 。
* `SHOW COLUMNS` 现在会在启用设置 `use_mysql_types_in_show_columns` 时，正确将 `FixedString` 类型报告为 `BLOB`。此外，还新增了两个设置：`mysql_map_string_to_text_in_show_columns` 和 `mysql_map_fixed_string_to_text_in_show_columns`，用于将 `String` 和 `FixedString` 类型的输出切换为 `TEXT` 或 `BLOB`。[#55617](https://github.com/ClickHouse/ClickHouse/pull/55617) ([Serge Klochkov](https://github.com/slvrtrn)) 。
* 在 ReplicatedMergeTree 表启动期间，ClickHouse server 会检查 parts 集合中是否存在异常 parts (本地存在，但在 ZooKeeper 中不存在) 。所有异常 parts 都会被移到 detached 目录中，server 会尝试恢复它们最近的某些祖先 (被覆盖的) parts 作为替代。现在，server 会尝试恢复最近的祖先，而不是随机的被覆盖 parts。[#55645](https://github.com/ClickHouse/ClickHouse/pull/55645) ([alesapin](https://github.com/alesapin)).
* 高级仪表板现已支持在触摸设备上拖拽图表。此项改动解决了 [#54206](https://github.com/ClickHouse/ClickHouse/issues/54206)。[#55649](https://github.com/ClickHouse/ClickHouse/pull/55649) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 如果已声明默认查询格式，则在使用 `http_write_exception_in_output_format` 输出异常时采用该格式。[#55739](https://github.com/ClickHouse/ClickHouse/pull/55739) ([Raúl Marín](https://github.com/Algunenano)) 。
* 为常见的 MATERIALIZED VIEW 陷阱提供更清晰的提示信息。[#55826](https://github.com/ClickHouse/ClickHouse/pull/55826) ([Raúl Marín](https://github.com/Algunenano)) 。
* 如果你删除了当前数据库，仍然可以在 `clickhouse-local` 中运行一些查询，并切换到另一个数据库。这样可使其行为与 `clickhouse-client` 保持一致。此更改解决了 [#55834](https://github.com/ClickHouse/ClickHouse/issues/55834)。[#55853](https://github.com/ClickHouse/ClickHouse/pull/55853) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 函数 `(add|subtract)(Year|Quarter|Month|Week|Day|Hour|Minute|Second|Millisecond|Microsecond|Nanosecond)` 现已支持以字符串编码的日期参数，例如 `SELECT addDays('2023-10-22', 1)`。这提升了与 MySQL 的兼容性，也是 Tableau Online 所必需的。[#55869](https://github.com/ClickHouse/ClickHouse/pull/55869) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 禁用设置 `apply_deleted_mask` 后，可读取被轻量级 DELETE 查询标记为已删除的行。这对调试很有帮助。[#55952](https://github.com/ClickHouse/ClickHouse/pull/55952) ([Alexander Gololobov](https://github.com/davenger)) 。
* 在将 Tuple 序列化为 JSON 对象时，允许跳过 `null` 值，从而能够与 Spark 的 `to_json` 函数保持兼容，这对 gluten 也很有帮助。[#55956](https://github.com/ClickHouse/ClickHouse/pull/55956) ([李扬](https://github.com/taiyang-li)).
* 函数 `(add|sub)Date` 现在支持以字符串编码的日期参数，例如 `SELECT addDate('2023-10-22 11:12:13', INTERVAL 5 MINUTE)`。加号和减号运算符现也支持以字符串编码的日期参数，例如 `SELECT '2023-10-23' + INTERVAL 1 DAY`。这提升了与 MySQL 的兼容性，也是 Tableau Online 所必需的。[#55960](https://github.com/ClickHouse/ClickHouse/pull/55960) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 允许在 CSV 格式中使用包含 CR (`\r`) 的未加引号字符串。已关闭 [#39930](https://github.com/ClickHouse/ClickHouse/issues/39930)。[#56046](https://github.com/ClickHouse/ClickHouse/pull/56046) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 支持使用嵌入式配置运行 `clickhouse-keeper`。[#56086](https://github.com/ClickHouse/ClickHouse/pull/56086) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 为 `queued.min.messages` 的最大配置值设定上限，以避免开始从 Kafka 拉取数据时出现问题。[#56121](https://github.com/ClickHouse/ClickHouse/pull/56121) ([Stas Morozov](https://github.com/r3b-fish)) 。
* 修复了 SQL 函数 `minSampleSizeContinous` 中的拼写错误 (已重命名为 `minSampleSizeContinuous`) 。保留旧名称以保持向后兼容。此项关闭了：[ #56139](https://github.com/ClickHouse/ClickHouse/issues/56139)。[#56143](https://github.com/ClickHouse/ClickHouse/pull/56143) ([Dorota Szeremeta](https://github.com/orotaday)) 。
* 在关闭 server 之前，打印磁盘上损坏的 parts 的路径。在此更改之前，如果某个 part 在磁盘上损坏且 server 无法启动，几乎无法判断究竟是哪个 part 损坏了。此问题现已修复。[#56181](https://github.com/ClickHouse/ClickHouse/pull/56181) ([Duc Canh Le](https://github.com/canhld94)).

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

* 如果 Docker 中的数据库已经初始化，后续启动时就无需再次初始化。这可能会修复数据库在 1000 次尝试内未能加载时容器无限重启的问题 (与超大数据库和多节点部署相关) 。[#50724](https://github.com/ClickHouse/ClickHouse/pull/50724) ([Alexander Nikolaev](https://github.com/AlexNik)).
* 包含子模块源码的资源会在 Darwin 的特殊构建任务中构建。这样无需检出子模块也可构建 ClickHouse。[#51435](https://github.com/ClickHouse/ClickHouse/pull/51435) ([Ilya Yatsishin](https://github.com/qoega)).
* 在全局启用 AVX 指令集系列 (不推荐) 来构建 ClickHouse 时会报错。原因是 snappy 未启用 `SNAPPY_HAVE_X86_CRC32`。[#55049](https://github.com/ClickHouse/ClickHouse/pull/55049) ([monchickey](https://github.com/monchickey)).
* 解决了从 `clickhouse-server` package 启动独立 `clickhouse-keeper` 的问题。[#55226](https://github.com/ClickHouse/ClickHouse/pull/55226) ([Mikhail f. Shiryaev](https://github.com/Felixoid)).
* 测试中将 RabbitMQ 版本更新到了 3.12.6，并改进了 RabbitMQ 测试的日志收集。[#55424](https://github.com/ClickHouse/ClickHouse/pull/55424) ([Ilya Yatsishin](https://github.com/qoega)).
* 调整了 openssl 与 boringssl 之间错误消息的差异，以修复功能测试。[#55975](https://github.com/ClickHouse/ClickHouse/pull/55975) ([MeenaRenganathan22](https://github.com/MeenaRenganathan22)).
* apache datasketches 改为使用上游仓库。[#55787](https://github.com/ClickHouse/ClickHouse/pull/55787) ([Nikita Taranov](https://github.com/nickitat)).

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

* 在变更期间跳过对倒排索引文件进行硬链接 [#47663](https://github.com/ClickHouse/ClickHouse/pull/47663) ([cangyin](https://github.com/cangyin)) 。
* 修复了 `match` 函数 (正则表达式) 的一个错误：当 pattern 包含交替分支时，会生成错误的键条件。关闭 #53222。 [#54696](https://github.com/ClickHouse/ClickHouse/pull/54696) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)).
* 修复在按序读取优化中使用 ARRAY JOIN 时出现的“Cannot find column”问题 [#51746](https://github.com/ClickHouse/ClickHouse/pull/51746) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 支持在查询中使用缺失的实验性 `Object(Nullable(json))` 子列。[#54052](https://github.com/ClickHouse/ClickHouse/pull/54052) ([zps](https://github.com/VanDarkholme7)) 。
* 重新加入 `accurateCastOrNull` 的修复 [#54629](https://github.com/ClickHouse/ClickHouse/pull/54629) ([Salvatore Mesoraca](https://github.com/aiven-sal)) 。
* 修复了对未使用 AS 创建的分布式表中列的 `DEFAULT` 检测问题 [#55060](https://github.com/ClickHouse/ClickHouse/pull/55060) ([Vitaly Baranov](https://github.com/vitlibar)).
* 修复 ShellCommandSource 的 ctor 中发生异常时未正确清理的问题 [#55103](https://github.com/ClickHouse/ClickHouse/pull/55103) ([Alexander Gololobov](https://github.com/davenger)).
* 修复 LDAP 分配角色更新时的死锁问题 [#55119](https://github.com/ClickHouse/ClickHouse/pull/55119) ([Julian Maicher](https://github.com/jmaicher)) 。
* 抑制对内部异常的错误统计信息更新 [#55128](https://github.com/ClickHouse/ClickHouse/pull/55128) ([Robert Schulze](https://github.com/rschu1ze)).
* 修复备份中的死锁问题 [#55132](https://github.com/ClickHouse/ClickHouse/pull/55132) ([alesapin](https://github.com/alesapin)) 。
* 修复存储层检索 Iceberg 文件的问题 [#55144](https://github.com/ClickHouse/ClickHouse/pull/55144) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复 set 中额外列的分区剪枝问题。[#55172](https://github.com/ClickHouse/ClickHouse/pull/55172) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了在表启用自适应粒度时，ALTER UPDATE 查询中跳过索引重新计算的问题 [#55202](https://github.com/ClickHouse/ClickHouse/pull/55202) ([Duc Canh Le](https://github.com/canhld94)).
* 修复了 fs cache 的后台下载问题 [#55252](https://github.com/ClickHouse/ClickHouse/pull/55252) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 避免在缓冲区未最终处理时压缩器中可能发生的内存泄漏 [#55262](https://github.com/ClickHouse/ClickHouse/pull/55262) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复函数在稀疏列上执行时的问题 [#55275](https://github.com/ClickHouse/ClickHouse/pull/55275) ([Azat Khuzhin](https://github.com/azat)).
* 修复在 SummingMergeTree 上执行 `SELECT FINAL FROM` 时 Nested 被错误合并的问题 [#55276](https://github.com/ClickHouse/ClickHouse/pull/55276) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了在未启用 zero copy 时，无法在基于 S3 的 replicated merge tree 中删除 detached 分区的问题 [#55309](https://github.com/ClickHouse/ClickHouse/pull/55309) ([alesapin](https://github.com/alesapin)) 。
* 修复 MergeSortingPartialResultTransform 中的崩溃问题 (原因是 `remerge` 后 chunks 数为 0) [#55335](https://github.com/ClickHouse/ClickHouse/pull/55335) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复 CreatingSetsTransform 中因抛出共享异常而在出错时发生的数据竞争问题 [#55338](https://github.com/ClickHouse/ClickHouse/pull/55338) ([Azat Khuzhin](https://github.com/azat)).
* 修复了 trash 优化中的问题 (在一定程度上) [#55353](https://github.com/ClickHouse/ClickHouse/pull/55353) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 修复 StorageHDFS 中的泄漏问题 [#55370](https://github.com/ClickHouse/ClickHouse/pull/55370) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复 `CAST` 运算符中数组解析错误 [#55417](https://github.com/ClickHouse/ClickHouse/pull/55417) ([Anton Popov](https://github.com/CurtizJ)).
* 修复了查询中使用 OR 过滤器时无法按虚拟列过滤的问题 [#55418](https://github.com/ClickHouse/ClickHouse/pull/55418) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复 MongoDB 连接问题 [#55419](https://github.com/ClickHouse/ClickHouse/pull/55419) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 修复 MySQL 接口中布尔值的表示方式 [#55427](https://github.com/ClickHouse/ClickHouse/pull/55427) ([Serge Klochkov](https://github.com/slvrtrn)) 。
* 修复 MySQL 文本协议中 DateTime 的格式化问题，以及 LowCardinality(Nullable(T)) 类型报告问题 [#55479](https://github.com/ClickHouse/ClickHouse/pull/55479) ([Serge Klochkov](https://github.com/slvrtrn)) 。
* 使 `use_mysql_types_in_show_columns` 只对 `SHOW COLUMNS` 生效 [#55481](https://github.com/ClickHouse/ClickHouse/pull/55481) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 修复栈符号化器对 `DW_FORM_ref_addr` 解析错误并偶发崩溃的问题 [#55483](https://github.com/ClickHouse/ClickHouse/pull/55483) ([Michael Kolupaev](https://github.com/al13n321)).
* 在 AsyncTaskExecutor 中，如果 cancelBefore 发生异常，则销毁 fiber [#55516](https://github.com/ClickHouse/ClickHouse/pull/55516) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复自定义 HTTP 处理程序中查询参数无法生效的问题 [#55521](https://github.com/ClickHouse/ClickHouse/pull/55521) ([Konstantin Bogdanov](https://github.com/thevar1able)).
* 修复了对 Values format 中未处理数据的检查问题 [#55527](https://github.com/ClickHouse/ClickHouse/pull/55527) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复 ODBC 与 MS SQL Server 交互时出现的 'Invalid cursor state' 错误 [#55558](https://github.com/ClickHouse/ClickHouse/pull/55558) ([vdimir](https://github.com/vdimir)) 。
* 修复最大执行时间和 'break' 溢出模式的问题 [#55577](https://github.com/ClickHouse/ClickHouse/pull/55577) ([Alexander Gololobov](https://github.com/davenger)) 。
* 修复 QueryNormalizer 在存在循环别名时崩溃的问题 [#55602](https://github.com/ClickHouse/ClickHouse/pull/55602) ([vdimir](https://github.com/vdimir)).
* 禁用错误的优化，并添加测试 [#55609](https://github.com/ClickHouse/ClickHouse/pull/55609) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 合并 [#52352](https://github.com/ClickHouse/ClickHouse/issues/52352) [#55621](https://github.com/ClickHouse/ClickHouse/pull/55621) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 添加了一项测试，以避免小数排序错误 [#55662](https://github.com/ClickHouse/ClickHouse/pull/55662) ([Amos Bird](https://github.com/amosbird)).
* 修复 S3 和 Azure 的 Cluster 函数在 URL 不含通配符时的进度条问题 [#55666](https://github.com/ClickHouse/ClickHouse/pull/55666) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复查询中使用 OR 过滤器按虚拟列过滤时的问题 (重新提交)  [#55678](https://github.com/ClickHouse/ClickHouse/pull/55678) ([Azat Khuzhin](https://github.com/azat)).
* Iceberg 存储的修复和改进 [#55695](https://github.com/ClickHouse/ClickHouse/pull/55695) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复 CreatingSetsTransform (v2) 中的数据竞争问题 [#55786](https://github.com/ClickHouse/ClickHouse/pull/55786) ([Azat Khuzhin](https://github.com/azat)).
* 如果 `precise&#95;float&#95;parsing` 为 true，则在将非法字符串解析为浮点数时会抛出异常 [#55861](https://github.com/ClickHouse/ClickHouse/pull/55861) ([李扬](https://github.com/taiyang-li)).
* 若 CTE 包含有状态函数，则禁用谓词下推 [#55871](https://github.com/ClickHouse/ClickHouse/pull/55871) ([Raúl Marín](https://github.com/Algunenano)).
* 修复 normalize ASTSelectWithUnionQuery，此前它会从查询中移除 `FORMAT` [#55887](https://github.com/ClickHouse/ClickHouse/pull/55887) ([flynn](https://github.com/ucasfl)).
* 尝试修复原生 ORC 输入格式中可能发生的段错误 [#55891](https://github.com/ClickHouse/ClickHouse/pull/55891) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了稀疏列场景下的窗口函数问题。[#55895](https://github.com/ClickHouse/ClickHouse/pull/55895) ([János Benjamin Antal](https://github.com/antaljanosbenjamin)).
* 修复：StorageNull 现已支持子列 [#55912](https://github.com/ClickHouse/ClickHouse/pull/55912) ([FFish](https://github.com/wxybear)).
* 不要将 Replicated mutate/merge 的可重试错误写入错误日志中 [#55944](https://github.com/ClickHouse/ClickHouse/pull/55944) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复 `SHOW DATABASES LIMIT <N>` 的问题 [#55962](https://github.com/ClickHouse/ClickHouse/pull/55962) ([Raúl Marín](https://github.com/Algunenano)) 。
* 修复自动生成的 Protobuf schema 中带下划线的字段 [#55974](https://github.com/ClickHouse/ClickHouse/pull/55974) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了 `dateTime64ToSnowflake64()` 在非默认标度下的问题 [#55983](https://github.com/ClickHouse/ClickHouse/pull/55983) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 修复 Arrow 字典列的输入/输出问题 [#55989](https://github.com/ClickHouse/ClickHouse/pull/55989) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复 AvroConfluent 中从 Schema Registry 拉取 schema 时的问题 [#55991](https://github.com/ClickHouse/ClickHouse/pull/55991) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复在 Buffer 表上并发执行 ALTER 和 INSERT 时出现的“块结构不匹配”问题 [#55995](https://github.com/ClickHouse/ClickHouse/pull/55995) ([Michael Kolupaev](https://github.com/al13n321)).
* 修复 least\_used JBOD 策略中空闲空间统计错误 [#56030](https://github.com/ClickHouse/ClickHouse/pull/56030) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复在表函数中评估子查询时缺少标量值的问题 [#56057](https://github.com/ClickHouse/ClickHouse/pull/56057) ([Amos Bird](https://github.com/amosbird)).
* 修复在 `http&#95;write&#95;exception&#95;in&#95;output&#95;format=1` 时查询结果错误的问题 [#56135](https://github.com/ClickHouse/ClickHouse/pull/56135) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复在设置变更时回退到 JSON->JSONEachRow 的 schema 缓存问题 [#56172](https://github.com/ClickHouse/ClickHouse/pull/56172) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 为 odbc-bridge 添加错误处理器 [#56185](https://github.com/ClickHouse/ClickHouse/pull/56185) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。

### <a id="239" /> ClickHouse 发布 23.9，2023-09-28。 [演示文稿](https://presentations.clickhouse.com/2023-release-23.9/), [视频](https://www.youtube.com/watch?v=yS8YU-rBpMM)

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

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

* 从默认的 Prometheus handler 中移除 `status_info` 配置选项和字典状态。[#54090](https://github.com/ClickHouse/ClickHouse/pull/54090) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* Experimental 的 parts 元数据缓存已从代码库中移除。[#54215](https://github.com/ClickHouse/ClickHouse/pull/54215) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 默认禁用设置 `input_format_json_try_infer_numbers_from_strings`，因此在 JSON formats 中默认不再尝试从字符串推断数值，以避免当样本数据中包含看起来像数字的字符串时出现解析错误。[#55099](https://github.com/ClickHouse/ClickHouse/pull/55099) ([Kruglov Pavel](https://github.com/Avogar)).

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

* 改进了 JSON formats 中的 schema 推断：1) 现在可以在 JSON formats 中通过设置 `input_format_json_try_infer_named_tuples_from_objects`，在不使用 Experimental JSON type 的情况下，从 JSON object 推断出命名元组。此前如果不使用 Experimental 类型 JSON，我们只能将 JSON object 推断为 String 或 Map，现在则可以推断为命名 Tuple。推断得到的 Tuple 类型将包含 schema 推断期间从数据样本中读取到的 object 的所有 key。这对于读取不包含稀疏 object 的结构化 JSON 数据很有帮助。该设置默认启用。2) 允许通过设置 `input_format_json_read_arrays_as_strings` 将 JSON array 解析到 String 类型的列中。这有助于读取包含不同类型值的数组。3) 允许通过设置 `input_format_json_infer_incomplete_types_as_strings`，将样本数据中类型未知的 JSON key (`null`/`[]`/`{}`) 推断为 String 类型。现在，在 JSON formats 中我们可以将任意值读入 String 列，还可以通过对未知类型使用 String 类型，避免在 schema 推断期间出现错误 `Cannot determine type for column 'column_name' by first 25000 rows of data, most likely this column contains only Nulls or empty Arrays/Maps`，从而成功读取数据。[#54427](https://github.com/ClickHouse/ClickHouse/pull/54427) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 为远程磁盘新增了 IO 调度支持。磁盘类型 `s3`、`s3_plain`、`hdfs` 和 `azure_blob_storage` 的存储配置现在可以包含 `read_resource` 和 `write_resource` 元素，用于存放资源名称。这些资源的调度策略可在单独的服务器配置部分 `resources` 中进行配置。可以使用设置 `workload` 为查询添加标记，并使用服务器配置部分 `workload_classifiers` 对其进行分类，以实现不同的资源调度目标。更多详情请参见[文档](/zh/concepts/features/configuration/server-config/workload-scheduling)。[#47009](https://github.com/ClickHouse/ClickHouse/pull/47009) ([Sergei Trifonov](https://github.com/serxa)) 。新增了 `bandwidth&#95;limit` IO 调度节点类型。它允许你对通过该节点的流量指定 `max_speed` 和 `max_burst` 约束。[#54618](https://github.com/ClickHouse/ClickHouse/pull/54618) ([Sergei Trifonov](https://github.com/serxa)) 。
* 新增了一种基于 SSH 密钥的身份验证类型。它仅适用于原生 TCP 协议。[#41109](https://github.com/ClickHouse/ClickHouse/pull/41109) ([George Gamezardashvili](https://github.com/InfJoker)) 。
* 为 MergeTree 表新增了 `_block_number` 列。[#44532](https://github.com/ClickHouse/ClickHouse/issues/44532)。[#47532](https://github.com/ClickHouse/ClickHouse/pull/47532) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)) 。
* 在 `DROP TABLE` 查询中新增 `IF EMPTY` 子句。[#48915](https://github.com/ClickHouse/ClickHouse/pull/48915) ([Pavel Novitskiy](https://github.com/pnovitskiy)) 。
* SQL 函数 `toString(datetime, timezone)` 和 `formatDateTime(datetime, format, timezone)` 现已支持使用非常量的 timezone 参数。[#53680](https://github.com/ClickHouse/ClickHouse/pull/53680) ([Yarik Briukhovetskyi](https://github.com/yariks5s)) 。
* 新增了对 `ALTER TABLE MODIFY COMMENT` 的支持。注意：很久以前曾有外部贡献者添加过类似功能，但它实际上完全无法使用，反而只会让用户困惑。此更改关闭了 [#36377](https://github.com/ClickHouse/ClickHouse/issues/36377)。[#51304](https://github.com/ClickHouse/ClickHouse/pull/51304) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。注意：此命令不会在副本之间传播，因此同一张表的不同副本可能带有不同的注释。
* 新增了 `GCD` (即 "最大公约数") 这一新的数据压缩编解码器。该编解码器会计算所有列值的 GCD，然后将每个值都除以该 GCD。GCD 编解码器属于数据预处理编解码器 (类似于 Delta 和 DoubleDelta) ，不能单独使用。它适用于整数、Decimal 以及日期/时间类型的数据。GCD 编解码器的一个典型适用场景是：列值按 GCD 的倍数变化 (增加/减少) ，例如 24 - 28 - 16 - 24 - 8 - 24 (假设 GCD = 4) 。[#53149](https://github.com/ClickHouse/ClickHouse/pull/53149) ([Alexander Nam](https://github.com/seshWCS)) 。
* 新增了两个新的类型别名：`DECIMAL(P)` (作为 `DECIMAL(P, 0)` 的简写) 和 `DECIMAL` (作为 `DECIMAL(10, 0)` 的简写) 。这让 ClickHouse 与 MySQL 的 SQL 方言更加兼容。[#53328](https://github.com/ClickHouse/ClickHouse/pull/53328) ([Val Doroshchuk](https://github.com/valbok)) 。
* 新增系统日志表 `backup_log`，用于跟踪所有 `BACKUP` 和 `RESTORE` 操作。[#53638](https://github.com/ClickHouse/ClickHouse/pull/53638) ([Victor Krasnov](https://github.com/sirvickr)) 。
* 新增格式设置 `output_format_markdown_escape_special_characters` (默认值：false) 。该设置用于控制在 `Markdown` 输出格式中，是否对 `!`、`#`、`$` 等特殊字符进行转义 (即在其前面添加反斜杠) 。[#53860](https://github.com/ClickHouse/ClickHouse/pull/53860) ([irenjj](https://github.com/irenjj)) 。
* 新增函数 `decodeHTMLComponent`。 [#54097](https://github.com/ClickHouse/ClickHouse/pull/54097) ([Bharat Nallan](https://github.com/bharatnc)).
* 在 query\_log 表中新增了 `peak_threads_usage`。[#54335](https://github.com/ClickHouse/ClickHouse/pull/54335) ([Alexey Gerasimchuck](https://github.com/Demilivor)) 。
* 为 clickhouse-client 新增 `SHOW FUNCTIONS` 支持。[#54337](https://github.com/ClickHouse/ClickHouse/pull/54337) ([Julia Kartseva](https://github.com/wat-ze-hex)) 。
* 新增函数 `toDaysSinceYearZero`，别名为 `TO_DAYS` (用于兼容 MySQL) ，该函数返回自 `0001-01-01` 起经过的天数 (采用前推公历) 。[#54479](https://github.com/ClickHouse/ClickHouse/pull/54479) ([Robert Schulze](https://github.com/rschu1ze)) 。函数 `toDaysSinceYearZero` 现已支持 `DateTime` 和 `DateTime64` 类型的参数。[#54856](https://github.com/ClickHouse/ClickHouse/pull/54856) ([Serge Klochkov](https://github.com/slvrtrn)) 。
* 新增了函数 `YYYYMMDDtoDate`、`YYYYMMDDtoDate32`、`YYYYMMDDhhmmssToDateTime` 和 `YYYYMMDDhhmmssToDateTime64`。它们可将编码为整数的日期或日期时间 (例如 20230911) 转换为原生日期或日期时间。因此，这些函数与现有函数 `YYYYMMDDToDate`、`YYYYMMDDToDateTime`、`YYYYMMDDhhmmddToDateTime`、`YYYYMMDDhhmmddToDateTime64` 的功能正好相反。[#54509](https://github.com/ClickHouse/ClickHouse/pull/54509) ([Quanfa Fu](https://github.com/dentiscalprum))   ([Robert Schulze](https://github.com/rschu1ze)) 。
* 新增了多个字符串距离函数，包括 `byteHammingDistance` 和 `editDistance`。[#54935](https://github.com/ClickHouse/ClickHouse/pull/54935) ([flynn](https://github.com/ucasfl)) 。
* 支持使用 `VALID UNTIL datetime` 子句为用户凭证指定过期日期，并可选地指定具体时间。[#51261](https://github.com/ClickHouse/ClickHouse/pull/51261) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 允许表函数 `s3`、`gcs`、`oss` 使用 S3 风格的 URL，URL 会自动转换为 HTTP。例如：`'s3://clickhouse-public-datasets/hits.csv'` 会被转换为 `'https://clickhouse-public-datasets.s3.amazonaws.com/hits.csv'`。[#54931](https://github.com/ClickHouse/ClickHouse/pull/54931) ([Yarik Briukhovetskyi](https://github.com/yariks5s)) 。
* 添加新设置 `print_pretty_type_names`，用于以 Pretty 形式打印深度嵌套类型名称，例如 Tuple/Map/Array。[#55095](https://github.com/ClickHouse/ClickHouse/pull/55095) ([Kruglov Pavel](https://github.com/Avogar)) 。

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

* 默认启用预取，加快从 S3 读取数据的速度。[#53709](https://github.com/ClickHouse/ClickHouse/pull/53709) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 如果 FINAL 查询无此需要，则不要在单独的 parts 中隐式读取 PK 和版本列。[#53919](https://github.com/ClickHouse/ClickHouse/pull/53919) ([Duc Canh Le](https://github.com/canhld94)).
* 优化按常量键进行 group by。在 [https://github.com/ClickHouse/ClickHouse/pull/53529](https://github.com/ClickHouse/ClickHouse/pull/53529) 之后，将优化按 `_file/_path` 进行 group by 的查询。[#53549](https://github.com/ClickHouse/ClickHouse/pull/53549) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 提升 `Decimal` 列的排序性能。若 ORDER BY 包含 `Decimal` 列，则提升向 `MergeTree` 插入数据时的性能。提升在数据已经排好序或接近有序时的排序性能。[#35961](https://github.com/ClickHouse/ClickHouse/pull/35961) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 提升超大查询分析的性能。修复了 [#51224](https://github.com/ClickHouse/ClickHouse/issues/51224)。[#51469](https://github.com/ClickHouse/ClickHouse/pull/51469) ([frinkr](https://github.com/frinkr)).
* 一项优化：如果是从带有 GROUP BY 的子查询中进行选择，可将 `COUNT(DISTINCT ...)` 和各种 `uniq` 变体重写为 `count`。 [#52082](https://github.com/ClickHouse/ClickHouse/pull/52082) [#52645](https://github.com/ClickHouse/ClickHouse/pull/52645) ([JackyWoo](https://github.com/JackyWoo)) 。
* 移除对 `mmap/mremap/munmap` 的手动调用，改由 `jemalloc` 统一处理这些工作——性能也会略有提升。[#52792](https://github.com/ClickHouse/ClickHouse/pull/52792) ([Nikita Taranov](https://github.com/nickitat)) 。
* 修复了使用 NATS 时 CPU 占用过高的问题。[#54399](https://github.com/ClickHouse/ClickHouse/pull/54399) ([Vasilev Pyotr](https://github.com/vahpetr)) 。
* 由于我们为带有 datetime 参数的 `toString` 执行采用了单独的指令，因此可以略微提升非 datetime 参数的性能，并使部分代码更加简洁。这是对 [#53680](https://github.com/ClickHouse/ClickHouse/issues/53680) 的后续改进。[#54443](https://github.com/ClickHouse/ClickHouse/pull/54443) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* 这个 PR 不再将 JSON 元素序列化到 `std::stringstream` 中，而是尝试直接将序列化结果写入 `ColumnString`。[#54613](https://github.com/ClickHouse/ClickHouse/pull/54613) ([lgbo](https://github.com/lgbo-ustc)) 。
* 启用 ORDER BY 优化，以便在表后存在视图时，按相应顺序从 MergeTree 表中读取数据。[#54628](https://github.com/ClickHouse/ClickHouse/pull/54628) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 通过复用 `GeneratorJSONPath` 并移除多个共享指针，优化 JSON SQL 函数。[#54735](https://github.com/ClickHouse/ClickHouse/pull/54735) ([lgbo](https://github.com/lgbo-ustc)).
* Keeper 会尝试将 flush 请求批量处理，以提升性能。[#53049](https://github.com/ClickHouse/ClickHouse/pull/53049) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 现在，`clickhouse-client` 在使用 `INFILE 'glob_expression'` 时可以并行处理文件。已关闭 [#54218](https://github.com/ClickHouse/ClickHouse/issues/54218)。[#54533](https://github.com/ClickHouse/ClickHouse/pull/54533) ([Max K.](https://github.com/mkaynov)) 。
* 允许在主键列类型与 `IN` 函数右侧列类型不一致时，对 `IN` 函数使用主键。示例：`SELECT id FROM test_table WHERE id IN (SELECT '5')`。关闭了 [#48936](https://github.com/ClickHouse/ClickHouse/issues/48936)。[#54544](https://github.com/ClickHouse/ClickHouse/pull/54544) ([Maksim Kita](https://github.com/kitaisreal)) 。
* Hash JOIN 会尝试缩减内部缓冲区，这些缓冲区会占用最大可用内存的一半 (由 `max_bytes_in_join` 设置) 。[#54584](https://github.com/ClickHouse/ClickHouse/pull/54584) ([vdimir](https://github.com/vdimir)) 。
* 使 `array join` 遵循 `max_block_size`，以避免可能发生 OOM。关闭 [#54290](https://github.com/ClickHouse/ClickHouse/issues/54290)。[#54664](https://github.com/ClickHouse/ClickHouse/pull/54664) ([李扬](https://github.com/taiyang-li)).
* 在 `s3` 表函数中复用 HTTP 连接。[#54812](https://github.com/ClickHouse/ClickHouse/pull/54812) ([Michael Kolupaev](https://github.com/al13n321)) 。
* 将 `MergeTreeRangeReader::Stream::ceilRowsToCompleteGranules` 中的线性搜索改为二分查找。[#54869](https://github.com/ClickHouse/ClickHouse/pull/54869) ([usurai](https://github.com/usurai)).

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

* 现在可以使用设置 `max_threads_for_annoy_index_creation` 并行创建 `Annoy` 索引。[#54047](https://github.com/ClickHouse/ClickHouse/pull/54047) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 在 Distributed 上的并行副本不会从所有副本读取数据。[#54199](https://github.com/ClickHouse/ClickHouse/pull/54199) ([Igor Nikonov](https://github.com/devcrafter)) 。

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

* 允许将 `MergeTree` 数据分区片段中列文件的长文件名替换为名称哈希。这有助于在某些情况下避免出现 `File name too long` 错误。[#50612](https://github.com/ClickHouse/ClickHouse/pull/50612) ([Anton Popov](https://github.com/CurtizJ)).
* 如果元数据解析失败，则将 `JSON` 格式的数据按 `JSONEachRow` 格式解析。这样一来，即使实际格式是 JSONEachRow，也能读取扩展名为 `.json` 的文件。关闭 [#45740](https://github.com/ClickHouse/ClickHouse/issues/45740)。[#54405](https://github.com/ClickHouse/ClickHouse/pull/54405) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 在 HTTP 查询执行期间发生异常时，也会输出有效的 JSON/XML。新增设置 `http_write_exception_in_output_format`，用于启用/禁用此行为 (默认启用) 。[#52853](https://github.com/ClickHouse/ClickHouse/pull/52853) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 视图 `information_schema.tables` 现新增字段 `data_length`，用于显示磁盘上数据的大致大小。运行 Amazon QuickSight 生成的查询需要该字段。[#55037](https://github.com/ClickHouse/ClickHouse/pull/55037) ([Robert Schulze](https://github.com/rschu1ze)) 。
* MySQL 接口新增了对预处理语句的基础实现，刚好足以让 Tableau Online 通过 MySQL 连接器连接到 ClickHouse。[#54115](https://github.com/ClickHouse/ClickHouse/pull/54115) ([Serge Klochkov](https://github.com/slvrtrn)) 。请注意：预处理语句的实现目前还很基础，我们尚未支持参数绑定，因为在 Tableau Online 的这个特定使用场景中并不需要。如果后续在对 Tableau Online 进行充分测试后发现问题且确有必要，我们会在后续版本中补上这一功能。
* 支持在 `regexp_tree` 字典中使用不区分大小写和 dot-all 模式进行匹配。[#50906](https://github.com/ClickHouse/ClickHouse/pull/50906) ([Johann Gan](https://github.com/johanngan)) 。
* Keeper 改进：新增 `createIfNotExists` Keeper 命令。[#48855](https://github.com/ClickHouse/ClickHouse/pull/48855) ([Konstantin Bogdanov](https://github.com/thevar1able)) 。
* 更准确的整数类型推断，修复 [#51236](https://github.com/ClickHouse/ClickHouse/issues/51236)。[#53003](https://github.com/ClickHouse/ClickHouse/pull/53003) ([Chen768959](https://github.com/Chen768959)) 。
* 为 MaterializedMySQL 新增了对字符串字面量中字符集的解析支持。[#53220](https://github.com/ClickHouse/ClickHouse/pull/53220) ([Val Doroshchuk](https://github.com/valbok)).
* 修复了 `EmbeddedRocksDB` 表引擎在一种极罕见情况下的细微问题：执行 `DROP TABLE` 后，有时 `EmbeddedRocksDB` 表引擎无法正确关闭 NFS 上的文件。[#53502](https://github.com/ClickHouse/ClickHouse/pull/53502) ([Mingliang Pan](https://github.com/liangliangpan)) 。
* `RESTORE TABLE ON CLUSTER` 必须在各主机上创建 UUID 一致的复制表。否则，ZooKeeper 路径中的宏 `{uuid}` 在 RESTORE 后将无法正常工作。此 PR 实现了这一点。[#53765](https://github.com/ClickHouse/ClickHouse/pull/53765) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 新增恢复设置 `restore_broken_parts_as_detached`：如果为 true，RESTORE 过程中在恢复时遇到损坏的 parts 不会停止，而是会将所有损坏的 parts 复制到 `detached` 文件夹中，并加上前缀 \`broken-from-backup'。如果为 false，RESTORE 过程会在遇到第一个损坏的 part 时停止 (如果有的话) 。默认值为 false。[#53877](https://github.com/ClickHouse/ClickHouse/pull/53877) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 为 HTTP 请求头 X-ClickHouse-Progress 和 X-ClickHouse-Summary 新增 `elapsed_ns` 字段。[#54179](https://github.com/ClickHouse/ClickHouse/pull/54179) ([joelynch](https://github.com/joelynch)) 。
* 为 keeper-client 新增 `reconfig` ([https://github.com/ClickHouse/ClickHouse/pull/49450](https://github.com/ClickHouse/ClickHouse/pull/49450)) 、`sync` 和 `exists` 命令的实现。[#54201](https://github.com/ClickHouse/ClickHouse/pull/54201) ([pufit](https://github.com/pufit)) 。
* `clickhouse-local` 和 `clickhouse-client` 现在支持多次指定 `--query` 参数，例如 `./clickhouse-client --query "SELECT 1" --query "SELECT 2"`。相比 `./clickhouse-client --multiquery "SELECT  1;S ELECT 2"`，这种语法略微更直观，也更便于编写脚本 (例如 `queries.push_back('--query "$q"')`) ，并且与现有参数 `--queries-file` 的行为更一致 (例如 `./clickhouse client --queries-file queries1.sql --queries-file queries2.sql`) 。[#54249](https://github.com/ClickHouse/ClickHouse/pull/54249) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 为 `formatReadableTimeDelta` 增加子秒级精度。[#54250](https://github.com/ClickHouse/ClickHouse/pull/54250) ([Andrey Zvonov](https://github.com/zvonand)) 。
* 默认开启 `allow_remove_stale_moving_parts`。 [#54260](https://github.com/ClickHouse/ClickHouse/pull/54260) ([vdimir](https://github.com/vdimir)).
* 修复使用缓存中的计数值的问题，并改进从归档文件读取时的进度条。[#54271](https://github.com/ClickHouse/ClickHouse/pull/54271) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 新增了对通过 SSO 使用 S3 credentials 的支持。要定义用于 SSO 的 profile，请设置 `AWS_PROFILE` 环境变量。[#54347](https://github.com/ClickHouse/ClickHouse/pull/54347) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 支持在输入格式中将 NULL 用作嵌套类型 Array/Tuple/Map 的默认值。关闭 [#51100](https://github.com/ClickHouse/ClickHouse/issues/51100)。[#54351](https://github.com/ClickHouse/ClickHouse/pull/54351) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 支持读取 Arrow/Parquet 格式中的某些非常规 chunk 配置。[#54370](https://github.com/ClickHouse/ClickHouse/pull/54370) ([Arthur Passos](https://github.com/arthurpassos)) 。
* 为兼容 MySQL，为 `stddevPop` 函数添加 `STD` 别名。关闭 [#54274](https://github.com/ClickHouse/ClickHouse/issues/54274)。[#54382](https://github.com/ClickHouse/ClickHouse/pull/54382) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 新增 `addDate` 函数以兼容 MySQL，并新增 `subDate` 以保持一致性。参见 [#54275](https://github.com/ClickHouse/ClickHouse/issues/54275)。[#54400](https://github.com/ClickHouse/ClickHouse/pull/54400) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 向 `system.detached_parts` 添加 `modification_time`。[#54506](https://github.com/ClickHouse/ClickHouse/pull/54506) ([Azat Khuzhin](https://github.com/azat)) 。
* 新增了一个设置 `splitby_max_substrings_includes_remaining_string`，用于控制当参数 "max\_substring" > 0 时，"splitBy\*()" 函数是否将剩余字符串 (如有) 包含在结果数组中 (即 Python/Spark 语义) 。默认行为不变。[#54518](https://github.com/ClickHouse/ClickHouse/pull/54518) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 改进了 `Int64`/`UInt64` 字段的整数类型推断。这是 [#53003](https://github.com/ClickHouse/ClickHouse/pull/53003) 的延续。现在也支持 Array 嵌套 Array 这类嵌套类型，以及 `map/tuple` 之类的函数。问题：[#51236](https://github.com/ClickHouse/ClickHouse/issues/51236)。[#54553](https://github.com/ClickHouse/ClickHouse/pull/54553) ([Kruglov Pavel](https://github.com/Avogar)).
* 新增了标量与数组之间的乘法、除法和取模运算。支持双向运算，例如 `5 * [5, 5]` 和 `[5, 5] * 5`——这两种写法都可以。[#54608](https://github.com/ClickHouse/ClickHouse/pull/54608) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* 为 `keeper-client` 中的 `rm` 命令添加可选的 `version` 参数，以便更安全地执行删除操作。[#54708](https://github.com/ClickHouse/ClickHouse/pull/54708) ([János Benjamin Antal](https://github.com/antaljanosbenjamin)).
* 禁用 systemd 终止服务器 (使用 Buffer tables 时，这可能会导致数据丢失) 。[#54744](https://github.com/ClickHouse/ClickHouse/pull/54744) ([Azat Khuzhin](https://github.com/azat)) 。
* 向系统表 `system.functions` 中新增字段 `is_deterministic`，用于指示某个函数在两次调用之间 (在输入完全相同的情况下) 其结果是否保持不变。 [#54766](https://github.com/ClickHouse/ClickHouse/pull/54766) [#55035](https://github.com/ClickHouse/ClickHouse/pull/55035) ([Robert Schulze](https://github.com/rschu1ze)).
* 使 schema `information_schema` 中的视图与 MySQL 中对应的视图更加兼容 (即对其进行了修改和扩展) ，从而使 Tableau Online 能够连接到 ClickHouse。更具体地说：1. 字段 `information_schema.tables.table_type` 的类型已从 Enum8 更改为 String。2. 向视图 `information_schema.table` 添加了字段 `table_comment` 和 `table_collation`。3. 添加了视图 `information_schema.key_column_usage` 和 `referential_constraints`。4. 将 `information_schema` 视图中的大写别名替换为实际的大写列。[#54773](https://github.com/ClickHouse/ClickHouse/pull/54773) ([Serge Klochkov](https://github.com/slvrtrn)) 。
* 现在，如果你尝试缓存包含 `now`、`randomString` 和 `dictGet` 等非确定性函数的查询结果，query cache 会返回错误。与之前的行为 (静默地不缓存结果) 相比，这样可以减少困惑和意外。 [#54801](https://github.com/ClickHouse/ClickHouse/pull/54801) ([Robert Schulze](https://github.com/rschu1ze)).
* 禁止在 `file`/`s3`/`url`/... 存储中使用物化列/临时列/别名列，修复从文件向临时列插入数据的问题。关闭了 [#53477](https://github.com/ClickHouse/ClickHouse/issues/53477)。[#54803](https://github.com/ClickHouse/ClickHouse/pull/54803) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 备份元数据收集提供了更多可配置选项。[#54804](https://github.com/ClickHouse/ClickHouse/pull/54804) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* `clickhouse-local`'的日志文件 (如果通过 --server\_logs\_file 标志启用) 现在会像 `clickhouse-server` 一样，在每行前加上时间戳、线程 ID 等信息。[#54807](https://github.com/ClickHouse/ClickHouse/pull/54807) ([Michael Kolupaev](https://github.com/al13n321)) 。
* `system.merge_tree_settings` 表中的字段 `is_obsolete`——对于已废弃的 MergeTree 设置，该字段的值现为 1。此前，只有在描述中才会表明该设置已废弃。[#54837](https://github.com/ClickHouse/ClickHouse/pull/54837) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 支持在使用时间间隔字面量时使用复数形式。`INTERVAL 2 HOURS` 应等同于 `INTERVAL 2 HOUR`。[#54860](https://github.com/ClickHouse/ClickHouse/pull/54860) ([Jordi Villar](https://github.com/jrdi)) 。
* 始终允许创建主键为 `Nullable` 的投影。这修复了 [#54814](https://github.com/ClickHouse/ClickHouse/issues/54814)。[#54895](https://github.com/ClickHouse/ClickHouse/pull/54895) ([Amos Bird](https://github.com/amosbird)) 。
* 在连接重置导致失败后，重试备份的 S3 操作。[#54900](https://github.com/ClickHouse/ClickHouse/pull/54900) ([Vitaly Baranov](https://github.com/vitlibar)).
* 当某项设置的最大值小于最小值时，使异常消息更准确。[#54925](https://github.com/ClickHouse/ClickHouse/pull/54925) ([János Benjamin Antal](https://github.com/antaljanosbenjamin)) 。
* `LIKE`、`match` 和其他正则表达式匹配函数现在支持通过回退到二进制匹配来匹配包含非 UTF-8 子字符串的模式。示例：你可以使用 `string LIKE '\xFE\xFF%'` 来检测 BOM。这修复了 [#54486](https://github.com/ClickHouse/ClickHouse/issues/54486)。[#54942](https://github.com/ClickHouse/ClickHouse/pull/54942) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 新增了 `ContextLockWaitMicroseconds` profile 事件。[#55029](https://github.com/ClickHouse/ClickHouse/pull/55029) ([Maksim Kita](https://github.com/kitaisreal)) 。
* Keeper 可动态调整日志级别。[#50372](https://github.com/ClickHouse/ClickHouse/pull/50372) ([helifu](https://github.com/helifu)) 。
* 新增了函数 `timestamp`，以兼容 MySQL。已关闭 [#54275](https://github.com/ClickHouse/ClickHouse/issues/54275)。[#54639](https://github.com/ClickHouse/ClickHouse/pull/54639) ([Nikolay Degterinsky](https://github.com/evillique)) 。

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

* 将 ClickHouse 官方构建和持续集成构建所使用的编译器从 Clang 16 升级到 17。[#53831](https://github.com/ClickHouse/ClickHouse/pull/53831) ([Robert Schulze](https://github.com/rschu1ze)).
* 重新生成了用于 lookup 的 tld 数据 (`tldLookup.generated.cpp`) 。[#54269](https://github.com/ClickHouse/ClickHouse/pull/54269) ([Bharat Nallan](https://github.com/bharatnc)).
* 删除了多余的 `clickhouse-keeper-client` 符号链接。[#54587](https://github.com/ClickHouse/ClickHouse/pull/54587) ([Tomas Barton](https://github.com/deric)).
* 使用 `/usr/bin/env` 来解析 bash，现在已支持 Nix OS。[#54603](https://github.com/ClickHouse/ClickHouse/pull/54603) ([Fionera](https://github.com/fionera)).
* CMake 新增了执行 `perf record` 所需的 `PROFILE_CPU` 选项，无需使用 DWARF 调用图。[#54917](https://github.com/ClickHouse/ClickHouse/pull/54917) ([Maksim Kita](https://github.com/kitaisreal)).
* 如果链接器不是 LLD，则直接报致命错误并停止。[#55036](https://github.com/ClickHouse/ClickHouse/pull/55036) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 将用于处理 (编码/解码) base64 值的库从 Turbo-Base64 替换为 aklomp-base64。两者在 x86 和 ARM 上都支持 SIMD 加速，但作出这一更改主要有四个原因：1. 后者的许可证 (BSD-2) 对 ClickHouse 更有利，而 Turbo64 此前已切换到 GPL-3；2. aklomp-base64 在 GitHub 上的 star 更多，看起来更具长期可持续性；3. aklomp-base64 的 API 稍好一些 (当然，这一点多少有些主观) ；4. aklomp-base64 不需要我们通过各种变通手段绕过 bug (例如非线程安全的初始化) 。注意：aklomp-base64 会拒绝未填充的 base64 值，而 Turbo-Base64 会尽力对其进行解码。RFC-4648 并未明确规定填充是否是强制要求，但视具体上下文而定，这可能会带来需要注意的行为变化。[#54119](https://github.com/ClickHouse/ClickHouse/pull/54119) ([Mikhail Koviazin](https://github.com/mkmkme)).

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

* 修复在使用 zero-copy 复制时 REPLACE/MOVE PARTITION 的问题 (注意："zero-copy 复制"是一项 Experimental 功能) [#54193](https://github.com/ClickHouse/ClickHouse/pull/54193) ([Alexander Tokmakov](https://github.com/tavplubix)) 。
* 修复使用硬链接时的零拷贝锁问题 (注意：“zero-copy replication”是一项 Experimental 功能) [#54859](https://github.com/ClickHouse/ClickHouse/pull/54859) ([Alexander Tokmakov](https://github.com/tavplubix)) 。
* 修复 zero copy 垃圾问题 (注意："zero-copy replication" 是一项 Experimental 功能) [#54550](https://github.com/ClickHouse/ClickHouse/pull/54550) ([Alexander Tokmakov](https://github.com/tavplubix)) 。
* 将 HTTP 重试超时按毫秒传递 (此前有误) 。[#54438](https://github.com/ClickHouse/ClickHouse/pull/54438) ([Duc Canh Le](https://github.com/canhld94)).
* 修复了 OUTFILE 中 `CapnProto`/`Protobuf` 的误导性错误信息 [#52870](https://github.com/ClickHouse/ClickHouse/pull/52870) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复在使用并行副本和 LIMIT 时的汇总报告错误 [#53050](https://github.com/ClickHouse/ClickHouse/pull/53050) ([Raúl Marín](https://github.com/Algunenano)).
* 修复从/向 S3 执行 BACKUP 时的限流问题 (在未使用原生复制时) ，以及其他一些位置的同类问题 [#53336](https://github.com/ClickHouse/ClickHouse/pull/53336) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复复制整个目录时的 IO 限流问题 [#53338](https://github.com/ClickHouse/ClickHouse/pull/53338) ([Azat Khuzhin](https://github.com/azat)).
* 修复：移至 prewhere 条件的操作时可能会丢失列 [#53492](https://github.com/ClickHouse/ClickHouse/pull/53492) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* 修复了用字节级相同的 parts 替换时出现的内部错误 [#53735](https://github.com/ClickHouse/ClickHouse/pull/53735) ([Pedro Riera](https://github.com/priera)).
* 修复：要求参与 `interpolate` 表达式的项必须为列 [#53754](https://github.com/ClickHouse/ClickHouse/pull/53754) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* 修复 cluster discovery 初始化问题 + 在配置中设置故障注入点 [#54113](https://github.com/ClickHouse/ClickHouse/pull/54113) ([vdimir](https://github.com/vdimir)).
* 修复 `accurateCastOrNull` 的问题 [#54136](https://github.com/ClickHouse/ClickHouse/pull/54136) ([Salvatore Mesoraca](https://github.com/aiven-sal)) 。
* 修复 Nullable 主键在使用 FINAL 修饰符时的问题 [#54164](https://github.com/ClickHouse/ClickHouse/pull/54164) ([Amos Bird](https://github.com/amosbird)).
* 修复了一个错误：在存在重复数据的情况下，该错误会阻止向 replicated materialized view 插入新数据。[#54184](https://github.com/ClickHouse/ClickHouse/pull/54184) ([Pedro Riera](https://github.com/priera)).
* 修复：允许布隆过滤器支持 `IPv6` [#54200](https://github.com/ClickHouse/ClickHouse/pull/54200) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* 修复可能出现的 `IPv4` 类型不匹配问题 [#54212](https://github.com/ClickHouse/ClickHouse/pull/54212) ([Bharat Nallan](https://github.com/bharatnc)).
* 修复重建后索引的 `system.data_skipping_indices` 问题 [#54225](https://github.com/ClickHouse/ClickHouse/pull/54225) ([Artur Malchanau](https://github.com/Hexta)) 。
* 修复 multiple join rewriter v2 的命名冲突 [#54240](https://github.com/ClickHouse/ClickHouse/pull/54240) ([Tao Wang](https://github.com/wangtZJU)).
* 修复 join 后 `system.errors` 中出现的异常错误 [#54306](https://github.com/ClickHouse/ClickHouse/pull/54306) ([vdimir](https://github.com/vdimir)).
* 修复 `isZeroOrNull(NULL)` 的问题 [#54316](https://github.com/ClickHouse/ClickHouse/pull/54316) ([flynn](https://github.com/ucasfl)).
* 修复：在 `prefer_localhost_replica` = 1 时，Distributed 表上的并行副本问题 [#54334](https://github.com/ClickHouse/ClickHouse/pull/54334) ([Igor Nikonov](https://github.com/devcrafter)).
* 修复 vertical merge、replacing merge tree 和 optimize cleanup 中的逻辑错误 [#54368](https://github.com/ClickHouse/ClickHouse/pull/54368) ([alesapin](https://github.com/alesapin)) 。
* 修复 `s3` 表函数中可能出现的 `URI contains invalid characters` 错误 [#54373](https://github.com/ClickHouse/ClickHouse/pull/54373) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复 `arrayExists` 函数在 AST 优化中的段错误 [#54379](https://github.com/ClickHouse/ClickHouse/pull/54379) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 在 `analysisOfVariance` 函数中执行加法前检查溢出 [#54385](https://github.com/ClickHouse/ClickHouse/pull/54385) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 复现并修复 removeSharedRecursive 中的缺陷 [#54430](https://github.com/ClickHouse/ClickHouse/pull/54430) ([Sema Checherinda](https://github.com/CheSema)) 。
* 修复了在 PREWHERE 和 FINAL 中使用 SimpleAggregateFunction 时可能产生错误结果的问题 [#54436](https://github.com/ClickHouse/ClickHouse/pull/54436) ([Azat Khuzhin](https://github.com/azat)).
* 修复在非 analyzer 情况下使用 indexHint 过滤 parts 的问题 [#54449](https://github.com/ClickHouse/ClickHouse/pull/54449) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复带有归一化状态的聚合投影问题 [#54480](https://github.com/ClickHouse/ClickHouse/pull/54480) ([Amos Bird](https://github.com/amosbird)) 。
* `clickhouse-local`：与多查询参数相关的一项改动 [#54498](https://github.com/ClickHouse/ClickHouse/pull/54498) ([CuiShuoGuo](https://github.com/bakam412)) 。
* `clickhouse-local` 支持 `--database` 命令行参数 [#54503](https://github.com/ClickHouse/ClickHouse/pull/54503) ([vdimir](https://github.com/vdimir)) 。
* 修复了在禁用 `input_format_with_names_use_header` 时，`-WithNames` 格式中可能出现的解析错误 [#54513](https://github.com/ClickHouse/ClickHouse/pull/54513) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复极少数情况下出现的 CHECKSUM\_DOESNT\_MATCH 错误 [#54549](https://github.com/ClickHouse/ClickHouse/pull/54549) ([alesapin](https://github.com/alesapin)).
* 修复对已排序结果执行 UNION ALL 后排序异常的问题 [#54564](https://github.com/ClickHouse/ClickHouse/pull/54564) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复 Keeper 中的快照安装问题 [#54572](https://github.com/ClickHouse/ClickHouse/pull/54572) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 修复 `ColumnUnique` 中的竞争条件问题 [#54575](https://github.com/ClickHouse/ClickHouse/pull/54575) ([Nikita Taranov](https://github.com/nickitat)) 。
* Annoy/Usearch 索引：修复在使用默认值构建时出现的 LOGICAL\_ERROR [#54600](https://github.com/ClickHouse/ClickHouse/pull/54600) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 修复 `ColumnDecimal` 的序列化问题 [#54601](https://github.com/ClickHouse/ClickHouse/pull/54601) ([Nikita Taranov](https://github.com/nickitat)).
* 修复 \*Cluster 函数在处理带空格的列名时的 schema inference 问题 [#54635](https://github.com/ClickHouse/ClickHouse/pull/54635) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了在存在默认值和显式插入列时，使用插入表的结构的问题 [#54655](https://github.com/ClickHouse/ClickHouse/pull/54655) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复：避免将可能包含交替项的正则匹配用作键条件。[#54696](https://github.com/ClickHouse/ClickHouse/pull/54696) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* 修复 ReplacingMergeTree 在垂直合并和清理方面的问题 [#54706](https://github.com/ClickHouse/ClickHouse/pull/54706) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)) 。
* 修复了虚拟列在 ORDER BY 后值不正确的问题 [#54811](https://github.com/ClickHouse/ClickHouse/pull/54811) ([Michael Kolupaev](https://github.com/al13n321)) 。
* 修复了在非 analyzer 情况下使用 indexHint 过滤 parts 的问题 [#54825](https://github.com/ClickHouse/ClickHouse/pull/54825) [#54449](https://github.com/ClickHouse/ClickHouse/pull/54449) ([Azat Khuzhin](https://github.com/azat)).
* 修复 Keeper 在关闭过程中发生段错误的问题 [#54841](https://github.com/ClickHouse/ClickHouse/pull/54841) ([Antonio Andelic](https://github.com/antonio2368)).
* 修复了 MaterializedPostgreSQL 中的 `Invalid number of rows in Chunk` 问题 [#54844](https://github.com/ClickHouse/ClickHouse/pull/54844) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 将已废弃的格式设置移至独立章节 [#54855](https://github.com/ClickHouse/ClickHouse/pull/54855) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 分区键被修改时，重新构建 `minmax_count_projection` [#54943](https://github.com/ClickHouse/ClickHouse/pull/54943) ([Amos Bird](https://github.com/amosbird)).
* 修复函数 `if` 中错误地转换为 `ColumnVector<Int128>` 的问题 [#55019](https://github.com/ClickHouse/ClickHouse/pull/55019) ([Kruglov Pavel](https://github.com/Avogar)).
* 防止附加来自具有不同 projections 或索引的表的 parts [#55062](https://github.com/ClickHouse/ClickHouse/pull/55062) ([János Benjamin Antal](https://github.com/antaljanosbenjamin)).
* 对于空的子查询结果，在标量结果映射中存储 NULL [#52240](https://github.com/ClickHouse/ClickHouse/pull/52240) ([vdimir](https://github.com/vdimir)).
* 修复了 `FINAL` 在极少数情况下会生成无效读取范围的问题 [#54934](https://github.com/ClickHouse/ClickHouse/pull/54934) ([Nikita Taranov](https://github.com/nickitat)) 。
* 修复：无 Keeper 重试时的 insert quorum 问题 [#55026](https://github.com/ClickHouse/ClickHouse/pull/55026) ([Igor Nikonov](https://github.com/devcrafter)).
* 修复带 Nullable 的 simple state 问题 [#55030](https://github.com/ClickHouse/ClickHouse/pull/55030) ([Pedro Riera](https://github.com/priera)).

### <a id="238" /> ClickHouse 发布 23.8 LTS，2023-08-31。 [演示文稿](https://presentations.clickhouse.com/2023-release-23.8/), [视频](https://www.youtube.com/watch?v=d1_pyoWcydk)

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

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

* 如果动态磁盘带有名称，则应在磁盘函数参数中将其指定为 `disk = disk(name = 'disk_name'`, ...)。在之前的版本中，也可以指定为 `disk = disk_<disk_name>(...)`，但现已不再支持。[#52820](https://github.com/ClickHouse/ClickHouse/pull/52820) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 当以大于 1 的 `--concurrency` 调用 `clickhouse-benchmark` 时，它会并行建立连接。此前，如果从欧洲到美国运行 1000 个并发连接，它几乎无法使用。现在可正确计算高延迟连接的 QPS。向后不兼容的更改：`clickhouse-benchmark` 的 JSON 输出选项已被移除。如果你此前使用过该选项，也可以作为变通方案，从 `system.query_log` 中提取 JSON 格式的数据。[#53293](https://github.com/ClickHouse/ClickHouse/pull/53293) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 已从 `system.text_log` 中移除 `microseconds` 列，并从 `system.metric_log` 中移除 `milliseconds` 列，因为在有 `event_time_microseconds` 列的情况下，它们是冗余的。[#53601](https://github.com/ClickHouse/ClickHouse/pull/53601) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 弃用元数据缓存功能。它仍处于 Experimental 状态，而且我们从未使用过它。该功能存在风险：[#51182](https://github.com/ClickHouse/ClickHouse/issues/51182)。移除 `system.merge_tree_metadata_cache` 系统表。元数据缓存在此版本中仍然可用，但很快就会被移除。此更改关闭了 [#39197](https://github.com/ClickHouse/ClickHouse/issues/39197)。[#51303](https://github.com/ClickHouse/ClickHouse/pull/51303) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 禁用 TLS 连接对 3DES 的支持。[#52893](https://github.com/ClickHouse/ClickHouse/pull/52893) ([Kenji Noguchi](https://github.com/knoguchi)).

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

* 支持直接从 zip/7z/tar 压缩包导入。示例：`file('*.zip :: *.csv')`。[#50321](https://github.com/ClickHouse/ClickHouse/pull/50321) ([nikitakeba](https://github.com/nikitakeba)).
* 向 `system.trace_log` 添加 `ptr` 列，用于 `trace_type = 'MemorySample'`。此列包含分配的地址。新增函数 `flameGraph`，可构建包含已分配但未释放内存的 flamegraph。对 [#38391](https://github.com/ClickHouse/ClickHouse/issues/38391) 的重做。[#45322](https://github.com/ClickHouse/ClickHouse/pull/45322) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 新增了表函数 `azureBlobStorageCluster`。其支持的功能与表函数 `s3Cluster` 非常相似。[#50795](https://github.com/ClickHouse/ClickHouse/pull/50795) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)).
* 在议题 [#50808](https://github.com/ClickHouse/ClickHouse/issues/50808) 中，允许在不指定表名的情况下使用 `cluster`、`clusterAllReplicas`、`remote` 和 `remoteSecure`。[#50848](https://github.com/ClickHouse/ClickHouse/pull/50848) ([Yangkuan Liu](https://github.com/LiuYangkuan)) 。
* 用于监控 Kafka 消费者的系统表。[#50999](https://github.com/ClickHouse/ClickHouse/pull/50999) ([Ilya Golshtein](https://github.com/ilejn)) 。
* 新增了 `max_sessions_for_user` 设置。[#51724](https://github.com/ClickHouse/ClickHouse/pull/51724) ([Alexey Gerasimchuck](https://github.com/Demilivor)) 。
* 新增函数 `toUTCTimestamp/fromUTCTimestamp`，其行为与 Spark 的 `to_utc_timestamp/from_utc_timestamp` 相同。[#52117](https://github.com/ClickHouse/ClickHouse/pull/52117) ([KevinyhZou](https://github.com/KevinyhZou)) 。
* 新增函数 `structureToCapnProtoSchema`/`structureToProtobufSchema`，用于将 ClickHouse 表结构转换为 CapnProto/Protobuf 格式的 schema。支持在不使用外部格式 schema 的情况下，基于表结构自动生成的 schema 以 CapnProto/Protobuf 格式输入/输出数据 (由设置 `format_capn_proto_use_autogenerated_schema`/`format_protobuf_use_autogenerated_schema` 控制) 。还支持在输入/输出时通过设置 `output_format_schema` 导出自动生成的 schema。[#52278](https://github.com/ClickHouse/ClickHouse/pull/52278) ([Kruglov Pavel](https://github.com/Avogar)) 。
* `system.query_log` 中新增了字段 `query_cache_usage`，用于显示是否使用了查询缓存，以及具体是如何使用的。[#52384](https://github.com/ClickHouse/ClickHouse/pull/52384) ([Robert Schulze](https://github.com/rschu1ze)).
* 新增 `startsWithUTF8` 和 `endsWithUTF8` 函数。[#52555](https://github.com/ClickHouse/ClickHouse/pull/52555) ([李扬](https://github.com/taiyang-li)) 。
* 允许 TSV/CustomSeparated/JSONCompactEachRow 中的列数可变，并使 schema 推断支持可变列数。新增设置 `input_format_tsv_allow_variable_number_of_columns`、`input_format_custom_allow_variable_number_of_columns`、`input_format_json_compact_allow_variable_number_of_columns`。[#52692](https://github.com/ClickHouse/ClickHouse/pull/52692) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 新增了 `SYSTEM STOP/START PULLING REPLICATION LOG` 查询 (用于测试 `ReplicatedMergeTree`) 。[#52881](https://github.com/ClickHouse/ClickHouse/pull/52881) ([Alexander Tokmakov](https://github.com/tavplubix)) 。
* 允许在发起端的变更中执行常量非确定性函数。[#53129](https://github.com/ClickHouse/ClickHouse/pull/53129) ([Anton Popov](https://github.com/CurtizJ)) 。
* 新增输入格式 `One`：该格式不读取任何数据，并始终返回一行，包含一个名为 `dummy`、类型为 `UInt8`、值为 `0` 的列，类似于 `system.one`。它可与 `_file/_path` 虚拟列配合使用，在不读取任何数据的情况下列出 file/s3/url/hdfs/etc 表函数中的文件。[#53209](https://github.com/ClickHouse/ClickHouse/pull/53209) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 新增 `tupleConcat` 函数。解决了 [#52759](https://github.com/ClickHouse/ClickHouse/issues/52759)。[#53239](https://github.com/ClickHouse/ClickHouse/pull/53239) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 支持 `TRUNCATE DATABASE` 操作。[#53261](https://github.com/ClickHouse/ClickHouse/pull/53261) ([Bharat Nallan](https://github.com/bharatnc)) 。
* 新增 `max_threads_for_indexes` 设置，用于限制主键处理使用的线程数。[#53313](https://github.com/ClickHouse/ClickHouse/pull/53313) ([jorisgio](https://github.com/jorisgio)).
* 重新加入 SipHash 带密钥函数。[#53525](https://github.com/ClickHouse/ClickHouse/pull/53525) ([Salvatore Mesoraca](https://github.com/aiven-sal)) 。
* ([#52755](https://github.com/ClickHouse/ClickHouse/issues/52755), [#52895](https://github.com/ClickHouse/ClickHouse/issues/52895)) 新增函数 `arrayRotateLeft`、`arrayRotateRight`、`arrayShiftLeft` 和 `arrayShiftRight`。[#53557](https://github.com/ClickHouse/ClickHouse/pull/53557) ([Mikhail Koviazin](https://github.com/mkmkme)) 。
* 向 `system.clusters` 添加列 `name`，作为 `cluster` 的别名。[#53605](https://github.com/ClickHouse/ClickHouse/pull/53605) ([irenjj](https://github.com/irenjj)) 。
* 高级仪表板现已支持批量编辑 (保存/加载) 。[#53608](https://github.com/ClickHouse/ClickHouse/pull/53608) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 高级仪表板现已支持将图表最大化并自由移动。[#53622](https://github.com/ClickHouse/ClickHouse/pull/53622) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 新增了对数组加减法的支持：`[5,2] + [1,7]`。由于按元素乘法与参数的标量积之间容易混淆，因此未实现除法和乘法。关闭 [#49939](https://github.com/ClickHouse/ClickHouse/issues/49939)。[#52625](https://github.com/ClickHouse/ClickHouse/pull/52625) ([Yarik Briukhovetskyi](https://github.com/yariks5s)) 。
* 新增了对使用字符串字面量作为表名的支持。已关闭 [#52178](https://github.com/ClickHouse/ClickHouse/issues/52178)。[#52635](https://github.com/ClickHouse/ClickHouse/pull/52635) ([hendrik-m](https://github.com/hendrik-m)) 。

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

* 新增表引擎 `S3Queue`，用于从 S3 流式导入数据。关闭了 [#37012](https://github.com/ClickHouse/ClickHouse/issues/37012)。[#49086](https://github.com/ClickHouse/ClickHouse/pull/49086) ([s-kat](https://github.com/s-kat)) 。该功能尚未可用。请勿使用。
* 启用通过分布式表从副本并行读取。与 [#49708](https://github.com/ClickHouse/ClickHouse/issues/49708) 相关。[#53005](https://github.com/ClickHouse/ClickHouse/pull/53005) ([Igor Nikonov](https://github.com/devcrafter)) 。
* 新增对将 HNSW 用作近似邻居搜索方法的实验性支持。[#53447](https://github.com/ClickHouse/ClickHouse/pull/53447) ([Davit Vardanyan](https://github.com/davvard)) 。目前仅供继续进行该实现工作的人员使用。请勿使用。

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

* Parquet 过滤器下推。即，读取 Parquet 文件时，会根据 WHERE 条件以及各列的最小/最大值跳过行组 (文件块) 。特别是，如果文件大致按某一列排序，那么按该列某个较小范围进行过滤的查询会快得多。[#52951](https://github.com/ClickHouse/ClickHouse/pull/52951) ([Michael Kolupaev](https://github.com/al13n321)).
* 通过在 Parquet 中将较小的行组按批次合并读取来优化读取性能。关闭了 [#53069](https://github.com/ClickHouse/ClickHouse/issues/53069)。[#53281](https://github.com/ClickHouse/ClickHouse/pull/53281) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 优化大多数输入格式下从文件执行 count 的性能。关闭 [#44334](https://github.com/ClickHouse/ClickHouse/issues/44334)。[#53637](https://github.com/ClickHouse/ClickHouse/pull/53637) ([Kruglov Pavel](https://github.com/Avogar))。
* 在 `url`/`file`/`hdfs` 表函数中，支持在读取前按文件/路径进行过滤。[#53529](https://github.com/ClickHouse/ClickHouse/pull/53529) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 为 AArch64、PowerPC、SystemZ 和 RISC-V 启用 JIT 编译。[#38217](https://github.com/ClickHouse/ClickHouse/pull/38217) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 新增设置 `rewrite_count_distinct_if_with_count_distinct_implementation`，用于将 `countDistinctIf` 改写为使用 `count_distinct_implementation`。关闭 [#30642](https://github.com/ClickHouse/ClickHouse/issues/30642)。[#46051](https://github.com/ClickHouse/ClickHouse/pull/46051) ([flynn](https://github.com/ucasfl)) 。
* 通过在合并前并行执行转换，加快 `uniq` 和 `uniqExact` 聚合函数状态的合并。[#50748](https://github.com/ClickHouse/ClickHouse/pull/50748) ([Jiebin Sun](https://github.com/jiebinn)) 。
* 针对大量变长键场景，优化 Nullable String 键的聚合性能。[#51399](https://github.com/ClickHouse/ClickHouse/pull/51399) ([LiuNeng](https://github.com/liuneng1994)) 。
* 在 Analyzer 中新增了一个基于原像的时间过滤器优化 pass。SSB 在 ICX 设备 (Intel Xeon Platinum 8380 CPU，80 核，160 线程) 上的性能实验表明，启用 Experimental analyzer 后，这一变更可将几何平均 QPS 提升 8.5%。[#52091](https://github.com/ClickHouse/ClickHouse/pull/52091) ([Zhiguo Zhou](https://github.com/ZhiguoZh)) 。
* 如果 `uniqExact` (COUNT DISTINCT) 函数中的所有哈希集均为单层结构，则可优化合并过程。[#52973](https://github.com/ClickHouse/ClickHouse/pull/52973) ([Jiebin Sun](https://github.com/jiebinn)) 。
* `Join` 表引擎：不再克隆包含所有列的哈希连接数据结构。[#53046](https://github.com/ClickHouse/ClickHouse/pull/53046) ([Duc Canh Le](https://github.com/canhld94)).
* 实现原生 `ORC` 输入格式，无需使用 "apache arrow" 库即可提升性能。[#53324](https://github.com/ClickHouse/ClickHouse/pull/53324) ([李扬](https://github.com/taiyang-li)) 。
* 该仪表板会通知服务器压缩数据，这对于在慢速网络连接下查看较大时间范围的数据很有帮助。例如，一个包含 86400 个点的图表未压缩时可能有 1.5 MB，而使用 `br` 压缩后只有 60 KB。[#53569](https://github.com/ClickHouse/ClickHouse/pull/53569) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 进一步提高 BACKUP 和 RESTORE 对线程池的利用率。[#53649](https://github.com/ClickHouse/ClickHouse/pull/53649) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 启动时并行加载文件系统缓存元数据。可通过缓存配置中的 `load_metadata_threads` 设置项进行配置 (默认值：1) 。相关内容见 [#52037](https://github.com/ClickHouse/ClickHouse/issues/52037)。[#52943](https://github.com/ClickHouse/ClickHouse/pull/52943) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 优化 `move_primary_key_columns_to_end_of_prewhere`。[#53337](https://github.com/ClickHouse/ClickHouse/pull/53337) ([Han Fei](https://github.com/hanfei1991)) 。
* 这项优化改进了与 ClickHouse Keeper 的交互。此前，调用方可以多次注册同一个 watch 回调。在这种情况下，每个条目都会占用内存，而且同一个回调也会被重复调用多次，这并没有太大意义。为避免这种情况，调用方原本需要自行编写一些逻辑，避免重复添加相同的 watch。此次变更后，如果 watch 回调通过 shared\_ptr 传递，这种去重会在内部自动完成。 [#53452](https://github.com/ClickHouse/ClickHouse/pull/53452) ([Alexander Gololobov](https://github.com/davenger)).
* 在 file/s3/url/hdfs/azure 函数中，为 count 操作缓存文件中的行数。可通过设置 `use_cache_for_count_from_files` 启用或禁用该缓存 (默认启用) 。这是对 [https://github.com/ClickHouse/ClickHouse/pull/53637](https://github.com/ClickHouse/ClickHouse/pull/53637) 的延续。[#53692](https://github.com/ClickHouse/ClickHouse/pull/53692) ([Kruglov Pavel](https://github.com/Avogar)).
* 更精细的线程管理可使 S3 表函数在处理大量文件时的速度提升超过约 25%。[#53668](https://github.com/ClickHouse/ClickHouse/pull/53668) ([pufit](https://github.com/pufit)) 。

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

* 添加 `stderr_reaction` 配置/设置，用于控制当外部命令的 stderr 中有数据时如何处理 (none、log 或 throw) 。这有助于简化对外部命令的调试。[#43210](https://github.com/ClickHouse/ClickHouse/pull/43210) ([Amos Bird](https://github.com/amosbird)) 。
* 向 `system part_log` 和 merge 表中添加 `partition` 列。[#48990](https://github.com/ClickHouse/ClickHouse/pull/48990) ([Jianfei Hu](https://github.com/incfly)) 。
* (索引) 未压缩缓存/标记缓存、mmap 缓存和查询缓存的大小现在都可以在运行时动态配置 (无需重启服务器) 。[#51446](https://github.com/ClickHouse/ClickHouse/pull/51446) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 如果字典是使用复杂键创建的，则会自动选择 "complex key" 布局变体。[#49587](https://github.com/ClickHouse/ClickHouse/pull/49587) ([xiebin](https://github.com/xbthink)) 。
* 新增设置 `use_concurrency_control`，便于更好地测试新的并发控制功能。[#49618](https://github.com/ClickHouse/ClickHouse/pull/49618) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 为拼写错误的数据库和表名增加了建议提示。[#49801](https://github.com/ClickHouse/ClickHouse/pull/49801) ([Yarik Briukhovetskyi](https://github.com/yariks5s)) 。
* 在 Gluten 从 HDFS 读取小文件时，我们发现与 Spark 直接查询相比，耗时更长。对此我们做了一些改进。[#50063](https://github.com/ClickHouse/ClickHouse/pull/50063) ([KevinyhZou](https://github.com/KevinyhZou)).
* 会话过期后出现了太多无意义的错误日志，这不是我们想看到的。[#50171](https://github.com/ClickHouse/ClickHouse/pull/50171) ([helifu](https://github.com/helifu)).
* 引入了有时限的 ZooKeeper 回退会话。修复了 system.zookeeper\_connection 中针对 DNS 地址的 `index` 列。[#50424](https://github.com/ClickHouse/ClickHouse/pull/50424) ([Anton Kozlov](https://github.com/tonickkozlov)) 。
* 新增了在达到 max\_partitions\_per\_insert\_block 时记录日志的能力。[#50948](https://github.com/ClickHouse/ClickHouse/pull/50948) ([Sean Haynes](https://github.com/seandhaynes)).
* 为 clickhouse-keeper-client 新增了一批自定义命令 (主要是为了让 ClickHouse 调试更方便) 。[#51117](https://github.com/ClickHouse/ClickHouse/pull/51117) ([pufit](https://github.com/pufit)) 。
* 更新了 `azureBlobStorage` 表函数中对 connection string 的检查，因为包含 "sas" 的 connection string 并不总是以默认端点开头；同时在将 Azure 的容器添加到 URL 后，也更新了连接 URL，使其包含 "sas" 标记。[#51141](https://github.com/ClickHouse/ClickHouse/pull/51141) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)).
* 修正了 `full_sorting_merge` JOIN 算法中过滤集合的描述。[#51329](https://github.com/ClickHouse/ClickHouse/pull/51329) ([Tanay Tummalapalli](https://github.com/ttanay)) 。
* 修复了 `max_block_size` 很大时 `Aggregator` 的内存占用问题。[#51566](https://github.com/ClickHouse/ClickHouse/pull/51566) ([Nikita Taranov](https://github.com/nickitat)) 。
* 新增 `SYSTEM SYNC FILESYSTEM CACHE` 命令。该命令会将文件系统缓存的内存状态与磁盘上的实际内容进行比较，并在需要时修正内存状态。只有在你手动修改磁盘数据时才需要这样做，但强烈不建议这么做。[#51622](https://github.com/ClickHouse/ClickHouse/pull/51622) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 尝试为 CH 创建一个通用的代理解析器，同时保持与现有 S3 存储配置代理解析器的向后兼容性。[#51749](https://github.com/ClickHouse/ClickHouse/pull/51749) ([Arthur Passos](https://github.com/arthurpassos)).
* 支持从 file/s3/hdfs/url/azureBlobStorage 表函数读取 Tuple 子列。[#51806](https://github.com/ClickHouse/ClickHouse/pull/51806) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 函数 `arrayIntersect` 现在会按第一个参数中对应的顺序返回值。关闭 [#27622](https://github.com/ClickHouse/ClickHouse/issues/27622)。[#51850](https://github.com/ClickHouse/ClickHouse/pull/51850) ([Yarik Briukhovetskyi](https://github.com/yariks5s)) 。
* 新增了新查询，允许在指定的访问存储中创建/删除访问实体，或将访问实体从一个访问存储迁移到另一个访问存储。[#51912](https://github.com/ClickHouse/ClickHouse/pull/51912) ([pufit](https://github.com/pufit)).
* 使 `ALTER TABLE FREEZE` 查询在 Replicated database engine 中不进行复制。[#52064](https://github.com/ClickHouse/ClickHouse/pull/52064) ([Mike Kot](https://github.com/myrrc)).
* 新增了在意外关闭时刷新系统表的功能。[#52174](https://github.com/ClickHouse/ClickHouse/pull/52174) ([Alexey Gerasimchuck](https://github.com/Demilivor)).
* 修复了 `s3` 表函数无法使用预签名 URL 的问题。关闭 [#50846](https://github.com/ClickHouse/ClickHouse/issues/50846)。[#52310](https://github.com/ClickHouse/ClickHouse/pull/52310) ([chen](https://github.com/xiedeyantu)).
* 在 `system.events` 和 `system.metrics` 表中，新增列 `name`，作为 `event` 和 `metric` 的别名。关闭 [#51257](https://github.com/ClickHouse/ClickHouse/issues/51257)。[#52315](https://github.com/ClickHouse/ClickHouse/pull/52315) ([chen](https://github.com/xiedeyantu)) 。
* 在解析器中新增了对语法 `CREATE UNIQUE INDEX` 的支持，并将其视为空操作，以提升 SQL 兼容性。`UNIQUE` 索引暂不支持。将 `create_index_ignore_unique = 1` 设为 1 以忽略查询中的 `UNIQUE` 关键字。[#52320](https://github.com/ClickHouse/ClickHouse/pull/52320) ([Ilya Yatsishin](https://github.com/qoega)) 。
* 在 Kafka 引擎的某些设置中增加了对预定义宏 (`{database}` 和 `{table}`) 的支持：topic、消费者、client\_id 等。[#52386](https://github.com/ClickHouse/ClickHouse/pull/52386) ([Yury Bogomolov](https://github.com/ybogo)) 。
* 在备份/恢复期间禁用文件系统缓存更新。备份/恢复期间不应更新文件系统缓存，因为这似乎只会拖慢过程而没有任何收益 (因为 BACKUP 命令可能会读取大量数据，把这些数据全部放入文件系统缓存后又立即逐出，并无意义) 。[#52402](https://github.com/ClickHouse/ClickHouse/pull/52402) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* S3 端点配置支持从根路径使用，并会在需要时自动追加 '/'。 [#47809](https://github.com/ClickHouse/ClickHouse/issues/47809)。 [#52600](https://github.com/ClickHouse/ClickHouse/pull/52600) ([xiaolei565](https://github.com/xiaolei565))。
* 为 clickhouse-local 支持位置参数选项，并补充全局 UDF 设置 (user\_scripts\_path 和 user\_defined\_executable\_functions\_config) 。[#52643](https://github.com/ClickHouse/ClickHouse/pull/52643) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* `system.asynchronous_metrics` 现已包含指标 "QueryCacheEntries" 和 "QueryCacheBytes"，可用于查看查询缓存。[#52650](https://github.com/ClickHouse/ClickHouse/pull/52650) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 新增支持在备份到 S3 时，于 `BACKUP` 语句的 `SETTINGS` 子句中使用 `s3_storage_class` 参数。[#52658](https://github.com/ClickHouse/ClickHouse/pull/52658) ([Roman Vasin](https://github.com/rvasin)).
* 新增实用工具 `print-backup-info.py`，用于解析备份元数据文件并输出备份信息。[#52690](https://github.com/ClickHouse/ClickHouse/pull/52690) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 关闭 [#49510](https://github.com/ClickHouse/ClickHouse/issues/49510)。目前，database 和表名称区分大小写，但 BI 工具查询 `information_schema` 时，有时使用小写，有时使用大写。因此，我们有 `information_schema` database，其中包含小写表，例如 `information_schema.tables`；也有 `INFORMATION_SCHEMA` database，其中包含大写表，例如 `INFORMATION_SCHEMA.TABLES`。但有些工具会查询 `INFORMATION_SCHEMA.tables` 和 `information_schema.TABLES`。提出的解决方案是：在小写和大写的 `information_schema` database 中，同时复制小写和大写表。[#52695](https://github.com/ClickHouse/ClickHouse/pull/52695) ([Yarik Briukhovetskyi](https://github.com/yariks5s)) 。
* 查询`CHECK TABLE`具有更好的性能和可用性 (会发送进度更新，并且可取消) 。[#52745](https://github.com/ClickHouse/ClickHouse/pull/52745) ([vdimir](https://github.com/vdimir)) 。
* 新增对元组的 `modulo`、`intDiv` 和 `intDivOrZero` 的支持，方式是将这些函数分发到元组的各个元素上。[#52758](https://github.com/ClickHouse/ClickHouse/pull/52758) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* 在 clickhouse-client 中，默认会在 `xml` 之后查找 `yaml` 和 `yml` 配置。[#52767](https://github.com/ClickHouse/ClickHouse/pull/52767) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 在合并到非 'clickhouse' 根的配置时，根节点名称不同的配置会被直接跳过，不会抛出异常。[#52770](https://github.com/ClickHouse/ClickHouse/pull/52770) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* 现在可以为由采样内存分析器跟踪的内存分配指定最小 (`memory_profiler_sample_min_allocation_size`) 和最大 (`memory_profiler_sample_max_allocation_size`) 大小。[#52779](https://github.com/ClickHouse/ClickHouse/pull/52779) ([alesapin](https://github.com/alesapin)) 。
* 新增 `precise_float_parsing` 设置，用于切换浮点数解析方式 (快速/精确) 。[#52791](https://github.com/ClickHouse/ClickHouse/pull/52791) ([Andrey Zvonov](https://github.com/zvonand)) 。
* 对 `clickhouse-keeper` (符号链接) 使用与 `clickhouse-keeper` (可执行文件) 相同的默认 path。[#52861](https://github.com/ClickHouse/ClickHouse/pull/52861) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 改进表函数 `remote` 的错误消息。关闭 [#40220](https://github.com/ClickHouse/ClickHouse/issues/40220)。[#52959](https://github.com/ClickHouse/ClickHouse/pull/52959) ([jiyoungyoooo](https://github.com/jiyoungyoooo)).
* 新增支持在 `RESTORE` 查询的 `SETTINGS` 子句中指定自定义存储策略。[#52970](https://github.com/ClickHouse/ClickHouse/pull/52970) ([Victor Krasnov](https://github.com/sirvickr)).
* 新增了在执行备份操作时对 S3 请求进行限流的能力 (`BACKUP` 和 `RESTORE` 命令现支持遵循 `s3_max_[get/put]_[rps/burst]`) 。[#52974](https://github.com/ClickHouse/ClickHouse/pull/52974) ([Daniel Pozo Escalona](https://github.com/danipozo)).
* 新增设置，可在用于管理复制用户自定义函数或采用复制存储的访问控制实体的查询中忽略 ON CLUSTER 子句。[#52975](https://github.com/ClickHouse/ClickHouse/pull/52975) ([Aleksei Filatov](https://github.com/aalexfvk)) 。
* 为 JOIN 步骤添加了 EXPLAIN actions。[#53006](https://github.com/ClickHouse/ClickHouse/pull/53006) ([Maksim Kita](https://github.com/kitaisreal)).
* 使 `hasTokenOrNull` 和 `hasTokenCaseInsensitiveOrNull` 在 needle 为空时返回 null。[#53059](https://github.com/ClickHouse/ClickHouse/pull/53059) ([ltrk2](https://github.com/ltrk2)).
* 允许限制文件系统缓存可使用的路径。主要对动态磁盘有用。如果在 server 配置中指定了 `filesystem_caches_path`，则所有文件系统缓存的路径都将被限制在此目录下。例如，如果缓存配置中的 `path` 是相对路径，它将被放在 `filesystem_caches_path` 中；如果缓存配置中的 `path` 是绝对路径，则必须位于 `filesystem_caches_path` 内。如果配置中未指定 `filesystem_caches_path`，则其行为将与早期版本相同。[#53124](https://github.com/ClickHouse/ClickHouse/pull/53124) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 新增了一批自定义命令 (主要是为了让 ClickHouse 的调试更方便) 。[#53127](https://github.com/ClickHouse/ClickHouse/pull/53127) ([pufit](https://github.com/pufit)).
* 在 schema 推断期间添加文件名诊断信息——当你使用通配符处理多个文件时，这会很有帮助。[#53135](https://github.com/ClickHouse/ClickHouse/pull/53135) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 如果第二个连接不允许创建 session，客户端将通过主连接加载建议。 [#53177](https://github.com/ClickHouse/ClickHouse/pull/53177) ([Alexey Gerasimchuck](https://github.com/Demilivor)).
* 在 `SYSTEM STOP/START LISTEN QUERIES [ALL/DEFAULT/CUSTOM]` 查询中添加 EXCEPT 子句，例如 `SYSTEM STOP LISTEN QUERIES ALL EXCEPT TCP, HTTP`。[#53280](https://github.com/ClickHouse/ClickHouse/pull/53280) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 将 `max_concurrent_queries` 的默认值从 100 提高到 1000。如果查询负载不高，而且大部分时间都在等待网络，那么有很多并发查询是没问题的。注意：不要混淆并发查询和 QPS：例如，ClickHouse server 在并发查询数不到 100 的情况下，也可以达到数万 QPS。[#53285](https://github.com/ClickHouse/ClickHouse/pull/53285) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 限制并发后台分区 optimize 合并的数量。[#53405](https://github.com/ClickHouse/ClickHouse/pull/53405) ([Duc Canh Le](https://github.com/canhld94)) 。
* 新增了一个设置 `allow_moving_table_directory_to_trash`，可在复制/恢复 `Replicated` 数据库时忽略 `Directory for table data already exists` 错误。[#53425](https://github.com/ClickHouse/ClickHouse/pull/53425) ([Alexander Tokmakov](https://github.com/tavplubix)) 。
* 如果服务器设置 `asynchronous_metrics_update_period_s` 和 `asynchronous_heavy_metrics_update_period_s` 被误配置为 0，现在将不再终止应用程序，而是会以更平稳的方式失败。[#53428](https://github.com/ClickHouse/ClickHouse/pull/53428) ([Robert Schulze](https://github.com/rschu1ze)).
* ClickHouse 服务器现在会在重新加载配置时遵从通过 cgroups 更改的内存限制。[#53455](https://github.com/ClickHouse/ClickHouse/pull/53455) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 新增了可在 `DETACH`、`DROP` 或服务器关闭时禁用分布式表 flush 的功能。[#53501](https://github.com/ClickHouse/ClickHouse/pull/53501) ([Azat Khuzhin](https://github.com/azat)).
* `domainRFC` 函数现已支持用方括号括起来的 IPv6。 [#53506](https://github.com/ClickHouse/ClickHouse/pull/53506) ([Chen768959](https://github.com/Chen768959)).
* 对用于 backups 的 S3 CopyObject 请求采用更长的超时时间。[#53533](https://github.com/ClickHouse/ClickHouse/pull/53533) ([Michael Kolupaev](https://github.com/al13n321)) 。
* 新增了服务器设置 `aggregate_function_group_array_max_element_size`。该设置用于限制 `groupArray` 函数在序列化时的数组大小。默认值为 `16777215`。[#53550](https://github.com/ClickHouse/ClickHouse/pull/53550) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 新增了 `SCHEMA` 作为 `DATABASE` 的别名，以提升与 MySQL 的兼容性。[#53587](https://github.com/ClickHouse/ClickHouse/pull/53587) ([Daniël van Eeden](https://github.com/dveeden)) 。
* 为系统数据库中的表添加异步指标，例如 `TotalBytesOfMergeTreeTablesSystem`。此更改修复了 [#53603](https://github.com/ClickHouse/ClickHouse/issues/53603)。[#53604](https://github.com/ClickHouse/ClickHouse/pull/53604) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* Play UI 和 Dashboard 中的 SQL 编辑器将不再使用 Grammarly。[#53614](https://github.com/ClickHouse/ClickHouse/pull/53614) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 作为专家级设置项，现在可以 (1) 配置 \[索引] 标记缓存/未压缩缓存的 size\_ratio (即受保护队列的相对大小) ， (2) 配置索引标记缓存和索引未压缩缓存的缓存策略。[#53657](https://github.com/ClickHouse/ClickHouse/pull/53657) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 在 TCPHandler 的查询数据包中新增了客户端信息校验。[#53673](https://github.com/ClickHouse/ClickHouse/pull/53673) ([Alexey Gerasimchuck](https://github.com/Demilivor)) 。
* 在与 Microsoft Azure 交互时如果发生网络错误，则重试加载 parts。[#53750](https://github.com/ClickHouse/ClickHouse/pull/53750) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)).
* 异常将显示堆栈跟踪，物化视图异常会向上传递。[#53766](https://github.com/ClickHouse/ClickHouse/pull/53766) ([Ilya Golshtein](https://github.com/ilejn)) 。
* 如果未指定主机名或端口，keeper 客户端会尝试在 ClickHouse 的 config.xml 中查找连接字符串。[#53769](https://github.com/ClickHouse/ClickHouse/pull/53769) ([pufit](https://github.com/pufit)) 。
* 新增 profile 事件 `PartsLockMicroseconds`，用于显示在 MergeTree 表引擎家族中持有数据分区片段锁的时长 (以微秒为单位) 。[#53797](https://github.com/ClickHouse/ClickHouse/pull/53797) ([alesapin](https://github.com/alesapin)).
* 使 keeper 中 RAFT 限制的重连次数上限可配置。此配置有助于在当前连接中断时，让 keeper 更快地与其他节点重新建立连接。[#53817](https://github.com/ClickHouse/ClickHouse/pull/53817) ([Pengyuan Bian](https://github.com/bianpengyuan)) 。
* 在表定义中忽略外键，以提高与 MySQL 的兼容性，这样用户就无需重写 SQL 中与外键相关的部分，参见 [#53380](https://github.com/ClickHouse/ClickHouse/issues/53380)。[#53864](https://github.com/ClickHouse/ClickHouse/pull/53864) ([jsc0218](https://github.com/jsc0218)).

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

* 不要将 ClickHouse 二进制文件中的符号暴露给动态链接器。这或许能修复 [#43933](https://github.com/ClickHouse/ClickHouse/issues/43933)。[#47475](https://github.com/ClickHouse/ClickHouse/pull/47475) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 在 clickhouse-server 软件包中添加 `clickhouse-keeper-client` 符号链接。[#51882](https://github.com/ClickHouse/ClickHouse/pull/51882) ([Mikhail f. Shiryaev](https://github.com/Felixoid)) 。
* 将 [https://github.com/elliotchance/sqltest](https://github.com/elliotchance/sqltest) 添加到 CI 中，用于报告对 SQL 2016 的符合情况。[#52293](https://github.com/ClickHouse/ClickHouse/pull/52293) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 将 PRQL 升级至 0.9.3。[#53060](https://github.com/ClickHouse/ClickHouse/pull/53060) ([Maximilian Roos](https://github.com/max-sixty)) 。
* CI 检查中的系统表已导出到 ClickHouse Cloud。[#53086](https://github.com/ClickHouse/ClickHouse/pull/53086) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 编译器的 profile 数据 (`-ftime-trace`) 会上传到 ClickHouse Cloud。[#53100](https://github.com/ClickHouse/ClickHouse/pull/53100) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 加快 Debug 和 Tidy 构建。[#53178](https://github.com/ClickHouse/ClickHouse/pull/53178) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 通过清理大量无用内容来加快构建速度。一个经常被包含的头文件受到了 boost 的污染。[#53180](https://github.com/ClickHouse/ClickHouse/pull/53180) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 进一步清理垃圾代码。[#53182](https://github.com/ClickHouse/ClickHouse/pull/53182) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 函数 `arrayAUC` 之前使用了大量复杂的 C++ 模板——现已移除。 [#53183](https://github.com/ClickHouse/ClickHouse/pull/53183) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 无论是否使用 `ccache`，某些翻译单元都会被重新构建。问题已查明并修复。[#53184](https://github.com/ClickHouse/ClickHouse/pull/53184) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 编译器的 profile 数据 (`-ftime-trace`) 已上传到 ClickHouse Cloud。这是继 [#53100](https://github.com/ClickHouse/ClickHouse/issues/53100) 之后的第二次尝试。[#53213](https://github.com/ClickHouse/ClickHouse/pull/53213) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 将 CI 中有状态测试的日志导出至 ClickHouse Cloud。[#53351](https://github.com/ClickHouse/ClickHouse/pull/53351) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 在压力测试期间从 CI 导出日志。[#53353](https://github.com/ClickHouse/ClickHouse/pull/53353) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 在 fuzzer 中导出 CI 日志。[#53354](https://github.com/ClickHouse/ClickHouse/pull/53354) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 在 `clickhouse start` 命令中保留环境变量参数。修复了 [#51962](https://github.com/ClickHouse/ClickHouse/issues/51962)。[#53418](https://github.com/ClickHouse/ClickHouse/pull/53418) ([Mikhail f. Shiryaev](https://github.com/Felixoid)) 。
* 跟进 [#53418](https://github.com/ClickHouse/ClickHouse/issues/53418)。对 install\_check.py 做了一些小改进，并新增测试，以验证执行 `init.d start` 时 ENV 参数能否正确传递给主进程。[#53457](https://github.com/ClickHouse/ClickHouse/pull/53457) ([Mikhail f. Shiryaev](https://github.com/Felixoid)) 。
* 重组 CMake 中的文件管理，以避免潜在的重复。例如，`indexHint.cpp` 同时在 `dbms_sources` 和 `clickhouse_functions_sources` 中重复出现。[#53621](https://github.com/ClickHouse/ClickHouse/pull/53621) ([Amos Bird](https://github.com/amosbird)) 。
* 将 snappy 升级至 1.1.10。 [#53672](https://github.com/ClickHouse/ClickHouse/pull/53672) ([李扬](https://github.com/taiyang-li)).
* 通过梳理部分依赖并移除一些重复项，对 cmake 构建做了小幅改进。每个提交都附有对所做更改的简短说明。[#53759](https://github.com/ClickHouse/ClickHouse/pull/53759) ([Amos Bird](https://github.com/amosbird)) 。

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

* 在构建过程中，当标记超过一个时，不要重置 (Experimental) Annoy 索引 [#51325](https://github.com/ClickHouse/ClickHouse/pull/51325) ([Tian Xinhui](https://github.com/xinhuitian)) 。
* 修复了 RESTORE 期间临时目录使用不当的问题 [#51493](https://github.com/ClickHouse/ClickHouse/pull/51493) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复 Nullable(IPv4) 的二元算术运算问题 [#51642](https://github.com/ClickHouse/ClickHouse/pull/51642) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* 支持 IPv4 和 IPv6 数据类型作为字典属性 [#51756](https://github.com/ClickHouse/ClickHouse/pull/51756) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* 修复了压缩标记校验和的问题 [#51777](https://github.com/ClickHouse/ClickHouse/pull/51777) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)) 。
* 修复了在 CSV 尽力解析过程中误将逗号解析为日期时间组成部分的问题 [#51950](https://github.com/ClickHouse/ClickHouse/pull/51950) ([Kruglov Pavel](https://github.com/Avogar)).
* 可执行 UDF 带有参数时不再抛出异常 [#51961](https://github.com/ClickHouse/ClickHouse/pull/51961) ([Nikita Taranov](https://github.com/nickitat)) 。
* 修复 `ALTER DELETE` 查询中跳过索引和投影重算的问题 [#52530](https://github.com/ClickHouse/ClickHouse/pull/52530) ([Anton Popov](https://github.com/CurtizJ)).
* MaterializedMySQL：修复了 ReadBuffer::read 中的无限循环问题 [#52621](https://github.com/ClickHouse/ClickHouse/pull/52621) ([Val Doroshchuk](https://github.com/valbok)) 。
* 仅对 `clickhouse` 方言加载建议 [#52628](https://github.com/ClickHouse/ClickHouse/pull/52628) ([János Benjamin Antal](https://github.com/antaljanosbenjamin)) 。
* 按需初始化和销毁 ares 通道。[#52634](https://github.com/ClickHouse/ClickHouse/pull/52634) ([Arthur Passos](https://github.com/arthurpassos)) 。
* 修复了使用 OR 表达式过滤虚拟列时的问题 [#52653](https://github.com/ClickHouse/ClickHouse/pull/52653) ([Azat Khuzhin](https://github.com/azat)).
* 修复函数 `tuple` 在仅有一个稀疏列参数时的崩溃问题 [#52659](https://github.com/ClickHouse/ClickHouse/pull/52659) ([Anton Popov](https://github.com/CurtizJ)).
* 修复集群中的命名集合问题 [#52687](https://github.com/ClickHouse/ClickHouse/pull/52687) ([Al Korgun](https://github.com/alkorgun)) 。
* 修复在多阶段 `PREWHERE` 情况下读取不必要列的问题 [#52689](https://github.com/ClickHouse/ClickHouse/pull/52689) ([Anton Popov](https://github.com/CurtizJ)).
* 修复多列排序中使用 NULL 优先方向时出现的异常排序结果 [#52761](https://github.com/ClickHouse/ClickHouse/pull/52761) ([copperybean](https://github.com/copperybean)).
* 修复 Keeper 重新配置时的数据竞争 [#52804](https://github.com/ClickHouse/ClickHouse/pull/52804) ([Antonio Andelic](https://github.com/antonio2368)).
* 修复了在 limit 较大时对稀疏列排序的问题 [#52827](https://github.com/ClickHouse/ClickHouse/pull/52827) ([Anton Popov](https://github.com/CurtizJ)).
* clickhouse-keeper：修复基于 poll 的服务器实现。[#52833](https://github.com/ClickHouse/ClickHouse/pull/52833) ([Andy Fiddaman](https://github.com/citrus-it)) 。
* 让 regexp analyzer 能够识别命名捕获组 [#52840](https://github.com/ClickHouse/ClickHouse/pull/52840) ([Han Fei](https://github.com/hanfei1991)) 。
* 修复 clickhouse-local 中 `~PushingAsyncPipelineExecutor` 里可能触发的断言 [#52862](https://github.com/ClickHouse/ClickHouse/pull/52862) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复空 `Nested(Array(LowCardinality(...)))` 的读取问题 [#52949](https://github.com/ClickHouse/ClickHouse/pull/52949) ([Anton Popov](https://github.com/CurtizJ)) 。
* 为 session\_log 新增了测试，并修复了登录与注销之间不一致的问题。[#52958](https://github.com/ClickHouse/ClickHouse/pull/52958) ([Alexey Gerasimchuck](https://github.com/Demilivor)) 。
* 修复 `show create mysql table` 中的密码泄露问题 [#52962](https://github.com/ClickHouse/ClickHouse/pull/52962) ([Duc Canh Le](https://github.com/canhld94)) 。
* 将 CreateSetAndFilterOnTheFlyStep 中的稀疏列格式转换为完整格式 [#53000](https://github.com/ClickHouse/ClickHouse/pull/53000) ([vdimir](https://github.com/vdimir)) 。
* 修复了 fs 缓存中删除 key 前缀为空的目录时出现的一种罕见竞态条件 [#53055](https://github.com/ClickHouse/ClickHouse/pull/53055) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复了 ZstdDeflatingWriteBuffer 有时会导致输出被截断的问题 [#53064](https://github.com/ClickHouse/ClickHouse/pull/53064) ([Michael Kolupaev](https://github.com/al13n321)) 。
* 修复异步 flush 查询中 part\_log 中的 query\_id 问题 [#53103](https://github.com/ClickHouse/ClickHouse/pull/53103) ([Raúl Marín](https://github.com/Algunenano)).
* 修复了可能由缓存引发的错误 "Read unexpected size" [#53121](https://github.com/ClickHouse/ClickHouse/pull/53121) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 禁用新版 Parquet 编码器 [#53130](https://github.com/ClickHouse/ClickHouse/pull/53130) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 修复 "Not-ready Set" 异常 [#53162](https://github.com/ClickHouse/ClickHouse/pull/53162) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复 PostgreSQL 引擎中的字符转义 [#53250](https://github.com/ClickHouse/ClickHouse/pull/53250) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* Experimental session\_log 表：新增了 session\_log 的测试，并修复了登录与登出状态不一致的问题。[#53255](https://github.com/ClickHouse/ClickHouse/pull/53255) ([Alexey Gerasimchuck](https://github.com/Demilivor))。修复了登录成功与登出状态不一致的问题 [#53302](https://github.com/ClickHouse/ClickHouse/pull/53302) ([Alexey Gerasimchuck](https://github.com/Demilivor))。
* 修复向 DateTime 添加亚秒级时间间隔时的问题 [#53309](https://github.com/ClickHouse/ClickHouse/pull/53309) ([Michael Kolupaev](https://github.com/al13n321)).
* 修复字典中“Context has expired”错误 [#53342](https://github.com/ClickHouse/ClickHouse/pull/53342) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 修复普通投影 AST 格式错误 [#53347](https://github.com/ClickHouse/ClickHouse/pull/53347) ([Amos Bird](https://github.com/amosbird)) 。
* 执行 Scalar 时，禁止在表函数中使用 use\_structure\_from\_insertion\_table\_in\_table\_functions [#53348](https://github.com/ClickHouse/ClickHouse/pull/53348) ([flynn](https://github.com/ucasfl)).
* 修复在执行 system.table select 查询时加载 lazy 数据库的问题 [#53372](https://github.com/ClickHouse/ClickHouse/pull/53372) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)).
* 修复了 MaterializedMySQL 中的 system.data\_skipping\_indices 问题 [#53381](https://github.com/ClickHouse/ClickHouse/pull/53381) ([Filipp Ozinov](https://github.com/bakwc)) 。
* 修复 TSV 文件分段引擎中单个回车符的处理问题 [#53407](https://github.com/ClickHouse/ClickHouse/pull/53407) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 妥善修复 `Context has expired` 错误 [#53433](https://github.com/ClickHouse/ClickHouse/pull/53433) ([Michael Kolupaev](https://github.com/al13n321)) 。
* 修复了在 IN 右侧包含子查询时 `timeout_overflow_mode` 的问题 [#53439](https://github.com/ClickHouse/ClickHouse/pull/53439) ([Duc Canh Le](https://github.com/canhld94)) 。
* 修复了 [#53152](https://github.com/ClickHouse/ClickHouse/issues/53152) 中的异常行为 [#53440](https://github.com/ClickHouse/ClickHouse/pull/53440) ([Zhiguo Zhou](https://github.com/ZhiguoZh)) 。
* 修复 path 全为数字时 JSON\_QUERY 函数的解析报错 [#53470](https://github.com/ClickHouse/ClickHouse/pull/53470) ([KevinyhZou](https://github.com/KevinyhZou)).
* 修复并行 FINAL 查询中的列顺序错误。[#53489](https://github.com/ClickHouse/ClickHouse/pull/53489) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了启用 do\_not\_merge\_across\_partitions\_select\_final 时从 ReplacingMergeTree 执行 SELECT 的问题 [#53511](https://github.com/ClickHouse/ClickHouse/pull/53511) ([Vasily Nemkov](https://github.com/Enmk)).
* 关闭时先将 async insert 队列刷写到存储 [#53547](https://github.com/ClickHouse/ClickHouse/pull/53547) ([joelynch](https://github.com/joelynch)).
* 修复在稀疏列上进行 join 时发生的崩溃 [#53548](https://github.com/ClickHouse/ClickHouse/pull/53548) ([vdimir](https://github.com/vdimir)).
* 修复 Set 跳过索引在函数参数不正确时可能出现的未定义行为 [#53559](https://github.com/ClickHouse/ClickHouse/pull/53559) ([Azat Khuzhin](https://github.com/azat)).
* 修复倒排索引中可能出现的 UB (Experimental 功能) [#53560](https://github.com/ClickHouse/ClickHouse/pull/53560) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复：`interpolate` 表达式会使用源列，而不是使用 `select` 表达式中的同名别名。[#53572](https://github.com/ClickHouse/ClickHouse/pull/53572) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* 修复 EXPLAIN PLAN index=1 中被跳过的粒度数量 [#53616](https://github.com/ClickHouse/ClickHouse/pull/53616) ([wangxiaobo](https://github.com/wzb5212)).
* 正确处理 `DelayedSource` 中的总计和极值 [#53644](https://github.com/ClickHouse/ClickHouse/pull/53644) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 修复变更管道中预备 Set 缓存卡住的问题 [#53645](https://github.com/ClickHouse/ClickHouse/pull/53645) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 修复了在 `UPDATE` 和 `DELETE` 查询的谓词中使用 JSON 类型子列时，变更操作出现的问题。[#53677](https://github.com/ClickHouse/ClickHouse/pull/53677) ([VanDarkholme7](https://github.com/VanDarkholme7)).
* 修复 full\_sorting\_merge join 中的过滤器下推问题 [#53699](https://github.com/ClickHouse/ClickHouse/pull/53699) ([vdimir](https://github.com/vdimir)).
* 尝试修复 `NULL::LowCardinality(Nullable(...)) NOT IN` 相关缺陷 [#53706](https://github.com/ClickHouse/ClickHouse/pull/53706) ([Andrey Zvonov](https://github.com/zvonand)) 。
* 修复：对稀疏列执行排序后的 DISTINCT 时出现的问题 [#53711](https://github.com/ClickHouse/ClickHouse/pull/53711) ([Igor Nikonov](https://github.com/devcrafter)).
* `transform`：正确处理多行情况下的默认列 [#53742](https://github.com/ClickHouse/ClickHouse/pull/53742) ([Salvatore Mesoraca](https://github.com/aiven-sal)) 。
* 修复 parseDateTime 中的 fuzzer 崩溃 [#53764](https://github.com/ClickHouse/ClickHouse/pull/53764) ([Robert Schulze](https://github.com/rschu1ze)).
* MaterializedPostgreSQL：修复 getCreateTableQueryImpl 中未处理的异常 [#53832](https://github.com/ClickHouse/ClickHouse/pull/53832) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复使用 PostgreSQL 引擎时可能出现的段错误 [#53847](https://github.com/ClickHouse/ClickHouse/pull/53847) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复 named\_collection\_admin 别名问题 [#54066](https://github.com/ClickHouse/ClickHouse/pull/54066) ([Kseniia Sumarokova](https://github.com/kssenii)) 。

### <a id="237" /> ClickHouse 发布 23.7，2023-07-27。 [演示文稿](https://presentations.clickhouse.com/2023-release-23.7/), [视频](https://www.youtube.com/watch?v=TI1kONfON18)

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

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

* 新增 `NAMED COLLECTION` 访问类型 (别名为 `USE NAMED COLLECTION`、`NAMED COLLECTION USAGE`) 。此 PR 属于向后不兼容变更，因为该访问类型默认是禁用的 (其父级访问类型 `NAMED COLLECTION ADMIN` 也默认禁用) 。提案见 [#50277](https://github.com/ClickHouse/ClickHouse/issues/50277)。如需授权，请使用 `GRANT NAMED COLLECTION ON collection_name TO user` 或 `GRANT NAMED COLLECTION ON * TO user`；若要授予这些授权，则需要在配置中启用 `named_collection_admin` (此前名为 `named_collection_control`，因此会继续保留为别名) 。[#50625](https://github.com/ClickHouse/ClickHouse/pull/50625) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 修复了 `system.parts` 列名 `last_removal_attemp_time` 中的拼写错误，现更名为 `last_removal_attempt_time`。[#52104](https://github.com/ClickHouse/ClickHouse/pull/52104) ([filimonov](https://github.com/filimonov)).
* 默认将 distributed\_ddl\_entry\_format\_version 升级到版本 5 (启用 OpenTelemetry 和 initial\_query\_idd 透传) 。这意味着在*降级*后，将无法处理 distributed DDL 的现有条目 (不过请注意，通常不应该存在这类未处理条目) 。[#52128](https://github.com/ClickHouse/ClickHouse/pull/52128) ([Azat Khuzhin](https://github.com/azat)).
* 现在会像检查普通元数据一样检查投影元数据。如果某个表包含无效投影，此变更可能导致 server 无法启动。一个例子是投影在 PK 中创建了位置列 (例如 `projection p (select * order by 1, 4)`；这在表 PK 中是不允许的，并且可能在 insert/merge 期间导致崩溃) 。请在更新前删除这类投影。修复 [#52353](https://github.com/ClickHouse/ClickHouse/issues/52353)。[#52361](https://github.com/ClickHouse/ClickHouse/pull/52361) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 实验性功能 `hashid` 因存在缺陷而被移除。它的实现质量从一开始就存疑，也始终未走出实验阶段。此变更关闭了 [#52406](https://github.com/ClickHouse/ClickHouse/issues/52406)。[#52449](https://github.com/ClickHouse/ClickHouse/pull/52449) ([Alexey Milovidov](https://github.com/alexey-milovidov)).

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

* 新增 `Overlay` 数据库引擎，可将多个数据库组合为一个。新增 `Filesystem` 数据库引擎，可将文件系统中的目录表示为一组隐式可用的表，并自动检测 format 和结构。新的 `S3` 数据库引擎可将前缀表示为一组表，从而以只读方式与 S3 存储交互。新的 `HDFS` 数据库引擎可用相同方式与 HDFS 存储交互。[#48821](https://github.com/ClickHouse/ClickHouse/pull/48821) ([alekseygolub](https://github.com/alekseygolub)).
* 为 Keeper 新增对外部磁盘的支持，用于存储快照和日志。[#50098](https://github.com/ClickHouse/ClickHouse/pull/50098) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 新增了对多目录选择 (`{}`) 通配符的支持。[#50559](https://github.com/ClickHouse/ClickHouse/pull/50559) ([Andrey Zvonov](https://github.com/zvonand)) 。
* Kafka connector 可使用经过 URL 编码的凭据进行基本身份验证，从 Schema Registry 拉取 Avro schema。 [#49664](https://github.com/ClickHouse/ClickHouse/pull/49664) ([Ilya Golshtein](https://github.com/ilejn)).
* 新增函数 `arrayJaccardIndex`，用于计算两个数组之间的 Jaccard 相似度。[#50076](https://github.com/ClickHouse/ClickHouse/pull/50076) ([FFFFFFFHHHHHHH](https://github.com/FFFFFFFHHHHHHH)).
* 为 `system.settings` 和类似的表新增 `is_obsolete` 列。解决了 [#50819](https://github.com/ClickHouse/ClickHouse/issues/50819)。[#50826](https://github.com/ClickHouse/ClickHouse/pull/50826) ([flynn](https://github.com/ucasfl)) 。
* 增加了对配置文件中加密元素的支持。现在可以在配置文件的叶子元素中使用加密文本。文本使用 `<encryption_codecs>` 部分中的加密编解码器进行加密。[#50986](https://github.com/ClickHouse/ClickHouse/pull/50986) ([Roman Vasin](https://github.com/rvasin)) 。
* Grace Hash Join 算法现已可用于 FULL 和 RIGHT JOIN。[#49483](https://github.com/ClickHouse/ClickHouse/issues/49483)。[#51013](https://github.com/ClickHouse/ClickHouse/pull/51013) ([lgbo](https://github.com/lgbo-ustc)) 。
* 新增 `SYSTEM STOP LISTEN` 查询，以实现更优雅的终止。关闭了 [#47972](https://github.com/ClickHouse/ClickHouse/issues/47972)。[#51016](https://github.com/ClickHouse/ClickHouse/pull/51016) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 添加了 `input_format_csv_allow_variable_number_of_columns` 选项。[#51273](https://github.com/ClickHouse/ClickHouse/pull/51273) ([Dmitry Kardymon](https://github.com/kardymonds)) 。
* 另一个平平无奇的功能：新增函数 `substring_index`，与 Spark 或 MySQL 中的相同。[#51472](https://github.com/ClickHouse/ClickHouse/pull/51472) ([李扬](https://github.com/taiyang-li)).
* 新增一个用于显示 jemalloc bins 统计信息的系统表 `jemalloc_bins`。示例：`SELECT *, size * (nmalloc - ndalloc) AS allocated_bytes FROM system.jemalloc_bins WHERE allocated_bytes > 0 ORDER BY allocated_bytes DESC LIMIT 10`。敬请体验。[#51674](https://github.com/ClickHouse/ClickHouse/pull/51674) ([Alexander Gololobov](https://github.com/davenger)) 。
* 新增 `RowBinaryWithDefaults` 格式，在每个列前添加一个额外字节，作为是否使用该列默认值的标志。关闭 [#50854](https://github.com/ClickHouse/ClickHouse/issues/50854)。[#51695](https://github.com/ClickHouse/ClickHouse/pull/51695) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 新增了 `default_temporary_table_engine` 设置。它与 `default_table_engine` 相同，但适用于临时表。[#51292](https://github.com/ClickHouse/ClickHouse/issues/51292)。[#51708](https://github.com/ClickHouse/ClickHouse/pull/51708) ([velavokr](https://github.com/velavokr)) 。
* 新增了 `initcap` / `initcapUTF8` 函数，可将每个单词的首字母转为大写，其余字母转为小写。[#51735](https://github.com/ClickHouse/ClickHouse/pull/51735) ([Dmitry Kardymon](https://github.com/kardymonds)) 。
* 现在，创建表时已支持在列定义中使用 `PRIMARY KEY` 语法。列会按其定义顺序添加到主索引中。[#51881](https://github.com/ClickHouse/ClickHouse/pull/51881) ([Ilya Yatsishin](https://github.com/qoega)).
* 新增了在日志文件和错误日志文件名中使用日期和时间格式说明符的能力，可在配置文件 (`log` 和 `errorlog` 标签) 或命令行参数 (`--log-file` 和 `--errorlog-file`) 中使用。[#51945](https://github.com/ClickHouse/ClickHouse/pull/51945) ([Victor Krasnov](https://github.com/sirvickr)).
* 在 HTTP 请求头中新增了峰值内存占用统计。[#51946](https://github.com/ClickHouse/ClickHouse/pull/51946) ([Dmitry Kardymon](https://github.com/kardymonds)) 。
* 新增了用于匹配字符串中子序列的 `hasSubsequence` 函数 (以及 `CaseInsensitive` 和 `UTF8` 版本) 。[#52050](https://github.com/ClickHouse/ClickHouse/pull/52050) ([Dmitry Kardymon](https://github.com/kardymonds)) 。
* 为兼容 PostgreSQL，新增 `array_agg` 作为 `groupArray` 的别名。关闭 [#52100](https://github.com/ClickHouse/ClickHouse/issues/52100)。 ### 面向用户可见变更的文档条目。 [#52135](https://github.com/ClickHouse/ClickHouse/pull/52135) ([flynn](https://github.com/ucasfl)).
* 新增 `any_value`，作为 `any` 聚合函数的兼容别名。关闭 [#52140](https://github.com/ClickHouse/ClickHouse/issues/52140)。[#52147](https://github.com/ClickHouse/ClickHouse/pull/52147) ([flynn](https://github.com/ucasfl)).
* 新增聚合函数 `array_concat_agg`，以兼容 BigQuery；它是 `groupArrayArray` 的别名。关闭 [#52139](https://github.com/ClickHouse/ClickHouse/issues/52139)。[#52149](https://github.com/ClickHouse/ClickHouse/pull/52149) ([flynn](https://github.com/ucasfl)).
* 新增 `OCTET_LENGTH` 作为 `length` 的别名。关闭 [#52153](https://github.com/ClickHouse/ClickHouse/issues/52153)。[#52176](https://github.com/ClickHouse/ClickHouse/pull/52176) ([FFFFFFFHHHHHHH](https://github.com/FFFFFFFHHHHHHH)) 。
* 新增了 `firstLine` 函数，用于从多行字符串中提取第一行。该改动修复了 [#51172](https://github.com/ClickHouse/ClickHouse/issues/51172)。[#52209](https://github.com/ClickHouse/ClickHouse/pull/52209) ([Mikhail Koviazin](https://github.com/mkmkme)) 。
* 为 `Interval` 数据类型添加 KQL 风格的格式化支持。这仅在兼容 `Kusto` 查询语言时才需要。[#45671](https://github.com/ClickHouse/ClickHouse/pull/45671) ([ltrk2](https://github.com/ltrk2)) 。
* 新增 `SYSTEM FLUSH ASYNC INSERT QUEUE` 查询，用于将所有待处理的异步插入刷写到目标表中。新增服务端设置 `async_insert_queue_flush_on_shutdown` (默认为 `true`) ，用于确定在优雅停机时是否刷写异步插入队列。`async_insert_threads` 现也成为服务端设置。[#49160](https://github.com/ClickHouse/ClickHouse/pull/49160) ([Anton Popov](https://github.com/CurtizJ)).
* 为兼容 PostgreSQL，新增了别名 `current_database` 以及新函数 `current_schemas`。[#51076](https://github.com/ClickHouse/ClickHouse/pull/51076) ([Pedro Riera](https://github.com/priera)).
* 为函数 `today` 新增别名 `curdate`/`current_date`，并为 `now` 新增别名 `current_timestamp`。[#52106](https://github.com/ClickHouse/ClickHouse/pull/52106) ([Lloyd-Pottiger](https://github.com/Lloyd-Pottiger)) 。
* 支持 async insert 的 `async_deduplication_token`。[#52136](https://github.com/ClickHouse/ClickHouse/pull/52136) ([Han Fei](https://github.com/hanfei1991)) 。
* 新增设置 `disable_url_encoding`，可在 URL engine 中禁用对 URI 中 path 的解码/编码。[#52337](https://github.com/ClickHouse/ClickHouse/pull/52337) ([Kruglov Pavel](https://github.com/Avogar)) 。

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

* 默认启用稀疏序列化格式的自动选择功能。这会提升性能。该格式自 22.1 版本起受支持。进行此更改后，可能无法再降级到早于 22.1 的版本。降级时可能需要设置 `ratio_of_defaults_for_sparse_serialization=0.9375` [55153](https://github.com/ClickHouse/ClickHouse/issues/55153)。你可以通过为 MergeTree 表设置 `ratio_of_defaults_for_sparse_serialization = 1` 来禁用稀疏序列化格式。[#49631](https://github.com/ClickHouse/ClickHouse/pull/49631) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 默认开启 `move_all_conditions_to_prewhere` 和 `enable_multiple_prewhere_read_steps` 设置。[#46365](https://github.com/ClickHouse/ClickHouse/pull/46365) ([Alexander Gololobov](https://github.com/davenger)) 。
* 通过调优内存分配器，提升了部分查询的性能。[#46416](https://github.com/ClickHouse/ClickHouse/pull/46416) ([Azat Khuzhin](https://github.com/azat)) 。
* 现在，我们在 `MergeTreePrefetchedReadPool` 中和 `MergeTreeReadPool` 一样使用固定大小的任务。此外，从现在起，S3 请求也使用连接池。[#49732](https://github.com/ClickHouse/ClickHouse/pull/49732) ([Nikita Taranov](https://github.com/nickitat)) 。
* 将更多操作下推到 join 的右侧。 [#50532](https://github.com/ClickHouse/ClickHouse/pull/50532) ([Nikita Taranov](https://github.com/nickitat)) 。
* 通过预留哈希表大小来优化 grace\_hash join (重新提交) 。[#50875](https://github.com/ClickHouse/ClickHouse/pull/50875) ([lgbo](https://github.com/lgbo-ustc)).
* 在 `OpenedFileCache` 上等待锁有时会比较明显。我们将其拆分为多个子映射 (每个子映射都有自己的锁) ，以避免锁争用。[#51341](https://github.com/ClickHouse/ClickHouse/pull/51341) ([Nikita Taranov](https://github.com/nickitat)).
* 将包含主键列的条件移至 PREWHERE 事件链的末尾。其思路是，包含 PK 列的条件很可能会在 PK 分析中使用，因此对 PREWHERE 过滤带来的额外收益不大。[#51958](https://github.com/ClickHouse/ClickHouse/pull/51958) ([Alexander Gololobov](https://github.com/davenger)).
* 通过内联 SipHash，加速 String 类型的 `COUNT(DISTINCT)`。在 ICX 设备 (Intel Xeon Platinum 8380 CPU，80 核、160 线程) 上对 *OnTime* 进行的性能测试表明，这一改动可使查询 *Q8* 的 QPS 提升 *11.6%*，而对其他查询没有影响。[#52036](https://github.com/ClickHouse/ClickHouse/pull/52036) ([Zhiguo Zhou](https://github.com/ZhiguoZh)) 。
* 默认启用 `allow_vertical_merges_from_compact_to_wide_parts`。这将在合并期间节省内存使用量。[#52295](https://github.com/ClickHouse/ClickHouse/pull/52295) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 修复了错误的投影分析导致主键失效的问题。此问题仅在 `query_plan_optimize_primary_key = 1, query_plan_optimize_projection = 1` 时存在。此修复解决了 [#48823](https://github.com/ClickHouse/ClickHouse/issues/48823)。此修复解决了 [#51173](https://github.com/ClickHouse/ClickHouse/issues/51173)。[#52308](https://github.com/ClickHouse/ClickHouse/pull/52308) ([Amos Bird](https://github.com/amosbird)) 。
* 减少 `FileCache::loadMetadata` 中的系统调用次数——在配置了文件系统缓存时，可加快服务器启动速度。[#52435](https://github.com/ClickHouse/ClickHouse/pull/52435) ([Raúl Marín](https://github.com/Algunenano)) 。
* 通过在后台下载剩余数据，可为 File 段大小设置严格的下界值。File 段的最小大小 (如果实际文件大小更大) 由 cache 配置项 `boundary_alignment` 指定，默认值为 `4Mi`。后台线程数由 cache 配置项 `background_download_threads` 指定，默认值为 `2`。此外，在此 PR 中，`max_file_segment_size` 也已从 `8Mi` 提高到 `32Mi`。[#51000](https://github.com/ClickHouse/ClickHouse/pull/51000) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 将 S3 的默认超时时间从 30 秒下调至 3 秒，并将其他 HTTP 的默认超时时间从 180 秒下调至 30 秒。[#51171](https://github.com/ClickHouse/ClickHouse/pull/51171) ([Michael Kolupaev](https://github.com/al13n321)) 。
* 新增设置 `merge_tree_determine_task_size_by_prewhere_columns`。如果设为 `true`，则确定读取任务大小时只会考虑 `PREWHERE` 部分中的列大小；否则，会考虑查询中的所有列。[#52606](https://github.com/ClickHouse/ClickHouse/pull/52606) ([Nikita Taranov](https://github.com/nickitat)).

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

* 在 s3/file/url/... 表函数中使用 read\_bytes/total\_bytes\_to\_read 作为进度条，以便更准确地显示进度。[#51286](https://github.com/ClickHouse/ClickHouse/pull/51286) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 引入表设置 `wait_for_unique_parts_send_before_shutdown_ms`，用于指定副本在关闭用于 replicated send 的服务器间 handler 之前的等待时长。同时还修复了表与服务器间 handler 关闭顺序不一致的问题：现在 server 会先关闭表，之后才会关闭服务器间 handler。[#51851](https://github.com/ClickHouse/ClickHouse/pull/51851) ([alesapin](https://github.com/alesapin)) 。
* 允许使用 SQL 标准 `FETCH` 而无需 `OFFSET`。参见 [https://antonz.org/sql-fetch/。\[#51293](https://antonz.org/sql-fetch/。\[#51293)]\([https://github.com/ClickHouse/ClickHouse/pull/51293](https://github.com/ClickHouse/ClickHouse/pull/51293)) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 允许在配置中使用新的 `http_forbid_headers` 部分，对 URL/S3 表函数的 HTTP 请求头进行过滤。支持精确匹配和正则表达式过滤。[#51038](https://github.com/ClickHouse/ClickHouse/pull/51038) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 不要在日志中显示 `16 EiB` 可用空间之类的消息，因为这毫无意义。此修复关闭了 [#49320](https://github.com/ClickHouse/ClickHouse/issues/49320)。[#49342](https://github.com/ClickHouse/ClickHouse/pull/49342) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 适当检查 `sleepEachRow` 函数的限制。新增设置 `function_sleep_max_microseconds_per_block`。这是通用查询 fuzzer 所必需的。[#49343](https://github.com/ClickHouse/ClickHouse/pull/49343) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 修复了 `geoHash` 函数中的两个问题。[#50066](https://github.com/ClickHouse/ClickHouse/pull/50066) ([李扬](https://github.com/taiyang-li)) 。
* 将 async insert flush 查询记入 `system.query_log`。[#51160](https://github.com/ClickHouse/ClickHouse/pull/51160) ([Raúl Marín](https://github.com/Algunenano)) 。
* 函数 `date_diff` 和 `age` 现已支持毫秒/微秒单位，并可按微秒精度运行。[#51291](https://github.com/ClickHouse/ClickHouse/pull/51291) ([Dmitry Kardymon](https://github.com/kardymonds)) 。
* 改进 clickhouse-keeper-client 中的路径解析。 [#51359](https://github.com/ClickHouse/ClickHouse/pull/51359) ([Azat Khuzhin](https://github.com/azat)).
* 一个依赖 ClickHouse 的第三方产品 (Gluten：可将 Spark SQL 性能翻倍的插件) 存在一个缺陷。此修复可避免该产品在从 HDFS 读取时发生堆溢出。 [#51386](https://github.com/ClickHouse/ClickHouse/pull/51386) ([李扬](https://github.com/taiyang-li)).
* 新增了可禁用 S3 原生复制的功能 (用于 BACKUP/RESTORE 的设置 `allow_s3_native_copy`，以及用于 `s3`/`s3_plain` 磁盘的 `s3_allow_native_copy`) 。[#51448](https://github.com/ClickHouse/ClickHouse/pull/51448) ([Azat Khuzhin](https://github.com/azat)) 。
* 向 `system.parts` 表中添加列 `primary_key_size`，用于显示磁盘上压缩后的主键大小。修复 [#51400](https://github.com/ClickHouse/ClickHouse/issues/51400)。[#51496](https://github.com/ClickHouse/ClickHouse/pull/51496) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
* 允许在没有 procfs、主目录不存在以及缺少 glibc 名称解析插件的情况下运行 `clickhouse-local`。[#51518](https://github.com/ClickHouse/ClickHouse/pull/51518) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 在 rename\_files\_after\_processing 设置中，为 rull 文件名新增占位符 `%a`。[#51603](https://github.com/ClickHouse/ClickHouse/pull/51603) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 在 `system.parts_columns` 中新增列 `modification_time`。[#51685](https://github.com/ClickHouse/ClickHouse/pull/51685) ([Azat Khuzhin](https://github.com/azat)) 。
* 为 CSV 格式新增设置 `input_format_csv_use_default_on_bad_values`，允许在单个字段解析失败时插入默认值。[#51716](https://github.com/ClickHouse/ClickHouse/pull/51716) ([KevinyhZou](https://github.com/KevinyhZou)) 。
* 新增了在发生意外崩溃后将崩溃日志刷写到磁盘的功能。[#51720](https://github.com/ClickHouse/ClickHouse/pull/51720) ([Alexey Gerasimchuck](https://github.com/Demilivor)).
* 修复了 dashboard 页面中与身份验证无关的错误无法显示的问题。还修复了图表“重叠”的问题。 [#51744](https://github.com/ClickHouse/ClickHouse/pull/51744) ([Zach Naimon](https://github.com/ArctypeZach)).
* 允许 UUID 转换为 UInt128。[#51765](https://github.com/ClickHouse/ClickHouse/pull/51765) ([Dmitry Kardymon](https://github.com/kardymonds)) 。
* 新增了对接受 Nullable 参数的 `range` 函数的支持。[#51767](https://github.com/ClickHouse/ClickHouse/pull/51767) ([Dmitry Kardymon](https://github.com/kardymonds)) 。
* 将 `toyear(x) = c` 这类条件改写为 `c1 <= x < c2`。[#51795](https://github.com/ClickHouse/ClickHouse/pull/51795) ([Han Fei](https://github.com/hanfei1991)) 。
* 改进语句 `SHOW INDEX` 的 MySQL 兼容性。[#51796](https://github.com/ClickHouse/ClickHouse/pull/51796) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 修复了 `use_structure_from_insertion_table_in_table_functions` 无法与 `MATERIALIZED` 和 `ALIAS` 列一起使用的问题。关闭了 [#51817](https://github.com/ClickHouse/ClickHouse/issues/51817)。关闭了 [#51019](https://github.com/ClickHouse/ClickHouse/issues/51019)。[#51825](https://github.com/ClickHouse/ClickHouse/pull/51825) ([flynn](https://github.com/ucasfl)) 。
* 缓存字典现在只会从数据源请求唯一键。关闭了 [#51762](https://github.com/ClickHouse/ClickHouse/issues/51762)。[#51853](https://github.com/ClickHouse/ClickHouse/pull/51853) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 修复了在指定 FORMAT 时，设置未应用于 EXPLAIN 查询的问题。[#51859](https://github.com/ClickHouse/ClickHouse/pull/51859) ([Nikita Taranov](https://github.com/nickitat)) 。
* 为与 SELECT 查询保持兼容，在 DESCRIBE TABLE 查询中允许将 SETTINGS 放在 FORMAT 之前。关闭 [#51544](https://github.com/ClickHouse/ClickHouse/issues/51544)。[#51899](https://github.com/ClickHouse/ClickHouse/pull/51899) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 经 Var-Int 编码的整数 (例如用于 native protocol) 现在可使用完整的 64 位范围。建议 3rd party 客户端相应更新其 var-int 代码。[#51905](https://github.com/ClickHouse/ClickHouse/pull/51905) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 证书变更时可自动更新，无需手动执行 SYSTEM RELOAD CONFIG。[#52030](https://github.com/ClickHouse/ClickHouse/pull/52030) ([Mike Kot](https://github.com/myrrc)) 。
* 新增了 `allow_create_index_without_type` 设置，允许忽略未指定 `TYPE` 的 `ADD INDEX` 查询。标准 SQL 查询将直接成功执行，而不会更改表 schema。[#52056](https://github.com/ClickHouse/ClickHouse/pull/52056) ([Ilya Yatsishin](https://github.com/qoega)) 。
* 从服务器启动开始，日志消息就会写入 `system.text_log`。[#52113](https://github.com/ClickHouse/ClickHouse/pull/52113) ([Dmitry Kardymon](https://github.com/kardymonds)) 。
* 在 HTTP 端点具有多个 IP 地址且第一个地址不可达时，此前会抛出超时异常。现已改进会话创建逻辑，以处理所有已解析出的端点。[#52116](https://github.com/ClickHouse/ClickHouse/pull/52116) ([Aleksei Filatov](https://github.com/aalexfvk)).
* Avro 输入格式现已支持 Union，即使其中只包含一种类型。关闭 [#52131](https://github.com/ClickHouse/ClickHouse/issues/52131)。[#52137](https://github.com/ClickHouse/ClickHouse/pull/52137) ([flynn](https://github.com/ucasfl)) 。
* 添加设置 `optimize_use_implicit_projections`，用于禁用隐式投影 (当前仅有 `min_max_count` 投影) 。[#52152](https://github.com/ClickHouse/ClickHouse/pull/52152) ([Amos Bird](https://github.com/amosbird)) 。
* 此前可利用函数 `hasToken` 触发无限循环。现在这一可能性已被消除。此修复关闭了 [#52156](https://github.com/ClickHouse/ClickHouse/issues/52156)。[#52160](https://github.com/ClickHouse/ClickHouse/pull/52160) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 以乐观方式创建 ZK 上级节点。[#52195](https://github.com/ClickHouse/ClickHouse/pull/52195) ([Raúl Marín](https://github.com/Algunenano)) 。
* 修复了 [#50582](https://github.com/ClickHouse/ClickHouse/issues/50582)。避免在顺序读取和处理常量的某些情况下出现 `Not found column ... in block` 错误。[#52259](https://github.com/ClickHouse/ClickHouse/pull/52259) ([Chen768959](https://github.com/Chen768959)) 。
* 尽可能在 ClickHouse 侧尽早检查 S2 Geo 基本类型是否无效。此项已关闭：[#27090](https://github.com/ClickHouse/ClickHouse/issues/27090)。[#52260](https://github.com/ClickHouse/ClickHouse/pull/52260) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 当 `query_plan_optimize_projection = 1` 时，补回缺失的 projection QueryAccessInfo。此项修复解决了 [#50183](https://github.com/ClickHouse/ClickHouse/issues/50183)。此项修复解决了 [#50093](https://github.com/ClickHouse/ClickHouse/issues/50093)。[#52327](https://github.com/ClickHouse/ClickHouse/pull/52327) ([Amos Bird](https://github.com/amosbird)) 。
* 当 `ZooKeeperRetriesControl` 重新抛出错误时，显示其原始 stack trace 比显示 `ZooKeeperRetriesControl` 自身的 stack trace 更有用。[#52347](https://github.com/ClickHouse/ClickHouse/pull/52347) ([Vitaly Baranov](https://github.com/vitlibar)).
* 即使某些磁盘不支持零拷贝复制，也会等待零拷贝复制锁。[#52376](https://github.com/ClickHouse/ClickHouse/pull/52376) ([Raúl Marín](https://github.com/Algunenano)) 。
* 现在，只有在表被关闭后，服务器间端口才会关闭。[#52498](https://github.com/ClickHouse/ClickHouse/pull/52498) ([alesapin](https://github.com/alesapin)) 。

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

* 写入 Parquet 文件的速度提升了 10 倍，现已支持多线程，速度几乎与读取相当。[#49367](https://github.com/ClickHouse/ClickHouse/pull/49367) ([Michael Kolupaev](https://github.com/al13n321))。该功能由设置 `output_format_parquet_use_custom_encoder` 控制，默认处于禁用状态，因为该特性仍不够完善。
* 新增对 [PRQL](https://prql-lang.org/) 作为查询语言的支持。[#50686](https://github.com/ClickHouse/ClickHouse/pull/50686) ([János Benjamin Antal](https://github.com/antaljanosbenjamin))。
* 允许为自定义磁盘指定磁盘名称。此前，自定义磁盘会使用内部生成的磁盘名。现在可以通过 `disk = disk_<name>(...)` 来实现 (例如，磁盘名将为 `name`) 。[#51552](https://github.com/ClickHouse/ClickHouse/pull/51552) ([Kseniia Sumarokova](https://github.com/kssenii))。此语法可能会在本次发布中调整。
* (experimental MaterializedMySQL) 修复了在 `mysqlxx::Pool::Entry` 断开连接后继续使用时导致崩溃的问题。[#52063](https://github.com/ClickHouse/ClickHouse/pull/52063) ([Val Doroshchuk](https://github.com/valbok))。
* (experimental MaterializedMySQL) MaterializedMySQL 现已支持 `CREATE TABLE ... AS SELECT` ..。[#52067](https://github.com/ClickHouse/ClickHouse/pull/52067) ([Val Doroshchuk](https://github.com/valbok))。
* (experimental MaterializedMySQL) 为 MaterializedMySQL 引入了将文本类型自动转换为 utf8 的功能。[#52084](https://github.com/ClickHouse/ClickHouse/pull/52084) ([Val Doroshchuk](https://github.com/valbok))。
* (experimental MaterializedMySQL) MaterializedMySQL 现已支持在 DDL 中使用不带引号的 UTF-8 字符串。[#52318](https://github.com/ClickHouse/ClickHouse/pull/52318) ([Val Doroshchuk](https://github.com/valbok))。
* (experimental MaterializedMySQL) MaterializedMySQL 现已支持双引号注释。[#52355](https://github.com/ClickHouse/ClickHouse/pull/52355) ([Val Doroshchuk](https://github.com/valbok))。
* 将 Intel QPL 从 v1.1.0 升级到 v1.2.0；将 Intel accel-config 从 v3.5 升级到 v4.0；修复了 Device IOTLB miss 对 IAA 加速器性能影响较大的问题。[#52180](https://github.com/ClickHouse/ClickHouse/pull/52180) ([jasperzhu](https://github.com/jinjunzh))。
* `session_timezone` 设置 (于 23.6 版本中新增) 被降为实验性功能。[#52445](https://github.com/ClickHouse/ClickHouse/pull/52445) ([Alexey Milovidov](https://github.com/alexey-milovidov))。
* ClickHouse Keeper 现已支持 ZooKeeper 的 `reconfig` 命令，可进行增量重配置，并可通过 `keeper_server.enable_reconfiguration` 设置启用。支持添加 server、移除 server，以及更改 server 优先级。[#49450](https://github.com/ClickHouse/ClickHouse/pull/49450) ([Mike Kot](https://github.com/myrrc))。该功能疑似尚未完整实现。

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

* 在 CI 中新增适用于 Linux RISC-V 64 的实验性 ClickHouse 构建。 [#31398](https://github.com/ClickHouse/ClickHouse/pull/31398) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 新增启用 analyzer 时的集成测试检查。 [#50926](https://github.com/ClickHouse/ClickHouse/pull/50926) [#52210](https://github.com/ClickHouse/ClickHouse/pull/52210) ([Dmitry Novik](https://github.com/novikd)).
* Rust 的可复现构建。 [#52395](https://github.com/ClickHouse/ClickHouse/pull/52395) ([Azat Khuzhin](https://github.com/azat)).
* 更新 Cargo 依赖。 [#51721](https://github.com/ClickHouse/ClickHouse/pull/51721) ([Raúl Marín](https://github.com/Algunenano)).
* 使函数 `CHColumnToArrowColumn::fillArrowArrayWithArrayColumnData` 能够处理 Nullable 数组；这类数组在 ClickHouse 中虽不可能存在，但 Gluten 需要它。 [#52112](https://github.com/ClickHouse/ClickHouse/pull/52112) ([李扬](https://github.com/taiyang-li)).
* 我们已将 CCTZ 库更新到 master，但没有用户可见的变更。 [#52124](https://github.com/ClickHouse/ClickHouse/pull/52124) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* `system.licenses` 表现在已包含硬分叉版本的库 Poco。此更改关闭了 [#52066](https://github.com/ClickHouse/ClickHouse/issues/52066)。 [#52127](https://github.com/ClickHouse/ClickHouse/pull/52127) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 检查是否存在错误的标点用法：例如在逗号前加空格，写成 `Hello ,world`，而不是 `Hello, world`。 [#52549](https://github.com/ClickHouse/ClickHouse/pull/52549) ([Alexey Milovidov](https://github.com/alexey-milovidov)).

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

* 修复 MaterializedPostgreSQL 的 syncTables 问题 [#49698](https://github.com/ClickHouse/ClickHouse/pull/49698) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复启用 `optimize_aggregators_of_group_by_keys` 时 projection 的问题 [#49709](https://github.com/ClickHouse/ClickHouse/pull/49709) ([Amos Bird](https://github.com/amosbird)).
* 修复 JOIN 场景下的 optimize\_skip\_unused\_shards 问题 [#51037](https://github.com/ClickHouse/ClickHouse/pull/51037) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复 formatDateTime() 在处理带小数部分的负 datetime64 时的问题 [#51290](https://github.com/ClickHouse/ClickHouse/pull/51290) ([Dmitry Kardymon](https://github.com/kardymonds)).
* 函数 `hasToken*` 之前完全不正确。为 [#43358](https://github.com/ClickHouse/ClickHouse/issues/43358) 添加测试 [#51378](https://github.com/ClickHouse/ClickHouse/pull/51378) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 修复了将函数移到排序前这一优化中的问题。[#51481](https://github.com/ClickHouse/ClickHouse/pull/51481) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复 Pipe::unitePipes 在 FINAL 中的块结构不匹配问题 [#51492](https://github.com/ClickHouse/ClickHouse/pull/51492) ([Nikita Taranov](https://github.com/nickitat)) 。
* 修复所有分片权重均为零的集群中出现的 SIGSEGV (修复 INSERT INTO FUNCTION clusterAllReplicas()) [#51545](https://github.com/ClickHouse/ClickHouse/pull/51545) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复对冲请求超时问题 [#51582](https://github.com/ClickHouse/ClickHouse/pull/51582) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复 ANTI join 在涉及 NULL 时的逻辑错误 [#51601](https://github.com/ClickHouse/ClickHouse/pull/51601) ([vdimir](https://github.com/vdimir)).
* 修复了将 'IN' 条件下推到 PREWHERE 的问题 [#51610](https://github.com/ClickHouse/ClickHouse/pull/51610) ([Alexander Gololobov](https://github.com/davenger)) 。
* 不要对 ASOF/ANTI join 应用 PredicateExpressionsOptimizer [#51633](https://github.com/ClickHouse/ClickHouse/pull/51633) ([vdimir](https://github.com/vdimir)).
* 修复了 ReplicatedMergeTree 在使用 merging 算法时，async insert 与去重功能配合使用的问题 [#51676](https://github.com/ClickHouse/ClickHouse/pull/51676) ([Antonio Andelic](https://github.com/antonio2368)).
* 修复了 `parseSipHashKey` 从空列读取的问题 [#51804](https://github.com/ClickHouse/ClickHouse/pull/51804) ([Nikita Taranov](https://github.com/nickitat)).
* 修复创建无效 EmbeddedRocksdb 表时发生的段错误 [#51847](https://github.com/ClickHouse/ClickHouse/pull/51847) ([Duc Canh Le](https://github.com/canhld94)) 。
* 修复向 MongoDB 表插入数据时的问题 [#51876](https://github.com/ClickHouse/ClickHouse/pull/51876) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 修复 DatabaseCatalog 在关闭时发生的死锁问题 [#51908](https://github.com/ClickHouse/ClickHouse/pull/51908) ([Alexander Tokmakov](https://github.com/tavplubix)) 。
* 修复子查询运算符相关错误 [#51922](https://github.com/ClickHouse/ClickHouse/pull/51922) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 修复异步连接具有多个 IP 地址的主机时出现的问题 [#51934](https://github.com/ClickHouse/ClickHouse/pull/51934) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 在 ActionsDAG::merge 后不要移除输入 [#51947](https://github.com/ClickHouse/ClickHouse/pull/51947) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 在 `RemoveManyObjectStorageOperation::finalize` 中检查引用计数，而不是在 `execute` 中检查 [#51954](https://github.com/ClickHouse/ClickHouse/pull/51954) ([vdimir](https://github.com/vdimir)) 。
* 允许使用参数化 UDFs [#51964](https://github.com/ClickHouse/ClickHouse/pull/51964) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 修复了 toDateTime64() 在处理 2283-12-31 之后日期时的一个小问题 [#52130](https://github.com/ClickHouse/ClickHouse/pull/52130) ([Andrey Zvonov](https://github.com/zvonand)) 。
* 修复 WINDOW 函数中 ORDER BY 元组的问题 [#52145](https://github.com/ClickHouse/ClickHouse/pull/52145) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 修复聚合表达式包含单调函数时的错误投影分析 [#52151](https://github.com/ClickHouse/ClickHouse/pull/52151) ([Amos Bird](https://github.com/amosbird)).
* 修复 `groupArrayMoving` 函数中的报错 [#52161](https://github.com/ClickHouse/ClickHouse/pull/52161) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 为范围字典禁用 Direct JOIN [#52187](https://github.com/ClickHouse/ClickHouse/pull/52187) ([Duc Canh Le](https://github.com/canhld94)) 。
* 修复卡住的变更测试 (以及一种极其罕见的竞态条件) [#52197](https://github.com/ClickHouse/ClickHouse/pull/52197) ([alesapin](https://github.com/alesapin)) 。
* 修复 Web 磁盘中的竞态问题 [#52211](https://github.com/ClickHouse/ClickHouse/pull/52211) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复了 Connection::setAsyncCallback 在收到来自服务器的未知数据包时发生的数据竞争问题 [#52219](https://github.com/ClickHouse/ClickHouse/pull/52219) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复启动时误删临时数据的问题，并添加测试 [#52275](https://github.com/ClickHouse/ClickHouse/pull/52275) ([vdimir](https://github.com/vdimir)).
* 统计 Nullable 列时，不要使用 minmax\_count 投影 [#52297](https://github.com/ClickHouse/ClickHouse/pull/52297) ([Amos Bird](https://github.com/amosbird)) 。
* MergeTree/ReplicatedMergeTree 处理日志记录时应使用服务器时区 [#52325](https://github.com/ClickHouse/ClickHouse/pull/52325) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复带有 CTE 且被多次使用的参数化视图问题 [#52328](https://github.com/ClickHouse/ClickHouse/pull/52328) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)) 。
* 禁用用于时间间隔的表达式模板 [#52335](https://github.com/ClickHouse/ClickHouse/pull/52335) ([Alexander Tokmakov](https://github.com/tavplubix)) 。
* 修复 Keeper 中的 `apply_snapshot` [#52358](https://github.com/ClickHouse/ClickHouse/pull/52358) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 更新了 build-osx.md [#52377](https://github.com/ClickHouse/ClickHouse/pull/52377) ([AlexBykovski](https://github.com/AlexBykovski)) 。
* 修复 `countSubstrings` 在 needle 为空且 haystack 为列时卡住的问题 [#52409](https://github.com/ClickHouse/ClickHouse/pull/52409) ([Sergei Trifonov](https://github.com/serxa)).
* 修复 Merge 表中的普通投影问题 [#52432](https://github.com/ClickHouse/ClickHouse/pull/52432) ([Amos Bird](https://github.com/amosbird)).
* 修复 Aggregator 中可能发生的双重释放问题 [#52439](https://github.com/ClickHouse/ClickHouse/pull/52439) ([Nikita Taranov](https://github.com/nickitat)).
* 修复了向 Buffer 引擎插入数据时的问题 [#52440](https://github.com/ClickHouse/ClickHouse/pull/52440) ([Vasily Nemkov](https://github.com/Enmk)).
* AnyHash 的实现不符合规范。[#52448](https://github.com/ClickHouse/ClickHouse/pull/52448) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 检查 OptimizedRegularExpression 的递归深度 [#52451](https://github.com/ClickHouse/ClickHouse/pull/52451) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 修复 DatabaseReplicated::startupTables()/canExecuteReplicatedMetadataAlter() 中的数据竞争问题 [#52490](https://github.com/ClickHouse/ClickHouse/pull/52490) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复函数 `transform` 中的异常中止问题 [#52513](https://github.com/ClickHouse/ClickHouse/pull/52513) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 修复删除投影后轻量级删除失效的问题 [#52517](https://github.com/ClickHouse/ClickHouse/pull/52517) ([Anton Popov](https://github.com/CurtizJ)).
* 修复可能出现的错误："无法释放连接：请先取消" [#52585](https://github.com/ClickHouse/ClickHouse/pull/52585) ([Kruglov Pavel](https://github.com/Avogar)).

### <a id="236" /> ClickHouse 发布 23.6，2023-06-29。[演示文稿](https://presentations.clickhouse.com/2023-release-23.6/)，[视频](https://www.youtube.com/watch?v=cuf_hYn7dqU)

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

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

* 删除文件系统缓存中的特性 `do_not_evict_index_and_mark_files`。该特性只会让情况变得更糟。[#51253](https://github.com/ClickHouse/ClickHouse/pull/51253) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 移除对 Experimental LIVE VIEW 的 ALTER 支持。[#51287](https://github.com/ClickHouse/ClickHouse/pull/51287) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 将 `http_max_field_value_size` 和 `http_max_field_name_size` 的默认值下调至 128 KiB。[#51163](https://github.com/ClickHouse/ClickHouse/pull/51163) ([Mikhail f. Shiryaev](https://github.com/Felixoid)).
* 与 CPU 相关的 CGroups 指标现统一为一个指标 `CGroupMaxCPU`，以提升易用性。设置了 CGroups 限制后，`Normalized` CPU 使用指标将按 CGroups 限制而非 CPU 总数进行归一化。这关闭了 [#50836](https://github.com/ClickHouse/ClickHouse/issues/50836)。[#50835](https://github.com/ClickHouse/ClickHouse/pull/50835) ([Alexey Milovidov](https://github.com/alexey-milovidov)).

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

* 函数 `transform` 以及带值匹配的 `CASE` 现已支持所有数据类型。此更改修复了 [#29730](https://github.com/ClickHouse/ClickHouse/issues/29730)、[#32387](https://github.com/ClickHouse/ClickHouse/issues/32387)、[#50827](https://github.com/ClickHouse/ClickHouse/issues/50827)、[#31336](https://github.com/ClickHouse/ClickHouse/issues/31336) 和 [#40493](https://github.com/ClickHouse/ClickHouse/issues/40493)。[#51351](https://github.com/ClickHouse/ClickHouse/pull/51351) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 新增选项 `--rename_files_after_processing <pattern>`。此更改修复了 [#34207](https://github.com/ClickHouse/ClickHouse/issues/34207)。[#49626](https://github.com/ClickHouse/ClickHouse/pull/49626) ([alekseygolub](https://github.com/alekseygolub)) 。
* 为 `INTO OUTFILE` clause 添加对 `TRUNCATE` modifier 的支持。建议在文件已存在时，为 `INTO OUTFILE` 使用 `APPEND` 或 `TRUNCATE`。[#50950](https://github.com/ClickHouse/ClickHouse/pull/50950) ([alekar](https://github.com/alekar)) 。
* 新增 `Redis` 表引擎和 `redis` 表函数，可用于查询外部 Redis server。[#50150](https://github.com/ClickHouse/ClickHouse/pull/50150) ([JackyWoo](https://github.com/JackyWoo)) 。
* 允许在 file/s3/url/hdfs 表函数中使用设置 `s3_skip_empty_files`、`hdfs_skip_empty_files`、`engine_file_skip_empty_files`、`engine_url_skip_empty_files` 跳过空文件。[#50364](https://github.com/ClickHouse/ClickHouse/pull/50364) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 新增名为 `use_mysql_types_in_show_columns` 的 setting，用于调整 `SHOW COLUMNS` SQL statement，使客户端通过 MySQL 兼容端口连接时显示对应的 MySQL 类型。[#49577](https://github.com/ClickHouse/ClickHouse/pull/49577) ([Thomas Panetti](https://github.com/tpanetti)) 。
* 现在调用 Clickhouse-client 时，可以使用 connection string，而不必再通过 "--host"、"--port"、"--user" 等参数指定连接信息。[#50689](https://github.com/ClickHouse/ClickHouse/pull/50689) ([Alexey Gerasimchuck](https://github.com/Demilivor)) 。
* 新增 setting `session_timezone`；在未显式指定时，它会作为 session 的默认 timezone。[#44149](https://github.com/ClickHouse/ClickHouse/pull/44149) ([Andrey Zvonov](https://github.com/zvonand)) 。
* Codec DEFLATE\_QPL 现在通过 server setting "enable\_deflate\_qpl\_codec" (默认值：false) 控制，而不再通过 setting "allow\_experimental\_codecs" 控制。这意味着 DEFLATE\_QPL 不再属于 Experimental。[#50775](https://github.com/ClickHouse/ClickHouse/pull/50775) ([Robert Schulze](https://github.com/rschu1ze)) 。

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

* 改进了 `ReplicatedMergeTree` 中合并选择与清理任务的调度。当没有可合并或可清理的内容时，这些任务不会再过于频繁地执行。新增设置 `max_merge_selecting_sleep_ms`、`merge_selecting_sleep_slowdown_factor`、`max_cleanup_delay_period` 和 `cleanup_thread_preferred_points_per_iteration`。此更改应可解决 [#31919](https://github.com/ClickHouse/ClickHouse/issues/31919)。[#50107](https://github.com/ClickHouse/ClickHouse/pull/50107) ([Alexander Tokmakov](https://github.com/tavplubix))。
* 支持在 cross join 中进行过滤器下推。[#50605](https://github.com/ClickHouse/ClickHouse/pull/50605) ([Han Fei](https://github.com/hanfei1991))。
* 在启用 QueryProfiler 时，使用线程本地 `timer_id` 代替全局对象，从而提升性能。[#48778](https://github.com/ClickHouse/ClickHouse/pull/48778) ([Jiebin Sun](https://github.com/jiebinn))。
* 重写 CapnProto 输入/输出格式以提升性能。Map 列名与 CapnProto 字段名现在大小写不敏感，并修复了嵌套结构字段的读写问题。[#49752](https://github.com/ClickHouse/ClickHouse/pull/49752) ([Kruglov Pavel](https://github.com/Avogar))。
* 优化并行线程下的 Parquet 写入性能。[#50102](https://github.com/ClickHouse/ClickHouse/pull/50102) ([Hongbin Ma](https://github.com/binmahone))。
* 对处理 MATERIALIZED VIEW 和仅包含一个块的存储禁用 `parallelize_output_from_storages`。[#50214](https://github.com/ClickHouse/ClickHouse/pull/50214) ([Azat Khuzhin](https://github.com/azat))。
* 合并 PR [#46558](https://github.com/ClickHouse/ClickHouse/pull/46558)。如果块已排好序，则在 sort 过程中避免对块进行置换。[#50697](https://github.com/ClickHouse/ClickHouse/pull/50697) ([Alexey Milovidov](https://github.com/alexey-milovidov), [Maksim Kita](https://github.com/kitaisreal))。
* 并行向 ZooKeeper 发起多个 list 请求，以加快从 system.zookeeper 表读取数据的速度。[#51042](https://github.com/ClickHouse/ClickHouse/pull/51042) ([Alexander Gololobov](https://github.com/davenger))。
* 加快 time zone 的 DateTime lookup 表初始化。这应能缩短 clickhouse-client 的启动/连接时间，尤其是在 debug 构建中，因为这部分开销较大。[#51347](https://github.com/ClickHouse/ClickHouse/pull/51347) ([Alexander Gololobov](https://github.com/davenger))。
* 修复了因同步 HEAD 请求导致的数据湖访问缓慢问题。 (与 Iceberg/Deltalake/Hudi 在文件很多时性能较慢有关) 。[#50976](https://github.com/ClickHouse/ClickHouse/pull/50976) ([Kseniia Sumarokova](https://github.com/kssenii))。
* 不再从右侧 GLOBAL JOIN 表读取所有列。[#50721](https://github.com/ClickHouse/ClickHouse/pull/50721) ([Nikolai Kochetov](https://github.com/KochetovNicolai))。

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

* 支持 analyzer 的并行副本。[#50441](https://github.com/ClickHouse/ClickHouse/pull/50441) ([Raúl Marín](https://github.com/Algunenano)).
* 在执行大型合并/变更前增加随机休眠，以便在零拷贝复制场景下让各副本间的负载分布更均匀。[#51282](https://github.com/ClickHouse/ClickHouse/pull/51282) ([alesapin](https://github.com/alesapin)).
* 如果 `Replicated` 数据库只有一个分片，且底层表为 `ReplicatedMergeTree`，则不通过该数据库复制 `ALTER PARTITION` 查询和变更。[#51049](https://github.com/ClickHouse/ClickHouse/pull/51049) ([Alexander Tokmakov](https://github.com/tavplubix)).

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

* 放宽“parts 过多”的阈值，使其更符合当前实践。在长时间运行的 insert 查询期间恢复背压。[#50856](https://github.com/ClickHouse/ClickHouse/pull/50856) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 允许将 CIDR ::ffff:0:0/96 (IPv4 映射地址) 范围内的 IPv6 地址转换为 IPv4 地址。 [#49759](https://github.com/ClickHouse/ClickHouse/pull/49759) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)).
* 更新了 MongoDB 协议，以支持 MongoDB 5.1 及更高版本，同时保留了对旧协议版本 (\<3.6) 的支持。关闭了 [#45621](https://github.com/ClickHouse/ClickHouse/issues/45621) 和 [#49879](https://github.com/ClickHouse/ClickHouse/issues/49879)。[#50061](https://github.com/ClickHouse/ClickHouse/pull/50061) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 添加设置 `input_format_max_bytes_to_read_for_schema_inference`，用于限制 schema 推断时读取的字节数。关闭了 [#50577](https://github.com/ClickHouse/ClickHouse/issues/50577)。[#50592](https://github.com/ClickHouse/ClickHouse/pull/50592) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 在 schema 推断中尊重设置 `input_format_null_as_default`。[#50602](https://github.com/ClickHouse/ClickHouse/pull/50602) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 允许通过设置 `input_format_csv_skip_trailing_empty_lines`、`input_format_tsv_skip_trailing_empty_lines` 和 `input_format_custom_skip_trailing_empty_lines` 跳过 CSV/TSV/CustomSeparated format 中末尾的空行 (默认禁用) 。已修复 [#49315](https://github.com/ClickHouse/ClickHouse/issues/49315)。[#50635](https://github.com/ClickHouse/ClickHouse/pull/50635) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 函数 "toDateOrDefault|OrNull" 和 "accuateCast\[OrDefault|OrNull]" 现在可以正确解析数值参数。[#50709](https://github.com/ClickHouse/ClickHouse/pull/50709) ([Dmitry Kardymon](https://github.com/kardymonds)) 。
* 支持使用空白字符或 `\t` 作为字段分隔符的 CSV，且 Spark 也支持这些分隔符。[#50712](https://github.com/ClickHouse/ClickHouse/pull/50712) ([KevinyhZou](https://github.com/KevinyhZou)).
* 设置 `number_of_mutations_to_delay` 和 `number_of_mutations_to_throw` 现已默认启用，取值分别为 500 和 1000。[#50726](https://github.com/ClickHouse/ClickHouse/pull/50726) ([Anton Popov](https://github.com/CurtizJ)) 。
* 仪表板现已能正确显示缺失值。此更改修复了 [#50831](https://github.com/ClickHouse/ClickHouse/issues/50831)。[#50832](https://github.com/ClickHouse/ClickHouse/pull/50832) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 新增了在函数 `parseDateTimeBestEffort*` 和 `parseDateTime64BestEffort*` 中支持使用 syslog 时间戳格式的日期和时间参数。[#50925](https://github.com/ClickHouse/ClickHouse/pull/50925) ([Victor Krasnov](https://github.com/sirvickr)).
* clickhouse-client 中的命令行参数 "--password" 现在仅可指定一次。[#50966](https://github.com/ClickHouse/ClickHouse/pull/50966) ([Alexey Gerasimchuck](https://github.com/Demilivor)) 。
* 在集群备份期间，使用 `system.parts` 中的 `hash_of_all_files` 来校验 parts 的标识。 [#50997](https://github.com/ClickHouse/ClickHouse/pull/50997) ([Vitaly Baranov](https://github.com/vitlibar)).
* 系统表 zookeeper\_connection 的 connected\_time 用于标识连接建立的时间 (标准格式) ，并新增了 session\_uptime\_elapsed\_seconds，用于标示已建立连接会话的耗时 (以秒为单位) 。 [#51026](https://github.com/ClickHouse/ClickHouse/pull/51026) ([郭小龙](https://github.com/guoxiaolongzte)).
* 通过利用源数据的块大小，并在每个线程中以增量方式统计总大小，改进了 file/S3/hdfs/url 表函数的进度条。修复了 \*Cluster 函数的进度条。此更改关闭了 [#47250](https://github.com/ClickHouse/ClickHouse/issues/47250)。[#51088](https://github.com/ClickHouse/ClickHouse/pull/51088) ([Kruglov Pavel](https://github.com/Avogar)).
* 在 TCP 协议中向 Progress 数据包添加 total\_bytes\_to\_read，以优化 Progress 进度条的显示。[#51158](https://github.com/ClickHouse/ClickHouse/pull/51158) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 借助文件系统缓存，可以更好地检查磁盘上的数据分区片段。[#51164](https://github.com/ClickHouse/ClickHouse/pull/51164) ([Anton Popov](https://github.com/CurtizJ)).
* 修复 fs cache 中 `current_elements_num` 偶尔不正确的问题。[#51242](https://github.com/ClickHouse/ClickHouse/pull/51242) ([Kseniia Sumarokova](https://github.com/kssenii)).

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

* 为独立的 Keeper 二进制文件添加嵌入式 keeper-client。[#50964](https://github.com/ClickHouse/ClickHouse/pull/50964) ([pufit](https://github.com/pufit)).
* 现在会使用实际的 LZ4 版本。[#50621](https://github.com/ClickHouse/ClickHouse/pull/50621) ([Nikita Taranov](https://github.com/nickitat)).
* ClickHouse server 现在会在发生致命错误时打印已修改 settings 的列表。此更改关闭了 [#51137](https://github.com/ClickHouse/ClickHouse/issues/51137)。[#51138](https://github.com/ClickHouse/ClickHouse/pull/51138) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 允许使用 clang-17 构建 ClickHouse。[#51300](https://github.com/ClickHouse/ClickHouse/pull/51300) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* [SQLancer](https://github.com/sqlancer/sqlancer) 检查现已被视为稳定版本，因为它触发的缺陷已被修复。现在，SQLancer 检查失败会被报告为检查状态失败。[#51340](https://github.com/ClickHouse/ClickHouse/pull/51340) ([Ilya Yatsishin](https://github.com/qoega)).
* 将 Dockerfile 中庞大的 `RUN` 拆分为更小的条件块。在同一个 `RUN` layer 中按需安装必要工具，并在之后将其移除。仅在开始时升级一次操作系统。使用更现代的方式检查已签名的 repository。将基础 repo 降级为 ubuntu:20.04，以解决旧版 docker 中的问题。升级 golang 版本以修复 golang 漏洞。[#51504](https://github.com/ClickHouse/ClickHouse/pull/51504) ([Mikhail f. Shiryaev](https://github.com/Felixoid)).

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

* 修正了可执行字典的加载状态报告 [#48775](https://github.com/ClickHouse/ClickHouse/pull/48775) ([Anton Kozlov](https://github.com/tonickkozlov)) 。
* 正确处理数据跳过索引和投影的变更 [#50104](https://github.com/ClickHouse/ClickHouse/pull/50104) ([Amos Bird](https://github.com/amosbird)).
* 清理移动中的 parts [#50489](https://github.com/ClickHouse/ClickHouse/pull/50489) ([vdimir](https://github.com/vdimir)).
* 修复聚合函数中 IP 类型哈希的向后兼容问题 [#50551](https://github.com/ClickHouse/ClickHouse/pull/50551) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)).
* 修复 Log 家族表在 TRUNCATE 后返回行数错误的问题 [#50585](https://github.com/ClickHouse/ClickHouse/pull/50585) ([flynn](https://github.com/ucasfl)).
* 修复 `uniqExact` 并行合并中的问题 [#50590](https://github.com/ClickHouse/ClickHouse/pull/50590) ([Nikita Taranov](https://github.com/nickitat)) 。
* 回滚最近的 grace hash join 变更 [#50699](https://github.com/ClickHouse/ClickHouse/pull/50699) ([vdimir](https://github.com/vdimir)).
* 查询缓存：尝试修复将 `ColumnConst` 错误转换为 `ColumnVector<char8_t>` 的问题 [#50704](https://github.com/ClickHouse/ClickHouse/pull/50704) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 避免在 Keeper 中存储包含未知操作的日志 [#50751](https://github.com/ClickHouse/ClickHouse/pull/50751) ([Antonio Andelic](https://github.com/antonio2368)) 。
* SummingMergeTree 现已支持 DateTime64 [#50797](https://github.com/ClickHouse/ClickHouse/pull/50797) ([Jordi Villar](https://github.com/jrdi)) 。
* 为非常量时区新增兼容性设置 [#50834](https://github.com/ClickHouse/ClickHouse/pull/50834) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 修复缓存条目中 LDAP 参数哈希处理的问题 [#50865](https://github.com/ClickHouse/ClickHouse/pull/50865) ([Julian Maicher](https://github.com/jmaicher)) 。
* 在 Parquet 格式中，解析 String 中的大整数时会回退处理，而不再抛出异常 [#50873](https://github.com/ClickHouse/ClickHouse/pull/50873) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复写入备份时过于频繁检查锁文件的问题 [#50889](https://github.com/ClickHouse/ClickHouse/pull/50889) ([Vitaly Baranov](https://github.com/vitlibar)).
* 如果已启用按顺序读取，则不要应用投影。[#50923](https://github.com/ClickHouse/ClickHouse/pull/50923) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复 Azure Blob 存储迭代器中的竞争条件 [#50936](https://github.com/ClickHouse/ClickHouse/pull/50936) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)).
* 修复 `CreatingSets` 中 `sort_description` 的错误传播问题 [#50955](https://github.com/ClickHouse/ClickHouse/pull/50955) ([Nikita Taranov](https://github.com/nickitat)) 。
* 修复 Iceberg v2 中可选元数据的解析问题 [#50974](https://github.com/ClickHouse/ClickHouse/pull/50974) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* MaterializedMySQL：为空表覆盖项保留括号 [#50977](https://github.com/ClickHouse/ClickHouse/pull/50977) ([Val Doroshchuk](https://github.com/valbok)) 。
* 修复 BackupCoordinationStageSync::setError() 中发生的崩溃 [#51012](https://github.com/ClickHouse/ClickHouse/pull/51012) ([Vitaly Baranov](https://github.com/vitlibar)).
* 修复 ColumnLowCardinality 字典写时复制中一个较为隐蔽的损坏问题 [#51064](https://github.com/ClickHouse/ClickHouse/pull/51064) ([Michael Kolupaev](https://github.com/al13n321)) 。
* 生成更安全的 IV [#51086](https://github.com/ClickHouse/ClickHouse/pull/51086) ([Salvatore Mesoraca](https://github.com/aiven-sal)) 。
* 修复包含子查询的 SELECT 查询缓存失效问题 [#51132](https://github.com/ClickHouse/ClickHouse/pull/51132) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 修复 Set 索引与常量 Nullable 值比较时的问题。[#51205](https://github.com/ClickHouse/ClickHouse/pull/51205) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复 s3 和 s3Cluster 函数中的崩溃问题 [#51209](https://github.com/ClickHouse/ClickHouse/pull/51209) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 修复了与已编译表达式相关的崩溃问题 [#51231](https://github.com/ClickHouse/ClickHouse/pull/51231) ([LiuNeng](https://github.com/liuneng1994)).
* 修复 StorageURL 在切换 URL 时发生的释放后使用问题 [#51260](https://github.com/ClickHouse/ClickHouse/pull/51260) ([Michael Kolupaev](https://github.com/al13n321)) 。
* 更新了参数化视图的检查逻辑 [#51272](https://github.com/ClickHouse/ClickHouse/pull/51272) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)) 。
* 修复同一文件被多次写入备份的问题 [#51299](https://github.com/ClickHouse/ClickHouse/pull/51299) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复 ActionsDAG 中的 fuzzer 失败问题 [#51301](https://github.com/ClickHouse/ClickHouse/pull/51301) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 清理函数 `transform` 中的无用内容 [#51350](https://github.com/ClickHouse/ClickHouse/pull/51350) ([Alexey Milovidov](https://github.com/alexey-milovidov)).

### <a id="235" /> ClickHouse 23.5 版本发布，2023-06-08。[演示文稿](https://presentations.clickhouse.com/2023-release-23.5/), [视频](https://www.youtube.com/watch?v=o8Gj1ClU71M)

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

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

* 默认压缩标记和主键。这会显著缩短冷查询时间。升级说明：自 22.9 版本起已支持压缩标记和主键。如果你已启用压缩标记或主键，或者安装了 23.5 及更高版本 (这些版本默认启用压缩标记或主键) ，则无法再降级到 22.8 或更早版本。你也可以在服务器配置文件的 `<merge_tree>` 部分中，通过指定 `compress_marks` 和 `compress_primary_key` 设置来显式禁用压缩标记或主键。**升级说明：** 如果你是从 22.9 之前的版本升级，应一次性升级所有副本，或在升级前禁用压缩，或者先升级到支持压缩标记但默认未启用的中间版本，例如 23.3。[#42587](https://github.com/ClickHouse/ClickHouse/pull/42587) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 使本地对象存储与 S3 对象存储的行为保持一致，修复 append 问题 (关闭 [#48465](https://github.com/ClickHouse/ClickHouse/issues/48465)) ，并支持将其配置为独立存储。此变更向后不兼容，因为位于本地对象存储之上的 cache 与旧版本不兼容。[#48791](https://github.com/ClickHouse/ClickHouse/pull/48791) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 已移除 Experimental 功能 “in-memory data parts”。该数据格式仍然受支持，但相关设置现在是空操作，系统将改用 compact 或 wide parts。这关闭了 [#45409](https://github.com/ClickHouse/ClickHouse/issues/45409)。[#49429](https://github.com/ClickHouse/ClickHouse/pull/49429) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 调整了设置 `parallelize_output_from_storages` 和 `input_format_parquet_preserve_order` 的默认值。这使 ClickHouse 在从文件 (例如 CSV 或 Parquet) 读取时可以重排行，从而在很多情况下显著提升性能。若要恢复保序的旧行为，请使用 `parallelize_output_from_storages = 0`、`input_format_parquet_preserve_order = 1`。[#49479](https://github.com/ClickHouse/ClickHouse/pull/49479) ([Michael Kolupaev](https://github.com/al13n321)).
* 使 projections 达到生产就绪状态。新增 `optimize_use_projections` 设置，用于控制是否为 SELECT 查询选择 projections。设置 `allow_experimental_projection_optimization` 已废弃，不再起作用。[#49719](https://github.com/ClickHouse/ClickHouse/pull/49719) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 将 `joinGet` 标记为非确定性 (`dictGet` 也是如此) 。这样一来，就可以在变更中使用它们，而无需额外设置。[#49843](https://github.com/ClickHouse/ClickHouse/pull/49843) ([Azat Khuzhin](https://github.com/azat)).
* 回退 “`groupArray` returns cannot be nullable” 这一变更 (因为这会破坏 `Nullable` 类型上 `groupArray`/`groupArrayLast`/`groupArraySample` 的 binary compatibility，并很可能导致 `TOO_LARGE_ARRAY_SIZE` 或 `CANNOT_READ_ALL_DATA`) 。[#49971](https://github.com/ClickHouse/ClickHouse/pull/49971) ([Azat Khuzhin](https://github.com/azat)).
* 设置 `enable_memory_bound_merging_of_aggregation_results` 现已默认启用。如果你是从 22.12 之前的版本升级，建议在升级完成前将该标志设为 `false`。[#50319](https://github.com/ClickHouse/ClickHouse/pull/50319) ([Nikita Taranov](https://github.com/nickitat)).

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

* 新增了存储引擎 AzureBlobStorage 和 azureBlobStorage 表函数。其支持的功能与存储/表函数 S3 非常相似 \[#50604] ([https://github.com/ClickHouse/ClickHouse/pull/50604](https://github.com/ClickHouse/ClickHouse/pull/50604)) ([alesapin](https://github.com/alesapin)) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni).
* 新增了原生的 ClickHouse Keeper CLI 客户端，可通过 `clickhouse keeper-client` 使用 [#47414](https://github.com/ClickHouse/ClickHouse/pull/47414) ([pufit](https://github.com/pufit)) 。
* 新增 `urlCluster` 表函数。重构所有 \*Cluster 表函数，以减少代码重复。让 schema 推断支持所有可能的 \*Cluster 函数签名以及命名集合。关闭 [#38499](https://github.com/ClickHouse/ClickHouse/issues/38499)。[#45427](https://github.com/ClickHouse/ClickHouse/pull/45427) ([attack204](https://github.com/attack204)), Pavel Kruglov.
* 查询缓存现已可用于生产 workloads。[#47977](https://github.com/ClickHouse/ClickHouse/pull/47977) ([Robert Schulze](https://github.com/rschu1ze))。查询缓存现已支持带有 `totals` 和 `extremes` modifier 的查询。[#48853](https://github.com/ClickHouse/ClickHouse/pull/48853) ([Robert Schulze](https://github.com/rschu1ze))。为保持向后兼容性，`allow_experimental_query_cache` setting 现已标记为 Obsolete。该设置已在 [https://github.com/ClickHouse/ClickHouse/pull/47977](https://github.com/ClickHouse/ClickHouse/pull/47977) 中移除。[#49934](https://github.com/ClickHouse/ClickHouse/pull/49934) ([Timur Solodovnikov](https://github.com/tsolodov))。
* 地理空间数据类型 (`Point`、`Ring`、`Polygon` 和 `MultiPolygon`) 已达到生产可用状态。[#50022](https://github.com/ClickHouse/ClickHouse/pull/50022) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 为 PostgreSQL、MySQL、MeiliSearch 和 SQLite 表引擎新增 schema inference。关闭 [#49972](https://github.com/ClickHouse/ClickHouse/issues/49972)。[#50000](https://github.com/ClickHouse/ClickHouse/pull/50000) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 在 `CREATE USER u IDENTIFIED BY 'p'` 这类查询中，密码类型会根据服务器上 `config.xml` 中的 `default_password_type` 设置自动确定。关闭了 [#42915](https://github.com/ClickHouse/ClickHouse/issues/42915)。[#44674](https://github.com/ClickHouse/ClickHouse/pull/44674) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 新增 bcrypt 密码身份验证类型。关闭 [#34599](https://github.com/ClickHouse/ClickHouse/issues/34599)。[#44905](https://github.com/ClickHouse/ClickHouse/pull/44905) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 新增关键字 `INTO OUTFILE 'file.txt' APPEND`。[#48880](https://github.com/ClickHouse/ClickHouse/pull/48880) ([alekar](https://github.com/alekar)) 。
* 新增了 `system.zookeeper_connection` 表，用于显示 Keeper 连接相关信息。[#45245](https://github.com/ClickHouse/ClickHouse/pull/45245) ([mateng915](https://github.com/mateng0915)) 。
* 新增函数 `generateRandomStructure`，用于生成随机表结构，可与表函数 `generateRandom` 配合使用。[#47409](https://github.com/ClickHouse/ClickHouse/pull/47409) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 允许在不带 `ELSE` 分支的情况下使用 `CASE`，并扩展了 `transform` 以支持更多数据类型。还修复了一些问题：当 decimal 类型与其他数值类型混用时，这些问题会导致 transform() 返回不正确的结果。[#48300](https://github.com/ClickHouse/ClickHouse/pull/48300) ([Salvatore Mesoraca](https://github.com/aiven-sal)) 。这解决了 #2655。这解决了 #9596。这解决了 #38666。
* 为 S3 表新增了[使用 KMS 密钥的服务端加密](https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html)支持，并为 S3 磁盘新增了 `header` 设置。关闭了 [#48723](https://github.com/ClickHouse/ClickHouse/issues/48723)。[#48724](https://github.com/ClickHouse/ClickHouse/pull/48724) ([Johann Gan](https://github.com/johanngan)) 。
* 为后台任务 (合并和变更) 添加了 MemoryTracker。引入了 `merges_mutations_memory_usage_soft_limit` 和 `merges_mutations_memory_usage_to_ram_ratio` 设置，用于表示合并和变更的软内存限制。如果达到该限制，ClickHouse 将不再调度新的合并或变更任务。此外，还引入了 `MergesMutationsMemoryTracking` 指标，以便观察后台任务当前的内存使用量。重新提交 [#46089](https://github.com/ClickHouse/ClickHouse/issues/46089)。关闭 [#48774](https://github.com/ClickHouse/ClickHouse/issues/48774)。[#48787](https://github.com/ClickHouse/ClickHouse/pull/48787) ([Dmitry Novik](https://github.com/novikd)) 。
* 函数 `dotProduct` 现已支持数组。[#49050](https://github.com/ClickHouse/ClickHouse/pull/49050) ([FFFFFFFHHHHHHH](https://github.com/FFFFFFFHHHHHHH)).
* 新增对 `SHOW INDEX` 语句的支持，以提升与 MySQL 的兼容性。[#49158](https://github.com/ClickHouse/ClickHouse/pull/49158) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 为表函数 `url` 新增对虚拟列 `_file` 和 `_path` 的支持。- 改进表函数 `url` 的错误信息。- 解决了 [#49231](https://github.com/ClickHouse/ClickHouse/issues/49231) - 解决了 [#49232](https://github.com/ClickHouse/ClickHouse/issues/49232)。[#49356](https://github.com/ClickHouse/ClickHouse/pull/49356) ([Ziyi Tan](https://github.com/Ziy1-Tan)).
* 在 users.xml 文件中新增 `grants` 字段，用于为用户指定授权。[#49381](https://github.com/ClickHouse/ClickHouse/pull/49381) ([pufit](https://github.com/pufit)) 。
* 通过 grace hash join 算法支持 full/right join。[#49483](https://github.com/ClickHouse/ClickHouse/pull/49483) ([lgbo](https://github.com/lgbo-ustc)).
* `WITH FILL` 修饰符会按排序前缀对填充进行分组。由 `use_with_fill_by_sorting_prefix` 设置控制 (默认启用) 。相关内容见 [#33203](https://github.com/ClickHouse/ClickHouse/issues/33203)#issuecomment-1418736794。[#49503](https://github.com/ClickHouse/ClickHouse/pull/49503) ([Igor Nikonov](https://github.com/devcrafter)) 。
* 现在，如果未指定 "--query" (或 "-q") ，Clickhouse-client 也支持在 "--multiquery" 后直接接收查询。示例：clickhouse-client --multiquery "select 1; select 2;"。[#49870](https://github.com/ClickHouse/ClickHouse/pull/49870) ([Alexey Gerasimchuk](https://github.com/Demilivor)) 。
* 为接收来自副本的 Hello 数据包新增了单独的 `handshake_timeout`。关闭了 [#48854](https://github.com/ClickHouse/ClickHouse/issues/48854)。[#49948](https://github.com/ClickHouse/ClickHouse/pull/49948) ([Kruglov Pavel](https://github.com/Avogar))。
* 新增了函数 "space"，可按指定次数重复输出空格。[#50103](https://github.com/ClickHouse/ClickHouse/pull/50103) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 新增了 --input\_format\_csv\_trim\_whitespaces 选项。[#50215](https://github.com/ClickHouse/ClickHouse/pull/50215) ([Alexey Gerasimchuk](https://github.com/Demilivor)) 。
* 允许 `dictGetAll` 函数对 regexp tree dictionaries 以数组形式返回多个匹配项的值。关闭 [#50254](https://github.com/ClickHouse/ClickHouse/issues/50254)。[#50255](https://github.com/ClickHouse/ClickHouse/pull/50255) ([Johann Gan](https://github.com/johanngan)).
* 新增了 `toLastDayOfWeek` 函数，用于将日期或日期时间向上取整到最近的星期六或星期日。[#50315](https://github.com/ClickHouse/ClickHouse/pull/50315) ([Victor Krasnov](https://github.com/sirvickr)) 。
* 可通过指定 `ignore_data_skipping_indices` 参数来忽略跳过索引。[#50329](https://github.com/ClickHouse/ClickHouse/pull/50329) ([Boris Kuschel](https://github.com/bkuschel)) 。
* 新增 `system.user_processes` 表和 `SHOW USER PROCESSES` 查询，用于在用户级别显示内存信息和 ProfileEvents。[#50492](https://github.com/ClickHouse/ClickHouse/pull/50492) ([János Benjamin Antal](https://github.com/antaljanosbenjamin)) 。
* 新增服务器和格式设置 `display_secrets_in_show_and_select`，用于显示表、数据库、表函数和字典中的敏感信息。新增权限 `displaySecretsInShowAndSelect`，用于控制哪些用户可以查看这些敏感信息。[#46528](https://github.com/ClickHouse/ClickHouse/pull/46528) ([Mike Kot](https://github.com/myrrc)).
* 允许为某个数据库中的所有表设置 ROW POLICY。[#47640](https://github.com/ClickHouse/ClickHouse/pull/47640) ([Ilya Golshtein](https://github.com/ilejn)) 。

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

* 默认压缩标记和主键，可显著缩短冷 查询时间。升级说明：22.9 版本新增了对压缩标记和主键的支持。如果您启用了压缩标记或主键，或者安装了 23.5 及以上版本 (这些版本默认启用压缩标记和主键) ，则无法再降级到 22.8 或更早版本。您也可以在服务器配置文件的 `<merge_tree>` 部分中，通过指定 `compress_marks` 和 `compress_primary_key` 设置来显式禁用压缩标记或主键。[#42587](https://github.com/ClickHouse/ClickHouse/pull/42587) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 新增设置 s3\_max\_inflight\_parts\_for\_one\_file 用于限制单个文件范围内分段上传请求中可并发加载的分片数量。[#49961](https://github.com/ClickHouse/ClickHouse/pull/49961) ([Sema Checherinda](https://github.com/CheSema)).
* 从多个文件读取数据时，减少每个文件的并行解析线程数。修复了 [#42192](https://github.com/ClickHouse/ClickHouse/issues/42192)。[#46661](https://github.com/ClickHouse/ClickHouse/pull/46661) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)) 。
* 仅当聚合投影读取的粒度比常规读取更少时，才使用它。如果查询命中了表的 PK，但未命中投影，它会有所帮助。修复了 [#49150](https://github.com/ClickHouse/ClickHouse/issues/49150)。[#49417](https://github.com/ClickHouse/ClickHouse/pull/49417) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 如果未插入任何内容，则不要在 `ANY` 哈希 JOIN 中存储块。[#48633](https://github.com/ClickHouse/ClickHouse/pull/48633) ([vdimir](https://github.com/vdimir)).
* 修复了聚合组合器 `-If` 在 JIT 编译时的问题，并为聚合函数启用 JIT 编译。关闭 [#48120](https://github.com/ClickHouse/ClickHouse/issues/48120)。[#49083](https://github.com/ClickHouse/ClickHouse/pull/49083) ([Igor Nikonov](https://github.com/devcrafter)).
* 对于从远程表读取，我们使用更小的任务 (而不是读取整个分片) ，以让任务窃取机制发挥作用 \* 任务大小由待读取列的大小决定 \* 从 S3 读取时始终使用 1 MB 缓冲区 \* 缓存分段的边界按 1 MB 对齐，因此即使任务较小，也能保持合适的大小。这也有助于防止碎片化。[#49287](https://github.com/ClickHouse/ClickHouse/pull/49287) ([Nikita Taranov](https://github.com/nickitat)) 。
* 引入了以下设置：- `merge_max_block_size_bytes`，用于限制后台操作的内存使用量。- `vertical_merge_algorithm_min_bytes_to_activate`，用于新增一个激活垂直合并的条件。[#49313](https://github.com/ClickHouse/ClickHouse/pull/49313) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* 用于从本地文件系统读取的读缓冲区默认大小已调整为一个稍优的值。同时还引入了两个新设置：`max_read_buffer_size_local_fs` 和 `max_read_buffer_size_remote_fs`。[#49321](https://github.com/ClickHouse/ClickHouse/pull/49321) ([Nikita Taranov](https://github.com/nickitat)) 。
* 改进了 `SPARSE_HASHED`/`HASHED` 字典的内存占用和性能 (例如，`SPARSE_HASHED` 现在的内存占用减少了 2.6 倍，速度提升约 2 倍) 。[#49380](https://github.com/ClickHouse/ClickHouse/pull/49380) ([Azat Khuzhin](https://github.com/azat)) 。
* 在适当情况下，通过对 `system.query_log` 和 `system.query_thread_log` 表应用 `LowCardinality` 来进行优化。针对这些表的查询速度会更快。[#49530](https://github.com/ClickHouse/ClickHouse/pull/49530) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 读取本地 `Parquet` 文件时性能有所提升 (通过并行读取) 。[#49539](https://github.com/ClickHouse/ClickHouse/pull/49539) ([Michael Kolupaev](https://github.com/al13n321)) 。
* 在某些场景下，`RIGHT/FULL JOIN` 的性能最多可提升 2 倍，尤其是在将较小的左表与较大的右表进行连接时。[#49585](https://github.com/ClickHouse/ClickHouse/pull/49585) ([lgbo](https://github.com/lgbo-ustc)).
* 通过为 Rust 启用 LTO，BLAKE3 的性能提升了 11%。[#49600](https://github.com/ClickHouse/ClickHouse/pull/49600) ([Azat Khuzhin](https://github.com/azat)) 。现在其性能已与 C++ 相当。
* 优化 `system.opentelemetry_span_log` 的结构。在适当的地方使用 `LowCardinality`。虽然这个表总体上仍然很糟糕 (就连常见属性也使用了 Map 数据类型) ，但还是会略有改善。[#49647](https://github.com/ClickHouse/ClickHouse/pull/49647) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 尝试在 `grace_hash` JOIN 中为哈希表预留空间。[#49816](https://github.com/ClickHouse/ClickHouse/pull/49816) ([lgbo](https://github.com/lgbo-ustc)) 。
* 支持对 `uniqExactIf` 状态进行并行合并。关闭 [#49885](https://github.com/ClickHouse/ClickHouse/issues/49885)。[#50285](https://github.com/ClickHouse/ClickHouse/pull/50285) ([flynn](https://github.com/ucasfl)).
* Keeper 改进：向 Keeper 添加 `CheckNotExists` 请求，以提升复制表的性能。[#48897](https://github.com/ClickHouse/ClickHouse/pull/48897) ([Antonio Andelic](https://github.com/antonio2368)).
* Keeper 性能改进：避免在处理过程中对同一请求重复序列化。缓存大型请求的反序列化结果。由新的协调设置 `min_request_size_for_cache` 控制。[#49004](https://github.com/ClickHouse/ClickHouse/pull/49004) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 在选择要合并的 parts，且许多分区实际上没有任何可合并内容时，减少了 `List` ZooKeeper 请求的数量。[#49637](https://github.com/ClickHouse/ClickHouse/pull/49637) ([Alexander Tokmakov](https://github.com/tavplubix)) 。
* 优化 FS 缓存中的锁机制 [#44985](https://github.com/ClickHouse/ClickHouse/pull/44985) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 如果可以使用简单的 count 优化，则禁用纯并行副本。[#50594](https://github.com/ClickHouse/ClickHouse/pull/50594) ([Raúl Marín](https://github.com/Algunenano)) 。
* 在 Iceberg schema 推断中，不要为所有键发送 HEAD 请求，只对用于读取数据的键发送。[#50203](https://github.com/ClickHouse/ClickHouse/pull/50203) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 设置 `enable_memory_bound_merging_of_aggregation_results` 默认处于启用状态。[#50319](https://github.com/ClickHouse/ClickHouse/pull/50319) ([Nikita Taranov](https://github.com/nickitat)) 。

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

* `DEFLATE_QPL` codec 将最低 SIMD 版本要求降至 SSE 4.2。[qpl 中的文档变更](https://github.com/intel/qpl/commit/3f8f5cea27739f5261e8fd577dc233ffe88bf679) - Intel® QPL 依赖运行时内核分发器和 cpuid 检查来选择最佳可用实现 (sse/avx2/avx512)  - 重构了 ClickHouse 中用于构建 qpl 的 cmakefile，以与最新的上游 qpl 保持一致。[#49811](https://github.com/ClickHouse/ClickHouse/pull/49811) ([jasperzhu](https://github.com/jinjunzh)).
* 新增了对使用纯并行副本执行 JOIN 的初步支持。[#49544](https://github.com/ClickHouse/ClickHouse/pull/49544) ([Raúl Marín](https://github.com/Algunenano)).
* 在“零拷贝复制”中，提高了移除 `过期` parts 时的并行度。[#49630](https://github.com/ClickHouse/ClickHouse/pull/49630) ([Alexander Tokmakov](https://github.com/tavplubix)).
* 并行副本：1) 修复了在禁用设置 `parallel_replicas_for_non_replicated_merge_tree` 的情况下，将并行副本用于非复制表存储时出现的 `NOT_FOUND_COLUMN_IN_BLOCK` 错误；2) 现在 `allow_experimental_parallel_reading_from_replicas` 有 3 个可能的值：0、1 和 2。0 - disabled，1 - enabled，在失败时静默禁用并行副本 (例如 FINAL 或 JOIN 的情况) ，2 - enabled，在失败时抛出异常。3) 如果在 SELECT 查询中使用了 FINAL 修饰符，且启用了并行副本，那么当 `allow_experimental_parallel_reading_from_replicas` 设为 1 时，ClickHouse 会尝试禁用并行副本，否则将抛出异常。[#50195](https://github.com/ClickHouse/ClickHouse/pull/50195) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* 启用并行副本后，将始终跳过不可用的服务器 (此行为由设置 `skip_unavailable_shards` 控制，该设置默认启用且只能禁用) 。此更改关闭了：[ #48565](https://github.com/ClickHouse/ClickHouse/issues/48565)。[#50293](https://github.com/ClickHouse/ClickHouse/pull/50293) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).

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

* `BACKUP` 命令在创建备份时不会解密加密磁盘上的数据。相反，数据会以加密形式存储在备份中。此类备份只能恢复到使用相同 (或扩展后的) 加密密钥列表的加密磁盘上。[#48896](https://github.com/ClickHouse/ClickHouse/pull/48896) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 新增支持在 ATTACH PARTITION FROM 和 REPLACE PARTITION FROM 的 FROM 子句中使用临时表。[#49436](https://github.com/ClickHouse/ClickHouse/pull/49436) ([Roman Vasin](https://github.com/rvasin)) 。
* 为 `MergeTree` 表新增了设置 `async_insert`。它与查询级设置 `async_insert` 的含义相同，可为特定表启用异步插入。注意：对于来自 `clickhouse-client` 的插入查询，该设置不会生效，此时请使用查询级设置。[#49122](https://github.com/ClickHouse/ClickHouse/pull/49122) ([Anton Popov](https://github.com/CurtizJ)) 。
* 为配额创建语句的参数新增了大小后缀支持。[#49087](https://github.com/ClickHouse/ClickHouse/pull/49087) ([Eridanus](https://github.com/Eridanus117)).
* 扩展 `first_value` 和 `last_value`，使其支持 NULL。[#46467](https://github.com/ClickHouse/ClickHouse/pull/46467) ([lgbo](https://github.com/lgbo-ustc)) 。
* 为 `extractKeyValuePairs` 新增别名 `str_to_map` 和 `mapFromString`。修复 [https://github.com/clickhouse/clickhouse/issues/47185。](https://github.com/clickhouse/clickhouse/issues/47185。) [#49466](https://github.com/ClickHouse/ClickHouse/pull/49466) ([flynn](https://github.com/ucasfl)).
* 增加了对 CGroup 版本 2 的支持，以提供有关内存使用量和可用性的异步指标。此项变更关闭了 [#37983](https://github.com/ClickHouse/ClickHouse/issues/37983)。[#45999](https://github.com/ClickHouse/ClickHouse/pull/45999) ([sichenzhao](https://github.com/sichenzhao)).
* Cluster 表函数应始终跳过不可用的分片。已关闭 [#46314](https://github.com/ClickHouse/ClickHouse/issues/46314)。[#46765](https://github.com/ClickHouse/ClickHouse/pull/46765) ([zk\_kiger](https://github.com/zk-kiger))。
* 允许 CSV 文件表头中包含空列。[#47496](https://github.com/ClickHouse/ClickHouse/pull/47496) ([你不要过来啊](https://github.com/iiiuwioajdks)).
* 新增 Google Cloud Storage 的 S3 兼容表函数 `gcs`。与 `oss` 和 `cosn` 函数一样，它只是 `s3` 表函数的别名，并未引入任何新功能。[#47815](https://github.com/ClickHouse/ClickHouse/pull/47815) ([Kuba Kaflik](https://github.com/jkaflik)) 。
* 新增了为 S3 使用严格分片大小的功能 (兼容 CloudFlare R2 S3 存储) 。[#48492](https://github.com/ClickHouse/ClickHouse/pull/48492) ([Azat Khuzhin](https://github.com/azat)).
* 在 `system.clusters` 中新增了几个用于表示 `Replicated` 数据库副本信息的列：`database_shard_name`、`database_replica_name`、`is_active`。为 `SYSTEM DROP DATABASE REPLICA` 查询新增了可选的 `FROM SHARD` 子句。[#48548](https://github.com/ClickHouse/ClickHouse/pull/48548) ([Alexander Tokmakov](https://github.com/tavplubix)) 。
* 在 system.replicas 中新增一列 `zookeeper_name`，用于指示复制表的元数据存储在哪个 (辅助) zookeeper 集群中。[#48549](https://github.com/ClickHouse/ClickHouse/pull/48549) ([cangyin](https://github.com/cangyin)).
* `IN` 运算符现已支持比较 `Date` 和 `Date32`。修复了 [#48736](https://github.com/ClickHouse/ClickHouse/issues/48736)。[#48806](https://github.com/ClickHouse/ClickHouse/pull/48806) ([flynn](https://github.com/ucasfl)).
* 支持 `HDFS` 中的纠删码，作者：@M1eyu2018、@tomscut。[#48833](https://github.com/ClickHouse/ClickHouse/pull/48833) ([M1eyu](https://github.com/M1eyu2018)) 。
* 支持从辅助 ZooKeeper 集群执行 SYSTEM DROP REPLICA，可能会关闭 [#48931](https://github.com/ClickHouse/ClickHouse/issues/48931)。[#48932](https://github.com/ClickHouse/ClickHouse/pull/48932) ([wangxiaobo](https://github.com/wzb5212)) 。
* 为 MongoDB 添加 Array 数据类型。关闭 [#48598](https://github.com/ClickHouse/ClickHouse/issues/48598)。[#48983](https://github.com/ClickHouse/ClickHouse/pull/48983) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 支持将 `Interval` 数据类型存储在表中。[#49085](https://github.com/ClickHouse/ClickHouse/pull/49085) ([larryluogit](https://github.com/larryluogit)) 。
* 允许在未显式定义窗口帧的情况下使用 `ntile` 窗口函数：`ntile(3) OVER (ORDER BY a)`，解决了 [#46763](https://github.com/ClickHouse/ClickHouse/issues/46763)。[#49093](https://github.com/ClickHouse/ClickHouse/pull/49093) ([vdimir](https://github.com/vdimir)) 。
* 新增了设置 (`number_of_mutations_to_delay`、`number_of_mutations_to_throw`) ，用于在表中已有大量未完成变更时，对会创建变更的 `ALTER` 查询 (`ALTER UPDATE`、`ALTER DELETE`、`ALTER MODIFY COLUMN`、...) 进行延迟处理或直接报错。[#49117](https://github.com/ClickHouse/ClickHouse/pull/49117) ([Anton Popov](https://github.com/CurtizJ)) 。
* 在文件系统缓存中捕获 `create_directories` 抛出的异常。[#49203](https://github.com/ClickHouse/ClickHouse/pull/49203) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 将内嵌示例复制到 `system.functions` 中的新字段 `example`，以补充 `description` 字段。[#49222](https://github.com/ClickHouse/ClickHouse/pull/49222) ([Dan Roscigno](https://github.com/DanRoscigno)) 。
* 为 MongoDB 字典启用连接选项。示例：`xml <source> <mongodb> <host>localhost</host> <port>27017</port> <user></user> <password></password> <db>test</db> <collection>dictionary_source</collection> <options>ssl=true</options> </mongodb> </source>` ### 面向用户变更的文档条目。[#49225](https://github.com/ClickHouse/ClickHouse/pull/49225) ([MikhailBurdukov](https://github.com/MikhailBurdukov)) 。
* 为 `kolmogorovSmirnovTest` 的 `asymp` 计算方法新增了别名 `asymptotic`。文档也已改进。[#49286](https://github.com/ClickHouse/ClickHouse/pull/49286) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* 聚合函数 groupBitAnd/Or/Xor 现在也支持有符号整数数据。这使其与标量函数 bitAnd/Or/Xor 的行为保持一致。[#49292](https://github.com/ClickHouse/ClickHouse/pull/49292) ([exmy](https://github.com/exmy)).
* 将函数文档拆分成更细化的字段。[#49300](https://github.com/ClickHouse/ClickHouse/pull/49300) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 使用服务器内所有表共享的多个线程来加载过期的数据分区片段。线程池及其队列的大小由 `max_outdated_parts_loading_thread_pool_size` 和 `outdated_part_loading_thread_pool_queue_size` 设置控制。[#49317](https://github.com/ClickHouse/ClickHouse/pull/49317) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 当 `LowCardinality` 列在块之间共享字典时，不要高估处理后数据的大小。此更改修复了 [#49322](https://github.com/ClickHouse/ClickHouse/issues/49322)。另请参见 [#48745](https://github.com/ClickHouse/ClickHouse/issues/48745)。[#49323](https://github.com/ClickHouse/ClickHouse/pull/49323) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* Parquet 写入器现在在通过 `OUTFILE` 调用时，会使用合理的行组大小。[#49325](https://github.com/ClickHouse/ClickHouse/pull/49325) ([Michael Kolupaev](https://github.com/al13n321)) 。
* 如果别名带引号，则允许将 `ARRAY` 这类受限关键字用作别名。关闭 [#49324](https://github.com/ClickHouse/ClickHouse/issues/49324)。[#49360](https://github.com/ClickHouse/ClickHouse/pull/49360) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 数据分区片段的加载和删除作业已从按表分别使用的池迁移到全服务器范围的共享池中。池大小由顶层配置中的设置 `max_active_parts_loading_thread_pool_size`、`max_outdated_parts_loading_thread_pool_size` 和 `max_parts_cleaning_thread_pool_size` 控制。表级设置 `max_part_loading_threads` 和 `max_part_removal_threads` 已过时。[#49474](https://github.com/ClickHouse/ClickHouse/pull/49474) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 允许在 Play UI 的 URL 中使用 `?password=pass`。密码会在浏览器历史记录中被替换掉。[#49505](https://github.com/ClickHouse/ClickHouse/pull/49505) ([Mike Kot](https://github.com/myrrc)).
* 允许从远程文件系统读取大小为 0 的对象。 (因为空文件不会被备份，所以元数据文件中最终可能会出现零个 blob。) 关闭 [#49480](https://github.com/ClickHouse/ClickHouse/issues/49480)。[#49519](https://github.com/ClickHouse/ClickHouse/pull/49519) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 在 `ThreadGroup` 脱离后，将线程的 MemoryTracker 挂接到 `total_memory_tracker`。[#49527](https://github.com/ClickHouse/ClickHouse/pull/49527) ([Dmitry Novik](https://github.com/novikd)) 。
* 修复了在查询中多次使用同一个查询参数时参数化视图出现的问题。[#49556](https://github.com/ClickHouse/ClickHouse/pull/49556) ([Azat Khuzhin](https://github.com/azat)).
* 释放查询上下文中为最近一次发送的 ProfileEvents snapshot 分配的内存。后续跟进见 [#47564](https://github.com/ClickHouse/ClickHouse/issues/47564)。[#49561](https://github.com/ClickHouse/ClickHouse/pull/49561) ([Dmitry Novik](https://github.com/novikd)) 。
* 函数 "makeDate" 现已提供一个与 MySQL 兼容的重载版本 (year 和一年中的第几天这两个参数) 。[#49603](https://github.com/ClickHouse/ClickHouse/pull/49603) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 支持 `RegExpTreeDictionary` 的 `dictionary` 表函数。[#49666](https://github.com/ClickHouse/ClickHouse/pull/49666) ([Han Fei](https://github.com/hanfei1991)) 。
* 新增了加权公平 IO 调度策略。新增了动态资源管理器，可在运行时更新 IO 调度层级，而无需重启服务器。[#49671](https://github.com/ClickHouse/ClickHouse/pull/49671) ([Sergei Trifonov](https://github.com/serxa)) 。
* 在向 GCS 完成分段上传后新增 compose 请求。这样一来，就可以对通过分段上传上传的对象执行复制操作。建议将 `s3_strict_upload_part_size` 设置为某个值，因为如果对象由大小不同的分片组成，compose 请求可能会失败。[#49693](https://github.com/ClickHouse/ClickHouse/pull/49693) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 对于 `extractKeyValuePairs` 函数：改进“尽力而为”的解析逻辑，使其将 `key_value_delimiter` 视为值的有效组成部分。这也简化了分支逻辑，甚至可能稍微提升一些速度。[#49760](https://github.com/ClickHouse/ClickHouse/pull/49760) ([Arthur Passos](https://github.com/arthurpassos)).
* 为 system.processors\_profile\_log 添加 `initial_query_id` 字段 [#49777](https://github.com/ClickHouse/ClickHouse/pull/49777) ([helifu](https://github.com/helifu)) 。
* 系统日志表现已支持自定义排序键。[#49778](https://github.com/ClickHouse/ClickHouse/pull/49778) ([helifu](https://github.com/helifu)).
* `system.query_log` 中新增了一个字段 `partitions`，用于标识哪些分区参与了计算。[#49779](https://github.com/ClickHouse/ClickHouse/pull/49779) ([helifu](https://github.com/helifu)).
* 为 `ReplicatedMergeTree` 新增了 `enable_the_endpoint_id_with_zookeeper_name_prefix` 设置 (默认禁用) 。启用后，它会将 ZooKeeper 集群名称添加到表的服务器间通信端点中。这样可以避免在存在路径相同但辅助 ZooKeeper 不同的复制表时出现 `Duplicate interserver IO endpoint` 错误。[#49780](https://github.com/ClickHouse/ClickHouse/pull/49780) ([helifu](https://github.com/helifu)) 。
* 为 `clickhouse-local` 增加查询参数。修复了 [#46561](https://github.com/ClickHouse/ClickHouse/issues/46561)。[#49785](https://github.com/ClickHouse/ClickHouse/pull/49785) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 默认允许从 YAML 加载字典和函数。在早期版本中，由于它们默认期望的是 `*.xml` 文件，因此需要在配置文件中编辑 `dictionaries_config` 或 `user_defined_executable_functions_config`。[#49812](https://github.com/ClickHouse/ClickHouse/pull/49812) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* Kafka 表引擎现已支持使用别名列。[#49824](https://github.com/ClickHouse/ClickHouse/pull/49824) ([Aleksandr Musorin](https://github.com/AVMusorin)) 。
* 新增一项设置，用于限制 `extractKeyValuePairs` 生成的键值对最大数量，以避免占用过多内存，起到保护作用。[#49836](https://github.com/ClickHouse/ClickHouse/pull/49836) ([Arthur Passos](https://github.com/arthurpassos)) 。
* 增加了对一种 (不常见的) 情况的支持，即 `IN` 运算符中的参数为单元素 Tuple。 [#49844](https://github.com/ClickHouse/ClickHouse/pull/49844) ([MikhailBurdukov](https://github.com/MikhailBurdukov)).
* `bitHammingDistance` 函数支持 `String` 和 `FixedString` 数据类型。已关闭 [#48827](https://github.com/ClickHouse/ClickHouse/issues/48827)。[#49858](https://github.com/ClickHouse/ClickHouse/pull/49858) ([flynn](https://github.com/ucasfl)).
* 修复了 OS X 上客户端中重置 timeout 时出现的错误。[#49863](https://github.com/ClickHouse/ClickHouse/pull/49863) ([alekar](https://github.com/alekar)) 。
* 为函数 `bitCount` 新增了对大整数的支持，例如 UInt128、Int128、UInt256 和 Int256。这使 AI 应用能够在大型位掩码上计算 Hamming 距离。[#49867](https://github.com/ClickHouse/ClickHouse/pull/49867) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 在加密磁盘中可使用指纹代替密钥 ID。这简化了加密磁盘的配置。[#49882](https://github.com/ClickHouse/ClickHouse/pull/49882) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 为 PostgreSQL 添加 UUID 数据类型。修复 [#49739](https://github.com/ClickHouse/ClickHouse/issues/49739)。[#49894](https://github.com/ClickHouse/ClickHouse/pull/49894) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 函数 `toUnixTimestamp` 现在支持接受 `Date` 和 `Date32` 类型的参数。[#49989](https://github.com/ClickHouse/ClickHouse/pull/49989) ([Victor Krasnov](https://github.com/sirvickr)) 。
* 字典仅计入服务器内存。 [#49995](https://github.com/ClickHouse/ClickHouse/pull/49995) ([Azat Khuzhin](https://github.com/azat)).
* 服务器将允许把 `SQL_*` 设置 (例如 `SQL_AUTO_IS_NULL`) 作为空操作来使用，以兼容 MySQL。这修复了 [#49927](https://github.com/ClickHouse/ClickHouse/issues/49927)。[#50013](https://github.com/ClickHouse/ClickHouse/pull/50013) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 为 ON CLUSTER 查询保留 initial\_query\_id，这对查看内部信息很有帮助 (在 `distributed_ddl_entry_format_version=5` 下) 。[#50015](https://github.com/ClickHouse/ClickHouse/pull/50015) ([Azat Khuzhin](https://github.com/azat)).
* 通过使用别名 (`allow_experimental_projection_optimization` 用作 `optimize_use_projections` 的别名，`allow_experimental_lightweight_delete` 用作 `enable_lightweight_delete` 的别名) ，保留对重命名设置的向后兼容性。[#50044](https://github.com/ClickHouse/ClickHouse/pull/50044) ([Azat Khuzhin](https://github.com/azat)) 。
* 支持通过设置 my\_hostname 传入 FQDN，以便在 Keeper 中注册集群节点。新增 invisible 设置，以支持多个计算组。每个计算组都作为一个集群存在，并且对其他计算组不可见。[#50186](https://github.com/ClickHouse/ClickHouse/pull/50186) ([Yangkuan Liu](https://github.com/LiuYangkuan)).
* 修复了 PostgreSQL 在指定 `LIMIT n` 的情况下仍会读取全部数据的问题。[#50187](https://github.com/ClickHouse/ClickHouse/pull/50187) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 为包含子查询的查询新增 profile events (`QueriesWithSubqueries`/`SelectQueriesWithSubqueries`/`InsertQueriesWithSubqueries`) 。[#50204](https://github.com/ClickHouse/ClickHouse/pull/50204) ([Azat Khuzhin](https://github.com/azat)) 。
* 在 users.xml 文件中新增 `roles` 字段，允许通过配置文件为角色指定授权。[#50278](https://github.com/ClickHouse/ClickHouse/pull/50278) ([pufit](https://github.com/pufit))。
* 在 AsynchronousMetrics 中上报 `CGroupCpuCfsPeriod` 和 `CGroupCpuCfsQuota`。- 在 server 启动期间遵守 cgroup v2 的内存限制。[#50379](https://github.com/ClickHouse/ClickHouse/pull/50379) ([alekar](https://github.com/alekar)).
* 为 SIGQUIT 添加一个信号处理器，使其行为与 SIGINT 相同。关闭 [#50298](https://github.com/ClickHouse/ClickHouse/issues/50298)。[#50435](https://github.com/ClickHouse/ClickHouse/pull/50435) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 如果 JSON 因输出对象过大而解析失败，则输出最后的位置，以便调试。[#50474](https://github.com/ClickHouse/ClickHouse/pull/50474) ([Valentin Alexeev](https://github.com/valentinalexeev)) 。
* 支持非固定大小的 Decimal。关闭了 [#49130](https://github.com/ClickHouse/ClickHouse/issues/49130)。[#50586](https://github.com/ClickHouse/ClickHouse/pull/50586) ([Kruglov Pavel](https://github.com/Avogar)) 。

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

* 全新改进的 `keeper-bench`。所有内容都可以通过 YAML/XML 文件自定义：- 请求生成器 - 每种类型的请求生成器都可以有一组专用字段 - 只需在 `multi` 键下进行相同配置，即可生成多请求 - 可以为 multi 中的每个请求或子请求定义 `weight` 字段，以控制分布 - 定义测试运行前需要建立的树 - 可以定义主机，所有 timeout 都可自定义，还能控制为每个主机生成多少个 sessions - 使用 `min_value` 和 `max_value` 字段定义的整数会作为随机数生成器。[#48547](https://github.com/ClickHouse/ClickHouse/pull/48547) ([Antonio Andelic](https://github.com/antonio2368)) 。
* Io\_uring 不支持 macOS，本地运行测试时请勿选择它，以避免偶发性失败。[#49250](https://github.com/ClickHouse/ClickHouse/pull/49250) ([Frank Chen](https://github.com/FrankChen021)) 。
* 支持用于测试的具名故障注入。[#49361](https://github.com/ClickHouse/ClickHouse/pull/49361) ([Han Fei](https://github.com/hanfei1991)) 。
* 允许 ClickHouse 在不提供 `prctl` (进程控制) 系统调用的操作系统中运行，例如 AWS Lambda。 [#49538](https://github.com/ClickHouse/ClickHouse/pull/49538) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 修复了 qpl 中 contrib/isa-l 与 isa-l 的构建冲突问题 [49296](https://github.com/ClickHouse/ClickHouse/issues/49296)。[#49584](https://github.com/ClickHouse/ClickHouse/pull/49584) ([jasperzhu](https://github.com/jinjunzh)).
* 现在，工具仅会在显式指定 ("-DENABLE\_UTILS=1") 时才构建，而不再默认构建，这缩短了典型开发构建中的链接时间。[#49620](https://github.com/ClickHouse/ClickHouse/pull/49620) ([Robert Schulze](https://github.com/rschu1ze)).
* 将 idxd-config 的构建说明拆分到单独的 CMake 文件中，以避免日后被误删。[#49651](https://github.com/ClickHouse/ClickHouse/pull/49651) ([jasperzhu](https://github.com/jinjunzh)) 。
* 在 master 中添加了启用 analyzer 的 CI 检查。后续跟进见 [#49562](https://github.com/ClickHouse/ClickHouse/issues/49562)。[#49668](https://github.com/ClickHouse/ClickHouse/pull/49668) ([Dmitry Novik](https://github.com/novikd)) 。
* 切换至 LLVM/clang 16。 [#49678](https://github.com/ClickHouse/ClickHouse/pull/49678) ([Azat Khuzhin](https://github.com/azat)).
* 支持使用 clang-17 构建 ClickHouse。[#49851](https://github.com/ClickHouse/ClickHouse/pull/49851) ([Alexey Milovidov](https://github.com/alexey-milovidov)). [#50410](https://github.com/ClickHouse/ClickHouse/pull/50410) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* ClickHouse 现在更容易集成到其他 cmake 项目中了。[#49991](https://github.com/ClickHouse/ClickHouse/pull/49991) ([Amos Bird](https://github.com/amosbird)) 。 (但强烈不建议这样做 - Alexey Milovidov) 。
* 修复 [#47151](https://github.com/ClickHouse/ClickHouse/issues/47151) 之后出现的异常额外 QEMU 日志，参见 [https://s3.amazonaws.com/clickhouse-test-reports/50078/a4743996ee4f3583884d07bcd6501df0cfdaa346/stateless\&#95;tests\&#95;\&#95;release\&#95;\&#95;databasereplicated\&#95;\&#95;\[3\&#95;4\].html。\[#50442](https://s3.amazonaws.com/clickhouse-test-reports/50078/a4743996ee4f3583884d07bcd6501df0cfdaa346/stateless\&#95;tests\&#95;\&#95;release\&#95;\&#95;databasereplicated\&#95;\&#95;\[3\&#95;4].html。\[#50442)]\([https://github.com/ClickHouse/ClickHouse/pull/50442](https://github.com/ClickHouse/ClickHouse/pull/50442)) ([Mikhail f. Shiryaev](https://github.com/Felixoid)) 。
* ClickHouse 现已可在 Linux RISC-V 6.1.22 上运行。此更改已关闭 [#50456](https://github.com/ClickHouse/ClickHouse/issues/50456)。[#50457](https://github.com/ClickHouse/ClickHouse/pull/50457) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 将内部 protobuf 升级至 v3.18 (修复误报的 CVE-2022-1941) 。[#50400](https://github.com/ClickHouse/ClickHouse/pull/50400) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 将内部 libxml2 升级至 v2.10.4 (修复了被误报的 CVE-2023-28484 和 CVE-2023-29469) 。[#50402](https://github.com/ClickHouse/ClickHouse/pull/50402) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 将 c-ares 升级至 v1.19.1 (CVE-2023-32067、CVE-2023-31130、CVE-2023-31147 均为误报) 。[#50403](https://github.com/ClickHouse/ClickHouse/pull/50403) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 修复 libgsasl 中误报的 CVE-2022-2469。 [#50404](https://github.com/ClickHouse/ClickHouse/pull/50404) ([Robert Schulze](https://github.com/rschu1ze)).

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

* ActionsDAG：修复了错误的优化逻辑 [#47584](https://github.com/ClickHouse/ClickHouse/pull/47584) ([Salvatore Mesoraca](https://github.com/aiven-sal)).
* 正确处理 Keeper 中的并发快照 [#48466](https://github.com/ClickHouse/ClickHouse/pull/48466) ([Antonio Andelic](https://github.com/antonio2368)) 。
* MergeTreeMarksLoader 持有的是 DataPart，而不是 DataPartStorage [#48515](https://github.com/ClickHouse/ClickHouse/pull/48515) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)).
* 修复序列状态 [#48603](https://github.com/ClickHouse/ClickHouse/pull/48603) ([Ilya Golshtein](https://github.com/ilejn)) 。
* 此前失败时的 Back/Restore 并发检查 [#48726](https://github.com/ClickHouse/ClickHouse/pull/48726) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)) 。
* 修复：对具有不存在的 ZK 路径的表执行 Attach 时，ReadonlyReplica 指标不会增加的问题 [#48954](https://github.com/ClickHouse/ClickHouse/pull/48954) ([wangxiaobo](https://github.com/wzb5212)).
* 修复了某些位置可能因未捕获异常而触发 terminate 的问题 [#49112](https://github.com/ClickHouse/ClickHouse/pull/49112) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复包含多个 StorageJoin 的查询中出现的 key not found 错误 [#49137](https://github.com/ClickHouse/ClickHouse/pull/49137) ([vdimir](https://github.com/vdimir)).
* 修复使用 Nullable 主键时查询结果错误的问题 [#49172](https://github.com/ClickHouse/ClickHouse/pull/49172) ([Duc Canh Le](https://github.com/canhld94)).
* 修复 reinterpretAs\*() 在大端序机器上的问题 [#49198](https://github.com/ClickHouse/ClickHouse/pull/49198) ([Suzy Wang](https://github.com/SuzyWangIBMer)) 。
* (Experimental 零拷贝复制) 更原子地锁定零拷贝 parts [#49211](https://github.com/ClickHouse/ClickHouse/pull/49211) ([alesapin](https://github.com/alesapin)).
* 修复加载过期分区片段时的竞态条件 [#49223](https://github.com/ClickHouse/ClickHouse/pull/49223) ([Alexander Tokmakov](https://github.com/tavplubix)) 。
* 修复在所有键值均为 NULL 且分组使用 rollup 时返回错误结果的问题 [#49282](https://github.com/ClickHouse/ClickHouse/pull/49282) ([Shuai li](https://github.com/loneylee)).
* 修复带有 SHARDS 的 HASHED 字典在计算 load\_factor 时的问题 [#49319](https://github.com/ClickHouse/ClickHouse/pull/49319) ([Azat Khuzhin](https://github.com/azat)) 。
* 不允许为别名列配置压缩 CODEC [#49363](https://github.com/ClickHouse/ClickHouse/pull/49363) ([Timur Solodovnikov](https://github.com/tsolodov)) 。
* 修复删除现有分片目录时出现的错误 [#49365](https://github.com/ClickHouse/ClickHouse/pull/49365) ([alesapin](https://github.com/alesapin)).
* 正确修复了使用 HMAC 时的 GCS 问题 [#49390](https://github.com/ClickHouse/ClickHouse/pull/49390) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 修复了从 remote() 读取时未构建子查询结果集的 fuzz 缺陷 [#49425](https://github.com/ClickHouse/ClickHouse/pull/49425) ([Alexander Gololobov](https://github.com/davenger)) 。
* 将 `shutdown_wait_unfinished_queries` 取反 [#49427](https://github.com/ClickHouse/ClickHouse/pull/49427) ([Konstantin Bogdanov](https://github.com/thevar1able)) 。
* (Experimental 零拷贝复制) 修复另一个零拷贝相关错误 [#49473](https://github.com/ClickHouse/ClickHouse/pull/49473) ([alesapin](https://github.com/alesapin)).
* 修复 postgres 数据库设置问题 [#49481](https://github.com/ClickHouse/ClickHouse/pull/49481) ([Mal Curtis](https://github.com/snikch)) 。
* 正确处理 `s3Cluster` 的参数 [#49490](https://github.com/ClickHouse/ClickHouse/pull/49490) ([Antonio Andelic](https://github.com/antonio2368)).
* 修复 TraceCollector 析构函数中的问题。[#49508](https://github.com/ClickHouse/ClickHouse/pull/49508) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* 修复 AsynchronousReadIndirectBufferFromRemoteFS 在短距离寻道时失效的问题 [#49525](https://github.com/ClickHouse/ClickHouse/pull/49525) ([Michael Kolupaev](https://github.com/al13n321)) 。
* 修复字典的加载顺序 [#49560](https://github.com/ClickHouse/ClickHouse/pull/49560) ([Alexander Tokmakov](https://github.com/tavplubix)) 。
* 禁止修改 Object('json') 列的数据类型 [#49563](https://github.com/ClickHouse/ClickHouse/pull/49563) ([Nikolay Degterinsky](https://github.com/evillique)).
* 修复压力测试问题 (逻辑错误：应满足 7134 >= 11030)  [#49623](https://github.com/ClickHouse/ClickHouse/pull/49623) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 修复 DISTINCT 的错误 [#49628](https://github.com/ClickHouse/ClickHouse/pull/49628) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 修复：按顺序 DISTINCT 在未排序列包含零值时的问题 [#49636](https://github.com/ClickHouse/ClickHouse/pull/49636) ([Igor Nikonov](https://github.com/devcrafter)) 。
* 修复了在大整数中由 UBSan 配合 fuzzer 发现的一处偶发错误 [#49645](https://github.com/ClickHouse/ClickHouse/pull/49645) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 修复重启后读取稀疏列时的问题 [#49660](https://github.com/ClickHouse/ClickHouse/pull/49660) ([Anton Popov](https://github.com/CurtizJ)).
* 修复在 fibers 环境下 SpanHolder::finish() 中的断言问题 [#49673](https://github.com/ClickHouse/ClickHouse/pull/49673) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复带有稀疏参数的短路函数和变更的问题 [#49716](https://github.com/ClickHouse/ClickHouse/pull/49716) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复将追加文件写入增量备份时的问题 [#49725](https://github.com/ClickHouse/ClickHouse/pull/49725) ([Vitaly Baranov](https://github.com/vitlibar)).
* 修复在包含 Object 列的表上执行轻量级删除变更时出现的“表中不存在物理列 \_row\_exists”错误。[#49737](https://github.com/ClickHouse/ClickHouse/pull/49737) ([Alexander Gololobov](https://github.com/davenger)) 。
* 修复 randomStringUTF8(奇数长度) 中的 msan 问题 [#49750](https://github.com/ClickHouse/ClickHouse/pull/49750) ([Robert Schulze](https://github.com/rschu1ze)).
* 修复聚合函数 kolmogorovSmirnovTest 的问题 [#49768](https://github.com/ClickHouse/ClickHouse/pull/49768) ([FFFFFFFHHHHHHH](https://github.com/FFFFFFFHHHHHHH)).
* 修复原生协议中的设置别名问题 [#49776](https://github.com/ClickHouse/ClickHouse/pull/49776) ([Azat Khuzhin](https://github.com/azat)).
* 修复 `arrayMap` 处理单参数元组数组时的问题 [#49789](https://github.com/ClickHouse/ClickHouse/pull/49789) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复按查询粒度的 IO/BACKUP 限流设置 [#49797](https://github.com/ClickHouse/ClickHouse/pull/49797) ([Azat Khuzhin](https://github.com/azat)).
* 修复了在 profile 定义中设置 NULL 时的问题 [#49831](https://github.com/ClickHouse/ClickHouse/pull/49831) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复了 projections 与 aggregate\_functions\_null\_for\_empty 设置相关的一个问题 (针对 query\_plan\_optimize\_projection) [#49873](https://github.com/ClickHouse/ClickHouse/pull/49873) ([Amos Bird](https://github.com/amosbird)) 。
* 修复重启后 Distributed 异步 INSERT 无法处理待处理批次的问题 [#49884](https://github.com/ClickHouse/ClickHouse/pull/49884) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复 CacheMetadata::doCleanup 中的断言问题 [#49914](https://github.com/ClickHouse/ClickHouse/pull/49914) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复 OptimizeRegularExpression 中的 `is_prefix` 问题 [#49919](https://github.com/ClickHouse/ClickHouse/pull/49919) ([Han Fei](https://github.com/hanfei1991)) 。
* 修复了指标 `WriteBufferFromS3Bytes`、`WriteBufferFromS3Microseconds` 和 `WriteBufferFromS3RequestsErrors` [#49930](https://github.com/ClickHouse/ClickHouse/pull/49930) ([Aleksandr Musorin](https://github.com/AVMusorin)) 。
* 修复 protobuf 中 IPv6 的编码问题 [#49933](https://github.com/ClickHouse/ClickHouse/pull/49933) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* 修复文本格式中错误解析 Nullable 时可能导致的逻辑错误 [#49960](https://github.com/ClickHouse/ClickHouse/pull/49960) ([Kruglov Pavel](https://github.com/Avogar)).
* 新增设置 output\_format\_parquet\_compliant\_nested\_types，以生成兼容性更好的 Parquet 文件 [#50001](https://github.com/ClickHouse/ClickHouse/pull/50001) ([Michael Kolupaev](https://github.com/al13n321)) 。
* 修复压力测试中 “Not enough space to add ...” 的逻辑错误 [#50021](https://github.com/ClickHouse/ClickHouse/pull/50021) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 避免在 `ReplicatedMergeTree` 的 attach 线程中启动表时出现死锁 [#50026](https://github.com/ClickHouse/ClickHouse/pull/50026) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 修复 `SpanHolder::finish()` 中与 fibers 相关的断言问题 (第 2 次尝试) [#50034](https://github.com/ClickHouse/ClickHouse/pull/50034) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 为 DDL OpenTelemetry 上下文序列化添加适当的转义处理 [#50045](https://github.com/ClickHouse/ClickHouse/pull/50045) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复对损坏的 projection parts 的报告问题 [#50052](https://github.com/ClickHouse/ClickHouse/pull/50052) ([Amos Bird](https://github.com/amosbird)) 。
* 修复 JIT 编译中“不等于 NaN”判断的问题 [#50056](https://github.com/ClickHouse/ClickHouse/pull/50056) ([Maksim Kita](https://github.com/kitaisreal)) 。
* 修复了不带参数的 Replicated 数据库导致崩溃的问题 [#50058](https://github.com/ClickHouse/ClickHouse/pull/50058) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了在常量条件和 Nullable 参数情况下 `multiIf` 发生崩溃的问题 [#50123](https://github.com/ClickHouse/ClickHouse/pull/50123) ([Anton Popov](https://github.com/CurtizJ)).
* 修复日期相关键的无效索引分析 [#50153](https://github.com/ClickHouse/ClickHouse/pull/50153) ([Amos Bird](https://github.com/amosbird)) 。
* 当不存在 ORDER BY 列时，不允许修改 ORDER BY [#50154](https://github.com/ClickHouse/ClickHouse/pull/50154) ([Han Fei](https://github.com/hanfei1991)) 。
* 修复了当二元运算符包含 NULL 常量参数时索引分析失效的问题 [#50177](https://github.com/ClickHouse/ClickHouse/pull/50177) ([Amos Bird](https://github.com/amosbird)) 。
* clickhouse-client：禁止同时使用 `--query` 和 `--queries-file` [#50210](https://github.com/ClickHouse/ClickHouse/pull/50210) ([Alexey Gerasimchuk](https://github.com/Demilivor)) 。
* 修复 INTO OUTFILE 扩展功能 (APPEND / AND STDOUT) 和 WATCH EVENTS 中的 UB [#50216](https://github.com/ClickHouse/ClickHouse/pull/50216) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复 CustomSeparatedIgnoreSpaces format 中行尾空格被跳过的问题 [#50224](https://github.com/ClickHouse/ClickHouse/pull/50224) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复 Iceberg 元数据解析问题 [#50232](https://github.com/ClickHouse/ClickHouse/pull/50232) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复 WITH 子句中嵌套分布式 SELECT 的问题 [#50234](https://github.com/ClickHouse/ClickHouse/pull/50234) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复 keyed siphash 的 msan 问题 [#50245](https://github.com/ClickHouse/ClickHouse/pull/50245) ([Robert Schulze](https://github.com/rschu1ze)).
* 修复了 Poco 套接字在非阻塞模式下的问题，改用真正的非阻塞套接字 [#50252](https://github.com/ClickHouse/ClickHouse/pull/50252) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复备份项的校验和计算问题 [#50264](https://github.com/ClickHouse/ClickHouse/pull/50264) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 比较函数中的 NaN 修复 [#50287](https://github.com/ClickHouse/ClickHouse/pull/50287) ([Maksim Kita](https://github.com/kitaisreal)) 。
* JIT 聚合中 Nullable 键的修复 [#50291](https://github.com/ClickHouse/ClickHouse/pull/50291) ([Maksim Kita](https://github.com/kitaisreal)).
* 修复 `clickhouse-local` 在写入空的 Arrow 或 Parquet 输出时发生崩溃的问题 [#50328](https://github.com/ClickHouse/ClickHouse/pull/50328) ([Michael Kolupaev](https://github.com/al13n321)).
* 修复了调用 Pool::Entry::disconnect() 时发生的崩溃 [#50334](https://github.com/ClickHouse/ClickHouse/pull/50334) ([Val Doroshchuk](https://github.com/valbok)) 。
* 通过延长目录锁的持有时间，改进了分片拉取 [#50339](https://github.com/ClickHouse/ClickHouse/pull/50339) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)).
* 修复 bitShift\* 函数在两个参数都为常量时的问题 [#50343](https://github.com/ClickHouse/ClickHouse/pull/50343) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了 Keeper 在预处理请求时因异常导致的死锁问题。[#50387](https://github.com/ClickHouse/ClickHouse/pull/50387) ([frinkr](https://github.com/frinkr)).
* 修复 const 整数值哈希计算的问题 [#50421](https://github.com/ClickHouse/ClickHouse/pull/50421) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 修复了数据跳过索引中 merge\_tree\_min\_rows\_for\_seek/merge\_tree\_min\_bytes\_for\_seek 的问题 [#50432](https://github.com/ClickHouse/ClickHouse/pull/50432) ([Azat Khuzhin](https://github.com/azat)).
* 限制加载过期分区片段时的并发任务数量 [#50450](https://github.com/ClickHouse/ClickHouse/pull/50450) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* Keeper 修复：安装快照后应用未提交的状态 [#50483](https://github.com/ClickHouse/ClickHouse/pull/50483) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 修复不正确的常量折叠 [#50536](https://github.com/ClickHouse/ClickHouse/pull/50536) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 修复压力测试中的逻辑错误 (没有足够空间添加……) [#50583](https://github.com/ClickHouse/ClickHouse/pull/50583) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复 values 表函数中将 Null 转换为 LowCardinality(Nullable) 的问题 [#50637](https://github.com/ClickHouse/ClickHouse/pull/50637) ([Kruglov Pavel](https://github.com/Avogar)).
* 撤销无效的 RegExpTreeDictionary 优化 [#50642](https://github.com/ClickHouse/ClickHouse/pull/50642) ([Johann Gan](https://github.com/johanngan)) 。

### <a id="234" /> ClickHouse 23.4 版本发布，2023-04-26。 [Presentation](https://presentations.clickhouse.com/2023-release-23.4/), [Video](https://www.youtube.com/watch?v=4rrf6bk_mOg)

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

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

* function formatDateTime() 中的格式说明符 '%M' 现在输出月份名称，而不是分钟。这使其行为与 MySQL 保持一致。可以使用设置 "formatdatetime\_parsedatetime\_m\_is\_month\_name = 0" 恢复之前的行为。 [#47246](https://github.com/ClickHouse/ClickHouse/pull/47246) ([Robert Schulze](https://github.com/rschu1ze)).
* 只有在使用虚拟文件系统缓存时，此更改才有意义。如果虚拟文件系统缓存配置中的 `path` 非空且不是绝对路径，则会将其放到 `<ClickHouse server 数据目录>/caches/<缓存配置中的路径>` 下。 [#48784](https://github.com/ClickHouse/ClickHouse/pull/48784) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 现在会拒绝主/二级索引和排序键中表达式相同的情况。可以使用设置 `allow_suspicious_indices` 禁用此行为。 [#48536](https://github.com/ClickHouse/ClickHouse/pull/48536) ([凌涛](https://github.com/lingtaolf)).

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

* 支持新的聚合函数 `quantileGK`/`quantilesGK`，类似于 Spark 中的 [approx\_percentile](https://spark.apache.org/docs/latest/api/sql/index.html#approx_percentile)。有关 Greenwald-Khanna 算法，详见 [http://infolab.stanford.edu/\~datar/courses/cs361a/papers/quantiles.pdf。\[#46428](http://infolab.stanford.edu/~datar/courses/cs361a/papers/quantiles.pdf。\[#46428)]\([https://github.com/ClickHouse/ClickHouse/pull/46428](https://github.com/ClickHouse/ClickHouse/pull/46428)) ([李扬](https://github.com/taiyang-li)) 。
* 新增语句 `SHOW COLUMNS`，用于显示从 system.columns 中提取出的精简信息。[#48017](https://github.com/ClickHouse/ClickHouse/pull/48017) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 为 `SYSTEM SYNC REPLICA` 查询新增了 `LIGHTWEIGHT` 和 `PULL` 修饰符。`LIGHTWEIGHT` 版本只等待拉取和 drop-ranges (忽略合并和变更) 。`PULL` 版本会从 ZooKeeper 拉取新条目，但不会等待这些条目。修复了 [#47794](https://github.com/ClickHouse/ClickHouse/issues/47794)。[#48085](https://github.com/ClickHouse/ClickHouse/pull/48085) ([Alexander Tokmakov](https://github.com/tavplubix)) 。
* 新增 `kafkaMurmurHash` 函数，以兼容 Kafka 的 DefaultPartitioner。关闭 [#47834](https://github.com/ClickHouse/ClickHouse/issues/47834)。[#48185](https://github.com/ClickHouse/ClickHouse/pull/48185) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 允许使用 `GRANT CURRENT GRANTS` 轻松创建一个与当前用户拥有相同授权的用户。[#48262](https://github.com/ClickHouse/ClickHouse/pull/48262) ([pufit](https://github.com/pufit)).
* 新增统计聚合函数 `kolmogorovSmirnovTest`。关闭了 [#48228](https://github.com/ClickHouse/ClickHouse/issues/48228)。[#48325](https://github.com/ClickHouse/ClickHouse/pull/48325) ([FFFFFFFHHHHHHH](https://github.com/FFFFFFFHHHHHHH)) 。
* 向 `system.replicas` 表新增了一个 `lost_part_count` 列。该列的值表示对应表中丢失的 parts 总数。该值存储在 ZooKeeper 中，可用于监控，替代非持久化的 `ReplicatedDataLoss` profile 事件。[#48526](https://github.com/ClickHouse/ClickHouse/pull/48526) ([Sergei Trifonov](https://github.com/serxa)) 。
* 添加 `soundex` 函数以提供兼容性支持。关闭 [#39880](https://github.com/ClickHouse/ClickHouse/issues/39880)。[#48567](https://github.com/ClickHouse/ClickHouse/pull/48567) ([FriendLey](https://github.com/FriendLey)) 。
* JSONExtract 现已支持 `Map` 类型。[#48629](https://github.com/ClickHouse/ClickHouse/pull/48629) ([李扬](https://github.com/taiyang-li)).
* 新增 `PrettyJSONEachRow` 格式，以美观的 JSON 输出，并使用换行分隔符和 4 个空格缩进。[#48898](https://github.com/ClickHouse/ClickHouse/pull/48898) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 新增 `ParquetMetadata` input format，以读取 Parquet 文件元数据。[#48911](https://github.com/ClickHouse/ClickHouse/pull/48911) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 新增 `extractKeyValuePairs` 函数，用于从字符串中提取键值对。输入字符串中可能包含噪声 (即日志文件 / 不一定 100% 符合键值对格式) ，算法会查找与传递给该函数的参数相匹配的键值对。目前，该函数接受以下参数：`data_column` (必填) 、`key_value_pair_delimiter` (默认为 `:`) 、`pair_delimiters` (默认为 `\space \, \;`) 以及 `quoting_character` (默认为双引号) 。[#43606](https://github.com/ClickHouse/ClickHouse/pull/43606) ([Arthur Passos](https://github.com/arthurpassos)) 。
* 函数 replaceOne()、replaceAll()、replaceRegexpOne() 和 replaceRegexpAll() 现在支持使用非常量的 pattern 和 replacement 参数进行调用。[#46589](https://github.com/ClickHouse/ClickHouse/pull/46589) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 新增了用于操作 `Map` 类型列的函数：`mapConcat`、`mapSort`、`mapExists`。 [#48071](https://github.com/ClickHouse/ClickHouse/pull/48071) ([Anton Popov](https://github.com/CurtizJ)).

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

* 读取 `Parquet` 格式文件的速度现已大幅提升。IO 和解码已实现并行化 (由 `max_threads` 设置控制) ，并且只会读取所需的数据范围。[#47964](https://github.com/ClickHouse/ClickHouse/pull/47964) ([Michael Kolupaev](https://github.com/al13n321))。
* 如果执行带有 IN (subquery) 的变更，例如：`ALTER TABLE t UPDATE col='new value' WHERE id IN (SELECT id FROM huge_table)`，并且表 `t` 有多个 parts，那么会为每个 part 在内存中构建一个用于 subquery `SELECT id FROM huge_table` 的 Set。如果 parts 很多，这可能会消耗大量内存 (并导致 OOM) 和 CPU。解决方案是引入一个短生命周期的缓存，用于保存当前由变更任务构建中的 Set。如果同一变更的另一个任务并发执行，它就可以从缓存中查找该 Set，等待其构建完成后复用。[#46835](https://github.com/ClickHouse/ClickHouse/pull/46835) ([Alexander Gololobov](https://github.com/davenger))。
* 仅在必要时，才会在应用 `ALTER TABLE` 查询时检查依赖项。[#48062](https://github.com/ClickHouse/ClickHouse/pull/48062) ([Raúl Marín](https://github.com/Algunenano))。
* 优化函数 `mapUpdate`。[#48118](https://github.com/ClickHouse/ClickHouse/pull/48118) ([Anton Popov](https://github.com/CurtizJ))。
* 现在，发往本地副本的内部查询会被显式发送，并通过回环接口接收返回的数据。对于并行副本，设置 `prefer_localhost_replica` 不再生效。这样做是为了获得更好的调度效果，同时也让代码更简洁：initiator 只负责协调读取过程和合并结果，在所有次级查询读取数据时持续响应请求。注意：使用回环接口的性能并不算高；但如果不这样做，某些副本可能会因分配不到任务而饥饿，导致查询执行更慢，也无法充分利用所有可用资源。现在 coordinator 的初始化也变得更惰性了。所有传入请求都包含读取算法的信息，我们会在第一个请求到达时用该信息初始化 coordinator。如果任何副本决定使用不同的算法读取，就会抛出异常并中止查询。[#48246](https://github.com/ClickHouse/ClickHouse/pull/48246) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov))。
* 当带有 subquery 的 `IN` clause 右侧仅用于分析跳过索引，且跳过索引已通过设置禁用 (`use_skip_indexes=0`) 时，不再为其构建 Set。此前这可能会影响查询性能。[#48299](https://github.com/ClickHouse/ClickHouse/pull/48299) ([Anton Popov](https://github.com/CurtizJ))。
* 在读取 `FROM file(...)` 后，查询处理会立即并行化。相关 issue 见 [#38755](https://github.com/ClickHouse/ClickHouse/issues/38755)。[#48525](https://github.com/ClickHouse/ClickHouse/pull/48525) ([Igor Nikonov](https://github.com/devcrafter))。现在，从任何数据源读取后，查询处理都会立即并行化。受影响的数据源主要是简单存储或外部存储，例如表函数 `url`、`file`。[#48727](https://github.com/ClickHouse/ClickHouse/pull/48727) ([Igor Nikonov](https://github.com/devcrafter))。该行为由设置 `parallelize_output_from_storages` 控制，默认未启用。
* 降低了 ThreadPool mutex 的竞争 (在存在大量小作业时，可能提升性能) 。[#48750](https://github.com/ClickHouse/ClickHouse/pull/48750) ([Sergei Trifonov](https://github.com/serxa))。
* 降低了多个 `ALTER DELETE` 变更的内存占用。[#48522](https://github.com/ClickHouse/ClickHouse/pull/48522) ([Nikolai Kochetov](https://github.com/KochetovNicolai))。
* 如果启用了 `skip_unavailable_shards` 设置，则不再进行多余的 connection 尝试。[#48771](https://github.com/ClickHouse/ClickHouse/pull/48771) ([Azat Khuzhin](https://github.com/azat))。

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

* 查询缓存中的条目现在会被合并至 `max_block_size` 并压缩。[#45912](https://github.com/ClickHouse/ClickHouse/pull/45912) ([Robert Schulze](https://github.com/rschu1ze)).
* 现在可以为每个用户定义查询缓存配额。[#48284](https://github.com/ClickHouse/ClickHouse/pull/48284) ([Robert Schulze](https://github.com/rschu1ze)).
* 修复了并行副本的一些问题。[#48433](https://github.com/ClickHouse/ClickHouse/pull/48433) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* 在加密磁盘上实现了零拷贝复制 (一项 Experimental 功能) 。[#48741](https://github.com/ClickHouse/ClickHouse/pull/48741) ([Vitaly Baranov](https://github.com/vitlibar)).

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

* 将 `connect_timeout_with_failover_ms` 的默认值提高到 1000 毫秒 (因为在 [https://github.com/ClickHouse/ClickHouse/pull/47229](https://github.com/ClickHouse/ClickHouse/pull/47229) 中添加了异步连接) 。已关闭 [#5188](https://github.com/ClickHouse/ClickHouse/issues/5188)。[#49009](https://github.com/ClickHouse/ClickHouse/pull/49009) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 围绕数据湖的多项改进： - 让 `Iceberg` 支持非分区数据。 - 支持 `Iceberg` 格式 v2 版本 (此前仅支持 v1)  - 支持读取 `DeltaLake`/`Hudi` 的分区数据 - 通过使用 Delta 的检查点文件，加快 `DeltaLake` 元数据读取速度 - 修复了 `Hudi` 读取不正确的问题：此前会错误地选择要读取的数据，因此只能正确读取小表 - 让这些引擎能够识别变更数据的更新 (此前状态是在创建表时设定的)  - 使用 spark 为 `Iceberg`/`DeltaLake`/`Hudi` 补充了适当的测试。 [#47307](https://github.com/ClickHouse/ClickHouse/pull/47307) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 为套接字添加异步 connection 和异步写入。使跨分片创建 connection 以及发送查询/外部表支持异步化。使用纤程重构代码。关闭 [#46931](https://github.com/ClickHouse/ClickHouse/issues/46931)。在此 PR 合并后，我们将能够默认增大 `connect_timeout_with_failover_ms` ([https://github.com/ClickHouse/ClickHouse/issues/5188](https://github.com/ClickHouse/ClickHouse/issues/5188)) 。[#47229](https://github.com/ClickHouse/ClickHouse/pull/47229) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 支持使用配置节 `keeper`/`keeper_server` 作为 `zookeeper` 的替代。关闭 [#34766](https://github.com/ClickHouse/ClickHouse/issues/34766)、[#34767](https://github.com/ClickHouse/ClickHouse/issues/34767)。[#35113](https://github.com/ClickHouse/ClickHouse/pull/35113) ([李扬](https://github.com/taiyang-li)).
* 现在可以在以 ClickHouse 表为源的字典的 named\_collections 中设置 *secure* 标志。修复了 [#38450](https://github.com/ClickHouse/ClickHouse/issues/38450)。[#46323](https://github.com/ClickHouse/ClickHouse/pull/46323) ([Ilya Golshtein](https://github.com/ilejn)) 。
* `bitCount` 函数现已支持 `FixedString` 和 `String` 数据类型。[#49044](https://github.com/ClickHouse/ClickHouse/pull/49044) ([flynn](https://github.com/ucasfl)) 。
* 为 Backup 查询中所有与 \[Zoo]Keeper 相关的操作新增了可配置的重试机制。[#47224](https://github.com/ClickHouse/ClickHouse/pull/47224) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 默认对 S3 启用 `use_environment_credentials`，因此默认会构建完整的凭证提供程序链。[#47397](https://github.com/ClickHouse/ClickHouse/pull/47397) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 目前，JSON\_VALUE 函数与 Spark 的 get\_json\_object 函数类似，都支持通过类似 '\$.key' 的路径从 JSON 字符串中提取值。但两者仍有一些区别：1. 在 Spark 的 get\_json\_object 中，如果路径不存在，则会返回 null，而 JSON\_VALUE 会返回空字符串；2. 在 Spark 的 get\_json\_object 中，会返回复杂类型的值，例如 JSON object/array 值，而 JSON\_VALUE 则会返回空字符串。 [#47494](https://github.com/ClickHouse/ClickHouse/pull/47494) ([KevinyhZou](https://github.com/KevinyhZou)).
* 对于 `use_structure_from_insertion_table_in_table_functions`，向表函数传播插入表结构的方式变得更加灵活。修复了名称映射和虚拟列使用方面的一个问题。不再需要 'auto' 设置。[#47962](https://github.com/ClickHouse/ClickHouse/pull/47962) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)).
* 如果查询被终止或超出限制，请勿继续重试连接 Keeper。[#47985](https://github.com/ClickHouse/ClickHouse/pull/47985) ([Raúl Marín](https://github.com/Algunenano)).
* 支持 `BSONEachRow` 的枚举输入/输出，允许所有 map 键类型，并避免输出时进行额外计算。[#48122](https://github.com/ClickHouse/ClickHouse/pull/48122) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 在 `ORC`/`Arrow`/`Parquet` 格式中支持更多 ClickHouse 类型：Enum(8|16)、(U)Int(128|256)、Decimal256 (ORC) ，支持从 Int32 值读取 IPv4 (ORC 会将 IPv4 输出为 Int32，而此前无法再将其读回) ，并修复了从 `ORC` 的二进制数据中读取 Nullable(IPv6) 的问题。[#48126](https://github.com/ClickHouse/ClickHouse/pull/48126) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 为表 `system.storage_policies` 新增列 `perform_ttl_move_on_insert` 和 `load_balancing`，并将列 `volume_type` 的类型修改为 `Enum8`。[#48167](https://github.com/ClickHouse/ClickHouse/pull/48167) ([lizhuoyu5](https://github.com/lzydmxy)) 。
* 新增了对 `BACKUP ALL` 命令的支持，可备份所有表和数据库，包括临时表/临时数据库以及系统表/系统数据库。[#48189](https://github.com/ClickHouse/ClickHouse/pull/48189) ([Vitaly Baranov](https://github.com/vitlibar)).
* 函数 mapFromArrays 支持以 `Map` 类型作为输入。[#48207](https://github.com/ClickHouse/ClickHouse/pull/48207) ([李扬](https://github.com/taiyang-li)) 。
* 现在，某些 SHOW PROCESSLIST 的输出结果已排序。[#48241](https://github.com/ClickHouse/ClickHouse/pull/48241) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 支持对远程 IO/本地 IO/备份按查询级别或服务器级别进行限流 (服务器设置：`max_remote_read_network_bandwidth_for_server`, `max_remote_write_network_bandwidth_for_server`, `max_local_read_bandwidth_for_server`, `max_local_write_bandwidth_for_server`, `max_backup_bandwidth_for_server`；设置：`max_remote_read_network_bandwidth`, `max_remote_write_network_bandwidth`, `max_local_read_bandwidth`, `max_local_write_bandwidth`, `max_backup_bandwidth`) 。[#48242](https://github.com/ClickHouse/ClickHouse/pull/48242) ([Azat Khuzhin](https://github.com/azat)) 。
* 在 `CapnProto` 格式中支持更多类型：Map、(U)Int(128|256)、Decimal(128|256)。允许在输入/输出过程中进行整数转换。[#48257](https://github.com/ClickHouse/ClickHouse/pull/48257) ([Kruglov Pavel](https://github.com/Avogar)).
* 正常情况下不再抛出 CURRENT\_WRITE\_BUFFER\_IS\_EXHAUSTED。[#48288](https://github.com/ClickHouse/ClickHouse/pull/48288) ([Raúl Marín](https://github.com/Algunenano)) 。
* 新增设置 `keeper_map_strict_mode`，为在 `KeeperMap` 表上执行的操作提供额外保证。[#48293](https://github.com/ClickHouse/ClickHouse/pull/48293) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 检查简单字典的主键类型是否为原生无符号整数类型。添加设置 `check_dictionary_primary_key ` 以保持兼容性 (将 `check_dictionary_primary_key =false` 设为 false 可禁用检查) 。[#48335](https://github.com/ClickHouse/ClickHouse/pull/48335) ([lizhuoyu5](https://github.com/lzydmxy)) 。
* 无需为 `KeeperMap` 复制变更，因为这并无必要。[#48354](https://github.com/ClickHouse/ClickHouse/pull/48354) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 支持在 Protobuf format 中将未命名 Tuple 作为嵌套 Message 写入和读取。Tuple 元素与 Message field 按位置对应。[#48390](https://github.com/ClickHouse/ClickHouse/pull/48390) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 在新的规划器中支持 `additional_table_filters` 和 `additional_result_filter` 设置。此外，还为 `additional_result_filter` 添加了文档说明。[#48405](https://github.com/ClickHouse/ClickHouse/pull/48405) ([Dmitry Novik](https://github.com/novikd)).
* `parseDateTime` 现在可以识别格式字符串 '%f' (秒的小数部分) 。[#48420](https://github.com/ClickHouse/ClickHouse/pull/48420) ([Robert Schulze](https://github.com/rschu1ze)).
* formatDateTime() 中的格式字符串 "%f" 现在会在格式化值不包含小数秒时输出 "000000"；此前的行为 (输出单个零) 可通过设置 "formatdatetime\_f\_prints\_single\_zero = 1" 恢复。[#48422](https://github.com/ClickHouse/ClickHouse/pull/48422) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 不再为 KeeperMap 复制 DELETE 和 TRUNCATE 操作。[#48434](https://github.com/ClickHouse/ClickHouse/pull/48434) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 在 generateRandom 函数中生成有效的 Decimal 和 Bool 值。[#48436](https://github.com/ClickHouse/ClickHouse/pull/48436) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 允许在 `SELECT` 查询的表达式列表中使用尾随逗号，例如 `SELECT a, b, c, FROM table`。解决了 [#37802](https://github.com/ClickHouse/ClickHouse/issues/37802)。[#48438](https://github.com/ClickHouse/ClickHouse/pull/48438) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 使用 `--user` 和 `--password` 客户端参数覆盖 `CLICKHOUSE_USER` 和 `CLICKHOUSE_PASSWORD` 环境变量。解决了 [#38909](https://github.com/ClickHouse/ClickHouse/issues/38909)。[#48440](https://github.com/ClickHouse/ClickHouse/pull/48440) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 为 `MergeTree` 表中数据分区片段的加载增加了重试机制，以便在发生可重试错误时自动重试。[#48442](https://github.com/ClickHouse/ClickHouse/pull/48442) ([Anton Popov](https://github.com/CurtizJ)) 。
* 为 `arrayMin`、`arrayMax`、`arrayDifference` 函数添加对 `Date`、`Date32`、`DateTime`、`DateTime64` 数据类型的支持。关闭 [#21645](https://github.com/ClickHouse/ClickHouse/issues/21645)。[#48445](https://github.com/ClickHouse/ClickHouse/pull/48445) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 新增对 `{server_uuid}` macro 的支持。在运行时会持续新增和移除副本的自动扩缩容集群中，它有助于识别各个副本。此项改动关闭了 [#48554](https://github.com/ClickHouse/ClickHouse/issues/48554)。[#48563](https://github.com/ClickHouse/ClickHouse/pull/48563) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 如果条件允许，安装脚本将创建硬链接，而不是复制文件。[#48578](https://github.com/ClickHouse/ClickHouse/pull/48578) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 支持 `SHOW TABLE` 语法，其作用与 `SHOW CREATE TABLE` 相同。关闭 [#48580](https://github.com/ClickHouse/ClickHouse/issues/48580)。[#48591](https://github.com/ClickHouse/ClickHouse/pull/48591) ([flynn](https://github.com/ucasfl)) 。
* HTTP 临时缓冲区现已支持通过从虚拟文件系统缓存中清除数据来运行。[#48664](https://github.com/ClickHouse/ClickHouse/pull/48664) ([Vladimir C](https://github.com/vdimir)) 。
* 使 `CREATE AS SELECT` 支持 schema 推断。关闭 [#47599](https://github.com/ClickHouse/ClickHouse/issues/47599)。[#48679](https://github.com/ClickHouse/ClickHouse/pull/48679) ([flynn](https://github.com/ucasfl)) 。
* 为 `ReplicatedMergeTree` 新增了 `replicated_max_mutations_in_one_entry` 设置，可限制每个 `MUTATE_PART` 条目中的变更命令数 (默认值为 10000) 。[#48731](https://github.com/ClickHouse/ClickHouse/pull/48731) ([Alexander Tokmakov](https://github.com/tavplubix)) 。
* 在 AggregateFunction 类型中，不要把 Arena 中未使用的字节计入 `read_bytes`。[#48745](https://github.com/ClickHouse/ClickHouse/pull/48745) ([Raúl Marín](https://github.com/Algunenano)) 。
* 修复了 MySQL 字典源 + 命名集合未正确处理部分 MySQL 相关设置的问题。关闭 [#48402](https://github.com/ClickHouse/ClickHouse/issues/48402)。[#48759](https://github.com/ClickHouse/ClickHouse/pull/48759) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 如果用户将 `max_single_part_upload_size` 设为非常大的值，可能会因 AWS S3 SDK 中的一个缺陷而导致崩溃。此修复解决了 [#47679](https://github.com/ClickHouse/ClickHouse/issues/47679)。[#48816](https://github.com/ClickHouse/ClickHouse/pull/48816) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 修复 `RabbitMQ` 中的数据竞争问题 ([报告](https://pastila.nl/?004f7100/de1505289ab5bb355e67ebe6c7cc8707)) ，并重构代码。[#48845](https://github.com/ClickHouse/ClickHouse/pull/48845) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 新增来自 `system.parts` 和 `system.part_log` 的别名 `name` 和 `part_name`。关闭了 [#48718](https://github.com/ClickHouse/ClickHouse/issues/48718)。[#48850](https://github.com/ClickHouse/ClickHouse/pull/48850) ([sichenzhao](https://github.com/sichenzhao))。
* 函数 "arrayDifferenceSupport()"、"arrayCumSum()" 和 "arrayCumSumNonNegative()" 现已支持大位宽整数类型 (U)Int128/256 的输入数组。[#48866](https://github.com/ClickHouse/ClickHouse/pull/48866) ([cluster](https://github.com/infdahai)) 。
* clickhouse-client 中的多行历史记录现在不再带有填充空格，粘贴起来也更自然。[#48870](https://github.com/ClickHouse/ClickHouse/pull/48870) ([Joanna Hulboj](https://github.com/jh0x)) 。
* 针对 ClickHouse 在 LXC 内运行且使用 LXCFS 的少见场景，做了一项小幅改进。LXCFS 存在一个问题：有时读取 `/proc` 中的文件时会返回错误 "Transport endpoint is not connected"。此前，该错误已被正确记录到 ClickHouse 的服务器日志中。我们还通过重新打开文件来额外规避了这一问题。这是一个极小的改动。[#48922](https://github.com/ClickHouse/ClickHouse/pull/48922) ([Real](https://github.com/RunningXie)).
* 改进预取的内存统计。在 CI 中将预取设置随机化。[#48973](https://github.com/ClickHouse/ClickHouse/pull/48973) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 在 GCS 上执行原生复制操作时，正确设置请求头。[#48981](https://github.com/ClickHouse/ClickHouse/pull/48981) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 新增支持在命令行中使用短横线而不是下划线来指定设置名称，例如使用 `--max-threads` 而不是 `--max_threads`。此外，还支持使用 Unicode 短横线字符，例如用 `—` 代替 `--`——这在你与另一家公司的团队沟通，而对方团队的经理从 MS Word 复制粘贴代码时会很有用。[#48985](https://github.com/ClickHouse/ClickHouse/pull/48985) ([alekseygolub](https://github.com/alekseygolub)).
* 新增了一种回退机制：当 SSL 用户证书身份验证失败时，改用密码身份验证。关闭了 [#48974](https://github.com/ClickHouse/ClickHouse/issues/48974)。[#48989](https://github.com/ClickHouse/ClickHouse/pull/48989) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 改进嵌入式仪表板。已关闭 [#46671](https://github.com/ClickHouse/ClickHouse/issues/46671)。[#49036](https://github.com/ClickHouse/ClickHouse/pull/49036) ([Kevin Zhang](https://github.com/Kinzeng)) 。
* 为日志消息添加 profile events，以便轻松查看各严重级别的日志消息数量。[#49042](https://github.com/ClickHouse/ClickHouse/pull/49042) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 在先前版本中，在存在 DOS 或 macOS Classic 换行符的情况下，`LineAsString` 格式在启用或未启用并行解析时的行为并不一致。此更改解决了 [#49039](https://github.com/ClickHouse/ClickHouse/issues/49039)。[#49052](https://github.com/ClickHouse/ClickHouse/pull/49052) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 关于无法解析的查询参数的异常消息现在也会指出该参数的名称。重新实现 [#48878](https://github.com/ClickHouse/ClickHouse/issues/48878)。关闭 [#48772](https://github.com/ClickHouse/ClickHouse/issues/48772)。[#49061](https://github.com/ClickHouse/ClickHouse/pull/49061) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。

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

* 更新时区。以下时区已更新：Africa/Cairo、Africa/Casablanca、Africa/El\_Aaiun、America/Bogota、America/Cambridge\_Bay、America/Ciudad\_Juarez、America/Godthab、America/Inuvik、America/Iqaluit、America/Nuuk、America/Ojinaga、America/Pangnirtung、America/Rankin\_Inlet、America/Resolute、America/Whitehorse、America/Yellowknife、Asia/Gaza、Asia/Hebron、Asia/Kuala\_Lumpur、Asia/Singapore、Canada/Yukon、Egypt、Europe/Kirov、Europe/Volgograd、Singapore。[#48572](https://github.com/ClickHouse/ClickHouse/pull/48572) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 减少头文件中的依赖项数量，以加快构建速度。[#47984](https://github.com/ClickHouse/ClickHouse/pull/47984) ([Dmitry Novik](https://github.com/novikd)) 。
* 在测试中对标记和索引的压缩进行随机化处理。[#48286](https://github.com/ClickHouse/ClickHouse/pull/48286) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 将内部 ZSTD 从 1.5.4 升级到 1.5.5。[#46797](https://github.com/ClickHouse/ClickHouse/pull/46797) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 在测试中对从 compact parts 到 wide parts 的垂直合并进行随机化处理。[#48287](https://github.com/ClickHouse/ClickHouse/pull/48287) ([Raúl Marín](https://github.com/Algunenano)) 。
* 支持 HDFS 中的 CRC32 校验和，并修复性能问题。[#48614](https://github.com/ClickHouse/ClickHouse/pull/48614) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 移除残留的 GCC 支持代码。[#48671](https://github.com/ClickHouse/ClickHouse/pull/48671) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 新增启用新 analyzer 基础设施的 CI 运行。[#48719](https://github.com/ClickHouse/ClickHouse/pull/48719) ([Dmitry Novik](https://github.com/novikd)) 。

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

* 修复从后台线程推送的 MV 的 system.query\_views\_log 问题 [#46668](https://github.com/ClickHouse/ClickHouse/pull/46668) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了多个 `RENAME COLUMN` 相关缺陷 [#46946](https://github.com/ClickHouse/ClickHouse/pull/46946) ([alesapin](https://github.com/alesapin)) 。
* 修复 clickhouse-format 中轻微的高亮显示问题 [#47610](https://github.com/ClickHouse/ClickHouse/pull/47610) ([Natasha Murashkina](https://github.com/murfel)) 。
* 修复了 LLVM's libc++ 中的一个 bug，该 bug 会在上传大小大于 INT\_MAX 的 S3 分片时导致崩溃 [#47693](https://github.com/ClickHouse/ClickHouse/pull/47693) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复 `sparkbar` 函数中的溢出问题 [#48121](https://github.com/ClickHouse/ClickHouse/pull/48121) ([Vladimir C](https://github.com/vdimir)) 。
* 修复 S3 中的竞态问题 [#48190](https://github.com/ClickHouse/ClickHouse/pull/48190) ([Anton Popov](https://github.com/CurtizJ)).
* 由于行为表现不一致，已禁用聚合函数的 JIT [#48195](https://github.com/ClickHouse/ClickHouse/pull/48195) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 修复 ALTER 格式问题 (轻微) [#48289](https://github.com/ClickHouse/ClickHouse/pull/48289) ([Natasha Murashkina](https://github.com/murfel)) 。
* 修复 RabbitMQ 中的 CPU 使用率问题 (在 [#44404](https://github.com/ClickHouse/ClickHouse/issues/44404) 之后，23.2 版本中曾恶化) [#48311](https://github.com/ClickHouse/ClickHouse/pull/48311) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复 EXPLAIN PIPELINE 中 Merge over Distributed 的崩溃问题 [#48320](https://github.com/ClickHouse/ClickHouse/pull/48320) ([Azat Khuzhin](https://github.com/azat)).
* 修复将 LowCardinality 序列化为 Arrow 字典时出现的问题 [#48361](https://github.com/ClickHouse/ClickHouse/pull/48361) ([Kruglov Pavel](https://github.com/Avogar)).
* 重置 TemporaryFileStream 中缓存 File 段的下载器 [#48386](https://github.com/ClickHouse/ClickHouse/pull/48386) ([Vladimir C](https://github.com/vdimir)) 。
* 修复在 DROP/REPLACE PARTITION 情况下 SYSTEM SYNC REPLICA 可能卡住的问题 [#48391](https://github.com/ClickHouse/ClickHouse/pull/48391) ([Azat Khuzhin](https://github.com/azat)).
* 修复了加载依赖字典的分布式表时出现的启动错误 [#48419](https://github.com/ClickHouse/ClickHouse/pull/48419) ([MikhailBurdukov](https://github.com/MikhailBurdukov)).
* 自动重命名系统表时不检查依赖关系 [#48431](https://github.com/ClickHouse/ClickHouse/pull/48431) ([Raúl Marín](https://github.com/Algunenano)).
* 仅更新 KeeperMap 存储中受影响的行 [#48435](https://github.com/ClickHouse/ClickHouse/pull/48435) ([Antonio Andelic](https://github.com/antonio2368)).
* 修复 VFS 缓存中可能发生的段错误 [#48469](https://github.com/ClickHouse/ClickHouse/pull/48469) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* `toTimeZone` 函数在未提供常量字符串时会报错 [#48471](https://github.com/ClickHouse/ClickHouse/pull/48471) ([Jordi Villar](https://github.com/jrdi)).
* 修复了 Protobuf 中 IPv4 的逻辑错误，并增加了对 Date32 的支持 [#48486](https://github.com/ClickHouse/ClickHouse/pull/48486) ([Kruglov Pavel](https://github.com/Avogar)) 。
* system.settings 中对于具有多个值的设置，"changed" 标志计算不正确 [#48516](https://github.com/ClickHouse/ClickHouse/pull/48516) ([MikhailBurdukov](https://github.com/MikhailBurdukov)).
* 修复 `Memory` 存储启用压缩时的问题 [#48517](https://github.com/ClickHouse/ClickHouse/pull/48517) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复客户端重新连接时，括号粘贴模式导致密码输入异常的问题 [#48528](https://github.com/ClickHouse/ClickHouse/pull/48528) ([Michael Kolupaev](https://github.com/al13n321)).
* 修复了键为 IP 和 UUID 类型的嵌套 Map [#48556](https://github.com/ClickHouse/ClickHouse/pull/48556) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* 修复了哈希字典在使用并行加载器时可能出现的未捕获异常 [#48571](https://github.com/ClickHouse/ClickHouse/pull/48571) ([Azat Khuzhin](https://github.com/azat)) 。
* `groupArray` aggregate function 现已可在 Nullable 类型的空结果上正常工作 [#48593](https://github.com/ClickHouse/ClickHouse/pull/48593) ([lgbo](https://github.com/lgbo-ustc)).
* 修复了 Keeper 中的一个 bug：在 ACL 中，节点有时不会以 `auth` 方案创建。 [#48595](https://github.com/ClickHouse/ClickHouse/pull/48595) ([Aleksei Filatov](https://github.com/aalexfvk)).
* 允许 IPv4 与 UInt 之间使用比较运算符 [#48611](https://github.com/ClickHouse/ClickHouse/pull/48611) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)).
* 修复了 cache 可能引发的错误 [#48636](https://github.com/ClickHouse/ClickHouse/pull/48636) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 空数据的异步插入将不再引发异常。[#48663](https://github.com/ClickHouse/ClickHouse/pull/48663) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复 RENAME TABLE 失败时的表依赖关系问题 [#48683](https://github.com/ClickHouse/ClickHouse/pull/48683) ([Azat Khuzhin](https://github.com/azat)).
* 如果主键中包含重复列 (这只可能出现在投影中) ，在早期版本中可能会导致一个 bug [#48838](https://github.com/ClickHouse/ClickHouse/pull/48838) ([Amos Bird](https://github.com/amosbird)) 。
* 修复了 ZooKeeper 在对 send\_thread/receive\_thread 调用 join 时的竞态条件问题 [#48849](https://github.com/ClickHouse/ClickHouse/pull/48849) ([Alexander Gololobov](https://github.com/davenger)) 。
* 修复在零拷贝复制中尝试删除已忽略的 detached 分片时，出现意外分片名称错误的问题 [#48862](https://github.com/ClickHouse/ClickHouse/pull/48862) ([Michael Lex](https://github.com/mlex)).
* 修复将 `Date32` Parquet/Arrow 列读入非 `Date32` 列时的问题 [#48864](https://github.com/ClickHouse/ClickHouse/pull/48864) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了从带有行级策略且列名包含点号的表中查询时出现的 `UNKNOWN_IDENTIFIER` 错误 [#48976](https://github.com/ClickHouse/ClickHouse/pull/48976) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复对空 Nullable 字符串进行聚合时的问题 [#48999](https://github.com/ClickHouse/ClickHouse/pull/48999) ([LiuNeng](https://github.com/liuneng1994)) 。

### <a id="233" /> ClickHouse 23.3 LTS 版本，2023-03-30。 [演示文稿](https://presentations.clickhouse.com/2023-release-23.3/), [视频](https://www.youtube.com/watch?v=ISaGUjvBNao)

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

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

* 轻量级删除已达到生产可用级别，且默认启用。现在，MergeTree 表的 `DELETE` 查询默认可用。
* `*domain*RFC` 和 `netloc` 函数的行为略有调整：放宽了 URL authority 中允许的符号范围，以实现更好的规范兼容性。[#46841](https://github.com/ClickHouse/ClickHouse/pull/46841) ([Azat Khuzhin](https://github.com/azat)).
* 现已禁止创建基于 KafkaEngine 且列使用 DEFAULT/EPHEMERAL/ALIAS/MATERIALIZED 语句的表。[#47138](https://github.com/ClickHouse/ClickHouse/pull/47138) ([Aleksandr Musorin](https://github.com/AVMusorin)).
* “异步连接排空”功能已移除。相关设置和指标也一并移除。该功能原本是内部功能，因此此次移除不应影响此前从未听说过它的用户。[#47486](https://github.com/ClickHouse/ClickHouse/pull/47486) ([Alexander Tokmakov](https://github.com/tavplubix)).
* 现已在 `arraySum`/`Min`/`Max`/`Avg`/`Product`、`arrayCumSum`/`CumSumNonNegative`、`arrayDifference`、数组构造、IN 运算符、查询参数、`groupArrayMovingSum`、统计函数、`min`/`max`/`any`/`argMin`/`argMax`、PostgreSQL wire protocol、MySQL 表引擎和函数、`sumMap`、`mapAdd`、`mapSubtract`、`arrayIntersect` 中支持 256 位 Decimal 数据类型 (超过 38 位数字) 。同时为 `arrayIntersect` 增加了对大整数的支持。涉及矩的统计聚合函数 (例如 `corr` 或各种 `TTest`) 现在将使用 `Float64` 作为内部表示 (在此更改之前使用的是 `Decimal128`，但那并无意义) ，并且这些函数在方差为无穷大时可能返回 `nan` 而非 `inf`。此前某些函数虽然允许用于 `Decimal256` 数据类型，但返回的却是 `Decimal128`；现在这一问题已修复。此更改关闭了 [#47569](https://github.com/ClickHouse/ClickHouse/issues/47569)。此更改关闭了 [#44864](https://github.com/ClickHouse/ClickHouse/issues/44864)。此更改关闭了 [#28335](https://github.com/ClickHouse/ClickHouse/issues/28335)。[#47594](https://github.com/ClickHouse/ClickHouse/pull/47594) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 将 backup\_threads/restore\_threads 改为服务器级设置 (而非用户级设置) 。[#47881](https://github.com/ClickHouse/ClickHouse/pull/47881) ([Azat Khuzhin](https://github.com/azat)).
* 不允许使用常量和非确定性的二级索引。[#46839](https://github.com/ClickHouse/ClickHouse/pull/46839) ([Anton Popov](https://github.com/CurtizJ)).

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

* 新增一种模式，可使用设置 `parallel_replicas_custom_key` 和 `parallel_replicas_custom_key_filter_type` 在各副本之间拆分工作。如果集群由一个分片和多个副本组成，则会随机选择最多 `max_parallel_replicas` 个副本，并将其作为分片处理。对于每个分片，都会先在发起节点上为查询添加相应的过滤器，然后再将查询发送到该分片。如果集群由多个分片组成，其行为与 `sample_key` 相同，但可以定义任意键。[#45108](https://github.com/ClickHouse/ClickHouse/pull/45108) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 新增一项可在取消时显示部分结果的选项：添加了查询设置 `partial_result_on_first_cancel`，使已取消的查询 (例如因按下 Ctrl-C 而取消) 能够返回部分结果。[#45689](https://github.com/ClickHouse/ClickHouse/pull/45689) ([Alexey Perevyshin](https://github.com/alexX512)).
* 新增了对临时表使用任意表引擎的支持 (Replicated 和 KeeperMap 引擎除外) 。关闭 [#31497](https://github.com/ClickHouse/ClickHouse/issues/31497)。[#46071](https://github.com/ClickHouse/ClickHouse/pull/46071) ([Roman Vasin](https://github.com/rvasin)).
* 新增支持通过 Keeper 中的集中式存储复制用户定义的 SQL 函数。[#46085](https://github.com/ClickHouse/ClickHouse/pull/46085) ([Aleksei Filatov](https://github.com/aalexfvk)) 。
* 实现 `system.server_settings` (类似于 `system.settings`) ，用于包含服务器配置。[#46550](https://github.com/ClickHouse/ClickHouse/pull/46550) ([pufit](https://github.com/pufit)) 。
* 支持 `UNDROP TABLE` 查询。已关闭 [#46811](https://github.com/ClickHouse/ClickHouse/issues/46811)。[#47241](https://github.com/ClickHouse/ClickHouse/pull/47241) ([chen](https://github.com/xiedeyantu)).
* 允许为 named collections 单独设置授权 (例如，可仅向特定的 named collection 授予 `SHOW/CREATE/ALTER/DROP named collection` 访问权限，而不是一次性授予所有 named collection) 。已关闭 [#40894](https://github.com/ClickHouse/ClickHouse/issues/40894)。新增访问类型 `NAMED_COLLECTION_CONTROL`，默认不会授予用户，除非在用户配置中显式添加 (执行 `GRANT ALL` 需要此权限) ；此外，与 23.2 不同，用户默认若要拥有完整访问权限，不再需要手动指定 `show_named_collections`。[#46241](https://github.com/ClickHouse/ClickHouse/pull/46241) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 支持嵌套式自定义磁盘。此前，自定义磁盘仅支持扁平磁盘结构。 [#47106](https://github.com/ClickHouse/ClickHouse/pull/47106) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 引入了函数 `widthBucket` (另提供 `WIDTH_BUCKET` 作为兼容性别名) 。[#42974](https://github.com/ClickHouse/ClickHouse/issues/42974)。[#46790](https://github.com/ClickHouse/ClickHouse/pull/46790) ([avoiderboi](https://github.com/avoiderboi)) 。
* 新增函数 `parseDateTime`/`parseDateTimeInJodaSyntax`，可按指定的格式字符串进行解析。`parseDateTime` 使用 MySQL 语法将 String 解析为 DateTime，`parseDateTimeInJodaSyntax` 使用 Joda 语法进行解析。[#46815](https://github.com/ClickHouse/ClickHouse/pull/46815) ([李扬](https://github.com/taiyang-li)).
* 将 `dummy UInt8` 用作表函数 `null` 的默认结构。关闭 [#46930](https://github.com/ClickHouse/ClickHouse/issues/46930)。[#47006](https://github.com/ClickHouse/ClickHouse/pull/47006) ([flynn](https://github.com/ucasfl)) 。
* 支持带逗号的日期格式，例如在 `parseDateTimeBestEffort` 函数中支持 `Dec 15, 2021`。已关闭 [#46816](https://github.com/ClickHouse/ClickHouse/issues/46816)。[#47071](https://github.com/ClickHouse/ClickHouse/pull/47071) ([chen](https://github.com/xiedeyantu)) 。
* 新增设置 `http_wait_end_of_query` 和 `http_response_buffer_size`，分别对应 HTTP 接口中的 URL 参数 `wait_end_of_query` 和 `buffer_size`。这样就可以在 profile 中修改这些设置。[#47108](https://github.com/ClickHouse/ClickHouse/pull/47108) ([Vladimir C](https://github.com/vdimir)) 。
* 新增 `system.dropped_tables` 表，用于显示从 `Atomic` 数据库中删除但尚未完全清除的表。[#47364](https://github.com/ClickHouse/ClickHouse/pull/47364) ([chen](https://github.com/xiedeyantu)) 。
* 新增 `INSTR`，作为 `positionCaseInsensitive` 的别名，以兼容 MySQL。已关闭 [#47529](https://github.com/ClickHouse/ClickHouse/issues/47529)。[#47535](https://github.com/ClickHouse/ClickHouse/pull/47535) ([flynn](https://github.com/ucasfl)).
* 新增了 `toDecimalString` 函数，可按固定精度将数字转换为字符串。[#47838](https://github.com/ClickHouse/ClickHouse/pull/47838) ([Andrey Zvonov](https://github.com/zvonand)) 。
* 新增 MergeTree 设置 `max_number_of_mutations_for_replica`。该设置将每个副本的 part mutation 数量限制为指定值。0 表示不限制每个副本的变更数量 (但执行仍可能受其他设置约束) 。[#48047](https://github.com/ClickHouse/ClickHouse/pull/48047) ([Vladimir C](https://github.com/vdimir)) 。
* 新增与 Map 相关的函数 `mapFromArrays`，可通过一对数组创建映射。 [#31125](https://github.com/ClickHouse/ClickHouse/pull/31125) ([李扬](https://github.com/taiyang-li)).
* 允许控制 Parquet/ORC/Arrow 输出格式中的压缩，并新增对更多压缩输入格式的支持。此更改修复了 [#13541](https://github.com/ClickHouse/ClickHouse/issues/13541)。[#47114](https://github.com/ClickHouse/ClickHouse/pull/47114) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 为原生协议添加 SSL 用户证书身份验证。解决了 [#47077](https://github.com/ClickHouse/ClickHouse/issues/47077)。[#47596](https://github.com/ClickHouse/ClickHouse/pull/47596) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 为 `parseDateTime` 新增 \*OrNull() 和 \*OrZero() 变体，并新增别名 `str_to_date`，以与 MySQL 保持一致。[#48000](https://github.com/ClickHouse/ClickHouse/pull/48000) ([Robert Schulze](https://github.com/rschu1ze)).
* 新增了运算符 `REGEXP` (类似于 "LIKE"、"IN"、"MOD" 等运算符) ，以更好地兼容 MySQL [#47869](https://github.com/ClickHouse/ClickHouse/pull/47869) ([Robert Schulze](https://github.com/rschu1ze)) 。

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

* 内存中的标记现已压缩，内存占用降至原来的 1/3 到 1/6。[#47290](https://github.com/ClickHouse/ClickHouse/pull/47290) ([Michael Kolupaev](https://github.com/al13n321)) 。
* 在之前的版本中，涉及大量文件的备份慢得令人难以置信。现在不再如此，如今速度快得同样令人难以置信。[#47251](https://github.com/ClickHouse/ClickHouse/pull/47251) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。为备份的 IO 操作引入了独立的线程池，使其能够独立于其他线程池进行扩缩容，并提升性能。[#47174](https://github.com/ClickHouse/ClickHouse/pull/47174) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。在备份处理的最后阶段，使用 MultiRead 请求和重试机制收集元数据。[#47243](https://github.com/ClickHouse/ClickHouse/pull/47243) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。如果备份和待恢复的数据都位于 S3 中，今后将使用服务器端复制。[#47546](https://github.com/ClickHouse/ClickHouse/pull/47546) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复了带有 `FINAL` 的查询中过多读取的问题。[#47801](https://github.com/ClickHouse/ClickHouse/pull/47801) ([Nikita Taranov](https://github.com/nickitat)) 。
* 在 server 启动时，`max_final_threads` 设置将被设为核心数 (使用与 `max_threads` 相同的算法) 。这提高了高 CPU 核数 server 上 `final` 执行的并发性。[#47915](https://github.com/ClickHouse/ClickHouse/pull/47915) ([Nikita Taranov](https://github.com/nickitat)) 。
* 允许对使用 CLICKHOUSE 源的 DIRECT 字典以多线程方式执行读取管道。要启用此功能，请在 `CREATE DICTIONARY` statement 中 source 的 `SETTINGS` 部分设置 `dictionary_use_async_executor=1`。[#47986](https://github.com/ClickHouse/ClickHouse/pull/47986) ([Vladimir C](https://github.com/vdimir)) 。
* 优化单个 Nullable 键聚合性能。[#45772](https://github.com/ClickHouse/ClickHouse/pull/45772) ([LiuNeng](https://github.com/liuneng1994)) 。
* 已支持为 `hasTokenOrNull`、`hasTokenCaseInsensitive` 和 `hasTokenCaseInsensitiveOrNull` 使用小写 `tokenbf_v1` 索引。 [#46252](https://github.com/ClickHouse/ClickHouse/pull/46252) ([ltrk2](https://github.com/ltrk2)).
* 通过使用 SIMD 搜索前两个字符，优化了函数 `position` 和 `LIKE`。[#46289](https://github.com/ClickHouse/ClickHouse/pull/46289) ([Jiebin Sun](https://github.com/jiebinn)) 。
* 优化了对 `system.detached_parts` 的查询，因为该表可能会非常大。考虑到块大小限制，增加了多个来源；在每个块中，都会使用一个 IO 线程池并行执行系统调用来计算 part 的大小。[#46624](https://github.com/ClickHouse/ClickHouse/pull/46624) ([Sema Checherinda](https://github.com/CheSema)) 。
* 将 ReplicatedMergeTree 表的 `max_replicated_merges_in_queue` 默认值从 16 提升至 1000。这使拥有大量副本的集群 (例如 ClickHouse Cloud 中使用共享存储的集群) 能够更快地执行后台合并操作。[#47050](https://github.com/ClickHouse/ClickHouse/pull/47050) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 将 `clickhouse-copier` 更新为使用 `GROUP BY` 而非 `DISTINCT` 来获取分区列表。对于大型表，这将查询时间从 500 多秒缩短到不到 1 秒。[#47386](https://github.com/ClickHouse/ClickHouse/pull/47386) ([Clayton McClure](https://github.com/cmcclure-twilio)) 。
* 修复 `ASOF JOIN` 的性能下降问题。[#47544](https://github.com/ClickHouse/ClickHouse/pull/47544) ([Ongkong](https://github.com/ongkong)).
* 进一步加强 Keeper 中的批处理。通过避免在处理读取请求时拆分批次来提升性能。[#47978](https://github.com/ClickHouse/ClickHouse/pull/47978) ([Antonio Andelic](https://github.com/antonio2368)).
* 允许在列具有不同 DEFAULT 表达式时，对 Merge 使用 PREWHERE。[#46831](https://github.com/ClickHouse/ClickHouse/pull/46831) ([Azat Khuzhin](https://github.com/azat)) 。

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

* 并行副本：通过更充分地利用本地副本，提升了整体性能，并且默认禁止从非复制的 MergeTree 使用并行副本读取。[#47858](https://github.com/ClickHouse/ClickHouse/pull/47858) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)).
* 如果启用 experimental analyzer，则支持将 `Join`、`Dictionary` 和 `EmbeddedRocksDB` 表的 JOIN 中的过滤器下推到左表。[#47280](https://github.com/ClickHouse/ClickHouse/pull/47280) ([Maksim Kita](https://github.com/kitaisreal)).
* 现在，启用零拷贝复制的 ReplicatedMergeTree 对 Keeper 的负载更低了。[#47676](https://github.com/ClickHouse/ClickHouse/pull/47676) ([alesapin](https://github.com/alesapin)).
* 修复了使用 MaterializedPostgreSQL 创建 materialized view 时的问题 [#40807](https://github.com/ClickHouse/ClickHouse/pull/40807) ([Maksim Buren](https://github.com/maks-buren630501)).

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

* 默认启用 `input_format_json_ignore_unknown_keys_in_named_tuple` 设置。[#46742](https://github.com/ClickHouse/ClickHouse/pull/46742) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 允许在写入 MATERIALIZED VIEW 时忽略错误 (新增设置 `materialized_views_ignore_errors`，默认值为 `false`，但对于将日志刷新到 `system.*_log` 表的情况，会无条件设为 `true`) 。[#46658](https://github.com/ClickHouse/ClickHouse/pull/46658) ([Azat Khuzhin](https://github.com/azat)) 。
* 在内存中跟踪分布式发送的文件队列。[#45491](https://github.com/ClickHouse/ClickHouse/pull/45491) ([Azat Khuzhin](https://github.com/azat)) 。
* 现在，所有通过 HTTP 协议执行的查询，其响应中都会包含 `X-ClickHouse-Query-Id` 和 `X-ClickHouse-Timezone` 这两个头。此前仅 `SELECT` 查询会返回这两个头。[#46364](https://github.com/ClickHouse/ClickHouse/pull/46364) ([Anton Popov](https://github.com/CurtizJ)) 。
* 来自 `MongoDB` 的外部表：支持通过包含 host:port 列表的 URI 连接到副本集，并支持在 MongoDB 字典中使用 readPreference 选项。示例 URI：`mongodb://db0.example.com:27017,db1.example.com:27017,db2.example.com:27017/?replicaSet=myRepl&amp;readPreference=primary`。[#46524](https://github.com/ClickHouse/ClickHouse/pull/46524) ([artem-yadr](https://github.com/artem-yadr)) 。
* 这项改进对你来说应该是无感知的。基于查询计划重新实现了 projection 分析。新增设置 `query_plan_optimize_projection=1`，用于在旧版和新版之间切换。修复了 [#44963](https://github.com/ClickHouse/ClickHouse/issues/44963)。[#46537](https://github.com/ClickHouse/ClickHouse/pull/46537) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 默认情况下，在输出格式中使用 Parquet v2 格式而非 v1。新增设置 `output_format_parquet_version` 用于控制 Parquet 版本，可选值为 `1.0`、`2.4`、`2.6`、`2.latest` (默认) 。[#46617](https://github.com/ClickHouse/ClickHouse/pull/46617) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 现在可以使用新的配置语法来配置名称中带有句点 (`.`) 的 Kafka topic。[#46752](https://github.com/ClickHouse/ClickHouse/pull/46752) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 修复了用于检查 hyperscan 模式中有问题的重复项的启发式规则。[#46819](https://github.com/ClickHouse/ClickHouse/pull/46819) ([Robert Schulze](https://github.com/rschu1ze)).
* 当某个块已由另一个副本并发创建时，不要将“ZK 节点已存在”上报到 system.errors 中。[#46820](https://github.com/ClickHouse/ClickHouse/pull/46820) ([Raúl Marín](https://github.com/Algunenano)) 。
* 提高 `clickhouse-local` 的打开文件数限制。这样一来，它就能在拥有大量 CPU 核心的服务器上从 `web` 表读取数据。即使打开的文件过多，也不要停止从 URL 表引擎读取。此更改修复了 [#46852](https://github.com/ClickHouse/ClickHouse/issues/46852)。[#46853](https://github.com/ClickHouse/ClickHouse/pull/46853) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 现在，当数字无法解析时抛出的异常会提供更易读的错误信息。[#46917](https://github.com/ClickHouse/ClickHouse/pull/46917) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 在每个任务处理完成后更新 `system.backups`，以跟踪备份进度。[#46989](https://github.com/ClickHouse/ClickHouse/pull/46989) ([Aleksandr Musorin](https://github.com/AVMusorin)) 。
* 允许在 Native input format 中进行类型转换。新增设置 `input_format_native_allow_types_conversion` 来控制该行为 (默认启用) 。[#46990](https://github.com/ClickHouse/ClickHouse/pull/46990) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 允许在 `range` 函数中使用 IPv4，以生成 IP 范围。[#46995](https://github.com/ClickHouse/ClickHouse/pull/46995) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* 优化了在无法将分片从一个卷/磁盘移动到另一个卷/磁盘时的异常消息。[#47032](https://github.com/ClickHouse/ClickHouse/pull/47032) ([alesapin](https://github.com/alesapin)) 。
* 在 `JSONType` 函数中支持 `Bool` 类型。此前会错误地对 bool 值返回 `Null` 类型。[#47046](https://github.com/ClickHouse/ClickHouse/pull/47046) ([Anton Popov](https://github.com/CurtizJ)) 。
* 使用 `_request_body` 参数配置预定义的 HTTP 查询。[#47086](https://github.com/ClickHouse/ClickHouse/pull/47086) ([Constantine Peresypkin](https://github.com/pkit)) 。
* 在内置 UI 的 SQL 编辑器中按下 Enter 键时，会自动进行缩进。[#47113](https://github.com/ClickHouse/ClickHouse/pull/47113) ([Alexey Korepanov](https://github.com/alexkorep)) 。
* 使用 'sudo' 进行自解压时，会尝试将解压出的文件的 uid 和 gid 设置为当前运行用户。[#47116](https://github.com/ClickHouse/ClickHouse/pull/47116) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* 此前，`repeat` 函数的第二个参数仅接受无符号整数类型，因此无法接受 -1 之类的值。这一行为与 Spark 函数不一致。在此次更新中，`repeat` 函数已调整为与 Spark 函数的行为一致。现在，它接受相同类型的输入，包括负整数。我们已进行了充分测试，以验证更新后实现的正确性。[#47134](https://github.com/ClickHouse/ClickHouse/pull/47134) ([KevinyhZou](https://github.com/KevinyhZou))。注意：该更新日志条目由 ChatGPT 重写。
* 移除 stacktraces 中的 `::__1` 部分。将 stacktraces 中的 `std::basic_string<char, ...` 显示为 `String`。[#47171](https://github.com/ClickHouse/ClickHouse/pull/47171) ([Mike Kot](https://github.com/myrrc)) 。
* 重新实现服务器间模式，以避免重放攻击 (请注意，此更改与旧版服务器向后兼容) 。[#47213](https://github.com/ClickHouse/ClickHouse/pull/47213) ([Azat Khuzhin](https://github.com/azat)).
* 改进对正则表达式分组的识别，并优化 regexp\_tree 字典。[#47218](https://github.com/ClickHouse/ClickHouse/pull/47218) ([Han Fei](https://github.com/hanfei1991)) 。
* Keeper 改进：新增 4LW `clrs`，用于清理 Keeper 占用的资源 (例如释放未使用的内存) 。[#47256](https://github.com/ClickHouse/ClickHouse/pull/47256) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 为编解码器 `DoubleDelta(bytes_size)`、`Gorilla(bytes_size)`、`FPC(level, float_size)` 添加可选参数，从而可以在 `clickhouse-compressor` 中无需指定列类型即可使用这些编解码器。修复了 `clickhouse-compressor` 使用这些编解码器时可能出现的中止和算术错误。修复：[https://github.com/ClickHouse/ClickHouse/discussions/47262。](https://github.com/ClickHouse/ClickHouse/discussions/47262。) [#47271](https://github.com/ClickHouse/ClickHouse/pull/47271) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 为 `runningDifference` 函数添加对大整数类型的支持。关闭 [#47194](https://github.com/ClickHouse/ClickHouse/issues/47194)。[#47322](https://github.com/ClickHouse/ClickHouse/pull/47322) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 为具有过期时间的 S3 凭证增加了一个过期缓冲窗口，以避免在某些边缘情况下出现 `ExpiredToken` 错误。可通过 `expiration_window_seconds` 配置控制，默认值为 120 秒。[#47423](https://github.com/ClickHouse/ClickHouse/pull/47423) ([Antonio Andelic](https://github.com/antonio2368)).
* 在 `Avro` 格式中支持 Decimals 和 Date32。[#47434](https://github.com/ClickHouse/ClickHouse/pull/47434) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 如果检测到从 `Ordinary` 到 `Atomic` 的转换曾被中断，则不要启动服务器，并输出更清晰的错误消息以及故障排查说明。[#47487](https://github.com/ClickHouse/ClickHouse/pull/47487) ([Alexander Tokmakov](https://github.com/tavplubix)) 。
* 向 `system.opentelemetry_span_log` 添加一个新列 `kind`。该列用于保存 OpenTelemetry 中定义的 [SpanKind](https://opentelemetry.io/docs/reference/specification/trace/api/#spankind) 的值。[#47499](https://github.com/ClickHouse/ClickHouse/pull/47499) ([Frank Chen](https://github.com/FrankChen021)) 。
* 允许在 `Protobuf` 格式中读写嵌套 Array 时仅使用根字段名作为列名。此前，列名必须包含所有嵌套字段名 (例如 `a.b.c Array(Array(Array(UInt32)))`，现在只需使用 `a Array(Array(Array(UInt32)))`) 。[#47650](https://github.com/ClickHouse/ClickHouse/pull/47650) ([Kruglov Pavel](https://github.com/Avogar)).
* 为 `SYSTEM SYNC REPLICA` 新增了一个可选的 `STRICT` modifier，使查询会一直等待，直到复制队列清空 (与此前的行为一致：[https://github.com/ClickHouse/ClickHouse/pull/45648](https://github.com/ClickHouse/ClickHouse/pull/45648)) 。[#47659](https://github.com/ClickHouse/ClickHouse/pull/47659) ([Alexander Tokmakov](https://github.com/tavplubix)) 。
* 优化了一些 OpenTelemetry span 日志的命名。[#47667](https://github.com/ClickHouse/ClickHouse/pull/47667) ([Frank Chen](https://github.com/FrankChen021)) 。
* 防止使用过长的聚合函数组合器链 (这可能导致查询在分析阶段变慢) 。这解决了 [#47715](https://github.com/ClickHouse/ClickHouse/issues/47715)。[#47716](https://github.com/ClickHouse/ClickHouse/pull/47716) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 参数化视图支持子查询；已解决 [#46741](https://github.com/ClickHouse/ClickHouse/issues/46741) [#47725](https://github.com/ClickHouse/ClickHouse/pull/47725) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)) 。
* 修复 MySQL integration 中的内存泄漏问题 (在 `connection_auto_close=1` 时可复现) 。[#47732](https://github.com/ClickHouse/ClickHouse/pull/47732) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 改进了与 Decimal 参数相关代码的错误处理，使错误消息更加清晰、信息更充分。此前，如果提供了错误的 Decimal 参数，生成的错误消息往往含义不清，难以帮助排查问题。此次更新修复了输出的错误消息，使其能够提供更详细、更有用的信息，从而更容易识别并纠正与 Decimal 参数相关的问题。[#47812](https://github.com/ClickHouse/ClickHouse/pull/47812) ([Yu Feng](https://github.com/Vigor-jpg)) 。注意：此更新日志条目由 ChatGPT 改写。
* 参数 `exact_rows_before_limit` 用于让 `rows_before_limit_at_least` 更准确地反映达到限制前返回的行数。此拉取请求修复了查询涉及跨多个分片的分布式处理或排序操作时出现的问题。在此次更新之前，这些场景无法按预期工作。[#47874](https://github.com/ClickHouse/ClickHouse/pull/47874) ([Amos Bird](https://github.com/amosbird)).
* ThreadPools 指标的内部信息。 [#47880](https://github.com/ClickHouse/ClickHouse/pull/47880) ([Azat Khuzhin](https://github.com/azat)).
* 新增 `WriteBufferFromS3Microseconds` 和 `WriteBufferFromS3RequestsErrors` profile events。[#47885](https://github.com/ClickHouse/ClickHouse/pull/47885) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 为 ClickHouse install 新增 `--link` 和 `--noninteractive` (`-y`) 选项。修复了 [#47750](https://github.com/ClickHouse/ClickHouse/issues/47750)。[#47887](https://github.com/ClickHouse/ClickHouse/pull/47887) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 修复了在附加到其依赖表不可用的 materialized view 时出现的 `UNKNOWN_TABLE` 异常。这在尝试从备份中恢复状态时可能很有用。[#47975](https://github.com/ClickHouse/ClickHouse/pull/47975) ([MikhailBurdukov](https://github.com/MikhailBurdukov)).
* 修复了加密磁盘配置中未添加 (可选) 路径时的问题。[#47981](https://github.com/ClickHouse/ClickHouse/pull/47981) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 参数化视图现已支持 CTE。实现：现已更新为在计算标量子查询时允许使用查询参数。[#48065](https://github.com/ClickHouse/ClickHouse/pull/48065) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)).
* 支持大整数 `(U)Int128/(U)Int256`、键类型可为任意类型的 `Map`，以及任意精度的 `DateTime64` (不再仅限于 3 和 6) 。[#48119](https://github.com/ClickHouse/ClickHouse/pull/48119) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 允许在行输入格式中跳过由未知枚举值导致的错误。[#48133](https://github.com/ClickHouse/ClickHouse/pull/48133) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。

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

* ClickHouse 现已使用 `C++23` 构建。[#47424](https://github.com/ClickHouse/ClickHouse/pull/47424) ([Robert Schulze](https://github.com/rschu1ze))。
* 在 AST Fuzzer 中对 `EXPLAIN` 查询进行模糊测试。[#47803](https://github.com/ClickHouse/ClickHouse/pull/47803) [#47852](https://github.com/ClickHouse/ClickHouse/pull/47852) ([flynn](https://github.com/ucasfl))。
* 将压力测试与自动向后兼容性检查 (现称为升级检查) 拆分开来。[#44879](https://github.com/ClickHouse/ClickHouse/pull/44879) ([Kruglov Pavel](https://github.com/Avogar))。
* 更新了 Docker 使用的 Ubuntu 镜像，以平息一些不实的安全报告。[#46784](https://github.com/ClickHouse/ClickHouse/pull/46784) ([Julio Jimenez](https://github.com/juliojimenez))。请注意，ClickHouse 没有依赖项，也不需要 Docker。
* 在通过 “curl | sh” 下载 ClickHouse 时，新增了一个提示，允许删除已有的 `clickhouse` 下载文件。提示内容为 “ClickHouse binary clickhouse already exists. Overwrite? \[y/N]”。[#46859](https://github.com/ClickHouse/ClickHouse/pull/46859) ([Dan Roscigno](https://github.com/DanRoscigno))。
* 修复了旧版发行版 (例如 Amazon Linux 2) 以及 ARM 平台上服务端启动时因找不到 glibc 2.28 符号而报错的问题。[#47008](https://github.com/ClickHouse/ClickHouse/pull/47008) ([Robert Schulze](https://github.com/rschu1ze))。
* 为 clang 16 做准备。[#47027](https://github.com/ClickHouse/ClickHouse/pull/47027) ([Amos Bird](https://github.com/amosbird))。
* 新增了一项 CI 检查，以确保 ClickHouse 在 ARM 平台上也能使用旧版 glibc 运行。[#47063](https://github.com/ClickHouse/ClickHouse/pull/47063) ([Robert Schulze](https://github.com/rschu1ze))。
* 添加了一项风格检查，以防止错误使用 `NDEBUG` 宏。[#47699](https://github.com/ClickHouse/ClickHouse/pull/47699) ([Alexey Milovidov](https://github.com/alexey-milovidov))。
* 小幅提升了构建速度。[#47714](https://github.com/ClickHouse/ClickHouse/pull/47714) ([Alexey Milovidov](https://github.com/alexey-milovidov))。
* 将 `vectorscan` 升级到 5.4.9。[#47955](https://github.com/ClickHouse/ClickHouse/pull/47955) ([Robert Schulze](https://github.com/rschu1ze))。
* 添加了一个单元测试，用于验证 Apache Arrow 的 fatal 日志不会导致进程中止。该测试覆盖了 [ClickHouse/arrow#16](https://github.com/ClickHouse/arrow/pull/16) 中的更改。[#47958](https://github.com/ClickHouse/ClickHouse/pull/47958) ([Arthur Passos](https://github.com/arthurpassos))。
* 恢复了原生 macOS 调试版服务端构建可启动的能力。[#48050](https://github.com/ClickHouse/ClickHouse/pull/48050) ([Robert Schulze](https://github.com/rschu1ze))。注意：此更改仅与开发有关，因为 ClickHouse 官方构建是通过交叉编译完成的。

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

* 修复 formats 解析器重置的问题，测试对 `Kafka` 中错误消息的处理 [#45693](https://github.com/ClickHouse/ClickHouse/pull/45693) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复 Keeper 中数据大小的计算问题 [#46086](https://github.com/ClickHouse/ClickHouse/pull/46086) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 修复了 `ReplicatedMergeTree` 表和 `Atomic` 数据库中 `DROP TABLE` 查询自动重试的一个问题。在极少数情况下，如果 ZooKeeper 会话在执行 DROP 期间过期，同时又并行创建了一个在 ZooKeeper 中使用相同路径的新复制表，可能会导致出现 `Can't get data for node /zk_path/log_pointer` 和 `The specified key does not exist` 错误。 [#46384](https://github.com/ClickHouse/ClickHouse/pull/46384) ([Alexander Tokmakov](https://github.com/tavplubix)).
* 修复了查询规范化过程中错误的别名递归问题，该问题导致某些查询无法运行。[#46609](https://github.com/ClickHouse/ClickHouse/pull/46609) ([Raúl Marín](https://github.com/Algunenano)) 。
* 修复二进制格式中 IPv4/IPv6 的序列化和反序列化问题 [#46616](https://github.com/ClickHouse/ClickHouse/pull/46616) ([Kruglov Pavel](https://github.com/Avogar)).
* ActionsDAG：优化期间不要更改 `and` 的结果 [#46653](https://github.com/ClickHouse/ClickHouse/pull/46653) ([Salvatore Mesoraca](https://github.com/aiven-sal)) 。
* 改进客户端异常退出时的查询取消机制 [#46681](https://github.com/ClickHouse/ClickHouse/pull/46681) ([Alexander Tokmakov](https://github.com/tavplubix)).
* 修复聚合优化中的算术运算错误 [#46705](https://github.com/ClickHouse/ClickHouse/pull/46705) ([Duc Canh Le](https://github.com/canhld94)).
* 修复 `clickhouse-local` 在 JSONEachRow schema inference 期间可能异常退出的问题 [#46731](https://github.com/ClickHouse/ClickHouse/pull/46731) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复更改已过期角色时的问题 [#46772](https://github.com/ClickHouse/ClickHouse/pull/46772) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复多个步骤中的 PREWHERE 列合并累积问题 [#46785](https://github.com/ClickHouse/ClickHouse/pull/46785) ([Alexander Gololobov](https://github.com/davenger)).
* 在 HTTP 读取缓冲区中，使用初始范围获取文件大小。若无此更改，某些远程文件将无法被处理。[#46824](https://github.com/ClickHouse/ClickHouse/pull/46824) ([Antonio Andelic](https://github.com/antonio2368)).
* 修复使用 URL 表时进度条显示不正确的问题 [#46830](https://github.com/ClickHouse/ClickHouse/pull/46830) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 修复 `maxIntersections` 函数中的 MSan 报告问题 [#46847](https://github.com/ClickHouse/ClickHouse/pull/46847) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 修复 `Map` 数据类型中的一个缺陷 [#46856](https://github.com/ClickHouse/ClickHouse/pull/46856) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 修复 LIKE 模式中包含用引号括起来的不可引用字符时，某些 LIKE 搜索返回错误结果的问题 [#46875](https://github.com/ClickHouse/ClickHouse/pull/46875) ([Robert Schulze](https://github.com/rschu1ze)).
* 修复 - 当 Filling Transform 处理空块时，WITH FILL 会导致异常终止 [#46897](https://github.com/ClickHouse/ClickHouse/pull/46897) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)).
* 修复 JSON 中从字符串推断日期和整数类型的问题 [#46972](https://github.com/ClickHouse/ClickHouse/pull/46972) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了拉取期间 zero-copy 复制中的磁盘选择问题 [#47010](https://github.com/ClickHouse/ClickHouse/pull/47010) ([alesapin](https://github.com/alesapin)).
* 修复了 systemd 服务定义中的一个拼写错误 [#47051](https://github.com/ClickHouse/ClickHouse/pull/47051) ([Palash Goel](https://github.com/palash-goel)) 。
* 修复了 `CROSS JOIN` 在 `algorithm = auto` 时触发的 `NOT_IMPLEMENTED` 错误 [#47068](https://github.com/ClickHouse/ClickHouse/pull/47068) ([Vladimir C](https://github.com/vdimir)) 。
* 修复了这样一个问题：当 'part\_type' 配置为 'InMemory' 模式时，'ReplicatedMergeTree' 表无法插入两条相似数据 (Experimental 功能) 。[#47121](https://github.com/ClickHouse/ClickHouse/pull/47121) ([liding1992](https://github.com/liding1992)).
* 外部字典 / library-bridge：修复 "unknown library method 'extDict\_libClone'" 错误 [#47136](https://github.com/ClickHouse/ClickHouse/pull/47136) ([alex filatov](https://github.com/phil-88)).
* 修复带有 limit 的 grace 哈希连接中的竞态条件 [#47153](https://github.com/ClickHouse/ClickHouse/pull/47153) ([Vladimir C](https://github.com/vdimir)) 。
* 修复 PREWHERE 对具体列的支持 [#47154](https://github.com/ClickHouse/ClickHouse/pull/47154) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复 Query Status 中可能发生的死锁 [#47161](https://github.com/ClickHouse/ClickHouse/pull/47161) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 禁止对同一 `Join` 表执行 insert select，因为这会导致死锁 [#47260](https://github.com/ClickHouse/ClickHouse/pull/47260) ([Vladimir C](https://github.com/vdimir)).
* 在 `min_age_to_force_merge_seconds` 合并中跳过已合并的分区 [#47303](https://github.com/ClickHouse/ClickHouse/pull/47303) ([Antonio Andelic](https://github.com/antonio2368)).
* 修改 find\_first\_symbols，使其在 find\_first\_not\_symbols 中也能按预期工作 [#47304](https://github.com/ClickHouse/ClickHouse/pull/47304) ([Arthur Passos](https://github.com/arthurpassos)).
* 修复 CSV 中大数字的类型推断问题 [#47410](https://github.com/ClickHouse/ClickHouse/pull/47410) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 对包含别名的表达式禁用逻辑表达式优化器。[#47451](https://github.com/ClickHouse/ClickHouse/pull/47451) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复 `decodeURLComponent` 的错误 [#47457](https://github.com/ClickHouse/ClickHouse/pull/47457) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 修复带有 projection 的 explain graph 问题 [#47473](https://github.com/ClickHouse/ClickHouse/pull/47473) ([flynn](https://github.com/ucasfl)) 。
* 修复查询参数问题 [#47488](https://github.com/ClickHouse/ClickHouse/pull/47488) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 参数化视图：修复了一个错误。[#47495](https://github.com/ClickHouse/ClickHouse/pull/47495) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)) 。
* 数据格式模糊测试器及相关修复。[#47519](https://github.com/ClickHouse/ClickHouse/pull/47519) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 修复 `DateTime64` 的单调性检查问题 [#47526](https://github.com/ClickHouse/ClickHouse/pull/47526) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 修复 Nullable LowCardinality 列中的“块结构不匹配”问题 [#47537](https://github.com/ClickHouse/ClickHouse/pull/47537) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了 Apache Parquet 中的一个缺陷 [#45878](https://github.com/ClickHouse/ClickHouse/issues/45878) [#47538](https://github.com/ClickHouse/ClickHouse/pull/47538) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复 `BSONEachRow` 在文档大小无效时并行解析的问题 [#47540](https://github.com/ClickHouse/ClickHouse/pull/47540) ([Kruglov Pavel](https://github.com/Avogar)).
* 在 `SYSTEM FLUSH DISTRIBUTED` 时保留 `system.distribution_queue` 中的错误信息 [#47541](https://github.com/ClickHouse/ClickHouse/pull/47541) ([Azat Khuzhin](https://github.com/azat)).
* 检查 `BSONEachRow` 格式中是否存在重复列 [#47609](https://github.com/ClickHouse/ClickHouse/pull/47609) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复移动操作期间等待 zero copy 锁的问题 [#47631](https://github.com/ClickHouse/ClickHouse/pull/47631) ([alesapin](https://github.com/alesapin)).
* 修复按分区进行聚合时的问题 [#47634](https://github.com/ClickHouse/ClickHouse/pull/47634) ([Nikita Taranov](https://github.com/nickitat)).
* 修复了 `BSONEachRow` 格式中将 Tuple 作为 Array 序列化时的 bug [#47690](https://github.com/ClickHouse/ClickHouse/pull/47690) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复 `polygonsSymDifferenceCartesian` 中的崩溃问题 [#47702](https://github.com/ClickHouse/ClickHouse/pull/47702) ([pufit](https://github.com/pufit)).
* 修复从存储 `File` 读取采用 `zlib` 和 `gzip` 压缩的文件时的问题 [#47796](https://github.com/ClickHouse/ClickHouse/pull/47796) ([Anton Popov](https://github.com/CurtizJ)).
* 改进 PostgreSQL 的空查询检测 (用于 pgx Go 驱动) [#47854](https://github.com/ClickHouse/ClickHouse/pull/47854) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了 LowCardinality 类型的 DateTime 单调性检查问题 [#47860](https://github.com/ClickHouse/ClickHouse/pull/47860) ([Antonio Andelic](https://github.com/antonio2368)) 。
* RESTORE ASYNC 应使用 restore\_threads (而不是 backup\_threads) [#47861](https://github.com/ClickHouse/ClickHouse/pull/47861) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了包含 projections 的 ReplicatedMergeTree 中的 DROP COLUMN 问题 [#47883](https://github.com/ClickHouse/ClickHouse/pull/47883) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 修复了 Replicated database 的恢复问题 [#47901](https://github.com/ClickHouse/ClickHouse/pull/47901) ([Alexander Tokmakov](https://github.com/tavplubix)) 。
* 修复 HTTP 中警告信息过于冗长的问题 [#47903](https://github.com/ClickHouse/ClickHouse/pull/47903) ([Alexander Tokmakov](https://github.com/tavplubix)) 。
* 修复 `catboostEvaluate` 中“字段值过长”的问题 [#47970](https://github.com/ClickHouse/ClickHouse/pull/47970) ([Robert Schulze](https://github.com/rschu1ze)).
* 修复 [#36971](https://github.com/ClickHouse/ClickHouse/issues/36971)：Watchdog：如果子进程退出，则以非零退出码退出 [#47973](https://github.com/ClickHouse/ClickHouse/pull/47973) ([Коренберг Марк](https://github.com/socketpair)).
* 修复“索引文件 `cidx` 长度异常”问题 [#48010](https://github.com/ClickHouse/ClickHouse/pull/48010) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)) 。
* 修复 MaterializedPostgreSQL 中用于获取属性 (replica-identity) 的查询 [#48015](https://github.com/ClickHouse/ClickHouse/pull/48015) ([Solomatov Sergei](https://github.com/solomatovs)) 。
* parseDateTime()：修复 UB (有符号整数溢出问题) [#48019](https://github.com/ClickHouse/ClickHouse/pull/48019) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 在 Avro 中为 Record 使用唯一名称，以避免其 schema 被重复使用 [#48057](https://github.com/ClickHouse/ClickHouse/pull/48057) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修正 Keeper 中 TCP/HTTP 套接字超时时间的设置 [#48108](https://github.com/ClickHouse/ClickHouse/pull/48108) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 修复 `Avro` 格式中可能发生的空指针成员调用问题 [#48184](https://github.com/ClickHouse/ClickHouse/pull/48184) ([Kruglov Pavel](https://github.com/Avogar)) 。

### <a id="232" /> ClickHouse 23.2 发布，2023-02-23。 [演示文稿](https://presentations.clickhouse.com/2023-release-23.2/), [视频](https://www.youtube.com/watch?v=2o0vRMMIrkY)

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

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

* 为函数 "toDayOfWeek()" (别名："DAYOFWEEK") 新增了一个 mode 参数，用于指示一周是从周一还是周日开始，以及计数是从 0 还是 1 开始。为与其他日期时间函数保持一致，mode 参数被插入到 time 和 time zone 参数之间。这会破坏现有的 (此前未文档说明的) 双参数语法 "toDayOfWeek(time, time\_zone)" 的用法。修复方法是将该函数改写为 "toDayOfWeek(time, 0, time\_zone)"。[#45233](https://github.com/ClickHouse/ClickHouse/pull/45233) ([Robert Schulze](https://github.com/rschu1ze)).
* 将设置 `max_query_cache_size` 重命名为 `filesystem_cache_max_download_size`。[#45614](https://github.com/ClickHouse/ClickHouse/pull/45614) ([Kseniia Sumarokova](https://github.com/kssenii)).
* `default` 用户默认将不再拥有访问类型 `SHOW NAMED COLLECTION` 的权限 (例如，`default` 用户将无法再像以前那样向其他用户授予 ALL，因此此 PR 属于向后不兼容变更) 。[#46010](https://github.com/ClickHouse/ClickHouse/pull/46010) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 如果在 FORMAT clause 之前指定 SETTINGS clause，这些设置也会应用到 formatting。[#46003](https://github.com/ClickHouse/ClickHouse/pull/46003) ([Azat Khuzhin](https://github.com/azat)).
* 移除对设置 `materialized_postgresql_allow_automatic_update` 的支持 (该设置默认是关闭的) 。[#46106](https://github.com/ClickHouse/ClickHouse/pull/46106) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 略微提升了 `countDigits` 在真实数据集上的性能。此更改关闭了 [#44518](https://github.com/ClickHouse/ClickHouse/issues/44518)。在此前版本中，`countDigits(0)` 返回 `0`；现在返回 `1`，这更准确，也符合现有文档。[#46187](https://github.com/ClickHouse/ClickHouse/pull/46187) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 禁止创建使用 "Delta" 或 "DoubleDelta" 编解码器后再接 "Gorilla" 或 "FPC" 编解码器组合进行压缩的新列。可通过设置 "allow\_suspicious\_codecs = true" 绕过此限制。[#45652](https://github.com/ClickHouse/ClickHouse/pull/45652) ([Robert Schulze](https://github.com/rschu1ze)).

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

* 新增 `StorageIceberg` 和表函数 `iceberg`，以访问 S3 上的 Iceberg 表存储。[#45384](https://github.com/ClickHouse/ClickHouse/pull/45384) ([flynn](https://github.com/ucasfl)) 。
* 允许将存储配置为 `SETTINGS disk = '<disk_name>'` (而非 `storage_policy`) ，也支持通过显式创建磁盘进行配置：`SETTINGS disk = disk(type=s3, ...)`。[#41976](https://github.com/ClickHouse/ClickHouse/pull/41976) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 在 `system.part_log` 中暴露 `ProfileEvents` 计数器。[#38614](https://github.com/ClickHouse/ClickHouse/pull/38614) ([Bharat Nallan](https://github.com/bharatnc)).
* 对现有 `ReplacingMergeTree` 引擎的增强，使其允许重复插入。它在一个 MergeTree 引擎中结合了 `ReplacingMergeTree` 和 `CollapsingMergeTree` 的能力。已删除的数据在查询时不会返回，但也不会从磁盘中移除。[#41005](https://github.com/ClickHouse/ClickHouse/pull/41005) ([youennL-cs](https://github.com/youennL-cs)).
* 新增 `generateULID` 函数。修复 [#36536](https://github.com/ClickHouse/ClickHouse/issues/36536)。[#44662](https://github.com/ClickHouse/ClickHouse/pull/44662) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 新增 `corrMatrix` 聚合函数，用于计算任意两列之间的相关性。此外，由于聚合函数 `covarSamp` 和 `covarPop` 与 `corr` 类似，也一并添加了 `covarSampMatrix` 和 `covarPopMatrix`。@alexey-milovidov 关闭了 [#44587](https://github.com/ClickHouse/ClickHouse/issues/44587)。[#44680](https://github.com/ClickHouse/ClickHouse/pull/44680) ([FFFFFFFHHHHHHH](https://github.com/FFFFFFFHHHHHHH)).
* 引入 `arrayShuffle` 函数，用于随机打乱数组顺序。[#45271](https://github.com/ClickHouse/ClickHouse/pull/45271) ([Joanna Hulboj](https://github.com/jh0x)) 。
* 支持 Arrow 中的 `FIXED_SIZE_BINARY` 类型和 `Parquet` 中的 `FIXED_LENGTH_BYTE_ARRAY` 类型，并将其对应到 `FixedString`。新增设置 `output_format_parquet_fixed_string_as_fixed_byte_array/output_format_arrow_fixed_string_as_fixed_byte_array`，用于控制 `FixedString` 的默认输出类型。关闭 [#45326](https://github.com/ClickHouse/ClickHouse/issues/45326)。[#45340](https://github.com/ClickHouse/ClickHouse/pull/45340) ([Kruglov Pavel](https://github.com/Avogar)).
* 在 system.replication\_queue 中新增列 `last_exception_time`。[#45457](https://github.com/ClickHouse/ClickHouse/pull/45457) ([Frank Chen](https://github.com/FrankChen021)) 。
* 新增两个函数，允许为 SipHash{64,128} 自定义 key/seed。[#45513](https://github.com/ClickHouse/ClickHouse/pull/45513) ([Salvatore Mesoraca](https://github.com/aiven-sal)) 。
* 支持表函数 `format` 的三参数版本。关闭 [#45808](https://github.com/ClickHouse/ClickHouse/issues/45808)。[#45873](https://github.com/ClickHouse/ClickHouse/pull/45873) ([FFFFFFFHHHHHHH](https://github.com/FFFFFFFHHHHHHH)) 。
* 为 `JodaTime` 添加对 'x'、'w'、'S' 格式的支持。参见 [https://joda-time.sourceforge.net/apidocs/org/joda/time/format/DateTimeFormat.html。\[#46073](https://joda-time.sourceforge.net/apidocs/org/joda/time/format/DateTimeFormat.html。\[#46073)]\([https://github.com/ClickHouse/ClickHouse/pull/46073](https://github.com/ClickHouse/ClickHouse/pull/46073)) ([zk\_kiger](https://github.com/zk-kiger)) 。
* 支持窗口函数 `ntile`。 ([lgbo](https://github.com/lgbo-ustc)) 。
* 新增设置 `final`，可将 `FINAL` 修饰符隐式应用于每个表。 [#40945](https://github.com/ClickHouse/ClickHouse/pull/40945) ([Arthur Passos](https://github.com/arthurpassos)) 。
* 新增了 `arrayPartialSort` 和 `arrayPartialReverseSort` 函数。[#46296](https://github.com/ClickHouse/ClickHouse/pull/46296) ([Joanna Hulboj](https://github.com/jh0x)) 。
* 新的 HTTP 参数 `client_protocol_version` 允许为使用 Native format 的 HTTP 响应设置客户端协议版本。[#40397](https://github.com/ClickHouse/ClickHouse/issues/40397)。[#46360](https://github.com/ClickHouse/ClickHouse/pull/46360) ([Geoff Genz](https://github.com/genzgd)) 。
* 新增函数 `regexpExtract`，与 Spark 函数 `REGEXP_EXTRACT` 保持兼容。它与现有函数 `extract` 类似。[#46469](https://github.com/ClickHouse/ClickHouse/pull/46469) ([李扬](https://github.com/taiyang-li)) 。
* 新增函数 `JSONArrayLength`，用于返回最外层 JSON 数组中的元素个数。如果输入的 JSON 字符串无效，该函数将返回 NULL。[#46631](https://github.com/ClickHouse/ClickHouse/pull/46631) ([李扬](https://github.com/taiyang-li)) 。

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

* 引入的这套逻辑会在 PREWHERE 条件为多个条件的合取 (cond1 AND cond2 AND ...) 时生效。它会将需要读取相同列的条件按步骤分组。每个步骤之后，都会计算完整条件中对应的那一部分，并且可能会对结果行进行过滤。这样一来，后续步骤中需要读取的行数会更少，从而节省 IO 带宽并减少计算量。目前，这套逻辑默认处于禁用状态。待确认不会引入任何回归问题后，它将在未来的某个版本中默认启用，因此强烈建议用于测试。它可通过 2 个设置进行控制："enable\_multiple\_prewhere\_read\_steps" 和 "move\_all\_conditions\_to\_prewhere"。[#46140](https://github.com/ClickHouse/ClickHouse/pull/46140) ([Alexander Gololobov](https://github.com/davenger)).
* 新增了一个选项：如果表分区键与 group by 键兼容，则可按分区独立聚合。由设置 `allow_aggregate_partitions_independently` 控制。由于适用场景有限，默认禁用 (请参阅文档) 。[#45364](https://github.com/ClickHouse/ClickHouse/pull/45364) ([Nikita Taranov](https://github.com/nickitat)) 。
* 允许对 Compact 格式的 parts 使用 Vertical merge algorithm。这将使 ClickHouse server 在后台操作中占用更少的内存。此更改修复了 [#46084](https://github.com/ClickHouse/ClickHouse/issues/46084)。[#45681](https://github.com/ClickHouse/ClickHouse/pull/45681) [#46282](https://github.com/ClickHouse/ClickHouse/pull/46282) ([Anton Popov](https://github.com/CurtizJ)) 。
* 使用批次读取器优化 `Parquet` 读取器。[#45878](https://github.com/ClickHouse/ClickHouse/pull/45878) ([LiuNeng](https://github.com/liuneng1994)).
* 新增了基于异步 Linux [io\_uring](https://kernel.dk/io_uring.pdf) 子系统的 `local_filesystem_read_method` 方法 `io_uring`；与默认的 `pread` 方法相比，它几乎在所有情况下都能提升读取性能。[#38456](https://github.com/ClickHouse/ClickHouse/pull/38456) ([Saulius Valatka](https://github.com/sauliusvl)) 。
* 在逻辑等价的情况下，将参数为 `if` expression 的 aggregate functions 改写为等价形式。例如，`avg(if(cond, col, null))` 可以改写为 avgIf(cond, col)。这有助于提升性能。[#44730](https://github.com/ClickHouse/ClickHouse/pull/44730) ([李扬](https://github.com/taiyang-li)).
* 利用 AVX512 指令提升 lower/upper 函数性能。[#37894](https://github.com/ClickHouse/ClickHouse/pull/37894) ([yaqi-zhao](https://github.com/yaqi-zhao)) 。
* 取消以下限制：在拥有 >=32 个核心且禁用 SMT 的系统上，ClickHouse 只会使用一半的核心 (即在 BIOS 中禁用 Hyper Threading 的情况) 。[#44973](https://github.com/ClickHouse/ClickHouse/pull/44973) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 通过列式执行优化函数 `multiIf` 的性能，提速 2.3 倍。[#45296](https://github.com/ClickHouse/ClickHouse/pull/45296) ([李扬](https://github.com/taiyang-li)) 。
* 为函数 `position` 增加 needle 为空时的快速路径。[#45382](https://github.com/ClickHouse/ClickHouse/pull/45382) ([李扬](https://github.com/taiyang-li)).
* 默认启用 `query_plan_remove_redundant_sorting` 优化。该优化在 [#45420](https://github.com/ClickHouse/ClickHouse/issues/45420) 中实现。[#45567](https://github.com/ClickHouse/ClickHouse/pull/45567) ([Igor Nikonov](https://github.com/devcrafter)) 。
* 增大了 HTTP 传输编码的分块大小，以提升通过 HTTP 接口执行大型查询的性能。[#45593](https://github.com/ClickHouse/ClickHouse/pull/45593) ([Geoff Genz](https://github.com/genzgd)) 。
* 优化了从包含大量 `Array`/`Map`/`Nested` 列的表中读取数据的短 `SELECT` 查询的性能。[#45630](https://github.com/ClickHouse/ClickHouse/pull/45630) ([Anton Popov](https://github.com/CurtizJ)) 。
* 优化对大整数和十进制类型进行过滤时的性能。 [#45949](https://github.com/ClickHouse/ClickHouse/pull/45949) ([李扬](https://github.com/taiyang-li)).
* 这一变更可有效降低从 ColumnNullable(UInt8) 获取过滤器的开销，并提升整体查询性能。为了评估这一变更的影响，我们采用了 TPC-H benchmark，但将列类型由非 Nullable 改为 Nullable，并以查询的 QPS 作为性能指标进行测量。[#45962](https://github.com/ClickHouse/ClickHouse/pull/45962) ([Zhiguo Zhou](https://github.com/ZhiguoZh)).
* 将虚拟列 `_part` 和 `_partition_id` 的类型设为 `LowCardinality(String)`。修复了 [#45964](https://github.com/ClickHouse/ClickHouse/issues/45964)。[#45975](https://github.com/ClickHouse/ClickHouse/pull/45975) ([flynn](https://github.com/ucasfl)).
* 在标度不变的情况下提升 Decimal 转换性能。[#46095](https://github.com/ClickHouse/ClickHouse/pull/46095) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 支持增加读取数据时的预取。[#46168](https://github.com/ClickHouse/ClickHouse/pull/46168) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 将 `arrayExists(x -> x = 1, arr)` 重写为 `has(arr, 1)`，性能提升 1.34 倍。[#46188](https://github.com/ClickHouse/ClickHouse/pull/46188) ([李扬](https://github.com/taiyang-li)) 。
* 修复非远程磁盘上垂直 merge 的 memory usage 过高问题。对远程磁盘遵循 `max_insert_delayed_streams_for_parallel_write`。[#46275](https://github.com/ClickHouse/ClickHouse/pull/46275) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 将 zstd 更新至 v1.5.4。该版本在性能和压缩率方面有一些小幅改进。如果你运行的是不同版本的 ClickHouse 副本，可能会看到带说明的正常错误消息 `Data after merge/mutation is not byte-identical to data on another replicas.`。这些消息是正常的，无需担心。[#46280](https://github.com/ClickHouse/ClickHouse/pull/46280) ([Raúl Marín](https://github.com/Algunenano)).
* 修复了由 [#39737](https://github.com/ClickHouse/ClickHouse/issues/39737) 引起的性能下降。[#46309](https://github.com/ClickHouse/ClickHouse/pull/46309) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 即使复制队列很大，`replicas_status` 句柄也能快速响应。 [#46310](https://github.com/ClickHouse/ClickHouse/pull/46310) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 为聚合函数 `sum`、一元算术函数和比较函数增加 avx512 支持。[#37870](https://github.com/ClickHouse/ClickHouse/pull/37870) ([zhao zhou](https://github.com/zzachimed)) 。
* 重写了与标记分布及读取过程整体协调相关的代码，以尽可能提升性能。该更改关闭了 [#34527](https://github.com/ClickHouse/ClickHouse/issues/34527)。[#43772](https://github.com/ClickHouse/ClickHouse/pull/43772) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 移除查询 (子查询) 中冗余的 DISTINCT 子句。该功能基于查询计划实现。对于 DISTINCT 子句，它执行与 `optimize_duplicate_order_by_and_distinct` 类似的优化。可通过 `query_plan_remove_redundant_distinct` 设置启用。相关内容见 [#42648](https://github.com/ClickHouse/ClickHouse/issues/42648)。[#44176](https://github.com/ClickHouse/ClickHouse/pull/44176) ([Igor Nikonov](https://github.com/devcrafter)) 。
* 几项查询重写优化：`sumIf(123, cond) -> 123 * countIf(1, cond)`, `sum(if(cond, 123, 0)) -> 123 * countIf(cond)`, `sum(if(cond, 0, 123)) -> 123 * countIf(not(cond))` [#44728](https://github.com/ClickHouse/ClickHouse/pull/44728) ([李扬](https://github.com/taiyang-li)) 。
* 改进了受内存限制的合并、按顺序聚合与顶层查询计划之间的交互。此前，在某些实际上并不需要的情况下，我们会回退为对 AIO 进行显式排序。[#45892](https://github.com/ClickHouse/ClickHouse/pull/45892) ([Nikita Taranov](https://github.com/nickitat)) 。
* 默认情况下，并发合并采用轮询调度，以确保调度公平且不会发生饥饿。此前，在负载严重过高的分片中，由于使用严格的优先级调度，大型合并可能会因较小的合并而长期得不到执行。新增了 `background_merges_mutations_scheduling_policy` server 配置选项，用于选择调度算法 (`round_robin` 或 `shortest_task_first`) 。[#46247](https://github.com/ClickHouse/ClickHouse/pull/46247) ([Sergei Trifonov](https://github.com/serxa)).

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

* 在 ZooKeeper session 丢失时，默认启用 INSERT 重试。我们已经在生产环境中使用了这一功能。[#46308](https://github.com/ClickHouse/ClickHouse/pull/46308) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 新增了在命名元组的 JSON 对象中忽略未知键的功能 (`input_format_json_ignore_unknown_keys_in_named_tuple`) 。[#45678](https://github.com/ClickHouse/ClickHouse/pull/45678) ([Azat Khuzhin](https://github.com/azat)) 。
* 支持针对带有 `final` 的查询进行优化，将 `where` 子句中的排序键表达式下推到 `prewhere`。[#38893](https://github.com/ClickHouse/ClickHouse/issues/38893)。[#38950](https://github.com/ClickHouse/ClickHouse/pull/38950) ([hexiaoting](https://github.com/hexiaoting)) 。
* 为备份新增了指标：num\_processed\_files 和 processed\_files\_size，用于反映实际已处理的文件数量。[#42244](https://github.com/ClickHouse/ClickHouse/pull/42244) ([Aleksandr](https://github.com/AVMusorin)).
* 新增了对服务器间 DNS 错误的重试机制。[#43179](https://github.com/ClickHouse/ClickHouse/pull/43179) ([Anton Kozlov](https://github.com/tonickkozlov)).
* Keeper 改进：尝试在磁盘上预分配空间，以避免出现未定义的磁盘空间耗尽问题。引入设置 `max_log_file_size`，用于限制 Keeper 的 Raft 日志文件最大大小。[#44370](https://github.com/ClickHouse/ClickHouse/pull/44370) ([Antonio Andelic](https://github.com/antonio2368)).
* 在副本处于只读状态时，优化副本延迟 API 逻辑的行为。[#45148](https://github.com/ClickHouse/ClickHouse/pull/45148) ([mateng915](https://github.com/mateng0915)) 。
* 当空密码无效时，在 clickhouse-client 中以交互方式提示输入密码。关闭 [#46702](https://github.com/ClickHouse/ClickHouse/issues/46702)。[#46730](https://github.com/ClickHouse/ClickHouse/pull/46730) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 将非 Float\* 类型列上的 `Gorilla` 压缩标记为可疑项。[#45376](https://github.com/ClickHouse/ClickHouse/pull/45376) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 在 `postpone_reason` 列中显示执行合并操作的副本名称。[#45458](https://github.com/ClickHouse/ClickHouse/pull/45458) ([Frank Chen](https://github.com/FrankChen021)) 。
* 在 part\_log 中保存异常堆栈信息。[#45459](https://github.com/ClickHouse/ClickHouse/pull/45459) ([Frank Chen](https://github.com/FrankChen021)) 。
* `regexp_tree` 字典已经过完善，现已兼容 [https://github.com/ua-parser/uap-core。\[#45631](https://github.com/ua-parser/uap-core。\[#45631)]\([https://github.com/ClickHouse/ClickHouse/pull/45631](https://github.com/ClickHouse/ClickHouse/pull/45631)) ([Han Fei](https://github.com/hanfei1991)) 。
* 改进了对 `SYSTEM SYNC REPLICA` 的检查，解决了 [#45508](https://github.com/ClickHouse/ClickHouse/issues/45508) [#45648](https://github.com/ClickHouse/ClickHouse/pull/45648) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)) 。
* 将设置 `replication_alter_partitions_sync` 更名为 `alter_sync`。[#45659](https://github.com/ClickHouse/ClickHouse/pull/45659) ([Antonio Andelic](https://github.com/antonio2368)) 。
* `generateRandom` 表函数和该引擎现已支持 `LowCardinality` 数据类型。这对测试很有帮助，例如你可以写 `INSERT INTO table SELECT * FROM generateRandom() LIMIT 1000`。这是调试 [#45590](https://github.com/ClickHouse/ClickHouse/issues/45590) 所必需的。[#45661](https://github.com/ClickHouse/ClickHouse/pull/45661) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* Experimental 查询结果缓存现已提供更模块化的配置选项。[#45679](https://github.com/ClickHouse/ClickHouse/pull/45679) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 将 "query result cache" 更名为 "query cache"。[#45682](https://github.com/ClickHouse/ClickHouse/pull/45682) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 新增 `SYSTEM SYNC FILE CACHE` 命令。该命令会执行 `sync` 系统调用。[#8921](https://github.com/ClickHouse/ClickHouse/issues/8921)。[#45685](https://github.com/ClickHouse/ClickHouse/pull/45685) ([DR](https://github.com/freedomDR)) 。
* 新增一个 S3 设置 `allow_head_object_request`。此 PR 让在 [https://github.com/ClickHouse/ClickHouse/pull/45288](https://github.com/ClickHouse/ClickHouse/pull/45288) 中引入的“使用 `GetObjectAttributes` 请求代替 `HeadObject`”变为可选 (默认禁用) 。[#45701](https://github.com/ClickHouse/ClickHouse/pull/45701) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 新增了可按连接名称覆盖连接设置的功能 (也就是说，现在你不必再为每个连接单独存储密码，只需将所有内容放到 `~/.clickhouse-client/config.xml` 中，甚至还可以为它们使用不同的历史记录文件，这也很有用) 。[#45715](https://github.com/ClickHouse/ClickHouse/pull/45715) ([Azat Khuzhin](https://github.com/azat)).
* Arrow 格式：支持 Duration 类型。修复了 [#45669](https://github.com/ClickHouse/ClickHouse/issues/45669)。[#45750](https://github.com/ClickHouse/ClickHouse/pull/45750) ([flynn](https://github.com/ucasfl)) 。
* 增强 Query Cache 中的日志记录，以改进对缓存行为的调查。[#45751](https://github.com/ClickHouse/ClickHouse/pull/45751) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 查询缓存的服务器级设置现已支持在运行时重新配置。[#45758](https://github.com/ClickHouse/ClickHouse/pull/45758) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 当使用命名集合指定表函数参数时，在日志中隐藏密码。[#45774](https://github.com/ClickHouse/ClickHouse/pull/45774) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 改进内部 S3 客户端，使其能够针对不同类型的 URL 正确识别区域和重定向。[#45783](https://github.com/ClickHouse/ClickHouse/pull/45783) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 为 generateRandom 添加对 Map、IPv4 和 IPv6 类型的支持。主要用于测试。[#45785](https://github.com/ClickHouse/ClickHouse/pull/45785) ([Raúl Marín](https://github.com/Algunenano)) 。
* 支持在 IP 类型上使用 empty/notEmpty。[#45799](https://github.com/ClickHouse/ClickHouse/pull/45799) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* 列 `num_processed_files` 已拆分为两列：`num_files` (用于 BACKUP) 和 `files_read` (用于 RESTORE) 。列 `processed_files_size` 已拆分为两列：`total_size` (用于 BACKUP) 和 `bytes_read` (用于 RESTORE) 。[#45800](https://github.com/ClickHouse/ClickHouse/pull/45800) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 为兼容 MySQL，新增了对 `SHOW ENGINES` 查询的支持。[#45859](https://github.com/ClickHouse/ClickHouse/pull/45859) ([Filatenkov Artur](https://github.com/FArthur-cmd)) 。
* 改进了混淆器对查询的处理方式。[#45867](https://github.com/ClickHouse/ClickHouse/pull/45867) ([Raúl Marín](https://github.com/Algunenano)) 。
* 改进转换为 Date 时对边界值 65535 (2149-06-06) 的处理。[#46042](https://github.com/ClickHouse/ClickHouse/pull/46042) [#45914](https://github.com/ClickHouse/ClickHouse/pull/45914) ([Joanna Hulboj](https://github.com/jh0x)) 。
* 新增设置 `check_referential_table_dependencies`，用于在 `DROP TABLE` 时检查引用依赖关系。此 PR 解决了 [#38326](https://github.com/ClickHouse/ClickHouse/issues/38326)。[#45936](https://github.com/ClickHouse/ClickHouse/pull/45936) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复 `tupleElement`，使其在参数为 `Null` 时返回 `Null`。关闭 [#45894](https://github.com/ClickHouse/ClickHouse/issues/45894)。[#45952](https://github.com/ClickHouse/ClickHouse/pull/45952) ([flynn](https://github.com/ucasfl)) 。
* 如果没有文件匹配 S3 通配符，则报错。关闭了 [#45587](https://github.com/ClickHouse/ClickHouse/issues/45587)。[#45957](https://github.com/ClickHouse/ClickHouse/pull/45957) ([chen](https://github.com/xiedeyantu)) 。
* 使用集群状态数据检查并发备份/恢复情况。[#45982](https://github.com/ClickHouse/ClickHouse/pull/45982) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)).
* ClickHouse Client：模糊搜索使用 "exact" 匹配，可正确忽略大小写，并采用更适合 SQL 查询匹配的算法。[#46000](https://github.com/ClickHouse/ClickHouse/pull/46000) ([Azat Khuzhin](https://github.com/azat)) 。
* 禁止使用错误的 create View 语法 `CREATE View X TO Y AS SELECT`。关闭了 [#4331](https://github.com/ClickHouse/ClickHouse/issues/4331)。[#46043](https://github.com/ClickHouse/ClickHouse/pull/46043) ([flynn](https://github.com/ucasfl)).
* `Log` 存储家族现已支持设置 `storage_policy`。关闭了 [#43421](https://github.com/ClickHouse/ClickHouse/issues/43421)。[#46044](https://github.com/ClickHouse/ClickHouse/pull/46044) ([flynn](https://github.com/ucasfl)).
* 当结果为空时，改进 `JSONColumns` 格式。修复了 [#46024](https://github.com/ClickHouse/ClickHouse/issues/46024)。[#46053](https://github.com/ClickHouse/ClickHouse/pull/46053) ([flynn](https://github.com/ucasfl)) 。
* 新增 SipHash128 的参考实现。[#46065](https://github.com/ClickHouse/ClickHouse/pull/46065) ([Salvatore Mesoraca](https://github.com/aiven-sal)) 。
* 新增一个指标，用于记录使用 mmap 时的分配次数和分配字节数。[#46068](https://github.com/ClickHouse/ClickHouse/pull/46068) ([李扬](https://github.com/taiyang-li)).
* 目前，对于 `leftPad`、`rightPad`、`leftPadUTF8`、`rightPadUTF8` 等函数，第二个参数 `length` 必须为 UInt8|16|32|64|128|256。这一限制对 ClickHouse 用户来说过于严格，而且也与 `arrayResize`、`substring` 等其他类似函数不一致。[#46103](https://github.com/ClickHouse/ClickHouse/pull/46103) ([李扬](https://github.com/taiyang-li)) 。
* 修复了调试构建中 `welchTTest` 函数在结果统计量为 NaN 时触发的断言，并将其行为与其他类似函数保持一致。将 `studentTTest` 的行为改为返回 NaN，而不是抛出异常，因为之前的行为不够方便。此更改关闭了 [#41176](https://github.com/ClickHouse/ClickHouse/issues/41176) 和 [#42162](https://github.com/ClickHouse/ClickHouse/issues/42162)。[#46141](https://github.com/ClickHouse/ClickHouse/pull/46141) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 更便捷地使用大整数和 ORDER BY WITH FILL。在对大整数 (128 位和 256 位) 执行 ORDER BY 时，允许在 WITH FILL 中将普通整数用作起点和终点。修复了大整数在起点或终点为负数时结果错误的问题。此更改关闭了 [#16733](https://github.com/ClickHouse/ClickHouse/issues/16733)。[#46152](https://github.com/ClickHouse/ClickHouse/pull/46152) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 在 [issue](https://github.com/ClickHouse/ClickHouse/issues/44336) 中，向 `system.tables` 添加 `parts`、`active_parts` 和 `total_marks` 列。[#46161](https://github.com/ClickHouse/ClickHouse/pull/46161) ([attack204](https://github.com/attack204)) 。
* 函数 "multi\[Fuzzy]Match(Any|AnyIndex|AllIndices}" 现在会拒绝那些在 vectorscan 中很可能导致求值速度非常慢的正则表达式。[#46167](https://github.com/ClickHouse/ClickHouse/pull/46167) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 当启用 `insert_null_as_default` 且列未定义默认值时，将使用该列类型的默认值。此外，此 PR 还修复了在 LowCardinality 列中遇到 null 时使用默认值的问题。[#46171](https://github.com/ClickHouse/ClickHouse/pull/46171) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 优先为 S3 客户端使用显式指定的访问密钥。如果将 `use_environment_credentials` 设为 `true`，且用户已通过查询或配置提供访问密钥，则会优先使用这些密钥，而不是环境变量中的密钥。[#46191](https://github.com/ClickHouse/ClickHouse/pull/46191) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 为函数 "formatDateTime()" 新增别名 "DATE\_FORMAT()"，以提高与 MySQL SQL dialect 的兼容性，并为函数 `formatDateTime` 扩展替换："a"、"b"、"c"、"h"、"i"、"k"、"l"、"r"、"s"、"W"。### 面向用户可见变更的文档条目 用户可读的简短说明：`DATE_FORMAT` 是 `formatDateTime` 的别名。它会按照给定的 format string 对 Time 进行格式化。Format 是常量 expression，因此单个结果列不能使用多种格式。 (提供指向 [formatDateTime](/zh/reference/functions/regular-functions/date-time-functions#formatDateTime) 的链接。) [#46302](https://github.com/ClickHouse/ClickHouse/pull/46302) ([Jake Bamrah](https://github.com/JakeBamrah)) 。
* 新增了与并行副本回调任务相关的 `ProfileEvents` 和 `CurrentMetrics` (用于 `s3Cluster` 和 `MergeTree` 表) 。[#46313](https://github.com/ClickHouse/ClickHouse/pull/46313) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 为使用 `KeeperMap` 存储引擎的表新增了对 `DELETE` 和 `UPDATE` 的支持。[#46330](https://github.com/ClickHouse/ClickHouse/pull/46330) ([Antonio Andelic](https://github.com/antonio2368)).
* 允许在 RENAME 查询中使用查询参数。修复了 [#45778](https://github.com/ClickHouse/ClickHouse/issues/45778)。[#46407](https://github.com/ClickHouse/ClickHouse/pull/46407) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 修复了使用 REPLACE 转换器的参数化 SELECT 查询。解决了 [#33002](https://github.com/ClickHouse/ClickHouse/issues/33002)。[#46420](https://github.com/ClickHouse/ClickHouse/pull/46420) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 在异步指标 "NumberOfDatabases" 的计算中，排除用于临时/外部表的内部数据库。这使其行为与系统表 "system.databases" 保持一致。[#46435](https://github.com/ClickHouse/ClickHouse/pull/46435) ([Robert Schulze](https://github.com/rschu1ze)).
* 在 distribution\_queue 表中新增了 `last_exception_time` 列。[#46564](https://github.com/ClickHouse/ClickHouse/pull/46564) ([Aleksandr](https://github.com/AVMusorin)) 。
* 支持在参数化视图的 IN 子句中使用参数。[#46583](https://github.com/ClickHouse/ClickHouse/pull/46583) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)) 。
* 不要在服务器启动时加载命名集合 (改为在首次访问时加载) 。[#46607](https://github.com/ClickHouse/ClickHouse/pull/46607) ([Kseniia Sumarokova](https://github.com/kssenii)) 。

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

* 引入由 LLVM 运行时实现的 GWP-ASan。此更改关闭了 [#27039](https://github.com/ClickHouse/ClickHouse/issues/27039)。[#45226](https://github.com/ClickHouse/ClickHouse/pull/45226) ([Han Fei](https://github.com/hanfei1991)).
* 我们希望让测试变得更不稳定、更容易随机失败：为测试中的 merge tree settings 增加随机化。[#38983](https://github.com/ClickHouse/ClickHouse/pull/38983) ([Anton Popov](https://github.com/CurtizJ)).
* 在 PowerPC 上启用 HDFS 支持，这有助于修复以下 Functional tests：02113\_hdfs\_assert.sh、02244\_hdfs\_cluster.sql 和 02368\_cancel\_write\_into\_hdfs.sh。[#44949](https://github.com/ClickHouse/ClickHouse/pull/44949) ([MeenaRenganathan22](https://github.com/MeenaRenganathan22)).
* 为 clickhouse-keeper 添加 systemd.service 文件。修复了 [#44293](https://github.com/ClickHouse/ClickHouse/issues/44293)。[#45568](https://github.com/ClickHouse/ClickHouse/pull/45568) ([Mikhail f. Shiryaev](https://github.com/Felixoid)).
* ClickHouse 的 poco fork 已从 "contrib/" 移至 "base/poco/"。[#46075](https://github.com/ClickHouse/ClickHouse/pull/46075) ([Robert Schulze](https://github.com/rschu1ze)).
* 为 `clickhouse-watchdog` 添加一个用于重启子进程的选项。这个选项其实没太大用处。[#46312](https://github.com/ClickHouse/ClickHouse/pull/46312) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 如果环境变量 `CLICKHOUSE_DOCKER_RESTART_ON_EXIT` 被设置为 1，Docker 容器将以子进程而非首个进程的方式运行 `clickhouse-server`，并在其退出后将其重启。[#46391](https://github.com/ClickHouse/ClickHouse/pull/46391) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 修复 systemd service 文件。[#46461](https://github.com/ClickHouse/ClickHouse/pull/46461) ([SuperDJY](https://github.com/cmsxbc)).
* 将构建 ClickHouse 所需的最低 Clang 版本从 12 提升到 15。[#46710](https://github.com/ClickHouse/ClickHouse/pull/46710) ([Robert Schulze](https://github.com/rschu1ze)).
* 将 Intel QPL 从 v0.3.0 升级到 v1.0.0 2。构建 libaccel-config，并将其静态链接到 QPL 库，而不是动态链接。[#45809](https://github.com/ClickHouse/ClickHouse/pull/45809) ([jasperzhu](https://github.com/jinjunzh)).

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

* 在 `StorageRabbitMQ` 中，数据会严格按照 `rabbitmq_flush_interval_ms` 或 `rabbitmq_max_block_size` 进行刷新。关闭了 [#42389](https://github.com/ClickHouse/ClickHouse/issues/42389)。关闭了 [#45160](https://github.com/ClickHouse/ClickHouse/issues/45160)。[#44404](https://github.com/ClickHouse/ClickHouse/pull/44404) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 在 sparkBar 函数中使用 PODArray 进行渲染，以便控制内存占用。关闭 [#44467](https://github.com/ClickHouse/ClickHouse/issues/44467)。[#44489](https://github.com/ClickHouse/ClickHouse/pull/44489) ([Duc Canh Le](https://github.com/canhld94))。
* 修复函数 (quantilesExactExclusive, quantilesExactInclusive) 返回未排序数组元素的问题。[#45379](https://github.com/ClickHouse/ClickHouse/pull/45379) ([wujunfu](https://github.com/wujunfu)) 。
* 修复了在启用 OpenTelemetry 时，HTTPHandler 中未捕获异常的问题。[#45456](https://github.com/ClickHouse/ClickHouse/pull/45456) ([Frank Chen](https://github.com/FrankChen021)) 。
* 不要根据 8 位数字推断日期，这可能会导致读取到错误的数据。[#45581](https://github.com/ClickHouse/ClickHouse/pull/45581) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复了 `odbc_bridge_use_connection_pooling` 设置未被正确使用的问题。[#45591](https://github.com/ClickHouse/ClickHouse/pull/45591) ([Bharat Nallan](https://github.com/bharatnc)) 。
* 调用缓存中的回调时，该缓存可能已经析构。为确保安全，我们按值捕获成员。对于任务调度来说，这样也是安全的，因为它会在存储销毁前停用。修复 [#45548](https://github.com/ClickHouse/ClickHouse/issues/45548)。[#45601](https://github.com/ClickHouse/ClickHouse/pull/45601) ([Han Fei](https://github.com/hanfei1991)) 。
* 修复 Delta 或 DoubleDelta 编解码器与 Gorilla 编解码器组合使用时导致的数据损坏问题。[#45615](https://github.com/ClickHouse/ClickHouse/pull/45615) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 使用 N-gram bloom filter 索引时，正确检查类型以避免无效读取。[#45617](https://github.com/ClickHouse/ClickHouse/pull/45617) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 已报告了几个与 `c-ares` 相关的段错误。这些问题是在我之前的拉取请求中引入的。我在 Alexander Tokmakov 的帮助下修复了它们。[#45629](https://github.com/ClickHouse/ClickHouse/pull/45629) ([Arthur Passos](https://github.com/arthurpassos)).
* 修复遇到重复主键时键描述错误的问题。这种情况可能发生在投影中。详情参见 [#45590](https://github.com/ClickHouse/ClickHouse/issues/45590)。[#45686](https://github.com/ClickHouse/ClickHouse/pull/45686) ([Amos Bird](https://github.com/amosbird)).
* 为备份设置压缩方法和级别。修复 [#45690](https://github.com/ClickHouse/ClickHouse/issues/45690)。[#45737](https://github.com/ClickHouse/ClickHouse/pull/45737) ([Pradeep Chhetri](https://github.com/chhetripradeep)) 。
* 应改用 `select_query_typed.limitByOffset`，而不是 `select_query_typed.limitOffset`。[#45817](https://github.com/ClickHouse/ClickHouse/pull/45817) ([刘陶峰](https://github.com/taofengliu)) 。
* 使用 Experimental analyzer 时，`SELECT number FROM numbers(100) LIMIT 10 OFFSET 10;` 这类查询会返回错误结果 (该 SQL 会返回空结果) 。这是由于 planner 额外添加了一个不必要的 offset step 所致。[#45822](https://github.com/ClickHouse/ClickHouse/pull/45822) ([刘陶峰](https://github.com/taofengliu)).
* 向后兼容——允许从 UInt64 到 IPv4 的隐式窄化转换——这是 "INSERT ... VALUES ..." 表达式所必需的。[#45865](https://github.com/ClickHouse/ClickHouse/pull/45865) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* 修复 IPv6 解析器在处理首个八位组缺失的混合 IPv4 地址 (如 `::.1.2.3`) 时的问题。 [#45871](https://github.com/ClickHouse/ClickHouse/pull/45871) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)).
* 将 `query_kind` 列添加到 `system.processes` 表和 `SHOW PROCESSLIST` 查询中。移除重复代码。修复了一个 bug：全局配置参数 `max_concurrent_select_queries` 对包含 `INTERSECT` 或 `EXCEPT` 链的查询未正确生效。[#45872](https://github.com/ClickHouse/ClickHouse/pull/45872) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 修复了函数 `stochasticLinearRegression` 中的崩溃。该问题由 WingFuzz 发现。[#45985](https://github.com/ClickHouse/ClickHouse/pull/45985) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复带有 `INTERSECT` 和 `EXCEPT` 修饰符、从启用稀疏列的表中读取数据的 `SELECT` 查询发生崩溃的问题 (由设置 `ratio_of_defaults_for_sparse_serialization` 控制) 。[#45987](https://github.com/ClickHouse/ClickHouse/pull/45987) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了在使用 FINAL 进行 DESC 排序时按顺序读取优化失效的问题，关闭了 [#45815](https://github.com/ClickHouse/ClickHouse/issues/45815)。[#46009](https://github.com/ClickHouse/ClickHouse/pull/46009) ([Vladimir C](https://github.com/vdimir)).
* 修复了在 compact parts 中读取多级不存在的嵌套列时的问题。[#46045](https://github.com/ClickHouse/ClickHouse/pull/46045) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复 system.processes 中 elapsed 列的 10 倍误差问题。[#46047](https://github.com/ClickHouse/ClickHouse/pull/46047) ([Azat Khuzhin](https://github.com/azat)) 。
* 将 domain IP 类型 (IPv4、IPv6) 替换为原生类型 ([https://github.com/ClickHouse/ClickHouse/pull/43221](https://github.com/ClickHouse/ClickHouse/pull/43221)) 的后续修复。 [#46087](https://github.com/ClickHouse/ClickHouse/pull/46087) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)).
* 修复了配置中环境变量替换的问题：当参数已有值时，也能正确处理。此修复关闭了 [#46131](https://github.com/ClickHouse/ClickHouse/issues/46131)。此修复关闭了 [#9547](https://github.com/ClickHouse/ClickHouse/issues/9547)。[#46144](https://github.com/ClickHouse/ClickHouse/pull/46144) ([pufit](https://github.com/pufit)) 。
* 修复了 grouping sets 中错误的谓词下推。关闭 [#45947](https://github.com/ClickHouse/ClickHouse/issues/45947)。[#46151](https://github.com/ClickHouse/ClickHouse/pull/46151) ([flynn](https://github.com/ucasfl)).
* 修复了在使用常量键时，`fulls_sorting_join` 可能引发管道卡住的问题。[#46175](https://github.com/ClickHouse/ClickHouse/pull/46175) ([Vladimir C](https://github.com/vdimir)) 。
* 为避免结果错误，在格式化期间切勿将 tuple 函数重写为字面量。[#46232](https://github.com/ClickHouse/ClickHouse/pull/46232) ([Salvatore Mesoraca](https://github.com/aiven-sal)).
* 修复以 Arrow 格式读取 LowCardinality(Nullable) 时可能出现的越界错误。[#46270](https://github.com/ClickHouse/ClickHouse/pull/46270) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复 `SYSTEM UNFREEZE` 查询因抛出 `CANNOT_PARSE_INPUT_ASSERTION_FAILED` 异常而失败的问题。[#46325](https://github.com/ClickHouse/ClickHouse/pull/46325) ([Aleksei Filatov](https://github.com/aalexfvk)) 。
* 修复了在反序列化存储 HashTable 的函数聚合状态时，可能因整数溢出导致的崩溃问题。[#46349](https://github.com/ClickHouse/ClickHouse/pull/46349) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了在 `VALUES` 格式中发送无效数据时，异步插入可能导致的 `LOGICAL_ERROR`。[#46350](https://github.com/ClickHouse/ClickHouse/pull/46350) ([Anton Popov](https://github.com/CurtizJ)) 。
* 修复了尝试执行 `ALTER ... MOVE PART ... TO TABLE` 时触发的 LOGICAL\_ERROR。实际上，这类查询此前从未被支持过。[#46359](https://github.com/ClickHouse/ClickHouse/pull/46359) ([Alexander Tokmakov](https://github.com/tavplubix)) 。
* 修复在启用 `parallel_distributed_insert_select` 时，并行分布式 insert select 中 s3Cluster schema 推断的问题。[#46381](https://github.com/ClickHouse/ClickHouse/pull/46381) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了如下查询：`ALTER TABLE ... UPDATE nested.arr1 = nested.arr2 ...`，其中 `arr1` 和 `arr2` 是同一 `Nested` 列中的字段。 [#46387](https://github.com/ClickHouse/ClickHouse/pull/46387) ([Anton Popov](https://github.com/CurtizJ)).
* 调度器可能无法调度任务。如果出现这种情况，应中止整个 MulityPartUpload，并且 `UploadHelper` 必须等待已调度的任务完成。[#46451](https://github.com/ClickHouse/ClickHouse/pull/46451) ([Dmitry Novik](https://github.com/novikd)).
* 修复默认类型不同的 Merge 中的 PREWHERE 问题 (修复了某些列默认类型不一致时出现的 `NOT_FOUND_COLUMN_IN_BLOCK`，同时允许在各表中该列类型一致时使用 `PREWHERE`，并且仅在类型不一致时才禁止使用) 。[#46454](https://github.com/ClickHouse/ClickHouse/pull/46454) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了在 `ORDER BY` 中使用常量值时可能出现的崩溃问题。修复了 [#46466](https://github.com/ClickHouse/ClickHouse/issues/46466)。[#46493](https://github.com/ClickHouse/ClickHouse/pull/46493) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 如果在查询级别指定了 `disk` 设置，而在配置的 merge tree settings 部分指定了 `storage_policy`，则不应抛出异常。`disk` 会覆盖配置中的设置。[#46533](https://github.com/ClickHouse/ClickHouse/pull/46533) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 修复了函数 `arrayMap` 中对常量 `LowCardinality` 参数处理不当的问题。该缺陷可能导致在 release 版本中发生段错误，并在 debug 构建中出现逻辑错误 `Bad cast`。[#46569](https://github.com/ClickHouse/ClickHouse/pull/46569) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 修复 [#46557](https://github.com/ClickHouse/ClickHouse/issues/46557)。[#46611](https://github.com/ClickHouse/ClickHouse/pull/46611) ([Alexander Gololobov](https://github.com/davenger)) 。
* 修复：如果服务器无法在 1 分 30 秒内启动，clickhouse-server 的 systemd 单元会不断重启；现已禁用 systemd 服务启动 clickhouse-server 时的超时逻辑。[#46613](https://github.com/ClickHouse/ClickHouse/pull/46613) ([Azat Khuzhin](https://github.com/azat)) 。
* 在异步插入期间分配的内存缓冲区却在全局上下文中被释放，且对应用户和查询的 MemoryTracker 计数器未被正确更新，导致误报 OOM 异常。[#46622](https://github.com/ClickHouse/ClickHouse/pull/46622) ([Dmitry Novik](https://github.com/novikd)) 。
* 现已更新为不再从 table\_join 中清除 on\_expression，因为后续的 analyze 运行还会用到它，解决了 [#45185](https://github.com/ClickHouse/ClickHouse/issues/45185)。[#46487](https://github.com/ClickHouse/ClickHouse/pull/46487) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)).

### <a id="231" /> ClickHouse 23.1 发布，2023-01-26。 [演示文稿](https://presentations.clickhouse.com/2023-release-23.1/), [视频](https://www.youtube.com/watch?v=zYSZXBnTMSE)

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

<div id="clickhouse-release-231">
  ### ClickHouse 23.1 发布
</div>

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

* `SYSTEM RESTART DISK` 查询将变为一个空操作。[#44647](https://github.com/ClickHouse/ClickHouse/pull/44647) ([alesapin](https://github.com/alesapin))。
* `HASHED`/`SPARSE_HASHED` 字典的 `PREALLOCATE` 选项将变为空操作。[#45388](https://github.com/ClickHouse/ClickHouse/pull/45388) ([Azat Khuzhin](https://github.com/azat))。它已不再带来明显优势。
* 禁止在不是 Float32 或 Float64 类型的列上使用 `Gorilla` codec。[#45252](https://github.com/ClickHouse/ClickHouse/pull/45252) ([Robert Schulze](https://github.com/rschu1ze))。这样做没有意义，而且会导致不一致。
* 对于使用已弃用语法创建的 `*MergeTree` 表，并行 quorum insert 可能无法正确工作。因此，这类表的并行 quorum insert 支持已被完全禁用。这不会影响使用新语法创建的表。[#45430](https://github.com/ClickHouse/ClickHouse/pull/45430) ([Alexander Tokmakov](https://github.com/tavplubix))。
* 使用 `GetObjectAttributes` 请求而不是 `HeadObject` 请求来获取 AWS S3 中对象的大小。比如，此更改修复了在更新 AWS SDK 后，对未显式指定区域的端点的处理问题。[#45288](https://github.com/ClickHouse/ClickHouse/pull/45288) ([Vitaly Baranov](https://github.com/vitlibar))。AWS S3 和 Minio 已经过测试，但请注意，各种兼容 S3 的服务 (GCS、R2、B2) 可能存在细微的不兼容情况。此更改还可能要求你调整 ACL，以允许 `GetObjectAttributes` 请求。
* 禁止在时区名称中包含路径。例如，不允许使用 `/usr/share/zoneinfo/Asia/Aden` 这样的时区名称；应使用 `Asia/Aden` 这样的 IANA 时区数据库名称。[#44225](https://github.com/ClickHouse/ClickHouse/pull/44225) ([Kruglov Pavel](https://github.com/Avogar))。
* 由于会产生错误结果，禁止将等值 join 与常量表达式组合的查询 (例如 `JOIN ON t1.x = t2.x AND 1 = 1`) 。[#44016](https://github.com/ClickHouse/ClickHouse/pull/44016) ([Vladimir C](https://github.com/vdimir))。

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

* 一种通过遍历正则表达式树来提取键的字典源。可用于 User-Agent 解析。[#40878](https://github.com/ClickHouse/ClickHouse/pull/40878) ([Vage Ogannisian](https://github.com/nooblose)). [#43858](https://github.com/ClickHouse/ClickHouse/pull/43858) ([Han Fei](https://github.com/hanfei1991)).
* 新增了参数化视图功能，现已支持为 View 表引擎指定查询参数。已解决 [#40907](https://github.com/ClickHouse/ClickHouse/issues/40907)。[#41687](https://github.com/ClickHouse/ClickHouse/pull/41687) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)) 。
* 新增 `quantileInterpolatedWeighted`/`quantilesInterpolatedWeighted` 函数。[#38252](https://github.com/ClickHouse/ClickHouse/pull/38252) ([Bharat Nallan](https://github.com/bharatnc)) 。
* 支持 `Map` 类型的 Array join，类似于 Spark 中的 "explode" 函数。[#43239](https://github.com/ClickHouse/ClickHouse/pull/43239) ([李扬](https://github.com/taiyang-li)) 。
* 支持符合 SQL 标准的二进制和十六进制字符串字面量。[#43785](https://github.com/ClickHouse/ClickHouse/pull/43785) ([Mo Xuan](https://github.com/mo-avatar)) 。
* 支持以 Joda-Time 风格格式化 `DateTime`。参见 [Joda-Time 文档](https://joda-time.sourceforge.net/apidocs/org/joda/time/format/DateTimeFormat.html)。[#43818](https://github.com/ClickHouse/ClickHouse/pull/43818) ([李扬](https://github.com/taiyang-li)) 。
* 为 `formatDateTime` 新增了小数秒格式说明符 (`%f`) 。[#44060](https://github.com/ClickHouse/ClickHouse/pull/44060) ([ltrk2](https://github.com/ltrk2))。[#44497](https://github.com/ClickHouse/ClickHouse/pull/44497) ([Alexander Gololobov](https://github.com/davenger)).
* 新增 `age` 函数，用于计算两个日期或两个包含时间值的日期之间相差的完整单位数。关闭 [#41115](https://github.com/ClickHouse/ClickHouse/issues/41115)。[#44421](https://github.com/ClickHouse/ClickHouse/pull/44421) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 为字典新增 `Null` 源。已关闭 [#44240](https://github.com/ClickHouse/ClickHouse/issues/44240)。[#44502](https://github.com/ClickHouse/ClickHouse/pull/44502) ([mayamika](https://github.com/mayamika)) 。
* 支持通过 `s3_storage_class` 配置选项设置 S3 存储类，例如 `<s3_storage_class>STANDARD/INTELLIGENT_TIERING</s3_storage_class>`。解决了 [#44443](https://github.com/ClickHouse/ClickHouse/issues/44443)。[#44707](https://github.com/ClickHouse/ClickHouse/pull/44707) ([chen](https://github.com/xiedeyantu)).
* 在解析命名元组时，如果 JSON 对象中缺少元素，则使用默认值进行填充。新增设置 `input_format_json_defaults_for_missing_elements_in_named_tuple`，用于控制此行为。关闭 [#45142](https://github.com/ClickHouse/ClickHouse/issues/45142)#issuecomment-1380153217。[#45231](https://github.com/ClickHouse/ClickHouse/pull/45231) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 在 ProfileEvents 中记录 server 启动耗时 (`ServerStartupMilliseconds`) 。修复了 [#43188](https://github.com/ClickHouse/ClickHouse/issues/43188)。[#45250](https://github.com/ClickHouse/ClickHouse/pull/45250) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)) 。
* 重构并改进流式引擎 Kafka/RabbitMQ/NATS，增加对所有格式的支持，并对格式相关部分做了少量重构： - 修复了在带有后缀/前缀的基于行的格式中生成消息的问题。现在每条消息都会连同所有分隔符一起被完整格式化，并且可以使用输入格式重新解析。 - 支持 Native、Parquet、ORC 等基于块的格式。每个块都会被格式化为一条独立消息。一条消息中的行数取决于块大小，因此可以通过设置 `max_block_size` 进行控制。 - 新增引擎设置 `kafka_max_rows_per_message/rabbitmq_max_rows_per_message/nats_max_rows_per_message`。它们用于控制在基于行的格式中，一条消息内格式化的行数。默认值：1。 - 修复了 NATS 表引擎内存占用过高的问题。 - NATS 生产端现已支持任意二进制数据 (此前仅支持末尾带有 \0 的字符串)  - 在文档中补充了缺失的 Kafka/RabbitMQ/NATS 引擎设置。 - 重构了 Kafka/RabbitMQ/NATS 中的生产和消费逻辑，使其与 WriteBuffers/ReadBuffers 语义解耦。 - 重构输出格式：移除 Kafka/RabbitMQ/NATS 中原先对每一行使用的回调 (现在已不再使用这些回调) ，允许直接使用 IRowOutputFormat，明确行结束分隔符和行间分隔符，并支持重置输出格式以重新开始格式化 - 在 formatRow 函数中添加了正确实现 (这是格式重构带来的额外收益) 。[#42777](https://github.com/ClickHouse/ClickHouse/pull/42777) ([Kruglov Pavel](https://github.com/Avogar)).
* 支持在 `CapnProto` 格式中将 `Nested` 表读写为由 `Struct` 组成的 `List`。支持将 `Decimal32/64` 读写为 `Int32/64`。关闭 [#43319](https://github.com/ClickHouse/ClickHouse/issues/43319)。[#43379](https://github.com/ClickHouse/ClickHouse/pull/43379) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 向 `system.text_log` 新增了 `message_format_string` 列。该列包含用于格式化消息的模式。[#44543](https://github.com/ClickHouse/ClickHouse/pull/44543) ([Alexander Tokmakov](https://github.com/tavplubix)) 。这使得可以对 ClickHouse 日志进行各种分析。
* 尝试为 CSV/TSV/CustomSeparated 输入格式自动检测包含列名 (以及可能还有类型) 的表头。
  新增设置 input\_format\_tsv/csv/custom\_detect\_header，用于启用此行为 (默认启用) 。关闭 [#44640](https://github.com/ClickHouse/ClickHouse/issues/44640)。[#44953](https://github.com/ClickHouse/ClickHouse/pull/44953) ([Kruglov Pavel](https://github.com/Avogar)) 。

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

* 新增实验性的倒排索引，作为一种新的二级索引类型，用于实现高效的文本搜索。[#38667](https://github.com/ClickHouse/ClickHouse/pull/38667) ([larryluogit](https://github.com/larryluogit)).
* 新增实验性的查询结果缓存。[#43797](https://github.com/ClickHouse/ClickHouse/pull/43797) ([Robert Schulze](https://github.com/rschu1ze)).
* 新增了可扩展且可配置的 IO 请求调度子系统 (尚未与 IO 代码本身集成) 。[#41840](https://github.com/ClickHouse/ClickHouse/pull/41840) ([Sergei Trifonov](https://github.com/serxa)). 这个功能实际上完全没有任何作用，敬请享用。
* 新增了 `SYSTEM DROP DATABASE REPLICA`，用于删除 `Replicated` 数据库中失效副本的元数据。解决了 [#41794](https://github.com/ClickHouse/ClickHouse/issues/41794)。[#42807](https://github.com/ClickHouse/ClickHouse/pull/42807) ([Alexander Tokmakov](https://github.com/tavplubix)).

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

* 启动 `MergeTree` 表时，不加载非活动的 parts。[#42181](https://github.com/ClickHouse/ClickHouse/pull/42181) ([Anton Popov](https://github.com/CurtizJ)) 。
* 改进了从存储 `S3` 和表函数 `s3` 读取大量小文件时的延迟表现。现在，从存储 `S3` 读取时，设置 `remote_filesystem_read_method` 和 `remote_filesystem_read_prefetch` 将会生效。[#43726](https://github.com/ClickHouse/ClickHouse/pull/43726) ([Anton Popov](https://github.com/CurtizJ)) 。
* 优化了读取 Parquet/ORC 文件中结构体字段时的性能。现在仅加载所需字段。[#44484](https://github.com/ClickHouse/ClickHouse/pull/44484) ([lgbo](https://github.com/lgbo-ustc)).
* 两级聚合算法此前曾被误对通过 HTTP 接口执行的查询禁用。现已重新启用，并显著提升了性能。[#45450](https://github.com/ClickHouse/ClickHouse/pull/45450) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 为 StorageFile 增加了 mmap 支持，这将提升 clickhouse-local 的性能。[#43927](https://github.com/ClickHouse/ClickHouse/pull/43927) ([pufit](https://github.com/pufit)) 。
* 在 HashedDictionary 中新增了分片支持，以支持并行加载 (性能几乎可随分片数量实现线性扩展) 。[#40003](https://github.com/ClickHouse/ClickHouse/pull/40003) ([Azat Khuzhin](https://github.com/azat)) 。
* 提升查询解析速度。[#42284](https://github.com/ClickHouse/ClickHouse/pull/42284) ([Raúl Marín](https://github.com/Algunenano)) 。
* 当 `expr` 是 `LowCardinality` 列时，始终将 OR 链 `expr = x1 OR ... OR expr = xN` 替换为 `expr IN (x1, ..., xN)`。在这种情况下，设置 `optimize_min_equality_disjunction_chain_length` 会被忽略。[#42889](https://github.com/ClickHouse/ClickHouse/pull/42889) ([Guo Wangyang](https://github.com/guowangy)) 。
* 通过优化 ThreadStatus 周边代码，小幅提升性能。[#43586](https://github.com/ClickHouse/ClickHouse/pull/43586) ([Zhiguo Zhou](https://github.com/ZhiguoZh)) 。
* 通过实现自动向量化，优化按列执行的三元逻辑求值。在这项 [microbenchmark](https://github.com/ZhiguoZh/ClickHouse/blob/20221123-ternary-logic-opt-example/src/Functions/examples/associative_applier_perf.cpp) 性能测试中，我们在 ICX 设备 (Intel Xeon Platinum 8380 CPU) 上观察到，**性能提升**峰值可达 **21 倍**。[#43669](https://github.com/ClickHouse/ClickHouse/pull/43669) ([Zhiguo Zhou](https://github.com/ZhiguoZh)) 。
* 尽可能避免在 `system.tables` 表上获取读锁。[#43840](https://github.com/ClickHouse/ClickHouse/pull/43840) ([Raúl Marín](https://github.com/Algunenano)) 。
* 优化 ThreadPool。SSB (Star Schema Benchmark) 在 ICX 设备 (Intel Xeon Platinum 8380 CPU，80 核，160 线程) 上的性能实验表明，此项变更可将 `ThreadPoolImpl::mutex` 的锁竞争有效减少 **75%**，提高 CPU 利用率，并使整体性能提升 **2.4%**。[#44308](https://github.com/ClickHouse/ClickHouse/pull/44308) ([Zhiguo Zhou](https://github.com/ZhiguoZh)) 。
* 现在，只有在缓存的哈希表大小足够大时，才会应用哈希表大小预测优化 (阈值通过经验确定并硬编码) 。[#44455](https://github.com/ClickHouse/ClickHouse/pull/44455) ([Nikita Taranov](https://github.com/nickitat)) 。
* 小幅提升了从远程文件系统异步读取的性能。[#44868](https://github.com/ClickHouse/ClickHouse/pull/44868) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 为以下情况添加快速处理路径：- `col like '%%'`; - `col like '%'`; - `col not like '%'`; - `col not like '%'`; - `match(col, '.*')`。[#45244](https://github.com/ClickHouse/ClickHouse/pull/45244) ([李扬](https://github.com/taiyang-li)) 。
* 对过滤 (WHERE 子句) 中的常见路径优化做了小幅改进。[#45289](https://github.com/ClickHouse/ClickHouse/pull/45289) ([Nikita Taranov](https://github.com/nickitat)) 。
* 为 `toUnixTimestamp64*` 提供单调性信息，以便在索引分析中进行更多代数优化。[#44116](https://github.com/ClickHouse/ClickHouse/pull/44116) ([Nikita Taranov](https://github.com/nickitat)) 。
* 支持将用于查询处理的临时数据 (落盘) 配置为与文件系统缓存协同工作 (占用缓存磁盘空间) [#43972](https://github.com/ClickHouse/ClickHouse/pull/43972) ([Vladimir C](https://github.com/vdimir)) 。这项改进主要适用于 [ClickHouse Cloud](https://console.clickhouse.cloud/)，但如果你清楚如何操作，也可用于自管理部署。
* 使 `system.replicas` 表能够并行拉取副本状态。关闭 [#43918](https://github.com/ClickHouse/ClickHouse/issues/43918)。[#43998](https://github.com/ClickHouse/ClickHouse/pull/43998) ([Nikolay Degterinsky](https://github.com/evillique)).
* 优化备份到 S3 时的内存占用：现在，写入 S3 的文件会直接复制，不再使用 `WriteBufferFromS3` (后者可能会占用大量内存) 。[#45188](https://github.com/ClickHouse/ClickHouse/pull/45188) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 为异步块 ID 增加缓存。这样在启用异步插入去重时，可减少对 ZooKeeper 的请求次数。[#45106](https://github.com/ClickHouse/ClickHouse/pull/45106) ([Han Fei](https://github.com/hanfei1991)) 。

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

* 在无参数的 GenerateRandom 中使用插入目标表的结构。[#45239](https://github.com/ClickHouse/ClickHouse/pull/45239) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 允许在 `JSONExtract` 函数中，将存储在 JSON 字符串字段中的浮点数隐式转换为整数。例如：`JSONExtract('{"a": "1000.111"}', 'a', 'UInt64')` -> `1000`，此前返回的是 0。[#45432](https://github.com/ClickHouse/ClickHouse/pull/45432) ([Anton Popov](https://github.com/CurtizJ)) 。
* 向表 `system.formats` 添加了字段 `supports_parallel_parsing` 和 `supports_parallel_formatting`，以便更好地查看内部信息。[#45499](https://github.com/ClickHouse/ClickHouse/pull/45499) ([Anton Popov](https://github.com/CurtizJ)).
* 改进了在 CustomSeparated/Template 格式中读取 CSV 字段的功能。关闭 [#42352](https://github.com/ClickHouse/ClickHouse/issues/42352) 和 [#39620](https://github.com/ClickHouse/ClickHouse/issues/39620)。[#43332](https://github.com/ClickHouse/ClickHouse/pull/43332) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 统一查询耗时的测量方式。[#43455](https://github.com/ClickHouse/ClickHouse/pull/43455) ([Raúl Marín](https://github.com/Algunenano)) 。
* 改进了在 `select` 查询包含虚拟列时，表函数 file/hdfs/s3 自动使用插入目标表结构的能力，从而修复可能出现的错误 `Block structure mismatch` 或 `number of columns mismatch`。[#43695](https://github.com/ClickHouse/ClickHouse/pull/43695) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 在函数 `range` 中新增了对有符号参数的支持。修复了 [#43333](https://github.com/ClickHouse/ClickHouse/issues/43333)。[#43733](https://github.com/ClickHouse/ClickHouse/pull/43733) ([sanyu](https://github.com/wineternity)) 。
* 移除冗余排序，例如子查询中与排序相关的 ORDER BY 子句。该功能基于查询计划实现。它在 `ORDER BY` 子句方面执行的优化与 `optimize_duplicate_order_by_and_distinct` 类似，但更通用，因为它适用于任何冗余排序步骤 (而不仅限于由 ORDER BY 子句导致的情况) ，并且可应用于任意深度的子查询。相关内容见 [#42648](https://github.com/ClickHouse/ClickHouse/issues/42648)。[#43905](https://github.com/ClickHouse/ClickHouse/pull/43905) ([Igor Nikonov](https://github.com/devcrafter)) 。
* 新增了在 BACKUP 中禁用文件去重的功能 (对于未去重的备份，可使用 ATTACH 而不是完整的 RESTORE) 。例如：`BACKUP foo TO S3(...) SETTINGS deduplicate_files=0` (默认值为 `deduplicate_files=1`) 。[#43947](https://github.com/ClickHouse/ClickHouse/pull/43947) ([Azat Khuzhin](https://github.com/azat)) 。
* 重构并优化文本 formats 的 schema inference。新增设置 `schema_inference_make_columns_nullable`，用于控制是否将结果类型设为 `Nullable` (默认启用) 。[#44019](https://github.com/ClickHouse/ClickHouse/pull/44019) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 进一步增强了对 `PROXYv1` 协议的支持。[#44135](https://github.com/ClickHouse/ClickHouse/pull/44135) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* 在 `system.parts` 表中新增由清理线程执行的最近一次 part 检查信息。[#44244](https://github.com/ClickHouse/ClickHouse/pull/44244) ([Dmitry Novik](https://github.com/novikd)) 。
* 在只读模式下禁用插入时使用的表函数。[#44290](https://github.com/ClickHouse/ClickHouse/pull/44290) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)) 。
* 新增设置 `simultaneous_parts_removal_limit`，用于限制 CleanupThread 单次迭代中处理的 parts 数量。[#44461](https://github.com/ClickHouse/ClickHouse/pull/44461) ([Dmitry Novik](https://github.com/novikd)) 。
* 当查询只需要虚拟列时，不要初始化 ReadBufferFromS3。这可能对 [#44246](https://github.com/ClickHouse/ClickHouse/issues/44246) 有帮助。[#44493](https://github.com/ClickHouse/ClickHouse/pull/44493) ([chen](https://github.com/xiedeyantu)).
* 防止出现重复列名的提示。关闭 [#44130](https://github.com/ClickHouse/ClickHouse/issues/44130)。[#44519](https://github.com/ClickHouse/ClickHouse/pull/44519) ([Joanna Hulboj](https://github.com/jh0x)) 。
* 允许在磁盘端点中进行 macro 替换。已解决 [#40951](https://github.com/ClickHouse/ClickHouse/issues/40951)。[#44533](https://github.com/ClickHouse/ClickHouse/pull/44533) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)) 。
* 在启用 `input_format_json_read_object_as_string` 时，优化 schema inference。[#44546](https://github.com/ClickHouse/ClickHouse/pull/44546) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 新增一个用户级设置 `database_replicated_allow_replicated_engine_arguments`，可用于禁止在 `DatabaseReplicated` 中创建带参数的 `ReplicatedMergeTree` 表。[#44566](https://github.com/ClickHouse/ClickHouse/pull/44566) ([alesapin](https://github.com/alesapin)) 。
* 防止用户误将零值 (无效值) 指定给 `index_granularity`。此更改关闭了 [#44536](https://github.com/ClickHouse/ClickHouse/issues/44536)。[#44578](https://github.com/ClickHouse/ClickHouse/pull/44578) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 新增了在 config.xml 的 `kerberos` 部分中通过 `keytab` 参数设置 service keytab 文件路径的功能。[#44594](https://github.com/ClickHouse/ClickHouse/pull/44594) ([Roman Vasin](https://github.com/rvasin)) 。
* 将查询中已输入的部分用于模糊搜索 (传给 `skim` 库，该库使用 Rust 编写，并以静态链接方式集成到 ClickHouse 中) 。[#44600](https://github.com/ClickHouse/ClickHouse/pull/44600) ([Azat Khuzhin](https://github.com/azat)) 。
* 默认启用 `input_format_json_read_objects_as_strings`，以便在 JSON Object 类型仍处于 Experimental 阶段时也能读取嵌套 JSON 对象。[#44657](https://github.com/ClickHouse/ClickHouse/pull/44657) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 异步插入去重改进：当用户发起重复的异步插入时，应在查询 Keeper 之前先在内存中完成去重。[#44682](https://github.com/ClickHouse/ClickHouse/pull/44682) ([Han Fei](https://github.com/hanfei1991)).
* 输入/输出 `Avro` 格式将 bool 类型解析为 ClickHouse 的 bool 类型。[#44684](https://github.com/ClickHouse/ClickHouse/pull/44684) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 支持 Arrow/Parquet/ORC 中的 Bool 类型。解决了 [#43970](https://github.com/ClickHouse/ClickHouse/issues/43970)。[#44698](https://github.com/ClickHouse/ClickHouse/pull/44698) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 读取 UUID 时，不要越过引号贪婪解析，否则可能会把错误数据误判为解析成功。[#44686](https://github.com/ClickHouse/ClickHouse/pull/44686) ([Raúl Marín](https://github.com/Algunenano)).
* 在 Int64 发生 overflow 时推断为 UInt64，并修复 schema inference 中的一些转换问题。 [#44696](https://github.com/ClickHouse/ClickHouse/pull/44696) ([Kruglov Pavel](https://github.com/Avogar)).
* 此前，`Replicated` database 内部的依赖解析是通过一种比较权宜的方式实现的，现在则改为使用显式图来正确处理。[#44697](https://github.com/ClickHouse/ClickHouse/pull/44697) ([Nikita Mikhaylov](https://github.com/nikitamikhaylov)) 。
* 修复了 `output_format_pretty_row_numbers` 在各个块之间无法保留计数器的问题。关闭 [#44815](https://github.com/ClickHouse/ClickHouse/issues/44815)。[#44832](https://github.com/ClickHouse/ClickHouse/pull/44832) ([flynn](https://github.com/ucasfl)).
* 不要将 parts 在与后台清理过程并发合并时产生的错误记录到 `system.errors` 中。 [#44874](https://github.com/ClickHouse/ClickHouse/pull/44874) ([Raúl Marín](https://github.com/Algunenano)).
* 优化并修复 Distributed async INSERT 相关指标。[#44922](https://github.com/ClickHouse/ClickHouse/pull/44922) ([Azat Khuzhin](https://github.com/azat)) 。
* 新增了用于禁止并发备份和恢复的设置，解决了 [#43891](https://github.com/ClickHouse/ClickHouse/issues/43891)。实现：\* 新增了服务器级设置，用于禁止并发备份和恢复；这些设置会在 Context 中创建 BackupWorker 时读取并设置。\* 这些设置默认值为 true。\* 在启动备份或恢复前，新增了检查，以确认是否有其他备份/恢复正在运行。对于内部请求，会通过 backup\_uuid 检查请求是否来自当前节点。 [#45072](https://github.com/ClickHouse/ClickHouse/pull/45072) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)).
* 为系统日志新增 `<storage_policy>` 配置参数。[#45320](https://github.com/ClickHouse/ClickHouse/pull/45320) ([Stig Bakken](https://github.com/stigsb)) 。

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

* 将 `skim` 库 (使用 Rust 编写) 静态链接进来，用于 clickhouse client/local 历史记录中的模糊搜索。[#44239](https://github.com/ClickHouse/ClickHouse/pull/44239) ([Azat Khuzhin](https://github.com/azat)).
* 由于 Rust，我们移除了对共享链接方式的支持。实际上，Rust 只是移除它的一个借口；即便没有 Rust，我们本来也想把它去掉。[#44828](https://github.com/ClickHouse/ClickHouse/pull/44828) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 从软件包中移除了对 `adduser` 工具的依赖，因为我们并未使用它。这修复了 [#44934](https://github.com/ClickHouse/ClickHouse/issues/44934)。[#45011](https://github.com/ClickHouse/ClickHouse/pull/45011) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* `SQLite` 库已更新到最新版本。它用于 SQLite 数据库和表集成引擎。同时还修复了一条 TSan 误报。此更改关闭了 [#45027](https://github.com/ClickHouse/ClickHouse/issues/45027)。[#45031](https://github.com/ClickHouse/ClickHouse/pull/45031) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 对 CRC-32 进行了修改，以解决 PowerPC 中的 WeakHash 冲突问题。[#45144](https://github.com/ClickHouse/ClickHouse/pull/45144) ([MeenaRenganathan22](https://github.com/MeenaRenganathan22)).
* 更新 aws-c\* 子模块 [#43020](https://github.com/ClickHouse/ClickHouse/pull/43020) ([Vitaly Baranov](https://github.com/vitlibar)).
* 自动合并状态为绿色的回移 PR，以及状态为绿色且已获批准的 PR [#41110](https://github.com/ClickHouse/ClickHouse/pull/41110) ([Mikhail f. Shiryaev](https://github.com/Felixoid)).
* 新增了一个用于查看 ClickHouse CI 状态的[网站](https://aretestsgreenyet.com/)。[来源](https://github.com/ClickHouse/aretestsgreenyet).

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

* 将 domain IP 类型 (IPv4、IPv6) 替换为原生类型。[#43221](https://github.com/ClickHouse/ClickHouse/pull/43221) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。这会自动补齐代码中一些缺失的实现。
* 修复了在备份过程中变更被终止时的备份流程问题。[#45351](https://github.com/ClickHouse/ClickHouse/pull/45351) ([Vitaly Baranov](https://github.com/vitlibar)) 。
* 修复 `Invalid number of rows in Chunk` 异常信息。[#41404](https://github.com/ClickHouse/ClickHouse/issues/41404)。[#42126](https://github.com/ClickHouse/ClickHouse/pull/42126) ([Alexander Gololobov](https://github.com/davenger)) 。
* 修复了排序后执行表达式时可能会使用未初始化值的问题。关闭 [#43386](https://github.com/ClickHouse/ClickHouse/issues/43386) [#43635](https://github.com/ClickHouse/ClickHouse/pull/43635) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 改进了聚合组合器中对 NULL 的处理，修复了在使用较冷门的优化 `optimize_rewrite_sum_if_to_count_if` 时可能出现的段错误或逻辑错误。关闭了 [#43758](https://github.com/ClickHouse/ClickHouse/issues/43758)。[#43813](https://github.com/ClickHouse/ClickHouse/pull/43813) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复 CREATE USER/ROLE 查询设置约束相关问题。[#43993](https://github.com/ClickHouse/ClickHouse/pull/43993) ([Nikolay Degterinsky](https://github.com/evillique)) 。
* 修复了表元数据中 `EPHEMERAL` 列默认值无法被解析的问题。[#44026](https://github.com/ClickHouse/ClickHouse/pull/44026) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* 修复 compatibility 设置中错误版本号的解析问题。[#44224](https://github.com/ClickHouse/ClickHouse/pull/44224) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 使从 datetime 中减去时间间隔的行为与加法保持一致。[#44241](https://github.com/ClickHouse/ClickHouse/pull/44241) ([ltrk2](https://github.com/ltrk2)).
* 取消对视图结果最大尺寸的限制。[#44261](https://github.com/ClickHouse/ClickHouse/pull/44261) ([lizhuoyu5](https://github.com/lzydmxy)).
* 修复了在 `do_not_evict_index_and_mrk_files=1` 时缓存中可能存在的逻辑错误。关闭 [#42142](https://github.com/ClickHouse/ClickHouse/issues/42142)。[#44268](https://github.com/ClickHouse/ClickHouse/pull/44268) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 修复直写缓存中缓存写入可能过早中断的问题 (此前可能会因误判而在本不该停止时停止缓存) 。 [#44289](https://github.com/ClickHouse/ClickHouse/pull/44289) ([Kseniia Sumarokova](https://github.com/kssenii)).
* 修复了这样一种可能导致崩溃的问题：在 case 函数中，将带有常量参数的 `IN` 与 `LowCardinality` 一同用作常量参数时。修复 [#44221](https://github.com/ClickHouse/ClickHouse/issues/44221)。[#44346](https://github.com/ClickHouse/ClickHouse/pull/44346) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 修复了参数化聚合函数对复杂参数 (如数组) 的支持问题。此修复关闭了 [#30975](https://github.com/ClickHouse/ClickHouse/issues/30975)。在此更改之前，聚合函数 `sumMapFiltered` 在分布式查询中无法使用。[#44358](https://github.com/ClickHouse/ClickHouse/pull/44358) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 修复了 BSON schema 推断中读取 ObjectId 时的问题。[#44382](https://github.com/ClickHouse/ClickHouse/pull/44382) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了 ReplicatedMergeTree 中可能导致 merge 完成前临时 parts 被提前删除的竞态问题。该问题可能会引发 `No such file or directory: xxx` 之类的错误。修复 [#43983](https://github.com/ClickHouse/ClickHouse/issues/43983)。[#44383](https://github.com/ClickHouse/ClickHouse/pull/44383) ([alesapin](https://github.com/alesapin)).
* 如果未指定 cluster 名称，一些无效的 `SYSTEM ... ON CLUSTER` 查询会以意料之外的方式执行。该问题已修复，现在无效查询会如预期那样抛出 `SYNTAX_ERROR`。修复了 [#44264](https://github.com/ClickHouse/ClickHouse/issues/44264)。[#44387](https://github.com/ClickHouse/ClickHouse/pull/44387) ([Alexander Tokmakov](https://github.com/tavplubix)) 。
* 修复了 ORC 格式中读取 Map 类型的问题。[#44400](https://github.com/ClickHouse/ClickHouse/pull/44400) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了在 Parquet/ORC 格式中读取输入数据中不存在的列时的问题。此前这可能导致错误 `INCORRECT_NUMBER_OF_COLUMNS`。关闭了 [#44333](https://github.com/ClickHouse/ClickHouse/issues/44333)。[#44405](https://github.com/ClickHouse/ClickHouse/pull/44405) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 此前，`bar` 函数一直使用同一个 '▋' (U+258B "左侧五分之八块") 字符来显示 5/8 和 6/8 的条形。这次更改改为使用 '▊' (U+258A "左侧四分之三块") 来显示 6/8 的条形，从而修正了这一问题。[#44410](https://github.com/ClickHouse/ClickHouse/pull/44410) ([Alexander Gololobov](https://github.com/davenger)) 。
* 在配置文件中，如果将 profile settings 放在其约束之后，会导致这些约束失效。[#44411](https://github.com/ClickHouse/ClickHouse/pull/44411) ([Konstantin Bogdanov](https://github.com/thevar1able)) 。
* 修复了运行带数据的 `EXPLAIN AST INSERT` 查询时出现的 `SYNTAX_ERROR`。关闭 [#44207](https://github.com/ClickHouse/ClickHouse/issues/44207)。[#44413](https://github.com/ClickHouse/ClickHouse/pull/44413) ([save-my-heart](https://github.com/save-my-heart)) 。
* 修复了在 CSV format 中读取带有 CRLF 的 Bool 值时的问题。关闭 [#44401](https://github.com/ClickHouse/ClickHouse/issues/44401)。[#44442](https://github.com/ClickHouse/ClickHouse/pull/44442) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 不要对 LowCardinality 字典执行 and/or/if/multiIf，因此结果类型不能为 LowCardinality。否则在某些情况下可能会导致错误 `Illegal column ColumnLowCardinality`。修复了 [#43603](https://github.com/ClickHouse/ClickHouse/issues/43603)。[#44469](https://github.com/ClickHouse/ClickHouse/pull/44469) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了在设置 `max_streams_for_merge_tree_reading` 时变更操作的问题。[#44472](https://github.com/ClickHouse/ClickHouse/pull/44472) ([Anton Popov](https://github.com/CurtizJ)).
* 修复 ASTSelectQuery::formatImpl 中在使用 GROUPING SETS 时可能发生的空指针解引用问题 ([#43049](https://github.com/ClickHouse/ClickHouse/issues/43049)) 。[#44479](https://github.com/ClickHouse/ClickHouse/pull/44479) ([Robert Schulze](https://github.com/rschu1ze)) 。
* 根据设置，对表函数参数、CAST 函数参数以及 JSONAsObject schema 推断中的类型进行验证。[#44501](https://github.com/ClickHouse/ClickHouse/pull/44501) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复 IN 函数在 LowCardinality 和 const 列上的问题，关闭 [#44503](https://github.com/ClickHouse/ClickHouse/issues/44503)。[#44506](https://github.com/ClickHouse/ClickHouse/pull/44506) ([Duc Canh Le](https://github.com/canhld94)).
* 修复了 `CREATE TABLE` 语句中 `DEFAULT` expression 规范化时的一个问题。在执行 CREATE 查询期间，函数 `in` 的第二个参数 (或运算符 `IN` 的右侧参数) 可能会被替换为其求值结果。修复了 [#44496](https://github.com/ClickHouse/ClickHouse/issues/44496)。[#44547](https://github.com/ClickHouse/ClickHouse/pull/44547) ([Alexander Tokmakov](https://github.com/tavplubix)) 。
* 在使用 WITH ROLLUP、WITH CUBE 和 WITH TOTALS 时，projections 不会生效。在之前的版本中，查询会抛出异常，而不是跳过使用 projections。此修复关闭了 [#44614](https://github.com/ClickHouse/ClickHouse/issues/44614)。此修复关闭了 [#42772](https://github.com/ClickHouse/ClickHouse/issues/42772)。[#44615](https://github.com/ClickHouse/ClickHouse/pull/44615) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 由于函数 `get all blocks sorted by time` 未获取异步块，因此这些异步块未被清理。[#44651](https://github.com/ClickHouse/ClickHouse/pull/44651) ([Han Fei](https://github.com/hanfei1991)) 。
* 修复了在 JOIN 与子查询、UNION 和 TOTALS 一起使用时出现的 `LOGICAL_ERROR` `The top step of the right pipeline should be ExpressionStep` 问题。修复 [#43687](https://github.com/ClickHouse/ClickHouse/issues/43687)。[#44673](https://github.com/ClickHouse/ClickHouse/pull/44673) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 避免在 Executable 表引擎中出现 `std::out_of_range` 异常。[#44681](https://github.com/ClickHouse/ClickHouse/pull/44681) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 不要对 AST 中的分位数应用 `optimize_syntax_fuse_functions`，关闭 [#44712](https://github.com/ClickHouse/ClickHouse/issues/44712)。[#44713](https://github.com/ClickHouse/ClickHouse/pull/44713) ([Vladimir C](https://github.com/vdimir)).
* 修复了 Merge 表和 PREWHERE 中类型错误的缺陷，关闭 [#43324](https://github.com/ClickHouse/ClickHouse/issues/43324)。[#44716](https://github.com/ClickHouse/ClickHouse/pull/44716) ([Vladimir C](https://github.com/vdimir)) 。
* 修复了关闭期间可能发生的崩溃问题 (在销毁 TraceCollector 时) 。修复 [#44757](https://github.com/ClickHouse/ClickHouse/issues/44757)。[#44758](https://github.com/ClickHouse/ClickHouse/pull/44758) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了分布式查询处理中的一个潜在崩溃问题。如果带有 totals 或 extremes 的查询返回空结果，且 Distributed 表与本地表的类型不匹配，就可能发生该崩溃。修复 [#44738](https://github.com/ClickHouse/ClickHouse/issues/44738)。[#44760](https://github.com/ClickHouse/ClickHouse/pull/44760) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了拉取 (`min_compressed_bytes_to_fsync_after_fetch`) 以及变更中小文件 (ttl.txt、columns.txt，`min_rows_to_fsync_after_merge`/`min_compressed_bytes_to_fsync_after_merge`) 的 fsync 问题。[#44781](https://github.com/ClickHouse/ClickHouse/pull/44781) ([Azat Khuzhin](https://github.com/azat)).
* 在分片于磁盘之间移动时，查询 `system.parts` 或 `system.parts_columns` 表可能会触发一种罕见的竞态条件。在 [#41145](https://github.com/ClickHouse/ClickHouse/issues/41145) 中引入。[#44809](https://github.com/ClickHouse/ClickHouse/pull/44809) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
* 修复了在启用 projection 优化时可能出现的 `Context has expired` 错误。对于包含特定函数 (如在运行时使用 Context 的 `dictHas/dictGet`) 的查询，可复现此问题。修复了 [#44844](https://github.com/ClickHouse/ClickHouse/issues/44844)。[#44850](https://github.com/ClickHouse/ClickHouse/pull/44850) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复了从远程文件系统读取 `LowCardinality` 字典时可能出现的 `Cannot read all data` 错误。修复 [#44709](https://github.com/ClickHouse/ClickHouse/issues/44709)。[#44875](https://github.com/ClickHouse/ClickHouse/pull/44875) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 在无法读取硬件监控传感器时，忽略此类情况，而不是在日志中显示完整的异常信息。[#44895](https://github.com/ClickHouse/ClickHouse/pull/44895) ([Raúl Marín](https://github.com/Algunenano)).
* 如果计算出的 INSERT 延迟时间超过设置值，则使用 `max_delay_to_insert` 的值。相关问题见 [#44902](https://github.com/ClickHouse/ClickHouse/issues/44902)。[#44916](https://github.com/ClickHouse/ClickHouse/pull/44916) ([Igor Nikonov](https://github.com/devcrafter)) 。
* 修复使用 `UNION` 的查询中出现的错误 `Different order of columns in UNION subquery`。修复 [#44866](https://github.com/ClickHouse/ClickHouse/issues/44866)。[#44920](https://github.com/ClickHouse/ClickHouse/pull/44920) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* `INSERT` 的延迟计算可能不正确，从而导致始终将 `max_delay_to_insert` 设置用作延迟值，而不是使用正确的值。现在改为采用简单公式 `max_delay_to_insert * (parts_over_threshold/max_allowed_parts_over_threshold)`，即延迟会随着超出阈值的 parts 数量按比例增加。关闭 [#44902](https://github.com/ClickHouse/ClickHouse/issues/44902)。[#44954](https://github.com/ClickHouse/ClickHouse/pull/44954) ([Igor Nikonov](https://github.com/devcrafter)) 。
* 修复了在 wide 分片带有轻量级删除掩码时出现的 alter table TTL 错误。[#44959](https://github.com/ClickHouse/ClickHouse/pull/44959) ([Mingliang Pan](https://github.com/liangliangpan)) 。
* 针对将 IP 域类型 (IPv4、IPv6) 替换为原生类型的后续修复 [#43221](https://github.com/ClickHouse/ClickHouse/issues/43221)。[#45024](https://github.com/ClickHouse/ClickHouse/pull/45024) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)).
* 针对将 domain IP 类型 (IPv4、IPv6) 替换为原生类型的后续修复，参见 [https://github.com/ClickHouse/ClickHouse/pull/43221。](https://github.com/ClickHouse/ClickHouse/pull/43221。) [#45043](https://github.com/ClickHouse/ClickHouse/pull/45043) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)).
* 解析器中可能存在缓冲区溢出漏洞。由 fuzzer 发现。[#45047](https://github.com/ClickHouse/ClickHouse/pull/45047) ([Alexey Milovidov](https://github.com/alexey-milovidov)) 。
* 修复 FileLog 存储中可能出现的 cannot-read-all-data 错误。关闭 [#45051](https://github.com/ClickHouse/ClickHouse/issues/45051)、[#38257](https://github.com/ClickHouse/ClickHouse/issues/38257)。[#45057](https://github.com/ClickHouse/ClickHouse/pull/45057) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 当查询中存在 grouping sets 时，内存高效聚合 (设置 `distributed_aggregation_memory_efficient`) 会被禁用。[#45058](https://github.com/ClickHouse/ClickHouse/pull/45058) ([Nikita Taranov](https://github.com/nickitat)) 。
* 修复 `RANGE_HASHED` 字典：指定 `update_field` 时，在更新过程中会将范围列计入主键。关闭 [#44588](https://github.com/ClickHouse/ClickHouse/issues/44588)。[#45061](https://github.com/ClickHouse/ClickHouse/pull/45061) ([Maksim Kita](https://github.com/kitaisreal)).
* 修复嵌套 lambda 的 `LowCardinality` 捕获参数出现 `Cannot capture column` 错误的问题。修复了 [#45028](https://github.com/ClickHouse/ClickHouse/issues/45028)。[#45065](https://github.com/ClickHouse/ClickHouse/pull/45065) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 修复了在使用 minmax/count 投影时，`additional_table_filters` 会返回错误查询结果的问题 (未应用额外过滤器) 。[#45133](https://github.com/ClickHouse/ClickHouse/pull/45133) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
* 修复了 `histogram` 函数错误接受负值的问题。[#45147](https://github.com/ClickHouse/ClickHouse/pull/45147) ([simpleton](https://github.com/rgzntrade)).
* 修复 StoreageJoin 中列可空性错误，关闭 [#44940](https://github.com/ClickHouse/ClickHouse/issues/44940)。[#45184](https://github.com/ClickHouse/ClickHouse/pull/45184) ([Vladimir C](https://github.com/vdimir)).
* 修复 `background_fetches_pool_size` 设置重新加载的问题 (可在运行时增大) 。 [#45189](https://github.com/ClickHouse/ClickHouse/pull/45189) ([Raúl Marín](https://github.com/Algunenano)).
* 正确处理 KV 引擎 (如 KeeperMap、EmbeddedRocksDB) 上的 `SELECT` 查询：当在键上使用 `IN`，且子查询生成的类型不同时，也能正确处理。[#45215](https://github.com/ClickHouse/ClickHouse/pull/45215) ([Antonio Andelic](https://github.com/antonio2368)) 。
* 修复某些情况下 SEMI JOIN 和 join\_use\_nulls 的逻辑错误，关闭 [#45163](https://github.com/ClickHouse/ClickHouse/issues/45163) 和 [#45209](https://github.com/ClickHouse/ClickHouse/issues/45209)。[#45230](https://github.com/ClickHouse/ClickHouse/pull/45230) ([Vladimir C](https://github.com/vdimir)).
* 修复从 S3 读取时的 heap-use-after-free 问题。[#45253](https://github.com/ClickHouse/ClickHouse/pull/45253) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了 Avro Union 类型为 \['null', Nested type] 时的 bug，关闭 [#45275](https://github.com/ClickHouse/ClickHouse/issues/45275)。修复了将 `bytes` 类型错误推断为 `Float` 的 bug。[#45276](https://github.com/ClickHouse/ClickHouse/pull/45276) ([flynn](https://github.com/ucasfl)) 。
* 当对使用 `Merge` 存储引擎的表无法使用显式 PREWHERE 时，会抛出恰当的异常。[#45319](https://github.com/ClickHouse/ClickHouse/pull/45319) ([Antonio Andelic](https://github.com/antonio2368)).
* 在 WSL1 Ubuntu 下，由于存在不一致，ClickHouse 自解压程序无法完成解压：`/proc/self/maps` 报告的是 32 位文件的 inode，而 stat 报告的是 64 位 inode。[#45339](https://github.com/ClickHouse/ClickHouse/pull/45339) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* 修复了 Distributed 表启动时的竞态问题 (可能导致 async INSERT 的文件被重复处理) 。[#45360](https://github.com/ClickHouse/ClickHouse/pull/45360) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了在 `ListObject` 请求失败时，从 `S3` 存储和表函数 `s3` 读取数据时可能发生崩溃的问题。[#45371](https://github.com/ClickHouse/ClickHouse/pull/45371) ([Anton Popov](https://github.com/CurtizJ)).
* 修复当存在结构有问题的字典 (例如 XML 配置中的类型不正确) 时，执行 `SELECT ... FROM system.dictionaries` 会抛出异常的问题。[#45399](https://github.com/ClickHouse/ClickHouse/pull/45399) ([Aleksei Filatov](https://github.com/aalexfvk)).
* 修复了在 `INSERT INTO ... SELECT * FROM s3Cluster` 查询中使用插入表结构时的 s3Cluster schema 推断问题。[#45422](https://github.com/ClickHouse/ClickHouse/pull/45422) ([Kruglov Pavel](https://github.com/Avogar)) 。
* 修复了 HTTP 下 JSON/BSONEachRow 解析中的一个 bug；该问题可能导致某些列使用默认值，而不是数据中的值。 [#45424](https://github.com/ClickHouse/ClickHouse/pull/45424) ([Kruglov Pavel](https://github.com/Avogar)).
* 修复了从文本源对 IP 类型进行类型解析时的错误 (Code: 632. DB::Exception: Unexpected data ... after parsed IPv6 value ...) 。[#45425](https://github.com/ClickHouse/ClickHouse/pull/45425) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)) 。
* 关闭 [#45297](https://github.com/ClickHouse/ClickHouse/issues/45297)，增加对空正则表达式的检查。[#45428](https://github.com/ClickHouse/ClickHouse/pull/45428) ([Han Fei](https://github.com/hanfei1991)) 。
* 修复可能出现的 (很可能是分布式) 查询挂起问题。[#45448](https://github.com/ClickHouse/ClickHouse/pull/45448) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了在启用 `allow_asynchronous_read_from_io_pool_for_merge_tree` 时，若 `ThreadPool::schedule` 抛出异常，可能导致死锁的问题。[#45481](https://github.com/ClickHouse/ClickHouse/pull/45481) ([Nikolai Kochetov](https://github.com/KochetovNicolai)) 。
* 修复执行 DETACH 后表可能仍被占用的问题。[#45493](https://github.com/ClickHouse/ClickHouse/pull/45493) ([Azat Khuzhin](https://github.com/azat)) 。
* 修复了一个罕见的中止问题：当查询被取消且其执行过程中使用了并行解析时，会触发该问题。[#45498](https://github.com/ClickHouse/ClickHouse/pull/45498) ([Anton Popov](https://github.com/CurtizJ)).
* 修复了分布式表创建与向其 INSERT 之间的竞态条件 (可能会在向该表执行 INSERT 时导致 CANNOT\_LINK) 。[#45502](https://github.com/ClickHouse/ClickHouse/pull/45502) ([Azat Khuzhin](https://github.com/azat)).
* 为 cache 策略 getter 添加正确的默认值 (SLRU) 。关闭 [#45514](https://github.com/ClickHouse/ClickHouse/issues/45514)。[#45524](https://github.com/ClickHouse/ClickHouse/pull/45524) ([Kseniia Sumarokova](https://github.com/kssenii)) 。
* 在变更中禁用 array join，关闭了 [#42637](https://github.com/ClickHouse/ClickHouse/issues/42637) [#44447](https://github.com/ClickHouse/ClickHouse/pull/44447) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)) 。
* 修复了限定星号与别名表名及列转换器配合使用时的问题。解决了 [#44736](https://github.com/ClickHouse/ClickHouse/issues/44736)。[#44755](https://github.com/ClickHouse/ClickHouse/pull/44755) ([SmitaRKulkarni](https://github.com/SmitaRKulkarni)).

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