Copilot commented on code in PR #438:
URL: https://github.com/apache/arrow-js/pull/438#discussion_r3277990890
##########
src/visitor/jsonvectorassembler.ts:
##########
@@ -152,6 +153,12 @@ export class JSONVectorAssembler extends Visitor {
'children': this.visitMany(data.type.children, data.children)
};
}
+ public visitLargeList<T extends LargeList>(data: Data<T>) {
+ return {
+ 'OFFSET': [...bigNumsToStrings(data.valueOffsets, 2)],
Review Comment:
`visitLargeList()` serializes `data.valueOffsets` via `bigNumsToStrings()`,
but `bigNumsToStrings()` builds `new Uint32Array(values.buffer)` and ignores
`values.byteOffset/byteLength`. If `valueOffsets` is a subarray (e.g. from
`Vector/Data.slice()`), this will stringify the wrong 64-bit words and produce
an incorrect OFFSET array in JSON output. Update `bigNumsToStrings()` to
construct the `Uint32Array` view with `values.byteOffset` and a length derived
from `values.byteLength` (or pass a correctly sliced view in here) so sliced
vectors serialize correctly.
--
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]