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

Function test_init_nulls

arrow-csv/src/reader/mod.rs:1678–1700  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1676
1677 #[test]
1678 fn test_init_nulls() {
1679 let schema = Arc::new(Schema::new(vec![
1680 Field::new("c_int", DataType::UInt64, true),
1681 Field::new("c_float", DataType::Float32, true),
1682 Field::new("c_string", DataType::Utf8, true),
1683 Field::new("c_bool", DataType::Boolean, true),
1684 Field::new("c_null", DataType::Null, true),
1685 ]));
1686 let file = File::open("test/data/init_null_test.csv").unwrap();
1687
1688 let mut csv = ReaderBuilder::new(schema)
1689 .with_header(true)
1690 .build(file)
1691 .unwrap();
1692
1693 let batch = csv.next().unwrap().unwrap();
1694
1695 assert!(batch.column(1).is_null(0));
1696 assert!(!batch.column(1).is_null(1));
1697 assert!(batch.column(1).is_null(2));
1698 assert!(!batch.column(1).is_null(3));
1699 assert!(!batch.column(1).is_null(4));
1700 }
1701
1702 #[test]
1703 fn test_init_nulls_with_inference() {

Callers

nothing calls this directly

Calls 3

buildMethod · 0.45
with_headerMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected