Skip to content

GH-35692: [C++][Parquet] Support to read fixed size list array with nulls - #50271

Merged
wgtmac merged 5 commits into
apache:mainfrom
HuaHuaY:nested_fixed_size_list_reader
Jul 28, 2026
Merged

GH-35692: [C++][Parquet] Support to read fixed size list array with nulls#50271
wgtmac merged 5 commits into
apache:mainfrom
HuaHuaY:nested_fixed_size_list_reader

Conversation

@HuaHuaY

@HuaHuaY HuaHuaY commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Rationale for this change

Support to read fixed size list array with nulls.

What changes are included in this PR?

Modified FixedSizeListReader to add null slots to FixedSizeList.

Are these changes tested?

Yes.

Are there any user-facing changes?

User can read fixed size list array with nulls now.

This PR also fixes GH-35697.

Comment thread cpp/src/parquet/arrow/reader.cc Outdated
int32_t expected_size) -> Status {
std::span<const int32_t> run_offsets(offsets + start,
static_cast<size_t>(length + 1));
const auto first_invalid_offset = std::ranges::adjacent_find(

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.

I'm not sure C++20 ranges are available on all our CI platforms unfortunately (some of them require old compilers).

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.

It looks like there are no compilation errors in the CI pipelines which are already run.

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.

Let me enable the more annoying ones :)

@HuaHuaY HuaHuaY Jul 9, 2026

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.

The new CI tests have also been compiled, so I haven't changed the code yet.

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.

@thisisnic Do you remember how to launch the R builds with the most outdated compilers? :)

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.

Not off the top of my head, but there should be a recent-ish PR which fixed the last ones that broke it, and will have the CI job being run on it in the comments.

Comment thread cpp/src/parquet/arrow/reader.cc Outdated
Comment thread cpp/src/parquet/arrow/reader.cc Outdated
@pitrou

pitrou commented Jul 8, 2026

Copy link
Copy Markdown
Member

@rok FYI :)

@github-actions github-actions Bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Jul 8, 2026
@pitrou pitrou added the CI: Extra: R Run extra R CI label Jul 8, 2026
@HuaHuaY
HuaHuaY force-pushed the nested_fixed_size_list_reader branch from 915c757 to 2fc0d49 Compare July 9, 2026 09:42
@github-actions github-actions Bot added awaiting changes Awaiting changes and removed awaiting committer review Awaiting committer review labels Jul 13, 2026
Comment thread cpp/src/parquet/arrow/reader.cc Outdated
return Status::OK();
}
child_arrays.push_back(
::arrow::MakeArray(data->child_data[0]->Slice(offsets[start], child_length)));

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.

Could we avoid creating one Array per validity run? This could become expensive for wide fixed-size lists. Is it possible to use a single builder using AppendArraySlice() and AppendNulls() instead?

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.

I don't think this is a good idea. First, the array is created via Slice, and the actual data isn't copied. Second, Concatenate handles different array types automatically, whereas doing it manually would be too much of a hassle.

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.

My concern is the per-run object/allocation overhead rather than copying each valid slice: an alternating validity bitmap still creates O(number of runs) Array/ArrayData objects and O(number of null runs) null arrays before the final concatenation.

But I agree that my suggestion requires a lot of changes to handle different child types. I'm fine to keep it as-is by adding a TODO comment for a future improvement?

@HuaHuaY HuaHuaY Jul 22, 2026

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.

I have added a TODO comment in the latest commit.

@wgtmac

wgtmac commented Jul 21, 2026

Copy link
Copy Markdown
Member

Codex reminded me that code below is outdated after this fix and it seems that level_info.null_slot_usage is useless anymore.

if (output->null_count > 0 && level_info.null_slot_usage > 1) {
throw ParquetException(
"Null values with null_slot_usage > 1 not supported."
"(i.e. FixedSizeLists with null values are not supported)");
}

@HuaHuaY
HuaHuaY force-pushed the nested_fixed_size_list_reader branch from 2fc0d49 to c5cadcf Compare July 21, 2026 11:00
@github-actions github-actions Bot added awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Jul 21, 2026
@HuaHuaY

HuaHuaY commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

Codex reminded me that code below is outdated after this fix and it seems that level_info.null_slot_usage is useless anymore.

This requires modifying the public methods in cpp/src/parquet/level_conversion.h, and I prefer opening a new pull request to address it.

@pitrou

pitrou commented Jul 22, 2026

Copy link
Copy Markdown
Member

@HuaHuaY Are you waiting for another review here?

@HuaHuaY

HuaHuaY commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

@HuaHuaY Are you waiting for another review here?

If there are no new comments, I think this PR is ok to be merged.

@HuaHuaY
HuaHuaY force-pushed the nested_fixed_size_list_reader branch from c5cadcf to 3840ffc Compare July 22, 2026 16:09
Comment thread cpp/src/parquet/arrow/arrow_reader_writer_test.cc Outdated

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

+1

@wgtmac

