ump45nose opened a new pull request, #514:
URL: https://github.com/apache/arrow-js/pull/514

   ## What's Changed
   
   An Arrow IPC file is supposed to contain a complete IPC stream after the 
leading `ARROW1` magic and padding, so that a reader can skip the magic and 
read the rest with a plain stream reader. `RecordBatchFileWriter` overrode 
`_writeSchema` to only write the magic and padding, so the Schema message never 
made it into the file body. The schema was only in the footer, and a 
stream-only reader could not read files written by arrow-js (this is what the 
embedded-stream validation from apache/arrow#43834 tripped on).
   
   `RecordBatchFileWriter._writeSchema` now writes the magic and padding and 
then calls the base implementation to write the Schema message. Dictionary and 
record batch blocks are still recorded at their real offsets, so the footer 
stays correct and the file reader is unaffected.
   
   Tests: added a case to `file-writer-tests.ts` that writes a file (one table 
with all generated types, one with dictionaries), strips the 8-byte header and 
reads the rest with `RecordBatchStreamReader`, checking the result equals the 
source. Both cases fail without the change. `npx jest -c 
jestconfigs/jest.src.config.js test/unit` passes (7240 tests) and eslint is 
clean on the touched files.
   
   AI disclosure: I used an AI coding assistant to help find the cause, write 
the change and the test. I reviewed the diff and ran the tests myself.
   
   Closes #51.
   


-- 
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]

Reply via email to