Commits


ptaylor authored and Wes McKinney committed 17e0198253f
ARROW-5396: [JS] Support files and streams with no record batches Re: #3871, [ARROW-2119](https://issues.apache.org/jira/browse/ARROW-2119), and closes [ARROW-5396](https://issues.apache.org/jira/browse/ARROW-5396). This PR updates the JS Readers and Writers to support files and streams with no RecordBatches. The approach here is two-fold: 1. If the Readers' source message stream terminates after reading the Schema message, the Reader will yield a dummy zero-length RecordBatch with the schema. 2. The Writer always writes the schema for any RecordBatch, but skips writing the RecordBatch field metadata if it's empty. This is necessary because the reader and writer don't know about each other when they're communicating via the Node and DOM stream i/o primitives; they only know about the values pushed through the streams. Since the RecordBatchReader and Writer don't yield the Schema message as a standalone value, we pump the stream with a zero-length RecordBatch that contains the schema instead. Author: ptaylor <paul.e.taylor@me.com> Author: Wes McKinney <wesm+git@apache.org> Closes #4373 from trxcllnt/js/fix-no-record-batches and squashes the following commits: c86069634 <Wes McKinney> Run no-batches integration test for JS also 86d192d5b <ptaylor> define an _InternalEmptyRecordBatch class to signal that the reader source stream has no RecordBatches 193b08de5 <ptaylor> ensure reader and writer support the case where a stream or file has a schema but no recordbatches