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

Function normalize_empty

arrow-array/src/record_batch.rs:1574–1597  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1572
1573 #[test]
1574 fn normalize_empty() {
1575 let animals_field = Arc::new(Field::new("animals", DataType::Utf8, true));
1576 let n_legs_field = Arc::new(Field::new("n_legs", DataType::Int64, true));
1577 let year_field = Arc::new(Field::new("year", DataType::Int64, true));
1578
1579 let schema = Schema::new(vec![
1580 Field::new(
1581 "a",
1582 DataType::Struct(Fields::from(vec![animals_field, n_legs_field, year_field])),
1583 false,
1584 ),
1585 Field::new("month", DataType::Int64, true),
1586 ]);
1587
1588 let normalized = RecordBatch::new_empty(Arc::new(schema.clone()))
1589 .normalize(".", Some(0))
1590 .expect("valid normalization");
1591
1592 let expected = RecordBatch::new_empty(Arc::new(
1593 schema.normalize(".", Some(0)).expect("valid normalization"),
1594 ));
1595
1596 assert_eq!(expected, normalized);
1597 }
1598
1599 #[test]
1600 fn project() {

Callers

nothing calls this directly

Calls 2

normalizeMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected