函数 builderThroughAsyncIterable

  • 将任意 JavaScript 值的 AsyncIterable 转换为 Arrow 向量序列遵循提供的 options 参数中定义的分块语义。

    此函数返回一个接受要转换的值的 AsyncIterable 的函数。调用时,此函数返回 Vector<T> 的 AsyncIterator。

    生成的 AsyncIterator<Vector<T>> 根据 options 参数中指定的 queueingStrategyhighWaterMark 生成向量。

    • 如果 queueingStrategy"count"(或省略),则一旦 Builder 的 length 达到或超过提供的 highWaterMarkAsyncIterator<Vector<T>> 将刷新底层的 Builder(并生成一个新的 Vector<T>)。
    • 如果 queueingStrategy"bytes",则一旦其 byteLength 达到或超过提供的 highWaterMarkAsyncIterator<Vector<T>> 将刷新底层的 Builder(并生成一个新的 Vector<T>)。

    类型参数

    参数

    • options: IterableBuilderOptions<T, TNull>

      一个属性对象,用于确定要创建的 Builder 和要使用的分块语义。

    返回 ThroughAsyncIterable<T, TNull>

    一个函数,它接受要写入的 JavaScript AsyncIterable 值,并根据 options 参数中定义的分块语义返回一个生成向量的 AsyncIterator