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

Method Exec

cpp/src/arrow/compute/kernels/vector_replace.cc:361–381  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

359template <typename Type>
360struct ReplaceMask {
361 static Status Exec(KernelContext* ctx, const ExecSpan& batch, ExecResult* out) {
362 const ArraySpan& arr = batch[0].array;
363 const ExecValue& mask = batch[1];
364 const ExecValue& replacements = batch[2];
365 RETURN_NOT_OK(CheckReplaceMaskInputs(*arr.type, arr.length, mask,
366 *replacements.type(), replacements.length(),
367 replacements.is_array()));
368 if (mask.is_scalar()) {
369 return ReplaceMaskImpl<Type>::ExecScalarMask(
370 ctx, arr, mask.scalar_as<BooleanScalar>(), replacements,
371 /*replacements_offset=*/0, out)
372 .status();
373 } else {
374 // The extra mask offset is for dealing with chunked inputs, so zero when
375 // there is only a single chunk to process
376 return ReplaceMaskImpl<Type>::ExecArrayMask(ctx, arr, mask.array,
377 /*mask_offset=*/0, replacements,
378 /*replacements_offset=*/0, out)
379 .status();
380 }
381 }
382
383 static std::shared_ptr<KernelSignature> GetSignature(detail::GetTypeId get_id) {
384 return KernelSignature::Make({InputType(get_id.id), boolean(), InputType(get_id.id)},

Callers

nothing calls this directly

Calls 6

CheckReplaceMaskInputsFunction · 0.85
is_arrayMethod · 0.80
is_scalarMethod · 0.80
typeMethod · 0.45
lengthMethod · 0.45
statusMethod · 0.45

Tested by

no test coverage detected