Skip to content

fix: preserve list types for empty Parquet splits - #1040

Merged
wgtmac merged 1 commit into
apache:mainfrom
fairytale0828:fix/parquet-empty-split-schema
Oct 19, 2026
Merged

wgtmac merged 1 commit into
apache:mainfrom
fairytale0828:fix/parquet-empty-split-schema

Conversation

@fairytale0828

Copy link
Copy Markdown
Contributor

Summary

When a split selects no row groups, EmptyRecordBatchReader::schema() returns nullptr, causing output schema alignment to be skipped. Empty splits can then report list instead of large_list, ignoring the reader configuration or list types stored in ARROW:schema.

Remove EmptyRecordBatchReader and use GetRecordBatchReader for both empty and non-empty splits. This preserves schema consistency while still returning end-of-stream immediately for empty splits.

Test plan

  • Add five tests covering use-large-list enabled and disabled, stored list types, missing fields, nested field pruning and renaming, and projections without physical columns. Verify that empty-split schemas match the unsplit reader and the first Next() returns end-of-stream.
  • Four new tests fail without the fix; all five pass with it.

Use Arrow's record batch reader for empty splits so schema alignment preserves configured and stored list types. Add regression tests for empty-split schema consistency and end-of-stream behavior.

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

Thanks for fixing this!

@wgtmac
wgtmac merged commit e1633ad into apache:main Oct 19, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants