| 234 | } |
| 235 | |
| 236 | std::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 | |
| 256 | std::shared_ptr<ScalarFunction> MakeIsInfFunction(std::string name, FunctionDoc doc) { |
| 257 | auto func = std::make_shared<ScalarFunction>(name, Arity::Unary(), std::move(doc)); |