Function mz_storage::decode::render_decode_delimited
source ยท pub fn render_decode_delimited<G: Scope, FromTime: Timestamp>(
input: &Collection<G, SourceOutput<FromTime>, Diff>,
key_encoding: Option<DataEncoding>,
value_encoding: DataEncoding,
debug_name: String,
metrics: DecodeMetricDefs,
storage_configuration: StorageConfiguration,
) -> (Collection<G, DecodeResult<FromTime>, Diff>, Stream<G, HealthStatusMessage>)
Expand description
Decode already delimited records of data.
Precondition: each record in the stream has at most one key and at most one value. This function is useful mainly for decoding data from systems like Kafka, that have already separated the stream into records/messages/etc. before we decode them.
Because we expect the upstream connection to have already delimited the data, we return an error here if the decoder does not consume all the bytes. This often lets us, for example, detect when Avro decoding has gone off the rails (which is not always possible otherwise, since often gibberish strings can be interpreted as Avro, so the only signal is how many bytes you managed to decode).