Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(parquet): handle nested data types correctly #20156

Merged
merged 6 commits into from
Jan 26, 2025

Conversation

wcy-fdu
Copy link
Contributor

@wcy-fdu wcy-fdu commented Jan 14, 2025

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

Here, there was a bug previously where the columns in the parquet file metadata returned the flattened columns, while parquet_to_arrow_schema.fields returned the un flattened schema. Therefore, when the parquet file contains nested columns, such as Structs, their lengths differ, which can lead to an index out of bound panic.

This PR fixes the issue by not performing column trimming for parquet files that contain nested columns, and replaces the previous method of finding data types by index with a method that find them up by name.

Checklist

  • I have written necessary rustdoc comments.
  • I have added necessary unit tests and integration tests.
  • I have added test labels as necessary.
  • I have added fuzzing tests or opened an issue to track them.
  • My PR contains breaking changes.
  • My PR changes performance-critical code, so I will run (micro) benchmarks and present the results.
  • My PR contains critical fixes that are necessary to be merged into the latest release.

Documentation

  • My PR needs documentation updates.
Release note

@github-actions github-actions bot added the type/fix Bug fix label Jan 14, 2025
@BugenZhao BugenZhao changed the title fix(connector): handle nested data types correctly fix(parquet): handle nested data types correctly Jan 15, 2025
@wcy-fdu
Copy link
Contributor Author

wcy-fdu commented Jan 22, 2025

@hzxa21 @chenzl25 PTAL❤️
Users are waiting for this fix.

Copy link
Collaborator

@hzxa21 hzxa21 left a comment

Choose a reason for hiding this comment

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

Generally LGTM. @chenzl25 PTAL

Copy link

gru-agent bot commented Jan 26, 2025

This pull request has been modified. If you want me to regenerate unit test for any of the files related, please find the file in "Files Changed" tab and add a comment @gru-agent. (The github "Comment on this file" feature is in the upper right corner of each file in "Files Changed" tab.)

Copy link
Contributor

@chenzl25 chenzl25 left a comment

Choose a reason for hiding this comment

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

LGTM

@wcy-fdu wcy-fdu enabled auto-merge January 26, 2025 09:55
@wcy-fdu wcy-fdu added this pull request to the merge queue Jan 26, 2025
Merged via the queue into main with commit 1384d45 Jan 26, 2025
29 of 30 checks passed
@wcy-fdu wcy-fdu deleted the wcy/fix_parquet_nested_data_type.pr branch January 26, 2025 10:41
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.

3 participants