Skip to content

Parse record_count and size_bytes fields from iceberg manifest file - #100645

Merged
divanik merged 8 commits into
masterfrom
divanik/add_bytes_and_rows_count_to_iceberg_data_object
Apr 7, 2026
Merged

divanik merged 8 commits into
masterfrom
divanik/add_bytes_and_rows_count_to_iceberg_data_object

Conversation

@divanik

@divanik divanik commented Mar 24, 2026 •

Copy link
Copy Markdown
Contributor

Changelog category (leave one):

  • Improvement

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Object information used for parsing data files in iceberg now contains the number of file rows and file size in bytes parsed from manifest file

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

@clickhouse-gh

clickhouse-gh Bot commented Mar 24, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [3ebd89c]

Summary: ❌

job_name test_name status info comment
Stateless tests (amd_asan_ubsan, distributed plan, parallel, 1/2) failure
03706_statistics_preserve_checksums_on_mutations FAIL cidb, issue ISSUE EXISTS
Stateless tests (amd_debug, distributed plan, s3 storage, parallel) failure
03706_statistics_preserve_checksums_on_mutations FAIL cidb, issue ISSUE EXISTS
Unit tests (msan) error IGNORED

AI Review

Summary

This PR adds parsing and propagation of Iceberg record_count and file_size_in_bytes from manifest entries, versions the cluster-processing serialization to carry these fields, and adds unit/integration coverage including cluster execution paths. The changes are coherent and backward-compatible at the protocol boundary; I did not find correctness, safety, or performance blockers in the current PR head.

Missing context
  • ⚠️ No CI logs/results were provided in this review context, so runtime validation relies on code inspection plus the added tests in the PR.
ClickHouse Rules
Item Status Notes
Deletion logging ➖
Serialization versioning ✅
Core-area scrutiny ✅
No test removal ✅
Experimental gate ➖
No magic constants ✅
Backward compatibility ✅
SettingsChangesHistory.cpp ➖
PR metadata quality ✅
Safe rollout ✅
Compilation time ✅
Final Verdict
  • Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-feature Pull request with new product feature label Mar 24, 2026
@divanik

divanik commented Mar 24, 2026

Copy link
Copy Markdown
Contributor Author

#100433 - needed to remove dependency of IcebergSource on SchemaInference class

{
if (value < 0)
{
throw Exception(ErrorCodes::INCORRECT_DATA, "NumericIndexedVector does not support negative values");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change introduces a behavioral regression: NumericIndexedVector currently supports signed values (including negative scalars), and existing stateless tests rely on it (for example tests/queries/0_stateless/03463_numeric_indexed_vector_overflow.sql line 11 uses numericIndexedVectorPointwiseMultiply(..., -9999999999) and expects a valid result).

After this new guard, every path that calls checkValidValue will throw INCORRECT_DATA for negative inputs, so legitimate signed use-cases will start failing.

Please keep the UB fix local to the problematic conversion path instead of banning negatives globally (e.g. restrict the change to the std::floor/cast path, while preserving negative-value semantics).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated because of garbage in master

divanik and others added 2 commits March 25, 2026 11:07
…tes`

Add `LOG_TEST` in `StorageObjectStorageSource::createReader` that logs
`record_count` and `file_size_in_bytes` from `IcebergObjectSerializableInfo`
when reading Iceberg data files.

Add unit tests for `IcebergObjectSerializableInfo` serialization round-trip,
backward compatibility with protocol version 5, and nullopt handling.

Add integration test that verifies the logged values match actual row counts
(via direct parquet reads) and file sizes (via S3 object metadata), both
for single-node and cluster table function paths.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@divanik
divanik force-pushed the divanik/add_bytes_and_rows_count_to_iceberg_data_object branch from 4f8e55d to 7021971 Compare March 25, 2026 10:07
…ed test

Merge `test_iceberg_file_stats_logging` and `test_iceberg_file_stats_logging_cluster`
into one test parametrized by `run_on_cluster`.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@clickhouse-gh clickhouse-gh Bot added pr-improvement Pull request with some product improvements and removed pr-feature Pull request with new product feature labels Mar 25, 2026
Prevents test contamination from accumulated log messages across
test runs by filtering log lines to only those matching the current
query's `query_id`.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@divanik
divanik marked this pull request as ready for review March 25, 2026 10:35
@divanik divanik changed the title [[DRAFT]] Parse record_count and size_bytes fields from iceberg manifest file Parse record_count and size_bytes fields from iceberg manifest file Mar 25, 2026
divanik and others added 2 commits March 25, 2026 14:48
When presence flags are 0, explicitly assign `std::nullopt` to prevent
stale values leaking if an `IcebergObjectSerializableInfo` instance is
reused across multiple deserializations.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@arsenmuk arsenmuk self-assigned this Mar 25, 2026
divanik and others added 2 commits March 25, 2026 16:19
In cluster mode, worker nodes execute reads with their own auto-generated
`query_id`, not the coordinator's. The test now queries `system.query_log`
on all nodes using `initial_query_id` to discover all related query_ids
before filtering log lines.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Mar 26, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 84.20% 84.10% -0.10%
Functions 24.70% 24.40% -0.30%
Branches 76.70% 76.60% -0.10%

Changed lines: 98.51% (198/201) · Uncovered code

Full report · Diff report

@divanik
divanik added this pull request to the merge queue Apr 7, 2026
Merged via the queue into master with commit 429800c Apr 7, 2026
146 of 149 checks passed
@divanik
divanik deleted the divanik/add_bytes_and_rows_count_to_iceberg_data_object branch April 7, 2026 15:16
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Apr 7, 2026
zvonand added a commit to Altinity/ClickHouse that referenced this pull request May 18, 2026
Antalya 26.3 Backport of ClickHouse#100645 - Parse record_count and size_bytes fields from iceberg manifest file
il9ue pushed a commit to il9ue/ClickHouse that referenced this pull request May 20, 2026
…s_and_rows_count_to_iceberg_data_object

Parse record_count and size_bytes fields from iceberg manifest file
subkanthi pushed a commit to Altinity/ClickHouse that referenced this pull request May 26, 2026
…s_and_rows_count_to_iceberg_data_object

Parse record_count and size_bytes fields from iceberg manifest file
subkanthi pushed a commit to Altinity/ClickHouse that referenced this pull request May 26, 2026
Antalya 26.3 Backport of ClickHouse#100645 - Parse record_count and size_bytes fields from iceberg manifest file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-improvement Pull request with some product improvements pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants