Skip to content

fix(parquet-source): recursively check the schema of nested data types #22301

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

Merged
merged 8 commits into from
Jun 20, 2025

Conversation

wcy-fdu
Copy link
Contributor

@wcy-fdu wcy-fdu commented Jun 20, 2025

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

What's changed and what's your intention?

The previous implementation only performed schema checks on the outermost layer of nested data types, which could lead to mismatches in the inner schema.
e.g struct<f1: Double, f2: Utf8> should not match rw_struct<f1: decimal, f2: Utf8>

This PR adds recursive validation for nested types and includes unit tests.

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.
  • I have checked the Release Timeline and Currently Supported Versions to determine which release branches I need to cherry-pick this PR into.

Documentation

  • My PR needs documentation updates.
Release note

@wcy-fdu wcy-fdu requested a review from chenzl25 June 20, 2025 05:53
@github-actions github-actions bot added the type/fix Type: Bug fix. Only for pull requests. label Jun 20, 2025
@wcy-fdu wcy-fdu requested a review from xiangjinwu June 20, 2025 05:53
@wcy-fdu
Copy link
Contributor Author

wcy-fdu commented Jun 20, 2025

This PR only adds schema checks. For user-defined columns, if they do not match the Parquet schema

  1. The column name cannot be found in the Parquet file;
  2. The column name matches but the data type is inconsistent),

a null value will currently be filled in. In the future, we may read the metadata of a Parquet file when creating a source/table to inform the user in advance about any schema mismatches.

@wcy-fdu wcy-fdu enabled auto-merge June 20, 2025 08:14
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 added this pull request to the merge queue Jun 20, 2025
@wcy-fdu wcy-fdu removed this pull request from the merge queue due to a manual request Jun 20, 2025
@wcy-fdu wcy-fdu enabled auto-merge June 20, 2025 14:26
@wcy-fdu wcy-fdu added this pull request to the merge queue Jun 20, 2025
Merged via the queue into main with commit 2f40095 Jun 20, 2025
29 of 30 checks passed
@wcy-fdu wcy-fdu deleted the wcy/parquet_schema_check branch June 20, 2025 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/fix Type: Bug fix. Only for pull requests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants