v26.2 Changelog for Cloud

- Fixed a bug where predefined query handlers had trailing whitespace interpreted as data during inserts. [#83604](https://github.com/ClickHouse/ClickHouse/pull/83604) ([Fabian Ponce](https://github.com/FabianPonce)).
- Fixed aggregation with projection producing an exception after metadata-only ALTERs such as extending Enum elements. [#84143](https://github.com/ClickHouse/ClickHouse/pull/84143) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
- Fixed `count_distinct_optimization` pass over window functions and over multiple arguments. [#92376](https://github.com/ClickHouse/ClickHouse/pull/92376) ([Raúl Marín](https://github.com/Algunenano)).
- Fixed inconsistent AST formatting of `arrayElement` with negated literal. [#92293](https://github.com/ClickHouse/ClickHouse/pull/92293) ([Pavel Kruglov](https://github.com/Avogar)).
- Fixed `NOT IN` with non-constant array arguments returning wrong values. [#93314](https://github.com/ClickHouse/ClickHouse/pull/93314) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
- Fixed null-safe comparison error involving the `Nothing` type. [#91884](https://github.com/ClickHouse/ClickHouse/pull/91884) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
- Fixed `Not found column` error for `use_top_k_dynamic_filtering` optimization. [#93316](https://github.com/ClickHouse/ClickHouse/pull/93316) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
- Fixed unused columns removal from subqueries in the presence of a scalar correlated subquery. [#93273](https://github.com/ClickHouse/ClickHouse/pull/93273) ([Dmitry Novik](https://github.com/novikd)).
- Fixed `optimize_inverse_dictionary_lookup` not working with distributed queries when key was a signed integral type. [#93848](https://github.com/ClickHouse/ClickHouse/pull/93848) ([Nihal Z. Miaji](https://github.com/nihalzp)).
- Fixed `lag`/`lead` not working with distributed `remote()` queries. [#93858](https://github.com/ClickHouse/ClickHouse/pull/93858) ([Nihal Z. Miaji](https://github.com/nihalzp)).
- Fixed bug in data skipping logic when `not match(...)` was used in `WHERE`, causing incorrect results. [#92726](https://github.com/ClickHouse/ClickHouse/pull/92726) ([Nihal Z. Miaji](https://github.com/nihalzp)).
- Fixed bug in data skipping logic when `not materialize(...)` or `not CAST(...)` was used in `WHERE`, causing incorrect results. [#93017](https://github.com/ClickHouse/ClickHouse/pull/93017) ([Nihal Z. Miaji](https://github.com/nihalzp)).
- Fixed logical error during index analysis when an empty array was used in the `has` function. [#92995](https://github.com/ClickHouse/ClickHouse/pull/92995) ([Nihal Z. Miaji](https://github.com/nihalzp)).
- Fixed logical error in a rare case when an empty tuple was used with a `Map` column. [#93814](https://github.com/ClickHouse/ClickHouse/pull/93814) ([Nihal Z. Miaji](https://github.com/nihalzp)).
- Fixed queries that used PK sharding with a false condition failing. [#92815](https://github.com/ClickHouse/ClickHouse/pull/92815) ([Yarik Briukhovetskyi](https://github.com/yariks5s)).
- Fixed `Merge` table engine query planning throwing `ILLEGAL_COLUMN` for `hostName()` when merging local and remote/Distributed tables. [#93286](https://github.com/ClickHouse/ClickHouse/pull/93286) ([Jinlin](https://github.com/withlin)).
- Fixed `NO_SUCH_COLUMN_IN_TABLE` error in `Merge` engine over tables with aliases. [#92910](https://github.com/ClickHouse/ClickHouse/pull/92910) ([Pavel Kruglov](https://github.com/Avogar)).
- Fixed `SELECT` query with predicate on multiple columns with bloom filter skip indexes and both `OR` and `NOT` conditions returning inconsistent results. [#94026](https://github.com/ClickHouse/ClickHouse/pull/94026) ([Shankar Iyer](https://github.com/shankar-iyer)).
- Fixed applying projection when filter contained subcolumns. [#93141](https://github.com/ClickHouse/ClickHouse/pull/93141) ([Pavel Kruglov](https://github.com/Avogar)).
- Fixed `_part_offset` corruption when projections were rebuilt during merges, and optimized projection processing by avoiding unnecessary reads. [#93827](https://github.com/ClickHouse/ClickHouse/pull/93827) ([Amos Bird](https://github.com/amosbird)).
- Prevented different interpolated columns from collapsing into the same column in a block when they were effectively aliases of the same column. [#93197](https://github.com/ClickHouse/ClickHouse/pull/93197) ([Yakov Olkhovskiy](https://github.com/yakov-olkhovskiy)).
- Removed unused columns when the projection was rebuilt during merge, reducing memory usage and creating fewer temporary parts. [#93233](https://github.com/ClickHouse/ClickHouse/pull/93233) ([Nikolai Kochetov](https://github.com/KochetovNicolai)).
- Fixed a logical error in some cases when negative `LIMIT/OFFSET` was used in distributed queries. [#95357](https://github.com/ClickHouse/ClickHouse/pull/95357) ([Nihal Z. Miaji](https://github.com/nihalzp)).
- Fixed a logical error in some cases when fractional `LIMIT/OFFSET` was used in distributed queries. [#96475](https://github.com/ClickHouse/ClickHouse/pull/96475) ([Nihal Z. Miaji](https://github.com/nihalzp)).
- Fixed `IN` function returning incorrect results with `NULL` values when `transform_null_in` was enabled. [#95674](https://github.com/ClickHouse/ClickHouse/pull/95674) ([Nihal Z. Miaji](https://github.com/nihalzp)).
- Fixed `IN (col)` with a single column reference failing with `UNSUPPORTED_METHOD` error. [#97646](https://github.com/ClickHouse/ClickHouse/pull/97646) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
- Fixed `optimize_syntax_fuse_functions` rewriting `sum`/`count`/`avg` into `sumCount()` when the aggregate argument was `LowCardinality(Nullable)`. [#96239](https://github.com/ClickHouse/ClickHouse/pull/96239) ([Nihal Z. Miaji](https://github.com/nihalzp)).
- Fixed incorrect partition pruning for `not IN` and `not has` functions. [#96241](https://github.com/ClickHouse/ClickHouse/pull/96241) ([Nihal Z. Miaji](https://github.com/nihalzp)).
- Fixed prewhere filter error caused by lambda expressions in prewhere. [#95395](https://github.com/ClickHouse/ClickHouse/pull/95395) ([Xiaozhe Yu](https://github.com/wudidapaopao)).
- Fixed `LOGICAL_ERROR` in query analyzer when a lambda expression was passed where a concrete value was expected. [#96892](https://github.com/ClickHouse/ClickHouse/pull/96892) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
- Fixed null pointer dereference in certain expressions with lambda functions. [#96479](https://github.com/ClickHouse/ClickHouse/pull/96479) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
- Fixed per-subquery `SETTINGS` not being applied to table functions like `file` in CTEs and subqueries. [#96882](https://github.com/ClickHouse/ClickHouse/pull/96882) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
- Fixed query condition cache hash collision for CTE folded constants, which could lead to wrong query results. [#96172](https://github.com/ClickHouse/ClickHouse/pull/96172) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
- Fixed `BAD_ARGUMENTS` error when querying tables with lambda expressions inside ALIAS columns through the `merge()` table function with the analyzer enabled. [#97551](https://github.com/ClickHouse/ClickHouse/pull/97551) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
- Fixed `EXCEPT ALL` and `INTERSECT ALL` ignoring row multiplicities and behaving like their `DISTINCT` counterparts. [#96876](https://github.com/ClickHouse/ClickHouse/pull/96876) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
- Fixed assertion failure in `WindowTransform` with a large `PRECEDING` offset. [#96026](https://github.com/ClickHouse/ClickHouse/pull/96026) ([Alexey Milovidov](https://github.com/alexey-milovidov)).
- Fixed exception when using window functions with `group_by_use_nulls = 1` and `CUBE`/`ROLLUP`/`GROUPING SETS`. [#96878](https://github.com/ClickHouse/ClickHouse/pull/96878) ([Alexey Milovidov](https://github.com/alexey-milovidov)).