()
| 1135 | |
| 1136 | #[test] |
| 1137 | fn test_null_struct() { |
| 1138 | // It is possible to create a null struct containing a non-nullable child |
| 1139 | // see https://github.com/apache/arrow-rs/pull/3244 for details |
| 1140 | let struct_type = DataType::Struct(vec![Field::new("data", DataType::Int64, false)].into()); |
| 1141 | let array = new_null_array(&struct_type, 9); |
| 1142 | |
| 1143 | let a = array.as_any().downcast_ref::<StructArray>().unwrap(); |
| 1144 | assert_eq!(a.len(), 9); |
| 1145 | assert_eq!(a.column(0).len(), 9); |
| 1146 | for i in 0..9 { |
| 1147 | assert!(a.is_null(i)); |
| 1148 | } |
| 1149 | |
| 1150 | // Make sure we can slice the resulting array. |
| 1151 | a.slice(0, 5); |
| 1152 | } |
| 1153 | |
| 1154 | #[test] |
| 1155 | fn test_null_variable_sized() { |
nothing calls this directly
no test coverage detected