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

Commit

Permalink
Added more tests (#1158)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgecarleitao committed Jul 12, 2022
1 parent 87b37ba commit 91e1ef7
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions tests/it/io/parquet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1394,3 +1394,38 @@ fn large_list_large_binary() -> Result<()> {
array.try_extend(data).unwrap();
list_array_generic(false, array.into())
}

#[test]
fn list_utf8_nullable() -> Result<()> {
let data = vec![
Some(vec![Some("a".to_string())]),
None,
Some(vec![None, Some("b".to_string())]),
Some(vec![]),
Some(vec![Some("c".to_string())]),
None,
];
let mut array =
MutableListArray::<i32, _>::new_with_field(MutableUtf8Array::<i32>::new(), "item", true);
array.try_extend(data).unwrap();
list_array_generic(true, array.into())
}

#[test]
fn list_int_nullable() -> Result<()> {
let data = vec![
Some(vec![Some(1)]),
None,
Some(vec![None, Some(2)]),
Some(vec![]),
Some(vec![Some(3)]),
None,
];
let mut array = MutableListArray::<i32, _>::new_with_field(
MutablePrimitiveArray::<i32>::new(),
"item",
true,
);
array.try_extend(data).unwrap();
list_array_generic(true, array.into())
}

0 comments on commit 91e1ef7

Please sign in to comment.