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

Function test_skip_empty_lines

arrow-json/src/reader/mod.rs:2488–2504  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2486
2487 #[test]
2488 fn test_skip_empty_lines() {
2489 let schema = Schema::new(vec![Field::new("a", DataType::Int64, true)]);
2490 let builder = ReaderBuilder::new(Arc::new(schema)).with_batch_size(64);
2491 let json_content = "
2492 {\"a\": 1}
2493 {\"a\": 2}
2494 {\"a\": 3}";
2495 let mut reader = builder.build(Cursor::new(json_content)).unwrap();
2496 let batch = reader.next().unwrap().unwrap();
2497
2498 assert_eq!(1, batch.num_columns());
2499 assert_eq!(3, batch.num_rows());
2500
2501 let schema = reader.schema();
2502 let c = schema.column_with_name("a").unwrap();
2503 assert_eq!(&DataType::Int64, c.1.data_type());
2504 }
2505
2506 #[test]
2507 fn test_with_multiple_batches() {

Callers

nothing calls this directly

Calls 5

column_with_nameMethod · 0.80
with_batch_sizeMethod · 0.45
buildMethod · 0.45
nextMethod · 0.45
schemaMethod · 0.45

Tested by

no test coverage detected