| 476 | enum type { PERHAPS_NULL, ALL_VALID, ALL_NULL }; |
| 477 | |
| 478 | static type Get(const ExecValue& value) { |
| 479 | const auto dtype_id = value.type()->id(); |
| 480 | if (dtype_id == Type::NA) { |
| 481 | return ALL_NULL; |
| 482 | } |
| 483 | if (!arrow::internal::may_have_validity_bitmap(dtype_id)) { |
| 484 | return ALL_VALID; |
| 485 | } |
| 486 | if (value.is_scalar()) { |
| 487 | return value.scalar->is_valid ? ALL_VALID : ALL_NULL; |
| 488 | } else { |
| 489 | const ArraySpan& arr = value.array; |
| 490 | // Do not count the bits if they haven't been counted already |
| 491 | if ((arr.null_count == 0) || (arr.buffers[0].data == nullptr)) { |
| 492 | return ALL_VALID; |
| 493 | } |
| 494 | if (arr.null_count == arr.length) { |
| 495 | return ALL_NULL; |
| 496 | } |
| 497 | } |
| 498 | return PERHAPS_NULL; |
| 499 | } |
| 500 | |
| 501 | static type Get(const Datum& datum) { |
| 502 | // Temporary workaround to help with ARROW-16756 |
nothing calls this directly
no test coverage detected