pub fn unpack_raw_series(
source: DfSendableRecordBatchStream,
expected: Option<Arc<SeriesSchema>>,
) -> Result<SendableRawSeriesStream>Expand description
Unpacks DataFusion batches declared by pack_raw_series.
The frame is the sole source of decode information: the payload fields, the label mode, the
label decode description, and the producer ordering are all read from the stream’s own schema,
so unpacking a frame a producer wrote needs no local copy of its binding. Like packing, unpacking
accepts Interleaved only when every producer fragment chain closes before the next starts; it
rejects multiplexed open chains. Closed fragment chains may recur with the same key and overlapping
timestamps. Validation does not certify nonadjacent recurrence for Contiguous ordering.
Every frame is validated here, unconditionally. The declared layout must be this revision’s, the label decode description must parse, name a known version, and agree with the declared label mode - a key frame must declare one and an explicit frame must not, since explicit labels are already complete. The declared fields and the empty batch are then decoded once, so a stream that could not be decoded is rejected before it is returned.
A frame that declares evaluated content is refused here, before anything is read: a raw consumer reads timestamps rather than grid positions, so the two contents are not interchangeable.
expected is a check, never an input. When it is given it must name the same logical fields in
the same order and the same evaluation grid as the frame declares - which for a raw frame is that
both sides carry none - and a mismatch is an error. The decoder and the returned stream’s schema
are built from the frame either way, so a caller cannot supply a field layout the frame does not
declare.