Skip to content

Commit f5166fe

Browse files
Isaac Brodskydomoritz
andcommitted
ARROW-16099: [JS] RecordBatches that are compressed should throw an error
While https://issues.apache.org/jira/browse/ARROW-8674 is not implemented, ArrowJS will silently provide corrupt (not uncompressed) data to applications when compressed files are passed in. This happens to be the default from Python, e.g. with `df.to_feather('my_file')`. Opening as a draft as I didn't find how to add a sample file for testing that this behaves as expected. I'd appreciate any pointers on which part of the test suite we can assert this behavior in. Closes apache#12718 from isaacbrodsky/js-recordbatch-compression-throw Lead-authored-by: Isaac Brodsky <isaac@unfolded.ai> Co-authored-by: Dominik Moritz <domoritz@gmail.com> Signed-off-by: Dominik Moritz <domoritz@gmail.com>
1 parent 33cb5bd commit f5166fe

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

js/src/ipc/metadata/message.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,9 @@ function decodeSchema(_schema: _Schema, dictionaries: Map<number, DataType> = ne
297297

298298
/** @ignore */
299299
function decodeRecordBatch(batch: _RecordBatch, version = MetadataVersion.V4) {
300+
if (batch.compression() !== null) {
301+
throw new Error('Record batch compression not implemented');
302+
}
300303
return new RecordBatch(batch.length(), decodeFieldNodes(batch), decodeBuffers(batch, version));
301304
}
302305

0 commit comments

Comments
 (0)