MCPcopy Create free account
hub / github.com/apache/arrow-rs / test_map_decoding_empty

Function test_map_decoding_empty

arrow-avro/src/reader/record.rs:3279–3289  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3277
3278 #[test]
3279 fn test_map_decoding_empty() {
3280 let value_type = avro_from_codec(Codec::Utf8);
3281 let map_type = avro_from_codec(Codec::Map(Arc::new(value_type)));
3282 let mut decoder = Decoder::try_new(&map_type).unwrap();
3283 let data = encode_avro_long(0);
3284 decoder.decode(&mut AvroCursor::new(&data)).unwrap();
3285 let array = decoder.flush(None).unwrap();
3286 let map_arr = array.as_any().downcast_ref::<MapArray>().unwrap();
3287 assert_eq!(map_arr.len(), 1);
3288 assert_eq!(map_arr.value_length(0), 0);
3289 }
3290
3291 #[test]
3292 fn test_fixed_decoding() {

Callers

nothing calls this directly

Calls 7

avro_from_codecFunction · 0.85
try_newFunction · 0.85
encode_avro_longFunction · 0.85
MapClass · 0.50
decodeMethod · 0.45
flushMethod · 0.45
as_anyMethod · 0.45

Tested by

no test coverage detected