Skip to content

fix(arrow/csv): preserve first row during headerless inference - #1145

Merged
zeroshade merged 1 commit into
apache:mainfrom
fallintoplace:fix/csv-headerless-inference
Aug 11, 2026
Merged

fix(arrow/csv): preserve first row during headerless inference#1145
zeroshade merged 1 commit into
apache:mainfrom
fallintoplace:fix/csv-headerless-inference

Conversation

@fallintoplace

@fallintoplace fallintoplace commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

What

When schema inference runs with WithHeader(false), the first CSV record is consumed while generating f0, f1, and so on, but it is not sent through the builders. This patch keeps that record pending and replays it through the normal reader path.

Test

  • go test ./arrow/csv -run TestInferringSchemaWithoutHeaderPreservesFirstRow -count=1

@fallintoplace
fallintoplace marked this pull request as ready for review August 8, 2026 15:52

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

The headerless inference fix looks correct. The pending row is copied safely despite ReuseRecord, and it is replayed exactly once across single-row, chunked, and read-all modes.

I exercised the chunk modes, single-row and filtered-column cases, focused stress and race tests, the CSV package, and the full arrow/... subtree on head 2b3b88faca7e; all passed. CI is green.


This review was drafted by an AI-assisted tool and confirmed by an Apache Arrow Go maintainer. The maintainer approving this PR has read the findings and signed off. If something feels off, please reply on the PR and a maintainer will follow up.

More on how Apache Arrow Go handles maintainer review: CONTRIBUTING.md.

@zeroshade
zeroshade merged commit d8a1e7d into apache:main Aug 11, 2026
23 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