Umer-Butt07 opened a new pull request, #553: URL: https://github.com/apache/arrow-js/pull/553
## What's Changed The stream reader ignored messages whose header type is not Schema, DictionaryBatch or RecordBatch (for example Tensor), but did not read their bodies. The next read started inside the body, so the body was parsed as the following messages: the repro in #546 returns rows that are only present inside a Tensor message's body. `RecordBatchStreamReaderImpl.next()` and `AsyncRecordBatchStreamReaderImpl.next()` now throw an error naming the header type when they read any other message type, as the stream format only holds those three. Arrow C++ and Rust also reject these messages in a stream. Tests: added `test/unit/ipc/reader/unexpected-message-tests.ts`, which inserts a Tensor message whose body is a complete RecordBatch message between the Schema and RecordBatch of a valid stream, and checks that `tableFromIPC`, the sync reader and the async reader throw. It fails on main and passes with this change. - `npx jest -c jest.config.js test/unit/ipc/reader/unexpected-message-tests.ts`: 3 passed - `npx jest -c jest.config.js`: 52 suites, 7094 tests passed - `npx eslint src test`: passed Closes #546. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
