<!-- Linked issues and pull requests. Use full GitHub URLs, one relationship per line; delete the lines you don't need. Related: https://github.com/ClickHouse/ClickHouse/issues/112203 Related: https://github.com/ClickHouse/ClickHouse/pull/113369 --> Related: https://github.com/ClickHouse/ClickHouse/issues/112203 Related: https://github.com/ClickHouse/ClickHo
# `Logical error: 'Equal values are not contiguous within the range assumed to be sorted'` — `DISTINCT` in order over `partial_merge` JOIN (wrong results in release) ## Summary With `join_algorithm = 'partial_merge'` (or `'prefer_partial_merge'`), the query plan assumes the join preserves the left stream's sort order and applies the pre-`DISTINCT` stage as `
Currently pre-built sets for `IN (subquery)` clauses don't work well, so as a workaround it make sense to enable `rewrite_in_to_join=1` by default for distributed queries v2.
### Describe the bug Having difficulty reproducing it. # The crash `26.7.1.569`, thread from the Parquet prefetcher fast pool: ``` <Fatal> BaseDaemon: Address: 0x28. Access: read. Address not mapped to object. 3. pthread_mutex_lock 5. std::mutex::lock() 6. std::__assoc_state<DB::IAsynchronousReader::Result>::move() future:636 (future::get) 7. DB::Asynchronou
### Company or project name _No response_ ### Describe what's wrong ### Bug description `subBitmap` / `bitmapSubsetOffsetLimit` can return an incorrect subset when the input bitmap is stored in the small representation. In `src/AggregateFunctions/AggregateFunctionGroupBitmapData.h`, `rb_offset_limit()` : ```cpp if (isSmall()) { UInt64 count = 0; UInt64 offse
## Summary `Logical error: RWLockImpl::getLock(): Cannot acquire exclusive lock while RWLock is already locked` fires from the internal cleanup DROP inside `CREATE OR REPLACE TABLE`. This is a fresh manifestation of the re-entrant DDL-lock LOGICAL_ERROR class previously seen in #79413 / #47023. Surfaced by CI: `Stress test (arm_debug)`, STID 2043-3c5c. Repor
**Describe what's wrong** A `WHERE` predicate that casts a tuple to `Point` (a non-`Nullable` type) throws `CANNOT_INSERT_NULL_IN_ORDINARY_COLUMN` at execution, even though a preceding filter guarantees the cast never sees a NULL. The throwing `CAST(tuple(...), 'Point')` is materialized in a PREWHERE read step **before** the guarding filter is applied, so it
## Describe what's wrong With `query_plan_optimize_join_order_algorithm = 'dpsub'` and `query_plan_enable_optimizations = 0`, a chained join whose first `ON` clause carries a non-equi conjunct returns wrong results: the DPsub reordering still runs (it restructures the join tree even though plan optimizations are disabled), but the residual, non-equi part of
### Company or project name ClickHouse customer ### Use case Queries that unnest one or more `Array` columns with `arrayJoin` (or `ARRAY JOIN`) and then select a few specific elements in `WHERE` are a very common pattern (tag/label arrays, event attribute arrays, key-value arrays stored as parallel arrays). Today ClickHouse first materializes the full expans
A valid table-free query combining a constant projection, `ORDER BY ALL`, `LIMIT n BY`, and `LIMIT ... WITH TIES` throws an exception at **default settings**: ```sql SELECT 1 FROM numbers(10) ORDER BY ALL LIMIT 1 BY number LIMIT 4 WITH TIES ``` ``` Code: 10. DB::Exception: Not found column 1_UInt8 in block. There are only columns: __table1.number. (NOT_FOUND
### Company or project name _No response_ ### Describe what's wrong A minmax data-skipping index can change the result of a strict comparison between DateTime64 and an integer. Without skip-index pruning, `time > 0` correctly matches a value of 0.01 seconds. With a minmax index, the same row is pruned. ### Does it reproduce on the most recent release? Yes ##
🕵️ ## Describe what's wrong Reading an Iceberg table whose metadata describes an invalid schema evolution (per the Iceberg spec) crashes the server instead of raising a normal, catchable exception: ``` Thread ... received signal SIGABRT, Aborted. ... #11 DB::Iceberg::IcebergSchemaProcessor::getSchemaTransformationDag (..., old_id=0, new_id=1) at SchemaProces
### Company or project name ClickHouse ### Use case Column statistics currently give string predicates almost nothing: - Range predicates (`url < 'https://m'`, `tenant BETWEEN 'a' AND 'b'`) fall through to the hard-coded `default_cond_range_factor = 0.33`, because `tdigest`/`basic`/`minmax` estimation is numeric-only. - `LIKE` / `ILIKE` always get the hard-c
🕵️ ## Describe what's wrong An explicit `PREWHERE` whose expression is a plain column reference fails when PREWHERE is deferred until after `FINAL`: ``` Code: 8. DB::Exception: Cannot find column `b` in source stream, there are only columns: [other]. (THERE_IS_NO_COLUMN) ``` This is reachable **with stock default settings** — no `SETTINGS` clause required. T
### Company or project name ClickHouse ### Describe the unexpected behaviour An access entity with a Map-valued setting — e.g. a settings profile with `http_response_headers` — is serialized into a form that ClickHouse's own parser cannot read back. The stored entity becomes permanently unloadable. ### How to reproduce ```sql -- A string literal is the only
🕵️ ## Describe what's wrong `ParquetV3BlockInputFormat` does not override `resetReadBuffer()`, so `IInputFormat::onFinish()` frees the format's owned `ReadBuffer` while the Parquet `Prefetcher`'s IO tasks are still reading through it on the prefetch thread pool. The tasks then dereference freed memory. ASan on a plain `clickhouse local` run of the reproducer
### Describe the unexpected behaviour `KeyCondition`'s primary-key range analysis for `pointInPolygon` (`analyze_point_in_polygon` in `src/Storages/MergeTree/KeyCondition.cpp:3583-3663`) builds the query polygon directly from the literal argument, calls `boost::geometry::correct` and `boost::geometry::envelope`, but never calls `boost::geometry::is_valid`. T
### Company or project name _No response_ ### Describe what's wrong A SELECT query crashes `clickhouse-server` with SIGSEGV while merging aggregate states for: ```sql countDistinct(note) = 1 ```` ClickHouse version: ```text 26.3.17.110 (official build) git hash: 59141459d999fabdcf3d1dd88cdd5ed6f10136ee ``` The relevant part of the query can be simplified to:
``` milovidov-desktop :) SELECT number FROM numbers(10) WHERE number % 2 IN (number % 3, number % 5) Received exception: Code: 47. DB::Exception: Missing columns: 'number' while processing query: 'number % 3', required columns: 'number' 'number': While processing (number % 2) IN (number % 3, number % 5). (UNKNOWN_IDENTIFIER) ``` It can be done in the followi
In case of <protocols> is used over <tcp_port> (e.t.c.), the name of the server is different and the code in AsynchronouseMetrics.cpp fails to match them. Suggestion - add proper ServerType::Type enum into the ProtocolServerAdapter, and use it over matching by "port name".
### Company or project name _No response_ ### Describe the unexpected behaviour ```sql SELECT * FROM icebergS3Cluster('replicated_cluster', 'http://minio:9000/warehouse/data2', 'admin', 'password') PASTE JOIN ( SELECT * FROM iceberg('http://minio:9000/warehouse/data3', 'admin', 'password') ) AS t1 ORDER BY tuple(*) ASC FORMAT Values ``` ``` Elapsed: 0.016 se
The native Parquet reader currently maps both `logical.TIMESTAMP` and `logical.TIME` (and the deprecated converted types `TIMESTAMP_MILLIS`/`TIMESTAMP_MICROS`/`TIME_MILLIS`/`TIME_MICROS`) to `DataTypeDateTime64`. That was fine before ClickHouse 25.6, when there was no time-of-day type, but it now produces the Parquet analogue of #104038: when the target colu
importance 5@tiandiwonderpr-bugfixcan be testedpr-autogenerated-docsOriginal evidence ↗
Extends the stateless-test randomizers in `tests/clickhouse-test` with settings added since they were last swept, and pins the tests that were implicitly relying on the old defaults. `SettingsRandomizer`: * Broadens `query_plan_optimize_join_order_algorithm` to cover `dpsub` and `dphyp` (always with `greedy` kept in the fallback chain, since exhausting the c
<!-- Linked issues and pull requests. Use full GitHub URLs, one relationship per line; delete the lines you don't need. Related: https://github.com/ClickHouse/ClickHouse/pull/106364 --> ### Changelog category (leave one): - Bug Fix (user-visible misbehavior in an official stable release) ### Changelog entry (a [user-readable short description](https://github
importance 5@groeneaiclosedpr-bugfixpr-must-backportcan be testedpr-synced-to-cloudpr-must-backport-syncedOriginal evidence ↗
<!-- Related: https://github.com/ClickHouse/ClickHouse/pull/85145 --> This PR adds automatic `LowCardinality` serialization for `MergeTree`, analogous to the existing automatic `Sparse` serialization. A `String` or `FixedString` column whose declared type is **not** `LowCardinality` can now be stored on disk in dictionary-encoded form when it has a `uniq` st
### Changelog category (leave one): - Improvement ### Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md): Speed up Keeper startup by reading multiple changelog files concurrently instead of serially, controlled by new settings `log_startup_read_max_streams` and `log_startup_read_buffer_size`. ### Documentation entr
Closes: https://github.com/ClickHouse/ClickHouse/issues/109974 Related: https://github.com/ClickHouse/ClickHouse/issues/106208 `subBitmap` and `bitmapSubsetOffsetLimit` apply offset/limit in ascending value order. The small-set bitmap path iterated keys in insertion order instead, producing wrong subsets when values were not inserted sorted (e.g. `bitmapBuil
importance 5@RamiDarwicheclosedpr-bugfixcan be testedpr-synced-to-cloudOriginal evidence ↗
### Changelog category (leave one): - Improvement ### Changelog entry (a [user-readable short description](https://github.com/ClickHouse/ClickHouse/blob/master/docs/changelog_entry_guidelines.md) of the changes that goes into CHANGELOG.md): Add STREAM BOUNDED modifier, which read only the first snapshot of a streaming query, then finish instead of subscribin
<!-- Closes: https://github.com/ClickHouse/ClickHouse/issues/111206 --> ### Changelog category (leave one): - Bug Fix (user-visible misbehavior in an official stable release) ### Changelog entry (a [user-readable short description](https://github.com/ClickHouse/ClickHouse/blob/master/docs/changelog_entry_guidelines.md) of the changes that goes into CHANGELOG
importance 5@groeneaiclosedpr-bugfixcan be testedpr-synced-to-cloudOriginal evidence ↗
<!-- Linked issues and pull requests. Use full GitHub URLs, one relationship per line; delete the lines you don't need. Related: https://github.com/ClickHouse/ClickHouse/issues/111373 Related: https://github.com/ClickHouse/ClickHouse/pull/111414 --> ### Changelog category (leave one): - Bug Fix (user-visible misbehavior in an official stable release) ### Cha
Closes: https://github.com/ClickHouse/ClickHouse/issues/111827 ### Changelog category (leave one): - New Feature ### Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md): Added exclude_from_backup and exclude_data_from_backup MergeTree table settings so BACKUP can skip a table entirely or skip only its data while sti
### Changelog category (leave one): - Bug Fix (user-visible misbehavior in an official stable release) ### Changelog entry (a [user-readable short description](https://github.com/ClickHouse/ClickHouse/blob/master/docs/changelog_entry_guidelines.md) of the changes that goes into CHANGELOG.md): Fix `S3Queue`/`AzureQueue` skipping a file forever after losing th
<!-- Linked issues and pull requests. Use full GitHub URLs, one relationship per line; delete the lines you don't need. Related: https://github.com/ClickHouse/ClickHouse/pull/109225 --> Related: https://github.com/ClickHouse/ClickHouse/pull/109225 ### Changelog category (leave one): - Bug Fix (user-visible misbehavior in an official stable release) ### Chang
importance 5@groeneaiopenpr-bugfixpr-must-backportcan be testedOriginal evidence ↗
Related: https://github.com/ClickHouse/ClickHouse/pull/96181 Related: https://github.com/ClickHouse/ClickHouse/issues/77366 Related: https://github.com/ClickHouse/ClickHouse/pull/110529 A table detached with a plain `DETACH TABLE` keeps its metadata file, so the server attaches it again on the next start. It is gone from `DatabaseCatalog` though, so `isTable
`SELECT ... FROM s3(...) WHERE _path GLOBAL IN (SELECT ...)` over a path without globs threw ``` Logical error: 'Not-ready Set is passed as the second argument for function 'globalIn'' ``` `ReadFromObjectStorageStep::applyFilters` intentionally leaves the sets of `globalIn` / `globalNotIn` unbuilt, so that `ReadFromRemote` can attach an external table to the
<!-- Linked issues and pull requests. Use full GitHub URLs, one relationship per line; delete the lines you don't need. Related: https://github.com/ClickHouse/ClickHouse/pull/112953 --> ### Changelog category (leave one): - Bug Fix (user-visible misbehavior in an official stable release) ### Changelog entry (a [user-readable short description](https://github
<!-- Linked issues and pull requests. Use full GitHub URLs, one relationship per line; delete the lines you don't need. Related: https://github.com/ClickHouse/ClickHouse/pull/113781 --> ### Changelog category (leave one): - CI Fix or Improvement (changelog entry is not required) ### Changelog entry (a [user-readable short description](https://github.com/Clic
importance 5@groeneaiopenmanual approvecan be testedpr-ciOriginal evidence ↗
<!-- Related: https://github.com/ClickHouse/ClickHouse/pull/86768 --> ### Changelog category (leave one): - Bug Fix (user-visible misbehavior in an official stable release) ### Changelog entry (a [user-readable short description](https://github.com/ClickHouse/ClickHouse/blob/master/docs/changelog_entry_guidelines.md) of the changes that goes into CHANGELOG.m
Do not create unused aggregate states in aggregation in order with a partial GROUP BY key <!-- Linked issues and pull requests. Use full GitHub URLs, one relationship per line; delete the lines you don't need. Closes: https://github.com/ClickHouse/ClickHouse/issues/114000 --> Closes: https://github.com/ClickHouse/ClickHouse/issues/114000 ### Changelog catego
importance 5@groeneaiclosedpr-bugfixcan be testedpr-synced-to-cloudOriginal evidence ↗
<!-- Closes: https://github.com/ClickHouse/ClickHouse/issues/111545 --> ### Changelog category (leave one): - Bug Fix (user-visible misbehavior in an official stable release) ### Changelog entry (a [user-readable short description](https://github.com/ClickHouse/ClickHouse/blob/master/docs/changelog_entry_guidelines.md) of the changes that goes into CHANGELOG
Related: https://github.com/ClickHouse/ClickHouse/pull/113978 Related: https://github.com/ClickHouse/ClickHouse/pull/111652 Test `04630_merge_over_stale_packed_tmp_dir` (added in https://github.com/ClickHouse/ClickHouse/pull/111652) copies a packed part directory with plain `cp` to simulate a stale `tmp_merge_` directory left by an interrupted merge. Modifyi
Related: https://github.com/ClickHouse/ClickHouse/pull/113925 Related: https://github.com/ClickHouse/ClickHouse/pull/113225 ### Changelog category (leave one): - CI Fix or Improvement (changelog entry is not required) ### Description A part written before an `ALTER` keeps its own older type (or misses the column) until the background mutation rewrites it. Re
Original pull-request https://github.com/ClickHouse/ClickHouse/pull/113291 This pull-request is a last step of an automated backporting. Treat it as a standard pull-request: look at the checks and resolve conflicts. Merge it only if you intend to backport changes to the target branch, otherwise just close it. ### The PR source The PR is created in the [CI jo