Verifies that `child` contains no nulls not present in `mask`
(
&self,
mask: Option<&NullBuffer>,
child: &ArrayData,
)
| 1395 | |
| 1396 | /// Verifies that `child` contains no nulls not present in `mask` |
| 1397 | fn validate_non_nullable( |
| 1398 | &self, |
| 1399 | mask: Option<&NullBuffer>, |
| 1400 | child: &ArrayData, |
| 1401 | ) -> Result<(), ArrowError> { |
| 1402 | let mask = match mask { |
| 1403 | Some(mask) => mask, |
| 1404 | None => { |
| 1405 | return match child.null_count() { |
| 1406 | 0 => Ok(()), |
| 1407 | _ => Err(ArrowError::InvalidArgumentError(format!( |
| 1408 | "non-nullable child of type {} contains nulls not present in parent {}", |
| 1409 | child.data_type, self.data_type |
| 1410 | ))), |
| 1411 | }; |
| 1412 | } |
| 1413 | }; |
| 1414 | |
| 1415 | match child.nulls() { |
| 1416 | Some(nulls) if !mask.contains(nulls) => Err(ArrowError::InvalidArgumentError(format!( |
| 1417 | "non-nullable child of type {} contains nulls not present in parent", |
| 1418 | child.data_type |
| 1419 | ))), |
| 1420 | _ => Ok(()), |
| 1421 | } |
| 1422 | } |
| 1423 | |
| 1424 | /// Validates the values stored within this [`ArrayData`] are valid |
| 1425 | /// without recursing into child [`ArrayData`] |
no test coverage detected