Skip to content

fix: Pass explicit length in Struct makeData calls#404

Open
rustyconover wants to merge 1 commit intoapache:mainfrom
Query-farm:fix/visitstruct-zero-children-length-default
Open

fix: Pass explicit length in Struct makeData calls#404
rustyconover wants to merge 1 commit intoapache:mainfrom
Query-farm:fix/visitstruct-zero-children-length-default

Conversation

@rustyconover
Copy link
Contributor

Summary

  • Pass length: data.length in setChildAt to preserve the batch's row count when constructing Struct data
  • Pass length: 0 explicitly in _InternalEmptyPlaceholderRecordBatch instead of relying on reduce-over-children fallback
  • Add tests for Struct makeData with empty children and setChildAt row count preservation

Closes #403

Test plan

  • makeData with empty children preserves explicit length
  • makeData with empty children and no length defaults to 0
  • setChildAt preserves numRows after column replacement
  • Full test suite passes (yarn test -t src)

🤖 Generated with Claude Code

In `setChildAt`, pass `length: data.length` to preserve the batch's row
count. In `_InternalEmptyPlaceholderRecordBatch`, pass `length: 0`
explicitly. Both call sites previously relied on reducing over children
to derive length, which silently defaults to 0 when children is empty.

Closes apache#403

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@rustyconover rustyconover force-pushed the fix/visitstruct-zero-children-length-default branch from a9e56d1 to 64a5428 Compare March 4, 2026 15:28
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.

makeData for Struct with empty children silently defaults length to 0

1 participant