Thalweg · API reference ← Main docs

Crate twg_proto_decode

Crate twg_proto_decode 

Source

Enums§

ProtoDecodeError

Functions§

decode_to_json
Decodes one protobuf-encoded message to the FLAT top-level JSON shape (matching twg-proto-schema’s derived “source” columns): lowercase, underscore-joined names up to flatten_depth, with container columns (repeated fields, or nesting beyond flatten_depth) holding fully recursively-decoded, verbatim-cased JSON.
decode_to_record_batch
Decodes one message straight to a single-row RecordBatch: the schema comes from twg_proto_schema::build_arrow_schema (so it’s guaranteed consistent with whatever the validator/schema side computed), and every column whose type is List/Struct/Map gets a genuine native Arrow array via json_to_native_array; everything else is the scalar JSON value, stringified for Utf8 columns exactly like the JSON path.