Understand the AsyncBuffer abstraction
masterHyparquet operates on an AsyncBuffer rather than a standard ArrayBuffer. An AsyncBuffer is an interface that allows the slice method to return a Promise<ArrayBuffer>, enabling efficient asynchronous fetching of remote files via HTTP range requests.
type Awaitable<T> = T | Promise<T>
interface AsyncBuffer {
byteLength: number
slice(start: number, end?: number): Awaitable<ArrayBuffer>
}Common ways to create an AsyncBuffer:
asyncBufferFromUrl({ url, requestInit, byteLength }): For remote HTTP files. UserequestInitfor auth headers andbyteLengthto avoid an extra HEAD request.asyncBufferFromFile(path): For local files in Node.js.ArrayBuffer: You can pass a standardArrayBufferdirectly where anAsyncBufferis expected.