Repository navigation
Fix exception when selecting _row_number with other virtual columns - #100295
Merged
alexey-milovidov merged 2 commits intoMar 22, 2026
Merged
Conversation
Contributor
|
Workflow [PR], commit [e4d3dba] Summary: ✅ AI ReviewSummaryThis PR fixes a real regression in ClickHouse Rules
Final Verdict
|
…hunk` In `addRequestedFileLikeStorageVirtualsToChunk`, the `_row_number` handling block uses `return` instead of `continue` after adding the column to the chunk. This causes the function to exit the loop early, skipping any remaining virtual columns (e.g. `_data_lake_snapshot_version`). When a query requests both `_row_number` and another virtual column after it, the chunk has fewer columns than expected, resulting in: "Invalid number of columns in chunk pushed to OutputPort." The fix was originally in #100116 but was lost during merge because #100208 (revert of #99163) had reintroduced the `return` on master after the fix branch had already resolved it via a different code structure. The regression test `04050_iceberg_virtual_columns_return_bug` is already on master from #100116. https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=100177&sha=f10711f066fd101124e088ce33061de51ebae0e9&name_0=PR&name_1=Stateless%20tests%20%28amd_debug%2C%20parallel%29 #87890 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…lumns Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
alexey-milovidov
force-pushed
the
fix-iceberg-virtual-columns-return-lost
branch
from
March 21, 2026 19:07
2a3aebc to
e4d3dba
Compare
Contributor
LLVM Coverage Report
PR changed lines: PR changed-lines coverage: 100.00% (6/6, 0 noise lines excluded) |
4 of 27 tasks
il9ue
pushed a commit
to Altinity/ClickHouse
that referenced
this pull request
May 26, 2026
The path resolution refactor in ClickHouse#100420/ClickHouse#100295 changed `FileNamesGenerator`'s constructor signature (5 args → 4 args, with `is_transactional` mapped to `use_uuid_in_metadata` and `config_path` removed) and removed `generateMetadataName()` in favour of `generateMetadataPathWithInfo()`. The `generateManifestList` signature also changed: first arg is now `IcebergPathResolver` instead of `FileNamesGenerator`, and manifest entry sizes is `std::vector<Int64>` instead of a scalar. Adapt the `TRUNCATE TABLE` code path (from #1655) to the new API: - Two-branch `FileNamesGenerator` construction (transactional vs. non-transactional, reading location from JSON) → single construction using `persistent_components.path_resolver.getTableLocation()` with `is_transactional` as `use_uuid_in_metadata`. - `generateMetadataName()` → `generateMetadataPathWithInfo()`, returning `GeneratedMetadataFileWithInfo { path, version, compression_method }`. - Storage paths derived via `path_resolver.resolve(path)` where raw strings were previously returned. - Catalog filename via `path_resolver.resolveForCatalog(path)`, replacing the manual `location + metadata_name` concatenation. - `generateManifestList(filename_generator, ...)` → `generateManifestList(path_resolver, ...)`. Behavior of truncate is preserved: clears data files by writing a new snapshot with empty manifests and updates the catalog pointer. The new `IcebergPathResolver` abstraction handles both transactional (full URI) and non-transactional (bare path) cases transparently. Refs: #1785, #1655
zvonand
added a commit
to Altinity/ClickHouse
that referenced
this pull request
Jun 1, 2026
…100420 Backport of ClickHouse#100420/ClickHouse#100295 - Resolve problems with paths and compatibility problems with Spark in Azure (v2)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In
addRequestedFileLikeStorageVirtualsToChunk, the_row_numberhandling block usesreturninstead ofcontinueafter adding the column to the chunk. This causes the function to exit the loop early, skipping any remaining virtual columns (e.g._data_lake_snapshot_version). When a query requests both_row_numberand another virtual column, the chunk has fewer columns than expected, resulting in: "Invalid number of columns in chunk pushed to OutputPort."The fix was originally in #100116 but was lost during merge because #100208 (revert of #99163) had reintroduced the
returnon master after the fix branch had already resolved it via a different code structure.The regression test
04050_iceberg_virtual_columns_return_bugis already on master from #100116.CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=100177&sha=f10711f066fd101124e088ce33061de51ebae0e9&name_0=PR&name_1=Stateless%20tests%20%28amd_debug%2C%20parallel%29
#100177
#87890
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Documentation entry for user-facing changes
Version info
26.4.1.114