#apache-arrow #parquet #arrow #apache #codec #generic #valu3

no-std valu3-parquet

Parquet and Arrow encoding and decoding for valu3

3 releases

0.4.5 Feb 10, 2024
0.4.4 Feb 10, 2024
0.4.3 Feb 10, 2024

#1027 in Encoding

Download history 9/week @ 2024-02-18 47/week @ 2024-02-25 3/week @ 2024-03-03 13/week @ 2024-03-10 39/week @ 2024-03-31 222/week @ 2024-04-14

261 downloads per month

MIT/Apache

190KB
4.5K SLoC

Valu3 Parquet

Apache Arrow Parquet Integration with Valu3

This library provides an integration layer between Apache Arrow's Parquet format and the valu3 library, facilitating seamless data manipulation and transformation between Parquet files and valu3's flexible Value structures. It offers convenient methods for working with tabular data, allowing for easy conversions and operations on datasets.

Docs and Notices

Use our github to stay up to date Valu3

License

This project is licensed under the Apache 2.0 or MIT License. See the LICENSE-APACHE or LICENSE-MIT file for more information.


lib.rs:

Apache Arrow Parquet Integration with Valu3

This library provides an integration layer between Apache Arrow's Parquet format and the valu3 library, facilitating seamless data manipulation and transformation between Parquet files and valu3's flexible Value structures. It offers convenient methods for working with tabular data, allowing for easy conversions and operations on datasets.

Features

  • prettytable: Enables pretty printing of tables using the prettytable crate.

Examples

Case 1

use valu3_parquet::Table;

let mut table = Table::new();
table.add("id", vec_value![1, 2, 3]);
table.add("name", vec_value!["Alice", "Bob", "Charlie"]);

assert_eq!(table.count_rows(), 3);

Case 2

use valu3_parquet::Table;

let mut table = Table::new();
table.add("id", vec_value![1, 2, 3]);
table.add("name", vec_value!["Alice", "Bob", "Charlie"]);
table.add("score", vec_value![85.0, 92.5, 78.3]);

// Access individual values
let name = table.get_value(1, 0).unwrap();

assert_eq!(name.to_string(), "Bob");

Case 3

use valu3_parquet::Table;

let mut table = Table::new();
table.add("id", vec_value![1, 2, 3]);
table.add("name", vec_value!["Alice", "Bob", "Charlie"]);
table.add("score", vec_value![85.0, 92.5, 78.3]);

// Convert table to Parquet file
table.to_parquet("data.parquet").expect("Failed to write Parquet file");

// Read Parquet file back into a table
let new_table = Table::from_parquet("data.parquet").expect("Failed to read Parquet file");

// Perform operations on the new table
assert_eq!(table.get_headers(), new_table.get_headers());
assert_eq!(table.get_cols(), new_table.get_cols());

Dependencies

~26–39MB
~742K SLoC