blkerby and wesm ARROW-3797: [Rust] BinaryArray::value_offset incorrect in offset case
Fixes a bug in BinaryArray::value_offset. Also added test cases to now cover this method as well as the BinaryArray::value_length method in the case where the underlying ArrayData has a nonzero offset.

Author: Brent Kerby <blkerby@gmail.com>

Closes #2971 from blkerby/BinaryArray_offset_fix and squashes the following commits:

fea0730 <Brent Kerby> Fix argument order in assert_eq in new test cases
8193a26 <Brent Kerby> Add test for BinaryArray::value_offset and value_length for offset case
31cc452 <Brent Kerby> Fix bug in BinaryArray::value_offset
Latest commit 1a00fe5 Nov 15, 2018

README.md

Native Rust implementation of Apache Arrow

Build Status Coverage Status

Status

This is a starting point for a native Rust implementation of Arrow.

The current code demonstrates arrays of primitive types and structs.

Creating an Array from a Vec

// create a memory-aligned Arrow array from an existing Vec
let array = PrimitiveArray::from(vec![1, 2, 3, 4, 5]);

println!("array contents: {:?}", array.iter().collect::<Vec<i32>>());

Run Examples

The examples folder shows how to construct some different types of Arrow arrays, including dynamic arrays created at runtime.

Examples can be run using the cargo run --example command. For example:

cargo run --example builders
cargo run --example dynamic_types

Run Tests

cargo test

Publishing to crates.io

An Arrow committer can publish this crate after an official project release has been made to crates.io using the following instructions.

Follow these instructions to create an account and login to crates.io before asking to be added as an owner of the arrow crate.

Checkout the tag for the version to be released. For example:

git checkout apache-arrow-0.11.0

If the Cargo.toml in this tag already contains version = "0.11.0" (as it should) then the crate can be published with the following command:

cargo publish

If the Cargo.toml does not have the correct version then it will be necessary to modify it manually. Since there is now a modified file locally that is not committed to github it will be necessary to use the following command.

cargo publish --allow-dirty