You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/11/20 12:03:48 UTC
[GitHub] [arrow-rs] alamb commented on a change in pull request #958: Adding Pretty Print Support For Fixed Size List
alamb commented on a change in pull request #958:
URL: https://github.com/apache/arrow-rs/pull/958#discussion_r753668334
##########
File path: arrow/src/util/pretty.rs
##########
@@ -263,6 +263,46 @@ mod tests {
Ok(())
}
+ #[test]
+ fn test_pretty_format_fixed_size_list() -> Result<()> {
+ // define a schema.
+ let field_type = DataType::FixedSizeList(
+ Box::new(Field::new("item", DataType::Int32, true)),
+ 3,
+ );
+ let schema = Arc::new(Schema::new(vec![Field::new("d1", field_type, true)]));
+
+ let keys_builder = Int32Array::builder(3);
+ let mut builder = FixedSizeListBuilder::new(keys_builder, 3);
+
+ builder.values().append_slice(&[1, 2, 3]).unwrap();
+ builder.append(true).unwrap();
+ builder.values().append_slice(&[4, 5, 6]).unwrap();
+ builder.append(true).unwrap();
+ builder.values().append_slice(&[7, 8, 9]).unwrap();
+ builder.append(true).unwrap();
Review comment:
Is there any chance you can add a NULL here as well (`append(false)`) to ensure a null entry is handled properly?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org