Skip to content

fix: Reject replacement dictionaries in IPC files - #558

Open
Sealdot wants to merge 1 commit into
apache:mainfrom
Sealdot:fix-ipc-file-dictionary-replacement-538
Open

Sealdot wants to merge 1 commit into
apache:mainfrom
Sealdot:fix-ipc-file-dictionary-replacement-538

Conversation

@Sealdot

@Sealdot Sealdot commented Dec 1, 2026

Copy link
Copy Markdown

Closes #538.

A file with two full dictionary batches for the same ID could silently change a column from ["a", "b", "c"] to ["c", null, null]. The synchronous and asynchronous file readers now track the IDs of full dictionary batches in the file footer. A duplicate closes the partially opened reader and raises an error with the dictionary ID before its body is read.

The regression tests cover bytes, a Node file handle, and a valid file with multiple dictionary IDs and a prepopulated dictionary map. An independent wire-level comparison changed a single flag byte and reproduced the original wrong values through both entry points. File deltas and stream dictionary replacements still round-trip their original values. IPC file format

All 2,824 IPC tests across 18 suites passed, along with the ESNext ESM source typecheck and ESLint on the two changed files. The full local Jest run reached its 640 MiB Node heap limit. With the local test dependencies, the optional test-source typecheck produced the same diagnostics on the base and this change.

OpenAI Codex (GPT-6) assisted with the implementation, tests and wire-level comparison.

Track the initial dictionary IDs in the current file footer for both byte and file-handle readers. Reject a duplicate before consuming its body and close the partially opened reader. Keep delta batches and IPC streams on their existing paths.

Generated-by: OpenAI Codex (GPT-6)
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 file reader accepts two non-delta DictionaryBatches for one id, and the column values change with no error

1 participant