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

Function IsNanPrimitive

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

Source from the content-addressed store, hash-verified

105enum class NullGeometry : int { NoNulls, AllNans, AllNulls, Empty, AtStart, AtEnd };
106
107inline bool IsNanPrimitive(const Array& array, int64_t index) {
108 switch (array.type_id()) {
109 case Type::FLOAT:
110 return std::isnan(checked_cast<const FloatArray&>(array).Value(index));
111 case Type::DOUBLE:
112 return std::isnan(checked_cast<const DoubleArray&>(array).Value(index));
113 case Type::HALF_FLOAT:
114 return Float16::FromBits(checked_cast<const HalfFloatArray&>(array).Value(index))
115 .is_nan();
116 default:
117 return false;
118 }
119}
120
121/// Detect the NullGeometry of a primitive or run-end-encoded array
122NullGeometry DetectNullGeometry(const Array& array) {

Callers 1

DetectNullGeometryFunction · 0.85

Calls 3

FromBitsFunction · 0.85
type_idMethod · 0.45
ValueMethod · 0.45

Tested by

no test coverage detected