Skip to content

Do not treat missing Iceberg column metrics as NULL - #2527

Open
ianton-ru wants to merge 2 commits into
antalya-26.6from
bugfix/antalya-26.6/iceberg-partial-column-stats
Open

ianton-ru wants to merge 2 commits into
antalya-26.6from
bugfix/antalya-26.6/iceberg-partial-column-stats

Conversation

@ianton-ru

@ianton-ru ianton-ru commented Oct 9, 2026 •

Copy link
Copy Markdown

allow_experimental_iceberg_read_optimization replaced nullable columns absent from partial manifest statistics with constant NULL. Record every column from the file schema so only columns added after the file was written are skipped.

Solved #2525

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

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

Do not treat missing Iceberg column metrics as NULL

Documentation entry for user-facing changes

...

CI/CD Options

Exclude tests:

  • Fast test
  • Integration Tests
  • Stateless tests
  • Stateful tests
  • Unit tests
  • Performance tests
  • Aarch64 tests
  • All with ASAN
  • All with TSAN
  • All with MSAN
  • All with UBSAN
  • All with Coverage
  • All Regression
  • Disable CI Cache

Regression jobs to run:

  • Fast suites (mostly <1h)
  • Aggregate Functions (2h)
  • Alter (1.5h)
  • Benchmark (30m)
  • CAS (content-addressed storage; Antalya only)
  • ClickHouse Keeper (1h)
  • Iceberg (2h)
  • LDAP (1h)
  • OAuth (5m)
  • Parquet (1.5h)
  • RBAC (1.5h)
  • SSL Server (1h)
  • S3 (2h)
  • S3 Export (2h)
  • Swarms (30m)
  • Tiered Storage (2h)

`allow_experimental_iceberg_read_optimization` replaced nullable columns absent from partial manifest statistics with constant NULL. Record every column from the file schema so only columns added after the file was written are skipped.

Related: #2525
Co-authored-by: Cursor <cursoragent@cursor.com>
@ianton-ru

Copy link
Copy Markdown
Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T13:32:22.294450Z a97c462 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Workflow [PR], commit [92a9e65]

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: a97c46205b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ianton-ru
ianton-ru marked this pull request as ready for review October 9, 2026 13:41
@ianton-ru ianton-ru added antalya bugfix port-antalya PRs to be ported to all new Antalya releases antalya-26.6 labels Oct 9, 2026
/// Missing metrics do not mean the column is absent from the file. Record every column of the
/// file schema so the read optimization substitutes NULL only for columns added after the file
/// was written. `emplace` keeps the statistics already stored above.
if (schema_processor.hasClickhouseTableSchemaById(file_schema_id))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Should we add an option to log for missing column statistics for the table.column so that we can diagnose query perf issues easier?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This check is executed for each data file, so can produce a large number of log records when table has many files.
Make sense, but with debug or trace log level in my opinion.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Agreed, maybe a more useful trace to output though is that we want to filter on a column but stats are missing.

That could be a followup ticket if possible? Think of it as iceberg performance tracing highlighting where Ch cannot accelerate using a feature.

Partial manifest statistics are read from the data file. A debug message names that file and reports only the count of columns without metrics.

Co-authored-by: Cursor <cursoragent@cursor.com>

@mkmkme mkmkme left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, one minor question

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I wonder if that would've been better to have it a proper integration test since it requires a python helper

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

antalya antalya-26.6 bugfix port-antalya PRs to be ported to all new Antalya releases

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants