MCPcopy Create free account
hub / github.com/apache/datafusion / column_serializer_task

Function column_serializer_task

datafusion/datasource-parquet/src/sink.rs:418–430  ·  view source on GitHub ↗

Consumes a stream of [ArrowLeafColumn] via a channel and serializes them using an [ArrowColumnWriter] Once the channel is exhausted, returns the ArrowColumnWriter.

(
    mut rx: Receiver<ArrowLeafColumn>,
    mut writer: ArrowColumnWriter,
    reservation: MemoryReservation,
    encoding_time: Time,
)

Source from the content-addressed store, hash-verified

416/// Consumes a stream of [ArrowLeafColumn] via a channel and serializes them using an [ArrowColumnWriter]
417/// Once the channel is exhausted, returns the ArrowColumnWriter.
418async fn column_serializer_task(
419 mut rx: Receiver<ArrowLeafColumn>,
420 mut writer: ArrowColumnWriter,
421 reservation: MemoryReservation,
422 encoding_time: Time,
423) -> Result<(ArrowColumnWriter, MemoryReservation)> {
424 while let Some(col) = rx.recv().await {
425 let _timer = encoding_time.timer();
426 writer.write(&col)?;
427 reservation.try_resize(writer.memory_size())?;
428 }
429 Ok((writer, reservation))
430}
431
432type ColumnWriterTask = SpawnedTask<Result<(ArrowColumnWriter, MemoryReservation)>>;
433type ColSender = Sender<ArrowLeafColumn>;

Calls 5

recvMethod · 0.80
timerMethod · 0.80
try_resizeMethod · 0.80
writeMethod · 0.45
memory_sizeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…