wgtmac commented Jul 27, 2026

Copy link
Copy Markdown
Member

I'll merge this tomorrow if no objection.

@thisisnic

Copy link
Copy Markdown
Member

@github-actions crossbow submit -g r

@thisisnic

Copy link
Copy Markdown
Member

I'll merge this tomorrow if no objection.

I've triggered the R builds just to make sure we don't have potential failures suggested in #50271 (comment)

@HuaHuaY

HuaHuaY commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

I'll merge this tomorrow if no objection.

I've triggered the R builds just to make sure we don't have potential failures suggested in #50271 (comment)

It seems that no extra ci starts. I might be because @pitrou has added "CI: Extra R". R's CI has already been run.

@github-actions

Copy link
Copy Markdown

Revision: 06266f9

Submitted crossbow builds: ursacomputing/crossbow @ actions-d711fbc610

Task Status
r-binary-packages GitHub Actions
r-recheck-most GitHub Actions
test-r-alpine-linux-cran GitHub Actions
test-r-arrow-backwards-compatibility GitHub Actions
test-r-depsource-system GitHub Actions
test-r-dev-duckdb GitHub Actions
test-r-devdocs GitHub Actions
test-r-extra-packages GitHub Actions
test-r-fedora-clang GitHub Actions
test-r-gcc-11 GitHub Actions
test-r-gcc-12 GitHub Actions
test-r-install-local GitHub Actions
test-r-install-local-minsizerel GitHub Actions
test-r-linux-as-cran GitHub Actions
test-r-linux-rchk GitHub Actions
test-r-linux-sanitizers GitHub Actions
test-r-linux-valgrind GitHub Actions
test-r-m1-san GitHub Actions
test-r-macos-as-cran GitHub Actions
test-r-offline-maximal GitHub Actions
test-r-ubuntu-22.04 GitHub Actions
test-r-versions GitHub Actions
test-r-wasm GitHub Actions

@HuaHuaY

HuaHuaY commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

Oh. Extra CI starts. It just takes a little while to start up.

@HuaHuaY

HuaHuaY commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

The additional CI run revealed an issue. Arrow recently introduced simdjson but hasn't updated this CI configuration yet. https://github.com/ursacomputing/crossbow/actions/runs/30279773748/job/90022897470

@HuaHuaY

HuaHuaY commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

I think these failures are unrelated to this PR. To be sure, I'll rebase and run it again.

@HuaHuaY
HuaHuaY force-pushed the nested_fixed_size_list_reader branch from 06266f9 to 6b0bd58 Compare July 28, 2026 02:47
@HuaHuaY

HuaHuaY commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

@github-actions crossbow submit -g r

@github-actions

Copy link
Copy Markdown
Only contributors can submit requests to this bot. Please ask someone from the community for help with getting the first commit in.
The Archery job run can be found at: https://github.com/apache/arrow/actions/runs/30324136965

@wgtmac

wgtmac commented Jul 28, 2026

Copy link
Copy Markdown
Member

@github-actions crossbow submit -g r

@github-actions

Copy link
Copy Markdown

Revision: 6b0bd58

Submitted crossbow builds: ursacomputing/crossbow @ actions-523da37569

Task Status
r-binary-packages GitHub Actions
r-recheck-most GitHub Actions
test-r-alpine-linux-cran GitHub Actions
test-r-arrow-backwards-compatibility GitHub Actions
test-r-depsource-system GitHub Actions
test-r-dev-duckdb GitHub Actions
test-r-devdocs GitHub Actions
test-r-extra-packages GitHub Actions
test-r-fedora-clang GitHub Actions
test-r-gcc-11 GitHub Actions
test-r-gcc-12 GitHub Actions
test-r-install-local GitHub Actions
test-r-install-local-minsizerel GitHub Actions
test-r-linux-as-cran GitHub Actions
test-r-linux-rchk GitHub Actions
test-r-linux-sanitizers GitHub Actions
test-r-linux-valgrind GitHub Actions
test-r-m1-san GitHub Actions
test-r-macos-as-cran GitHub Actions
test-r-offline-maximal GitHub Actions
test-r-ubuntu-22.04 GitHub Actions
test-r-versions GitHub Actions
test-r-wasm GitHub Actions

@wgtmac

wgtmac commented Jul 28, 2026

Copy link
Copy Markdown
Member

I've checked that all CI failures are unrelated.

@wgtmac
wgtmac merged commit 5e698fe into apache:main Jul 28, 2026
57 of 61 checks passed
@wgtmac wgtmac removed the awaiting change review Awaiting change review label Jul 28, 2026
@HuaHuaY
HuaHuaY deleted the nested_fixed_size_list_reader branch July 28, 2026 03:56
@conbench-apache-arrow

Copy link
Copy Markdown

After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 5e698fe.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 4 possible false positives for unstable benchmarks that are known to sometimes produce them.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[C++][Parquet] NotImplemented: Lists with non-zero length null components are not supported

4 participants