trxcllnt commented on code in PR #320:
URL: https://github.com/apache/arrow-js/pull/320#discussion_r2487736866
##########
src/data.ts:
##########
@@ -117,7 +123,16 @@ export class Data<T extends DataType = DataType> {
return nullCount;
}
- constructor(type: T, offset: number, length: number, nullCount?: number,
buffers?: Partial<Buffers<T>> | Data<T>, children: Data[] = [], dictionary?:
Vector) {
+ constructor(
+ type: T,
+ offset: number,
+ length: number,
+ nullCount?: number,
+ buffers?: Partial<Buffers<T>> | Data<T>,
+ children: Data[] = [],
+ dictionary?: Vector,
+ variadicBuffers: ReadonlyArray<Uint8Array> = []
Review Comment:
I had the same thought. The `Buffers<T>` type is the type-safe map of the
buffer layout for each Arrow type, but it doesn't lend itself to representing a
variable number of data buffers like we have here. We _could_ define a 5th
index, but then `Buffers<T>` isn't a map from `[BufferType] => Buffer`, which
doesn't feel right.
I'm fine with it as-is, or if we want to implement a (rust-style) Builder
pattern for Data. The idea of introducing a new `DataLayout<T>` for each
`Data<T>` feels like overkill to me, but I could be persuaded otherwise.
--
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]