Skip to main content

Module table_sample

Module table_sample 

Source
Expand description

The sample as a step of the view: drawn into memory a chunk at a time, while the table shows the rows kept so far.

draw reads the rows crate::sampling would, but hands each chunk that is final when kept to SampleRows as it lands: a seeded run of one Parquet or IPC file, a batch of the head or of every row, and a batch’s share of a Bernoulli sample when the total is known. A reservoir (an unknown total) and an equal per value sample keep evicting rows until the end, so their rows arrive as one chunk when the read ends. Rows land in arrival order; SampleRows::in_source_order puts them in the order the source holds them once the draw ends.

Nothing is written to disk: saving a sample is export’s job.

Structs§

Drawn
What a draw read, beside the rows it kept.
Live
What a draw keeps its chunks in and how it says so.
MemoryCheck
The memory a draw is checked against, before it starts and as it runs.
SampleRows
The chunks a draw has kept, shared between its worker and the view that shows them. The data is held once: the view’s frame is built on these chunks.

Enums§

DrawPath
How a random sample of a stream was drawn: what makes the same seed draw the same rows again, so a view keeps it and a redraw takes it again.
Limit
Where the memory a draw may take is measured against.

Constants§

MEMORY_SETTING
The setting that caps a sample’s memory, as every message about it names it.

Functions§

available_memory
The memory available now, as the system (or the cgroup it runs in) says.
draw
Draw sample from lf, already cut to its scope, into live’s chunks.

Type Aliases§

MemoryProbe
Reads the memory available now, in bytes; None when the system will not say.