MCPcopy Create free account
hub / github.com/apache/arrow / Get

Method Get

cpp/src/arrow/compute/exec.cc:478–499  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 11

may_have_validity_bitmapFunction · 0.85
is_scalarMethod · 0.80
is_arrayMethod · 0.80
SetScalarMethod · 0.80
GetFunction · 0.70
idMethod · 0.45
typeMethod · 0.45
SetArrayMethod · 0.45
arrayMethod · 0.45
getMethod · 0.45
scalarMethod · 0.45

Tested by

no test coverage detected