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

Function validate_nulls

arrow-select/src/nullif.rs:513–524  ·  view source on GitHub ↗

Ensures that the null count matches the actual number of nulls.

(nulls: Option<&NullBuffer>)

Source from the content-addressed store, hash-verified

511
512 /// Ensures that the null count matches the actual number of nulls.
513 fn validate_nulls(nulls: Option<&NullBuffer>) {
514 let Some(nulls) = nulls else {
515 return;
516 };
517 let mut actual_null_count = 0;
518 for i in 0..nulls.len() {
519 if nulls.is_null(i) {
520 actual_null_count += 1;
521 }
522 }
523 assert_eq!(actual_null_count, nulls.null_count());
524 }
525
526 #[test]
527 fn nullif_fuzz() {

Callers 1

test_nullifFunction · 0.85

Calls 2

lenMethod · 0.45
is_nullMethod · 0.45

Tested by 1

test_nullifFunction · 0.68