Repository navigation
Release notes
This version adds Apache Arrow and Apache Parquet encoding to the dbn crate and CLI.
It also adds decoders and DBN, JSON, and CSV encoders for the in-development DBN
version 4.
DBN version 3 remains the default.
Enhancements
- Added Apache Arrow and Apache Parquet encoding support behind the
arrowand
parquetfeature flags, respectively- Added
ArrowEncoderandParquetEncoderwith builders for the batch size,
compression, andsymbolcolumn - Added
OutputEncodingenum, a superset ofEncodingwithArrowandParquet
variants.DynEncoderandDynEncoderBuilderaccept anyimpl Into<OutputEncoding>,
so passing anEncodingcontinues to work - Added
--arrow/-Aand--parquet/-Pflags to thedbnCLI, which also infers
the formats from.arrow,.feather, and.parquetoutput paths. These formats
reject--omit-header,--metadata, and fragment input - Added
Error::ArrowandError::Parquetvariants
- Added
- Added
DynEncoder::finish()to flush buffered records and finalize the output, which
surfaces errors that dropping the encoder would swallow, andSplitEncoder::finish()
to do the same for everyDynEncodersub-encoder - Added
SizeSplitterfor splitting encoded output into parts by size, which can be
nested in the other splitters - Improved the performance of
SymbolSplitterwith metadata containing many symbols - Added
decode::dbn::v4::Decoder,RecordDecoder,MetadataDecoder,AsyncDecoder,
AsyncRecordDecoder, andAsyncMetadataDecoderfor reading DBN version 4 streams - Added
UpgradeToV4andExpectV4variants toVersionUpgradePolicy. The version 4
decoders default toUpgradeToV4, which decodes version 1-3 input into version 4
records, andExpectV4returns an error for input older than version 4 - Added a record header type parameter to
DecodeRecordRef,DecodeRecord,
DecodeStream,DecodeDbn,AsyncDecodeRecordRef, andAsyncDecodeRecord,
defaulting to the version 3RecordHeader, and implemented them for the version 4
decoders.MergeDecoderandMergeRecordDecodercan merge version 4 decoders - Added
encode::dbn::v4::Encoder,RecordEncoder,AsyncEncoder, andAsyncRecordEncoder
for writing DBN version 4 streams - Added
encode::json::v4::Encoderfor encoding DBN version 4 records as JSON lines - Added
encode::csv::v4::Encoderfor encoding DBN version 4 records as CSV or TSV - Increased the maximum dataset code length in version 4 metadata to 37 characters
- Added a
versionparameter toschema_dispatch!for dispatching to the record types
of DBN versions 1 and 2 - Implemented
Debugfor the sync and async DBNDecoder,RecordDecoder, and
MetadataDecoder - Changed
Transcoderin the Python bindings to release the GIL while transcoding - Upgraded async-compression to 0.4.51
Breaking changes
- Added a
'staticbound to theDbnEncodabletrait. All DBN record types satisfy it,
but generic code that restates the trait's bounds needs to add'static - Changed
DynEncoderandDynEncoderBuilderto requireW: io::Write + Send
(previouslyW: io::Write). All standard writers (File,BufWriter,Vec<u8>)
satisfy this bound - The CSV
Encodernow returnsError::Encodewhenencode_recordand
encode_record_with_symare mismatched against the builder'swith_symbol
setting (previously, mismatches silently produced rows whose column count did
not match the header). Existing callers that always pairwith_symbol(true)with
encode_record_with_symandwith_symbol(false)withencode_recordare unaffected.
The same strictness applies to the new parquet and arrow encoders - Added required
into_sub_encoders()method to theSplittertrait, which consumes the
splitter and yields every active sub-encoder
Bug fixes
- Fixed legacy DBZ metadata decoding allocating memory for the symbol mapping count
before checking it against the input (credit: @Tyagiquamar) - Fixed legacy DBZ metadata decoding allocating memory for the metadata length before
reading the metadata - Fixed the
requires-pythonmetadata ofdatabento_dbnwhich prevented installation on
Python 3.15