Skip to content

Backport #116129 to 26.3: Fix iceberg identity partitioned reading - #116673

Closed
robot-ch-test-poll2 wants to merge 6 commits into
26.3from
backport/26.3/116129
Closed

robot-ch-test-poll2 wants to merge 6 commits into
26.3from
backport/26.3/116129

Conversation

@robot-ch-test-poll2

Copy link
Copy Markdown
Contributor

Original pull-request #116129
Cherry-pick pull-request #116572

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 job

@robot-ch-test-poll2 robot-ch-test-poll2 added pr-backport Changes, backported to release branch. Do not use manually - automated use only! pr-bugfix Pull request with bugfix, not backported by default labels Aug 27, 2026
@clickhouse-gh

clickhouse-gh Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [BackportPR], commit [88abfb2]

Summary: ❌

job_name test_name status info comment
Build (amd_debug) failure
Build ClickHouse failure cidb
Build (amd_asan) failure
Build ClickHouse failure cidb
Build (amd_tsan) failure
Build ClickHouse failure cidb
Build (amd_release) failure
Build ClickHouse failure cidb
Build (arm_release) failure
Build ClickHouse failure cidb
Build (amd_darwin) failure
Build ClickHouse failure cidb
Build (arm_darwin) failure
Build ClickHouse failure cidb
Docker server image dropped
Docker keeper image dropped
Install packages (amd_release) dropped

PedroTadim and others added 2 commits September 10, 2026 10:42
Every build fails on this branch with:

    src/Storages/ObjectStorage/DataLakes/Iceberg/Utils.h:108:30:
        error: use of undeclared identifier 'avro'
      108 |     std::function<void(const avro::GenericDatum &)> callback);

`26.3` never had `forEachAvroEntry`: it arrived on master in 8fe1d61
("Extract forEachAvroEntry helper for iceberg avro readers"), which is not on
this branch. That commit added both the declaration and the
`namespace avro { class GenericDatum; }` forward declaration it needs.

The cherry-pick of #116129 appends `getIdentityPartitionColumnValues` directly
below `forEachAvroEntry`, so it pulled the `forEachAvroEntry` declaration in as
part of the hunk, but not the forward declaration - that sits higher up in the
file, outside any hunk this cherry-pick touches. The definition in `Utils.cpp`
came along too and compiles, because that translation unit includes the real
avro headers; only the header was left without a declaration.

Add the forward declaration, byte-identical to master's and in the same place
relative to the includes. `avro::GenericDatum` is only used here as a reference
inside a `std::function` parameter, so an incomplete type is sufficient - the
same way master uses it.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Resolved one conflict in `src/Storages/ObjectStorage/StorageObjectStorageSource.cpp`,
where two unrelated changes land on adjacent lines.

  - Operands: kept this branch's `row_level_filter` / `prewhere_info`. #116129
    introduces those locals just above and rewrites them through
    `substituteIdentityPartitionColumns` when the filter reads an identity
    partition column - that substitution is the whole point of the PR, so
    reverting to `format_filter_info->...` would undo the fix.

  - `current_schema_column_mapper`: dropped, taking the release-branch side.
    It is not part of #116129 (that PR does not touch `src/Formats/` at all);
    it is master-only code that predates it and the cherry-pick pulled in as
    adjacent context. `FormatFilterInfo` has no such member on `26.3`, so it
    would not have compiled - a second build break, latent only because ninja
    stopped at the `avro` error in `Utils.h` before reaching this file.

Checked that nothing else references `current_schema_column_mapper`, and that
every symbol the merged code uses exists on this branch.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@PedroTadim

Copy link
Copy Markdown
Member

This seems difficult to backport, not sure if worth to proceed

…AndName`

The cherry-pick brought master's three-argument
`addColumn(column, type, name)`; splitting the argument out is a later
change that is not in this branch, where `addColumn` still takes one
`ColumnWithTypeAndName`:

  error: no viable conversion from 'ColumnPtr' (aka 'immutable_ptr<DB::IColumn>') to 'ColumnWithTypeAndName'

Build the `ColumnWithTypeAndName` explicitly at both call sites, which
is behaviour-neutral.
The cherry-pick brought master's way of resolving a data file's
storage path:

    persistent_table_components.path_resolver.resolve(data_file->parsed_entry->file_path_key)

`PersistentTableComponents::path_resolver` comes with
`IcebergPathResolver` (#99163), which replaced
`getProperFilePathFromMetadataInfo` and is not in this branch - 26.3
was cut about seven hours before it merged - so both builds failed
with

    error: no member named 'path_resolver' in 'DB::Iceberg::PersistentTableComponents'

In this branch the resolution has already happened by then:
`ManifestFileIterator` computes it once per entry with
`getProperFilePathFromMetadataInfo(parsed_entry->file_path_key,
common_path, table_location)` and stores it as
`ProcessedManifestFileEntry::file_path` ("Computed file path for
Object Storage"), which is exactly what the pre-cherry-pick
`IcebergDataObjectInfo` constructor read. So pass that field, which is
what the neighbouring code in `IcebergIterator.cpp` already does.
The build failed on

    error: unused variable 'data_file_path' [-Werror,-Wunused-variable]

because the cherry-pick brought the comment of the keying fix but not
the code: the three lookups still used
`manifest_file.manifest_file_path` while the comment right above them
already explained why that is wrong -

    /// One DataFilePlan per source *data file*, keyed by the data file's own path.
    /// Keying by the manifest path made every data file after the first in a
    /// manifest reuse the first file's plan, so writeDataFiles rewrote only one
    /// file per manifest and the rest of the manifest's data silently disappeared
    /// from the compacted table.

So `-Werror` caught a real hole rather than a stylistic one. Use
`data_file_path` for the `contains` check and both map accesses, which
is what `master` does.
@PedroTadim PedroTadim closed this Oct 2, 2026
@maxknv
maxknv deleted the backport/26.3/116129 branch November 13, 2026 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-backport Changes, backported to release branch. Do not use manually - automated use only! pr-bugfix Pull request with bugfix, not backported by default

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants