Skip to content

Improve Arrow Parquet writer to include UUID logical type - #100150

Merged
alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
ivanmantova:fix-arrow-parquet-builder
Mar 20, 2026
Merged

alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
ivanmantova:fix-arrow-parquet-builder

Conversation

@ivanmantova

@ivanmantova ivanmantova commented Mar 19, 2026 •

Copy link
Copy Markdown
Contributor

Closes #100119

Changelog category:

  • Improvement

Changelog entry:

Exporting UUIDs to Parquet via the Arrow encoder now includes the correct UUID type annotation, eliminating the need to manually cast FixedString(16) data when reading the files back into ClickHouse or other systems.

Motivation

When exporting to Parquet using the Arrow-based writer, UUID columns were previously written as raw FIXED_LEN_BYTE_ARRAY(16) without the logicalType.UUID annotation. This caused downstream systems (and ClickHouse's own Parquet reader) to infer the column as FixedString(16) rather than a proper UUID.

Ensures full data interoperability for UUIDs when exporting to Parquet via Arrow, so downstream tools read the type correctly out of the box without requiring manual schema hints.

Parameters

output_format_parquet_use_custom_encoder=0: Applies specifically when this setting is explicitly set to 0 (which routes Parquet generation through the Arrow subsystem). The native Parquet encoder (1, the default) is unaffected and already handles UUIDs correctly.

Version info

  • Merged into: 26.4.1.66

@ivanmantova
ivanmantova force-pushed the fix-arrow-parquet-builder branch from 47ac08b to ff8664c Compare March 19, 2026 23:49
@ivanmantova ivanmantova changed the title Fix Arrow Parquet writer missing UUID logical type Improve Arrow Parquet writer missing UUID logical type Mar 20, 2026
@ivanmantova ivanmantova changed the title Improve Arrow Parquet writer missing UUID logical type Improve Arrow Parquet writer to include UUID logical type Mar 20, 2026
@alexey-milovidov alexey-milovidov added the can be tested Allows running workflows for external contributors label Mar 20, 2026
@clickhouse-gh

clickhouse-gh Bot commented Mar 20, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [ff8664c]

Summary: ✅


AI Review

Summary

This PR updates Arrow-based UUID export by introducing Arrow UUID extension typing and a builder-safe conversion path (MakeBuilder on storage type + View to extension type), then adds a stateless regression test for Parquet round-trip type inference. I did not find any high-confidence correctness, safety, concurrency, or performance issues in the patch.

ClickHouse Rules

Item Status Notes
Deletion logging ➖
Serialization versioning ➖
Core-area scrutiny ✅
No test removal ✅
Experimental gate ➖
No magic constants ✅
Backward compatibility ✅
SettingsChangesHistory.cpp ➖
Safe rollout ✅
Compilation time ✅

Final Verdict

  • Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-improvement Pull request with some product improvements label Mar 20, 2026
@clickhouse-gh

clickhouse-gh Bot commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 83.80% 83.70% -0.10%
Functions 24.00% 24.00% +0.00%
Branches 76.40% 76.30% -0.10%

PR changed lines: PR changed-lines coverage: 92.00% (69/75, 0 noise lines excluded)
Diff coverage report
Uncovered code

@ivanmantova

Copy link
Copy Markdown
Contributor Author

Looks like the public CI is looking great, but the CH Inc sync check failed. Could a maintainer take a quick look? Let me know if it's related to the Arrow parquet writer UUID changes or not, and I'd be happy to push a fix if needed!

Thanks!

@alexey-milovidov alexey-milovidov left a comment

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.

Thanks for the quick fix!

@alexey-milovidov alexey-milovidov self-assigned this Mar 20, 2026
@alexey-milovidov
alexey-milovidov merged commit fb713c3 into ClickHouse:master Mar 20, 2026
319 of 322 checks passed
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-synced-to-cloud The PR is synced to the cloud repo label Mar 20, 2026
fm4v added a commit that referenced this pull request Mar 21, 2026
…tion

When a PR changes a C++ source file, tests that cover sibling files
(same directory, same functional domain) are now included as additional
candidates, ranked below direct hits (SIBLING_DIR_WIDTH=10000).

Problem solved: for PR #100150 (Arrow writer UUID fix), the 16 directly
selected tests all covered CHColumnToArrowColumn.cpp (the writer), but
32 additional tests cover ArrowColumnToCHColumn.cpp (the reader) which
lives in the same directory and is functionally related.  These tests
were missed because they don't call the writer directly.

Algorithm (new _query_sibling_dir_tests method):

1. Extract domain keywords from changed C++ source filenames using
   CamelCase word splitting, filtering out architectural/common words.
   E.g. CHColumnToArrowColumn.cpp → ["Arrow"]
       MergeTreeIndexConditionText.cpp → ["Index", "Text"]

2. With one keyword: LIKE '%Arrow%' (OR logic).
   With multiple: LIKE '%Index%' AND LIKE '%Text%' (AND logic avoids
   false matches on broad words like "Index" alone).

3. Inner query: find sibling files (same dir, keyword-filtered) that
   the PRIMARY tests already cover — these are files with a natural
   code relationship to the changed file.

4. Outer query: find tests covering those same sibling files that were
   NOT in the primary set — these tests exercise the same domain from
   a different entry point.

Results:
  PR #100150 (Arrow writer): 16 → 48 tests (+32 Arrow reader tests)
  PR #100224 (text index): 71 → 112 tests (+41 text/bloom index tests)
  No false positives added for unrelated PRs.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@alexbakharew alexbakharew added pr-bugfix Pull request with bugfix, not backported by default and removed pr-improvement Pull request with some product improvements labels Mar 24, 2026
zvonand added a commit to Altinity/ClickHouse that referenced this pull request May 21, 2026
Antalya 26.3 Backport of ClickHouse#99521, ClickHouse#100150 - Add Arrow and Parquet format support for UUID data type
subkanthi pushed a commit to Altinity/ClickHouse that referenced this pull request May 26, 2026
…et-builder

Improve Arrow Parquet writer to include UUID logical type
subkanthi pushed a commit to Altinity/ClickHouse that referenced this pull request May 26, 2026
Antalya 26.3 Backport of ClickHouse#99521, ClickHouse#100150 - Add Arrow and Parquet format support for UUID data type
il9ue pushed a commit to il9ue/ClickHouse that referenced this pull request Jun 1, 2026
…et-builder

Improve Arrow Parquet writer to include UUID logical type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors pr-bugfix Pull request with bugfix, not backported by default 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.

Arrow-based Parquet writer does not set UUID logical type in schema (output_format_parquet_use_custom_encoder=0)

4 participants