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

Function PropagateNulls

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

Source from the content-addressed store, hash-verified

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