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

Function json_array_writer_empty_batch

arrow-json/src/writer/mod.rs:1359–1369  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1357
1358 #[test]
1359 fn json_array_writer_empty_batch() {
1360 let mut writer = ArrayWriter::new(vec![] as Vec<u8>);
1361
1362 let array = Int32Array::from(Vec::<i32>::new());
1363 let schema = Schema::new(vec![Field::new("c", DataType::Int32, true)]);
1364 let batch = RecordBatch::try_new(Arc::new(schema), vec![Arc::new(array)]).unwrap();
1365
1366 writer.write(&batch).unwrap();
1367 writer.finish().unwrap();
1368 assert_eq!(str::from_utf8(&writer.into_inner()).unwrap(), "[]");
1369 }
1370
1371 #[test]
1372 fn json_struct_array_nulls() {

Callers

nothing calls this directly

Calls 3

try_newFunction · 0.85
writeMethod · 0.45
finishMethod · 0.45

Tested by

no test coverage detected