@@ -21,15 +21,25 @@ using FunctionPositiveModuloOrNll = BinaryArithmeticOverloadResolver<PositiveMod
2121
2222REGISTER_FUNCTION (PositiveModuloOrNull)
2323{
24- factory.registerFunction <FunctionPositiveModuloOrNll>(FunctionDocumentation
25- {
26- .description = R"(
24+ FunctionDocumentation::Description description = R"(
2725Calculates the remainder when dividing `a` by `b`. Similar to function `positiveModulo` except that `positiveModuloOrNull` will return NULL
2826if the right argument is 0.
29- )" ,
30- .examples {{" positiveModuloOrNull" , " SELECT positiveModuloOrNull(1, 0);" , " " }},
31- .category = FunctionDocumentation::Category::Arithmetic},
32- FunctionFactory::Case::Insensitive);
27+ )" ;
28+ FunctionDocumentation::Syntax syntax = " positiveModulo(x, y)" ;
29+ FunctionDocumentation::Arguments arguments = {
30+ {" x" , " The dividend. [`(U)Int*`](/sql-reference/data-types/int-uint)/[`Float32/64`](/sql-reference/data-types/float)." },
31+ {" x" , " The divisor (modulus). [`(U)Int*`](/sql-reference/data-types/int-uint)/[`Float32/64`](/sql-reference/data-types/float)." }
32+ };
33+ FunctionDocumentation::ReturnedValue returned_value = R"(
34+ Returns the difference between `x` and the nearest integer not greater than
35+ `x` divisible by `y`, `null` when the divisor is zero.
36+ )" ;
37+ FunctionDocumentation::Examples examples = {{" positiveModulo" , " SELECT positiveModulo(-1, 10)" , " 9" }};
38+ FunctionDocumentation::IntroducedIn introduced_in = {22 , 11 };
39+ FunctionDocumentation::Category categories = FunctionDocumentation::Category::Arithmetic;
40+ FunctionDocumentation documentation = {description, syntax, arguments, returned_value, examples, introduced_in, categories};
41+
42+ factory.registerFunction <FunctionPositiveModuloOrNll>(documentation, FunctionFactory::Case::Insensitive);
3343
3444 factory.registerAlias (" positive_modulo_or_null" , " positiveModuloOrNull" , FunctionFactory::Case::Insensitive);
3545 factory.registerAlias (" pmodOrNull" , " positiveModuloOrNull" , FunctionFactory::Case::Insensitive);
0 commit comments