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

Function ValidateNeedleInput

cpp/src/arrow/compute/kernels/vector_search_sorted.cc:387–398  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

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.
387Status 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
401template <typename ArrowType, typename Accessor>

Callers 1

ExecuteImplMethod · 0.85

Calls 7

is_arrayMethod · 0.80
is_scalarMethod · 0.80
TypeErrorFunction · 0.50
OKFunction · 0.50
idMethod · 0.45
typeMethod · 0.45

Tested by

no test coverage detected