Skip to content

fix: encode empty FlatBuffer vectors as present - #80

Merged
jheer merged 1 commit into
uwdata:mainfrom
Query-farm:upstream/empty-vectors
Oct 22, 2026
Merged

jheer merged 1 commit into
uwdata:mainfrom
Query-farm:upstream/empty-vectors

Conversation

@rustyconover

Copy link
Copy Markdown
Contributor

Encoding a table with no fields currently omits Schema.fields. PyArrow rejects both IPC streams and files with Unexpected null field Schema.fields in flatbuffer-encoded metadata.

Encode empty arrays as present zero-length FlatBuffer vectors. Null and undefined inputs still omit optional vectors. The existing alignment and element-writing path handles zero elements without a separate encoder implementation.

Regression tests inspect field presence in the IPC schema and file footer, check vector alignment, preserve absent optional metadata, and round-trip empty schemas and empty structs through Flechette and Apache Arrow JS.

Validation:

  • 200 tests pass on Node 24 and 26; lint and bundle/declaration builds pass.
  • Five new regression cases fail against upstream before the fix.
  • PyArrow 24.0.0 rejects upstream's empty-schema output in both formats, then accepts and fully validates empty schemas and nullable empty structs after the fix.

@jheer
jheer merged commit 9f4005a into uwdata:main Oct 22, 2026
2 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