Skip to content

[WIP] A pure rust implementation of the Avro Specification

Notifications You must be signed in to change notification settings

AtherEnergy/ravro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ravro - A pure rust implementation of the Avro Spec. [WIP]

NOTE:[Deprecated. This is undergoing a major rewrite with Serde support]

Build Status

Implementation Status:

  • Binary Encoding

  • Json Encoding

  • Writer interface

    • Primitives - null, boolean, int, long, float, byte, double, string
    • Complex - Records (support recursive types in its fields is in the works), Enums, Arrays, Maps. TODO(unions, fixed)
  • Supported codecs: null, deflate, snappy are all supported.

  • Reader interface (Implementation is on hold until Writer API and performance stability.)

  • RPC related implementations.

Getting Started

Add the following dependency to your Cargo manifest...

[dependencies]
ravro = { git = "https://github.com/AtherEnergy/ravro" }

Examples

// test example taken from `/tests/primitive.rs`
let schema_file = "tests/schemas/bool_schema.avsc";
let bool_schema = AvroSchema::from_file(schema_file).unwrap();
let datafile_name = "tests/encoded/bool_encoded.avro";
let mut data_writer = DataWriter::new(bool_schema, Codec::Deflate).unwrap();
let _ = data_writer.write(true);
let _ = data_writer.write(false);
let avro_encoded_buffer: Vec<u8> = data_writer.take_datafile().unwrap();
// `avro_encoded_buffer` can now be write to file or streamed over RPC

Running tests

We currently use avro-tools.jar to get .avro data output and assert against it. This is until we implement decoding of .avro files. So the tool needs to be downloaded for tests to run. To install the tool issue: ./install_test_util.sh and then run:

cargo test to run the test suite.

License

ravro is licensed under the terms of the MIT License or the Apache License 2.0, at your choosing.

Code of Conduct

Contribution to the ravro crate is organized under the terms of the Contributor Covenant, the maintainer of ravro, @creativcoder, promises to intervene to uphold that code of conduct.

About

[WIP] A pure rust implementation of the Avro Specification

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published