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

Method ProcessIsIn

cpp/src/arrow/compute/kernels/scalar_set_lookup.cc:436–478  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

434
435 template <typename Type>
436 Status ProcessIsIn(const SetLookupState<Type>& state, const ArraySpan& input) {
437 using T = typename GetViewType<Type>::T;
438 FirstTimeBitmapWriter writer_boolean(out_boolean_bitmap, out->offset, out->length);
439 FirstTimeBitmapWriter writer_null(out_null_bitmap, out->offset, out->length);
440 bool value_set_has_null = state.null_index != -1;
441 VisitArraySpanInline<Type>(
442 input,
443 [&](T v) {
444 if (state.lookup_table->Get(v) != -1) { // true
445 writer_boolean.Set();
446 writer_null.Set();
447 } else if (state.null_matching_behavior == SetLookupOptions::INCONCLUSIVE &&
448 value_set_has_null) { // null
449 writer_boolean.Clear();
450 writer_null.Clear();
451 } else { // false
452 writer_boolean.Clear();
453 writer_null.Set();
454 }
455 writer_boolean.Next();
456 writer_null.Next();
457 },
458 [&]() {
459 if (state.null_matching_behavior == SetLookupOptions::MATCH &&
460 value_set_has_null) { // true
461 writer_boolean.Set();
462 writer_null.Set();
463 } else if (state.null_matching_behavior == SetLookupOptions::SKIP ||
464 (!value_set_has_null && state.null_matching_behavior ==
465 SetLookupOptions::MATCH)) { // false
466 writer_boolean.Clear();
467 writer_null.Set();
468 } else { // null
469 writer_boolean.Clear();
470 writer_null.Clear();
471 }
472 writer_boolean.Next();
473 writer_null.Next();
474 });
475 writer_boolean.Finish();
476 writer_null.Finish();
477 return Status::OK();
478 }
479
480 template <typename Type>
481 Status ProcessIsIn() {

Callers

nothing calls this directly

Calls 15

CastFunction · 0.85
SafeFunction · 0.85
ToArrayDataMethod · 0.80
exec_contextMethod · 0.80
OKFunction · 0.50
TypeErrorFunction · 0.50
GetMethod · 0.45
SetMethod · 0.45
ClearMethod · 0.45
NextMethod · 0.45
FinishMethod · 0.45
stateMethod · 0.45

Tested by

no test coverage detected