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

Method ExecTake

cpp/src/arrow/compute/kernels/vector_selection_internal.cc:414–447  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

412 virtual Status Finish() = 0;
413
414 Status ExecTake() {
415 RETURN_NOT_OK(this->validity_builder.Reserve(output_length));
416 RETURN_NOT_OK(Init());
417 int index_width = this->selection.type->byte_width();
418
419 // CTRP dispatch here
420 switch (index_width) {
421 case 1: {
422 Status s =
423 static_cast<Impl*>(this)->template GenerateOutput<TakeAdapter<uint8_t>>();
424 RETURN_NOT_OK(s);
425 } break;
426 case 2: {
427 Status s =
428 static_cast<Impl*>(this)->template GenerateOutput<TakeAdapter<uint16_t>>();
429 RETURN_NOT_OK(s);
430 } break;
431 case 4: {
432 Status s =
433 static_cast<Impl*>(this)->template GenerateOutput<TakeAdapter<uint32_t>>();
434 RETURN_NOT_OK(s);
435 } break;
436 case 8: {
437 Status s =
438 static_cast<Impl*>(this)->template GenerateOutput<TakeAdapter<uint64_t>>();
439 RETURN_NOT_OK(s);
440 } break;
441 default:
442 DCHECK(false) << "Invalid index width";
443 break;
444 }
445 RETURN_NOT_OK(this->FinishCommon());
446 return Finish();
447 }
448
449 Status ExecFilter() {
450 RETURN_NOT_OK(this->validity_builder.Reserve(output_length));

Callers 1

TakeExecFunction · 0.80

Calls 4

FinishCommonMethod · 0.95
FinishFunction · 0.50
ReserveMethod · 0.45
byte_widthMethod · 0.45

Tested by

no test coverage detected