LazyFrame.forEachBatch

void forEachBatch(scope bool delegate(ref DataFrame) consumer, size_t batchSize = 65_536) @trusted

Consumes the deferred frame batch-by-batch without accumulating the output: each pulled batch (the row-wise prefix applied, the limit bound honored) is handed to consumer; returning false stops pulling (the early-exit rule). When nothing ever arrives, the consumer sees one empty schema-carrying batch (a sink still writes its header). Blocking plans materialise through collect() first - disclosed by streamMode() - and are then iterated in batchSize batches.

Parameters

consumerthe batch sink; false stops the pull
batchSizethe pull width (blocking-fallback iteration)

Throws

DataFrameException on batchSize < 1 or source errors

(in source order).