Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Table.toReadStreams

Table.toReadStreams([targetCount, { variables }]) → Promise<ReadStream[]>

Splits the table into multiple ReadStreams, each of which can be read independently (and concurrently) with the same to* methods. This is useful for distributing a large read across multiple consumers.

Also callable on Queries and Uploads → query.toReadStreams(...) | upload.toReadStreams(...)

const streams = await table.toReadStreams(4);
const arrowTables = await Promise.all(streams.map((stream) => stream.toArrowTable()));

Parameters:

targetCount : number, default the number of CPU cores, up to 8 The number of streams to request. The server may return fewer streams, depending on the size of the table.

variables : string[], optional A list of variable names to read, as in toArrowBatchIterator().

Returns: Promise<ReadStream[]>

Was this helpful?