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

Function TrueUnlessNullExec

cpp/src/arrow/compute/kernels/scalar_validity.cc:297–311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

295}
296
297Status TrueUnlessNullExec(KernelContext* ctx, const ExecSpan& batch, ExecResult* out) {
298 // Set all bits in the output's value bitmap to true
299 ArraySpan* out_span = out->array_span_mutable();
300 bit_util::SetBitsTo(out_span->buffers[1].data, out_span->offset, out_span->length,
301 true);
302
303 // Set the output's validity bitmap based on the nullity of the input array
304 // NOTE: alternatively, we could switch this kernel's null handling back to
305 // NullHandling::INTERSECTION and change the validity checks in exec.cc so that
306 // they correctly handle logical nulls, but that would invove significant changes
307 // in exec.cc which might have more side effects
308 return SetLogicalNullBits(ctx, batch[0].array, out_span->buffers[0].data,
309 out_span->offset,
310 /*set_on_null=*/false, /*nan_is_null=*/false);
311}
312
313const FunctionDoc is_valid_doc(
314 "Return true if non-null",

Callers

nothing calls this directly

Calls 2

SetLogicalNullBitsFunction · 0.70
SetBitsToFunction · 0.50

Tested by

no test coverage detected