Skip to content

Commit d501497

Browse files
committed
docs: refined explanations of nullability
1 parent 2ea9122 commit d501497

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

site/docs/expressions/scalar_functions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ A producer may specify multiple values for an option. If the producer does so t
7070

7171
| Mode | Description |
7272
| --------------- | ------------------------------------------------------------ |
73-
| MIRROR | This means that the function has the behavior that if at least one of the input arguments are nullable, the return type is also nullable. If all arguments are non-nullable, the return type will be non-nullable. The nullability of the expected return type in the function definition can be disregarded, as the nullability of the output is determined by the nullability of the inputs. An example might be the `+` function. |
73+
| MIRROR | This means that the function has the behavior that if at least one of the input arguments are nullable, the return type is also nullable. If all arguments are non-nullable, the return type will be non-nullable. The nullability of the expected return type in the function definition can be disregarded, as the nullability of the output is determined by the nullability of the inputs. An example of a function with MIRROR nullability is the `add` function. |
7474
| DECLARED_OUTPUT | Input arguments are accepted of any mix of nullability. The nullability of the output function is whatever the return type expression states. Example use might be the function `is_null()` where the output is always `boolean` independent of the nullability of the input. |
75-
| DISCRETE | DISCRETE nullability follows DECLARED_OUTPUT rules, in the sense that the output nullability must match the return type expression's nullability. However, the input and arguments all define concrete nullability and can only be bound to the types that have those nullability. For example, if a type input is declared `i64?` and one has an `i64` literal, the `i64` literal must be specifically cast to `i64?` to allow the operation to bind. |
75+
| DISCRETE | DISCRETE nullability extends DECLARED_OUTPUT. The output nullability must still match the return type expression's nullability. Additionally, the input and arguments all define concrete nullability and can only be bound to the types that have those nullability. For example, if a type input is declared `i64?` and one has an `i64` literal, the `i64` literal must be specifically casted to `i64?` to allow the operation to bind. |
7676

7777

7878

0 commit comments

Comments
 (0)