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

Method Exec

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

Source from the content-addressed store, hash-verified

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