From 25225bf5d3d88208be81a01a5558c54fd09f908d Mon Sep 17 00:00:00 2001 From: Liang-Chi Hsieh Date: Wed, 22 Nov 2023 20:00:27 +0800 Subject: [PATCH] Update existing test --- arrow-array/src/builder/struct_builder.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/arrow-array/src/builder/struct_builder.rs b/arrow-array/src/builder/struct_builder.rs index f67eb4e62a4a..06b8385b3164 100644 --- a/arrow-array/src/builder/struct_builder.rs +++ b/arrow-array/src/builder/struct_builder.rs @@ -511,13 +511,18 @@ mod tests { #[test] #[should_panic( - expected = "Data type List(Field { name: \"item\", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }) is not currently supported" + expected = "Data type Map(Field { name: \"entries\", data_type: Struct([Field { name: \"keys\", data_type: Int32, nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: \"values\", data_type: UInt32, nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} }]), nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} }, false) is not currently supported" )] fn test_struct_array_builder_from_schema_unsupported_type() { - let list_type = DataType::List(Arc::new(Field::new("item", DataType::Int64, true))); + let keys = Arc::new(Field::new("keys", DataType::Int32, false)); + let values = Arc::new(Field::new("values", DataType::UInt32, false)); + let struct_type = DataType::Struct(Fields::from(vec![keys, values])); + let map_data_type = + DataType::Map(Arc::new(Field::new("entries", struct_type, false)), false); + let fields = vec![ Field::new("f1", DataType::Int16, false), - Field::new("f2", list_type, false), + Field::new("f2", map_data_type, false), ]; let _ = StructBuilder::from_fields(fields, 5);