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

Function MakeIsFiniteFunction

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

Source from the content-addressed store, hash-verified

234}
235
236std::shared_ptr<ScalarFunction> MakeIsFiniteFunction(std::string name, FunctionDoc doc) {
237 auto func = std::make_shared<ScalarFunction>(name, Arity::Unary(), std::move(doc));
238
239 AddFloatValidityKernel<FloatType, IsFiniteOperator>(float32(), func.get());
240 AddFloatValidityKernel<DoubleType, IsFiniteOperator>(float64(), func.get());
241 AddFloatValidityKernel<HalfFloatType, IsFiniteOperator>(float16(), func.get());
242
243 for (const auto& ty : IntTypes()) {
244 DCHECK_OK(func->AddKernel({InputType(ty->id())}, boolean(), ConstBoolExec<true>));
245 }
246 DCHECK_OK(func->AddKernel({InputType(Type::NA)}, boolean(), ConstBoolExec<true>));
247 DCHECK_OK(
248 func->AddKernel({InputType(Type::DECIMAL128)}, boolean(), ConstBoolExec<true>));
249 DCHECK_OK(
250 func->AddKernel({InputType(Type::DECIMAL256)}, boolean(), ConstBoolExec<true>));
251 DCHECK_OK(func->AddKernel({InputType(Type::DURATION)}, boolean(), ConstBoolExec<true>));
252
253 return func;
254}
255
256std::shared_ptr<ScalarFunction> MakeIsInfFunction(std::string name, FunctionDoc doc) {
257 auto func = std::make_shared<ScalarFunction>(name, Arity::Unary(), std::move(doc));

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