This is an automated email from the ASF dual-hosted git repository.
wesm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/master by this push:
new 098bd46 ARROW-3336: [JS] Fix IPC writer serializing sliced Utf8Vectors
098bd46 is described below
commit 098bd463b8b5db3a81023102cb6f212c792d626b
Author: ptaylor <[email protected]>
AuthorDate: Thu Oct 11 05:29:12 2018 -0400
ARROW-3336: [JS] Fix IPC writer serializing sliced Utf8Vectors
I just noticed this commit wasn't included in
https://github.com/apache/arrow/pull/2638 :-[. My bad, here's the rest of the
fix for ARROW-3336
Author: ptaylor <[email protected]>
Closes #2742 from trxcllnt/js-fix-writing-sliced-arrays and squashes the
following commits:
3ab9da080 <ptaylor> fix serializing sliced Utf8 vectors
---
js/src/ipc/writer/binary.ts | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/js/src/ipc/writer/binary.ts b/js/src/ipc/writer/binary.ts
index 015e747..8b5206a 100644
--- a/js/src/ipc/writer/binary.ts
+++ b/js/src/ipc/writer/binary.ts
@@ -263,7 +263,7 @@ export class RecordBatchSerializer extends VectorVisitor {
}
protected visitFlatListVector<T extends FlatListType>(vector: Vector<T>) {
const { data, length } = vector;
- const { offset, values, valueOffsets } = data;
+ const { values, valueOffsets } = data;
const firstOffset = valueOffsets[0];
const lastOffset = valueOffsets[length];
const byteLength = Math.min(lastOffset - firstOffset,
values.byteLength - firstOffset);
@@ -271,7 +271,7 @@ export class RecordBatchSerializer extends VectorVisitor {
// valueOffsets buffer first
this.addBuffer(this.getZeroBasedValueOffsets(0, length, valueOffsets));
// sliced values buffer second
- this.addBuffer(values.subarray(firstOffset + offset, firstOffset +
offset + byteLength));
+ this.addBuffer(values.subarray(firstOffset, firstOffset + byteLength));
return this;
}
protected visitListVector<T extends SingleNestedType>(vector: Vector<T>) {