Skip to content

fix: Detect replacements after the first IPC dictionary chunk - #550

Open
Grivn wants to merge 1 commit into
apache:mainfrom
Grivn:fix/ipc-dictionary-chunk-prefix
Open

Grivn wants to merge 1 commit into
apache:mainfrom
Grivn:fix/ipc-dictionary-chunk-prefix

Conversation

@Grivn

@Grivn Grivn commented Nov 28, 2026

Copy link
Copy Markdown

What's Changed

Two record batches can reuse their first dictionary chunk and have different values in a later chunk. The IPC writer checked only the first chunk, so reading the second batch could return a value from the first batch.

The writer now treats a dictionary as an extension only when all the previous chunks form a prefix. Streams emit a replacement when that prefix changes. Files report the existing unsupported-replacement error. Reusing the same chunk array still skips the scan.

Added a regression for both formats. Verified with npm run build, npm test, npm run test:bundle and npm run lint:ci on Node 24. PyArrow also read the expected values from seven streams covering dictionary reuse, append, replacement, truncation and reordering.

OpenAI Codex (GPT-6) generated the code and tests and ran these checks.

Closes #537.

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.

The IPC writer writes no new dictionary when two batches share the first dictionary chunk, and the second batch reads back wrong

1 participant