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

Function MakeIsNanFunction

cpp/src/arrow/compute/kernels/scalar_validity.cc:276–295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

274}
275
276std::shared_ptr<ScalarFunction> MakeIsNanFunction(std::string name, FunctionDoc doc) {
277 auto func = std::make_shared<ScalarFunction>(name, Arity::Unary(), std::move(doc));
278
279 AddFloatValidityKernel<FloatType, IsNanOperator>(float32(), func.get());
280 AddFloatValidityKernel<DoubleType, IsNanOperator>(float64(), func.get());
281 AddFloatValidityKernel<HalfFloatType, IsNanOperator>(float16(), func.get());
282
283 for (const auto& ty : IntTypes()) {
284 DCHECK_OK(func->AddKernel({InputType(ty->id())}, boolean(), ConstBoolExec<false>));
285 }
286 DCHECK_OK(func->AddKernel({InputType(Type::NA)}, boolean(), ConstBoolExec<false>));
287 DCHECK_OK(
288 func->AddKernel({InputType(Type::DECIMAL128)}, boolean(), ConstBoolExec<false>));
289 DCHECK_OK(
290 func->AddKernel({InputType(Type::DECIMAL256)}, boolean(), ConstBoolExec<false>));
291 DCHECK_OK(
292 func->AddKernel({InputType(Type::DURATION)}, boolean(), ConstBoolExec<false>));
293
294 return func;
295}
296
297Status TrueUnlessNullExec(KernelContext* ctx, const ExecSpan& batch, ExecResult* out) {
298 // Set all bits in the output's value bitmap to true

Callers 1

RegisterScalarValidityFunction · 0.85

Calls 5

UnaryFunction · 0.85
InputTypeFunction · 0.85
getMethod · 0.45
AddKernelMethod · 0.45
idMethod · 0.45

Tested by

no test coverage detected