Validate the needles input shape and supported encoding. Needles can be a scalar, array, or chunked array. Array-like needles must not have nested run-end encoding since that is not currently supported.
| 385 | /// Needles can be a scalar, array, or chunked array. Array-like needles must not have |
| 386 | /// nested run-end encoding since that is not currently supported. |
| 387 | Status ValidateNeedleInput(const Datum& datum) { |
| 388 | if (!(datum.is_array() || datum.is_chunked_array() || datum.is_scalar())) { |
| 389 | return Status::TypeError( |
| 390 | "search_sorted needles must be a scalar, array, or chunked array"); |
| 391 | } |
| 392 | |
| 393 | if ((datum.is_array() || datum.is_chunked_array()) && |
| 394 | datum.type()->id() == Type::RUN_END_ENCODED) { |
| 395 | return ValidateRunEndEncodedLogicalValueType(*datum.type(), "needles"); |
| 396 | } |
| 397 | return Status::OK(); |
| 398 | } |
| 399 | |
| 400 | /// Find the insertion point into a dense array |
| 401 | template <typename ArrowType, typename Accessor> |
no test coverage detected