Skip to content

Read Arrow ListView and LargeListView as Array - #126014

Merged
NIKTONIKTO717 merged 5 commits into
ClickHouse:masterfrom
JayPokale:arrow-list-view
Oct 20, 2026
Merged

NIKTONIKTO717 merged 5 commits into
ClickHouse:masterfrom
JayPokale:arrow-list-view

Conversation

@JayPokale

@JayPokale JayPokale commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Closes: #125144

The native Arrow IPC reader now reads ListView and LargeListView columns as Array, instead of failing with Native Arrow IPC reader does not support the Arrow type ListView.

A list view describes each row by an offset and a size into its child, and unlike List the ranges can come in any order and overlap. RecordBatchDecoder::readListViewAndChild:

  • checks every visible row's range against the child's declared length (a range outside it is INCORRECT_DATA), and builds the array offsets from the sizes; a null row is an empty array, like a null List row;
  • marks the child rows that no visible row references as invisible (counted with a difference array for non-contiguous ranges), so their undefined bytes are not validated, and decodes the child with the list's element hint and list_depth + 1, like List;
  • uses the child as is when the ranges are already laid out like a List (one after another), and otherwise copies the ranges with insertRangeFrom;
  • builds only the referenced rows for a child determined by its size alone (the null type), like readOffsetsAndChild.

ListView and LargeListView are now ordinary type kinds: fieldToCHType maps them to Array, advanceField checks their offsets and sizes buffers (one value per row each) when skipping or validating, and collectDictionaryUses descends into them like List. The SkipLayout::ListView placeholder is removed; RunEndEncoded is still unsupported.

Tests:

  • 05402_arrow_list_view: Arrow and ArrowStream files written with pyarrow with out-of-order and overlapping ranges, a null row with a non-empty range, a LargeListView of strings, a list view nested in a list view, a dictionary-encoded child, and a child of the null type, with inferred and explicit structures.
  • 04345_native_arrow_ipc_skip_unsupported_column used list views as examples of a type that can be skipped but not read; requesting them now returns the arrays (RunEndEncoded is still rejected).

The documentation of the Arrow format lists LIST_VIEW as read into Array.

Changelog category (leave one):

  • Improvement

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

The Arrow and ArrowStream input formats can read the ListView and LargeListView types as Array.


Workflow [PR]
Sync PR [sync-upstream/pr/126014]

Version info

  • Merged into: 26.11.1.362-master (included in 26.11 and later)

@clickhouse-gh clickhouse-gh Bot added comp-formats Input/output formats (CSV/JSON/Parquet/ORC/Arrow/Protobuf/etc.). external Author is not a member of the ClickHouse organization labels Oct 15, 2026
@NIKTONIKTO717 NIKTONIKTO717 self-assigned this Oct 16, 2026
@NIKTONIKTO717 NIKTONIKTO717 added the can be tested Allows running workflows for external contributors label Oct 16, 2026
@clickhouse-gh

clickhouse-gh Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [788230b]

Summary: ✅


AI Review

Summary

PR #126014 adds ListView and LargeListView input support as Array in the native Arrow and ArrowStream readers, including overlapping ranges, nested values, dictionaries, and null rows. No unresolved findings remain in the current code; the four earlier review points are addressed.

Missing context / blind spots
  • ⚠️ The current head, 788230bc3d97c46d9be44a8df52aaf99697132b7, still has its targeted sanitizer job pending. 05402_arrow_list_view passed all 50 targeted ASan/UBSan runs on afabe7ae1af53a6b13578ad4c1c04633feea83e6 (CI report). A successful run on the current head would close this validation gap. No local build or test run was performed.
Final Verdict

Status: ✅ Approve. No code changes requested; normal CI completion remains pending.

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

@NIKTONIKTO717 NIKTONIKTO717 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.

Thank you @JayPokale for such a nice PR! I left a few comments, I'd appreciate if you let me know what you think about them.

AI comment: #125134 adds the test 05361_arrow_testing_corpus, whose .reference expects Error: CANNOT_EXTRACT_TABLE_STRUCTURE for generated_list_view.arrow_file and generated_list_view.stream. This PR makes both files readable. If #125134 is merged first, please update those two lines with the new output; otherwise they will be updated in #125134.

…ous ranges, name the column in errors, more tests
@JayPokale

Copy link
Copy Markdown
Contributor Author

Thank you for the review, all four points are addressed in 42d35c6. About #125134: if it's merged first, I'll update the two generated_list_view lines in 05361_arrow_testing_corpus.reference here with the new output.

The `mask` case of `05402_arrow_list_view` now goes through the contiguous shortcut, so add an out-of-order case that reaches the mask built by counting.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@NIKTONIKTO717 NIKTONIKTO717 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.

Thank you @JayPokale for such a wonderful PR!

@clickhouse-gh

clickhouse-gh Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing 788230bc3 with master 6cf960b3c (stripped binary size, per-symbol sizes and ThinLTO time; object sizes against the warmup build of 2a95d09f4; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes

programs/clickhouse-stripped: smaller than the master baseline by the known offset between the two builds, so the difference is not shown. A delta that differs from the offset by more than 50% of it is shown, in either direction.

The official master build is compiled with -g and a pull request build is not, and XRay counts debug instructions towards its instrumentation threshold, so master instruments thousands of functions more and its binary is ~0.4% larger no matter what the pull request does.

Object file sizes

6 object files changed (+25.57 KiB total), 2 added.

Object file Master PR Δ
src/CMakeFiles/dbms.dir/Processors/Formats/Impl/ArrowIPC/RecordBatchDecoder.cpp.o 596.16 KiB 614.54 KiB +18.38 KiB (+3.08%)

721 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only clickhouse-bundle) and not compared.

Compile time of recompiled translation units

11 translation units recompiled, 36 s compile time in total, 6 of them have a recent master baseline.

Translation units without a recent master baseline:

  • src/Processors/Formats/Impl/ArrowIPC/ArrowIPCBlockInputFormat.cpp: 10.1 s
  • src/Processors/Formats/Impl/ArrowIPC/ArrowIPCSchemaReader.cpp: 7.1 s
  • src/Processors/Formats/Impl/ArrowIPC/RecordBatchDecoder.cpp: 5.6 s

Job report

@NIKTONIKTO717
NIKTONIKTO717 added this pull request to the merge queue Oct 19, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 19, 2026
# Conflicts:
#	src/Processors/Formats/Impl/ArrowIPC/SchemaConverter.cpp
#	src/Processors/Formats/Impl/ArrowIPC/SchemaConverter.h
#	tests/queries/0_stateless/04345_native_arrow_ipc_skip_unsupported_column.sh
@NIKTONIKTO717
NIKTONIKTO717 added this pull request to the merge queue Oct 20, 2026
Merged via the queue into ClickHouse:master with commit 69553a3 Oct 20, 2026
179 checks passed
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 20, 2026
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 comp-formats Input/output formats (CSV/JSON/Parquet/ORC/Arrow/Protobuf/etc.). external Author is not a member of the ClickHouse organization 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.

Arrow: the ListView type is not supported

3 participants