| 60 | BINARY_SAFE_NULL_NEVER(name, ALIASES, boolean) |
| 61 | |
| 62 | std::vector<NativeFunction> GetMathOpsFunctionRegistry() { |
| 63 | static std::vector<NativeFunction> math_fn_registry_ = { |
| 64 | MATH_UNARY_OPS(cbrt, {}), MATH_UNARY_OPS(exp, {}), MATH_UNARY_OPS(log, {}), |
| 65 | MATH_UNARY_OPS(log10, {}), |
| 66 | |
| 67 | MATH_BINARY_UNSAFE(log, {}), |
| 68 | |
| 69 | BINARY_SYMMETRIC_SAFE_NULL_IF_NULL(power, {"pow"}, float64), |
| 70 | |
| 71 | UNARY_SAFE_NULL_NEVER_BOOL_FN(isnull, {}), |
| 72 | UNARY_SAFE_NULL_NEVER_BOOL_FN(isnotnull, {}), |
| 73 | |
| 74 | NUMERIC_TYPES(UNARY_SAFE_NULL_NEVER_BOOL, isnumeric, {}), |
| 75 | |
| 76 | BINARY_SAFE_NULL_NEVER_BOOL_FN(is_distinct_from, {}), |
| 77 | BINARY_SAFE_NULL_NEVER_BOOL_FN(is_not_distinct_from, {}), |
| 78 | |
| 79 | UNARY_UNSAFE_NULL_IF_NULL(factorial, {}, int32, int64), |
| 80 | UNARY_UNSAFE_NULL_IF_NULL(factorial, {}, int64, int64), |
| 81 | |
| 82 | // trigonometry functions |
| 83 | MATH_UNARY_OPS(sin, {}), MATH_UNARY_OPS(cos, {}), MATH_UNARY_OPS(asin, {}), |
| 84 | MATH_UNARY_OPS(acos, {}), MATH_UNARY_OPS(tan, {}), MATH_UNARY_OPS(atan, {}), |
| 85 | MATH_UNARY_OPS(sinh, {}), MATH_UNARY_OPS(cosh, {}), MATH_UNARY_OPS(tanh, {}), |
| 86 | MATH_UNARY_OPS(cot, {}), MATH_UNARY_OPS(radians, {}), |
| 87 | MATH_UNARY_OPS(degrees, {"udfdegrees"}), MATH_BINARY_SAFE(atan2, {}), |
| 88 | |
| 89 | // decimal functions |
| 90 | UNARY_SAFE_NULL_IF_NULL(abs, {}, decimal128, decimal128), |
| 91 | UNARY_SAFE_NULL_IF_NULL(ceil, {}, decimal128, decimal128), |
| 92 | UNARY_SAFE_NULL_IF_NULL(floor, {}, decimal128, decimal128), |
| 93 | UNARY_SAFE_NULL_IF_NULL(round, {}, decimal128, decimal128), |
| 94 | UNARY_SAFE_NULL_IF_NULL(truncate, {"trunc"}, decimal128, decimal128), |
| 95 | BINARY_GENERIC_SAFE_NULL_IF_NULL(round, {}, decimal128, int32, decimal128), |
| 96 | BINARY_GENERIC_SAFE_NULL_IF_NULL(truncate, {"trunc"}, decimal128, int32, |
| 97 | decimal128), |
| 98 | BINARY_SYMMETRIC_SAFE_NULL_NEVER_FN(nvl, {}), |
| 99 | |
| 100 | NativeFunction("truncate", {"trunc"}, DataTypeVector{int64(), int32()}, int64(), |
| 101 | kResultNullIfNull, "truncate_int64_int32"), |
| 102 | NativeFunction("random", {"rand"}, DataTypeVector{}, float64(), kResultNullNever, |
| 103 | "gdv_fn_random", NativeFunction::kNeedsFunctionHolder), |
| 104 | NativeFunction("random", {"rand"}, DataTypeVector{int32()}, float64(), |
| 105 | kResultNullNever, "gdv_fn_random_with_seed", |
| 106 | NativeFunction::kNeedsFunctionHolder), |
| 107 | NativeFunction("rand_integer", {}, DataTypeVector{}, int32(), kResultNullNever, |
| 108 | "gdv_fn_rand_integer", NativeFunction::kNeedsFunctionHolder), |
| 109 | NativeFunction("rand_integer", {}, DataTypeVector{int32()}, int32(), |
| 110 | kResultNullNever, "gdv_fn_rand_integer_with_range", |
| 111 | NativeFunction::kNeedsFunctionHolder), |
| 112 | NativeFunction("rand_integer", {}, DataTypeVector{int32(), int32()}, int32(), |
| 113 | kResultNullNever, "gdv_fn_rand_integer_with_min_max", |
| 114 | NativeFunction::kNeedsFunctionHolder)}; |
| 115 | |
| 116 | return math_fn_registry_; |
| 117 | } |
| 118 | |
| 119 | #undef MATH_UNARY_OPS |
no test coverage detected