Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
Added support for exporting metadata via FFI.
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgecarleitao committed Sep 1, 2021
1 parent 3d7cc31 commit 19fa845
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/it/ffi.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use arrow2::array::*;
use arrow2::datatypes::{DataType, Field, TimeUnit};
use arrow2::{error::Result, ffi};
use std::collections::BTreeMap;
use std::sync::Arc;

fn test_round_trip(expected: impl Array + Clone + 'static) -> Result<()> {
Expand Down Expand Up @@ -163,5 +164,11 @@ fn schema() -> Result<()> {
DataType::Dictionary(Box::new(DataType::UInt32), Box::new(DataType::Utf8)),
true,
);
test_round_trip_schema(field)?;

let field = Field::new("a", DataType::Int32, true);
let mut metadata = BTreeMap::new();
metadata.insert("some".to_string(), "stuff".to_string());
let field = field.with_metadata(metadata);
test_round_trip_schema(field)
}

0 comments on commit 19fa845

Please sign in to comment.