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

Function PropagateNulls

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

Source from the content-addressed store, hash-verified

1198} // namespace
1199
1200Status PropagateNulls(KernelContext* ctx, const ExecSpan& batch, ArrayData* output) {
1201 DCHECK_NE(nullptr, output);
1202 DCHECK_GT(output->buffers.size(), 0);
1203
1204 if (output->type->id() == Type::NA) {
1205 // Null output type is a no-op (rare when this would happen but we at least
1206 // will test for it)
1207 return Status::OK();
1208 }
1209
1210 // This function is ONLY able to write into output with non-zero offset
1211 // when the bitmap is preallocated. This could be a DCHECK but returning
1212 // error Status for now for emphasis
1213 if (output->offset != 0 && output->buffers[0] == nullptr) {
1214 return Status::Invalid(
1215 "Can only propagate nulls into pre-allocated memory "
1216 "when the output offset is non-zero");
1217 }
1218 NullPropagator propagator(ctx, batch, output);
1219 return propagator.Execute();
1220}
1221
1222void PropagateNullsSpans(const ExecSpan& batch, ArraySpan* out) {
1223 if (out->type->id() == Type::NA) {

Callers 3

TEST_FFunction · 0.85
ExecuteNonSpansMethod · 0.85
ExecMethod · 0.85

Calls 5

OKFunction · 0.50
InvalidFunction · 0.50
sizeMethod · 0.45
idMethod · 0.45
ExecuteMethod · 0.45

Tested by 1

TEST_FFunction · 0.68