Skip to content

Support other formats (ORC, ...) in iceberg writes - #87277

Merged
scanhex12 merged 4 commits into
ClickHouse:masterfrom
scanhex12:orc_writes_iceberg
Sep 18, 2025
Merged

scanhex12 merged 4 commits into
ClickHouse:masterfrom
scanhex12:orc_writes_iceberg

Conversation

@scanhex12

@scanhex12 scanhex12 commented Sep 18, 2025 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Improvement

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

Support other formats (ORC, Avro) in iceberg writes. This closes #86179

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

@clickhouse-gh

clickhouse-gh Bot commented Sep 18, 2025 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [40a7638]

Summary: ❌

job_name test_name status info comment
AST fuzzer (amd_debug) failure
Let op! FAIL

@clickhouse-gh clickhouse-gh Bot added the pr-improvement Pull request with some product improvements label Sep 18, 2025
@kssenii kssenii self-assigned this Sep 18, 2025
@@ -268,6 +275,7 @@ FileNamesGenerator & FileNamesGenerator::operator=(const FileNamesGenerator & ot
storage_dir = other.storage_dir;
use_uuid_in_metadata = other.use_uuid_in_metadata;
compression_method = other.compression_method;
format_name = other.format_name;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also for FileNamesGenerator::FileNamesGenerator(const FileNamesGenerator & other)?

@scanhex12
scanhex12 requested a review from kssenii September 18, 2025 12:27
@scanhex12
scanhex12 enabled auto-merge September 18, 2025 12:53
@divanik

divanik commented Sep 18, 2025

Copy link
Copy Markdown
Contributor
  1. Also change the PR's description to state all the newly supported formats
  2. Also we need to have a check that we are writing in a supported data format.
  3. Reflect in documentation all the supported data formats
  4. Add a test that checks that error is clear if we are trying to write in an unsupported format

@divanik divanik self-assigned this Sep 18, 2025
@scanhex12
scanhex12 requested a review from divanik September 18, 2025 13:24

@divanik divanik left a comment •

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.

All comments from the previous review should be either addressed or you should comment on why you think these changes are not necessary

@divanik

divanik commented Sep 18, 2025 •

Copy link
Copy Markdown
Contributor

I can say what is bothering me right now a bit more:
By this PR we are closing the issue: #86179
For me it is unclear from the tests if we indeed support the required formats by user, by Iceberg specification or did you fix only ORC case. If you name your PR as "support ORC format for Iceberg" for me current test is enough (only put the info to docs that we curerently support only Parquet or ORC), but this approach doesn't close the claimed issue.

@scanhex12

Copy link
Copy Markdown
Member Author

We don't have documentation yet and adding test with non-existing format seems really strange

@divanik

divanik commented Sep 18, 2025 •

Copy link
Copy Markdown
Contributor

Adding test with non-existing format seems really strange

Why, we test verbosity of CH this way (that error message is clearly understandable for a user)

We don't have documentation yet

#85953 - I think this PR should be easy to merge, or are there any problems I don't know about?

@scanhex12
scanhex12 added this pull request to the merge queue Sep 18, 2025
Merged via the queue into ClickHouse:master with commit a385a5a Sep 18, 2025
@scanhex12
scanhex12 deleted the orc_writes_iceberg branch September 18, 2025 22:04
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Sep 18, 2025
@clickgapai

Copy link
Copy Markdown
Contributor

Hi @scanhex12 @kssenii @divanik — while reviewing this PR I found the following:

Happy to discuss — close anything that's wrong or already addressed.

kavirajk pushed a commit to kavirajk/ClickHouse that referenced this pull request Jul 21, 2026
`ALTER TABLE ... DELETE` and `ALTER TABLE ... UPDATE` on Iceberg tables
whose data file format is not Parquet either aborted the server
(`Unexpected null _row_number` LOGICAL_ERROR on ORC) or silently corrupted
the table (Avro write succeeded but produced position-delete files that
the read path then rejected with `NOT_IMPLEMENTED`).

Mutations write position-delete files using the table's `write_format`.
The read side only accepts Parquet there
(`IcebergDataObjectInfo::addPositionDeleteObject`), and the ORC/Avro write
paths do not match that contract. PR ClickHouse#87277 (introducer) enabled
non-Parquet table formats in `FileNamesGenerator` without gating the
mutation paths.

Validate the format up front with a single helper
`Iceberg::validateMutationWriteFormat`. It is called from both
`IcebergMetadata::checkMutationIsPossible` (early rejection during
analysis) and `Iceberg::mutate` (defence in depth for any direct caller).
Parquet tables continue to work; `ALTER ... ADD/DROP/MODIFY/RENAME COLUMN`
are unaffected.

Closes ClickHouse#102508.
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
`ALTER TABLE ... DELETE` and `ALTER TABLE ... UPDATE` on Iceberg tables
whose data file format is not Parquet either aborted the server
(`Unexpected null _row_number` LOGICAL_ERROR on ORC) or silently corrupted
the table (Avro write succeeded but produced position-delete files that
the read path then rejected with `NOT_IMPLEMENTED`).

Mutations write position-delete files using the table's `write_format`.
The read side only accepts Parquet there
(`IcebergDataObjectInfo::addPositionDeleteObject`), and the ORC/Avro write
paths do not match that contract. PR ClickHouse#87277 (introducer) enabled
non-Parquet table formats in `FileNamesGenerator` without gating the
mutation paths.

Validate the format up front with a single helper
`Iceberg::validateMutationWriteFormat`. It is called from both
`IcebergMetadata::checkMutationIsPossible` (early rejection during
analysis) and `Iceberg::mutate` (defence in depth for any direct caller).
Parquet tables continue to work; `ALTER ... ADD/DROP/MODIFY/RENAME COLUMN`
are unaffected.

Closes ClickHouse#102508.
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.

Iceberg table format not respected on insert?

5 participants