| 581 | /// of logical elements. |
| 582 | template <typename ArrowType, typename Visitor> |
| 583 | Status VisitNeedleRuns(const Datum& needles, Visitor&& visitor) { |
| 584 | if (needles.is_scalar()) { |
| 585 | if (!needles.scalar()->is_valid) { |
| 586 | return visitor(std::optional<SearchValue<ArrowType>>{}); |
| 587 | } |
| 588 | ARROW_ASSIGN_OR_RAISE(auto scalar_array, MakeArrayFromScalar(*needles.scalar(), 1)); |
| 589 | return VisitArrayNeedleRuns<ArrowType>(scalar_array->data(), |
| 590 | std::forward<Visitor>(visitor)); |
| 591 | } |
| 592 | |
| 593 | const auto& needle_data = needles.array(); |
| 594 | return VisitArrayNeedleRuns<ArrowType>(needle_data, visitor); |
| 595 | } |
| 596 | |
| 597 | /// Build uint64 insertion-index arrays with an optional null bitmap. |
| 598 | class InsertionIndexBuilder { |