Repository navigation
Revert "Fix Parquet reads of .null and .size0 subcolumns when the filter runs as PREWHERE" - #125121
Merged
alexey-milovidov merged 1 commit intoOct 11, 2026
Conversation
… filter runs as PREWHERE"
alexey-milovidov
deleted the
revert-124685-parquet-prewhere-subcolumn-header
branch
October 11, 2026 00:36
Contributor
This was referenced Oct 11, 2026
groeneai
added a commit
to groeneai/ClickHouse
that referenced
this pull request
Oct 11, 2026
…mber-missing-from-child Picks up ClickHouse#125121 (revert of ClickHouse#124685), which fixes the 05339_parquet_prewhere_subcolumn_read_through_column failure on this PR. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 11, 2026
This was referenced Oct 11, 2026
Member
|
@alexey-milovidov are you going to revert this and reapply the PR? |
opensource-fork-sync Bot
pushed a commit
to cla7aye15I4nd/opensource-ClickHouse__ClickHouse
that referenced
this pull request
Nov 6, 2026
…RE read header `prepareReadingFromFormat` keeps query-level `requested_columns` / `source_header`, which can hold subcolumns such as `n.null` or `arr.size0`, and a format-level `format_header`, where Parquet reads such a subcolumn through its whole column (`n`). After PREWHERE, `updateFormatPrewhereInfo` set `source_header` to the post-PREWHERE `format_header`, and ClickHouse#126573 then re-requested a subcolumn only when its column was still read. Two shapes stayed broken: - an explicit PREWHERE that consumes the column a selected subcolumn is read through drops the subcolumn: `SELECT countIf(n.null), count() FROM file('x.parquet') PREWHERE n > 5` fails with NOT_FOUND_COLUMN_IN_BLOCK, also on released 26.3, 26.8, 26.9 and 26.10; - when the column survives an optimizer PREWHERE, the read step outputs the whole column `n` that no step requested, and lazy materialization over it trips `chassert(header.columns() == required_inputs.size())` in `splitExpressionStep` with default settings: `SELECT n.null, number FROM file('x.parquet') WHERE number > 5 ORDER BY number LIMIT 3`. Compute the post-PREWHERE source header by applying the PREWHERE actions to the query-level requested block, as `SourceStepWithFilter::updatePrewhereInfo` does, keep each requested column with its storage mapping, and keep a storage column in `format_header` when an explicit PREWHERE consumes the column a selected subcolumn is extracted from. This replaces the ClickHouse#126573 loop, whose cases the new construction covers (05413 passes unchanged). The object-storage fallback that re-applies PREWHERE after the reader, for a data file whose format has no PREWHERE (ORC files of an Iceberg table read as Parquet, schema-evolved files), now keeps the inputs listed in the format header among the PREWHERE outputs, so the column survives the filter there too. This re-lands the source part of ClickHouse#124685 (reverted in ClickHouse#125121 because its test failed under DatabaseReplicated: the replicated DDL worker does not see the `TEMPORARY TABLE` that the Iceberg block passes to `IcebergLocal`). The test now carries `no-replicated-database` with the reason line of `05291_iceberg_optimize_explicit_metadata`. Its explicit-PREWHERE `s3` arm pins `parallel_replicas_for_cluster_engines = 0`, because under parallel replicas `s3` is read through its `-Cluster` storage, which rejects PREWHERE. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Reverts #124685
Workflow [PR]
Sync PR [sync-upstream/pr/125121]
Version info
26.10.1.2089-master(included in26.10and later)