| 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)); |
| 258 | |
| 259 | AddFloatValidityKernel<FloatType, IsInfOperator>(float32(), func.get()); |
| 260 | AddFloatValidityKernel<DoubleType, IsInfOperator>(float64(), func.get()); |
| 261 | AddFloatValidityKernel<HalfFloatType, IsInfOperator>(float16(), func.get()); |
| 262 | |
| 263 | for (const auto& ty : IntTypes()) { |
| 264 | DCHECK_OK(func->AddKernel({InputType(ty->id())}, boolean(), ConstBoolExec<false>)); |
| 265 | } |
| 266 | DCHECK_OK(func->AddKernel({InputType(Type::NA)}, boolean(), ConstBoolExec<false>)); |
| 267 | DCHECK_OK( |
| 268 | func->AddKernel({InputType(Type::DECIMAL128)}, boolean(), ConstBoolExec<false>)); |
| 269 | DCHECK_OK( |
| 270 | func->AddKernel({InputType(Type::DECIMAL256)}, boolean(), ConstBoolExec<false>)); |
| 271 | DCHECK_OK( |
| 272 | func->AddKernel({InputType(Type::DURATION)}, boolean(), ConstBoolExec<false>)); |
| 273 | return func; |
| 274 | } |
| 275 | |
| 276 | std::shared_ptr<ScalarFunction> MakeIsNanFunction(std::string name, FunctionDoc doc) { |
| 277 | auto func = std::make_shared<ScalarFunction>(name, Arity::Unary(), std::move(doc)); |