Skip to content

Commit

Permalink
Document @SqlNullable
Browse files Browse the repository at this point in the history
Provide javadoc level documentation addtional to documentation already
existing in docs in presto-docs/src/main/sphinx/develop/functions.rst
  • Loading branch information
findepi committed Sep 28, 2020
1 parent cbcba45 commit d148de2
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
* Indicates a parameter or return value can be NULL.
* <p>
* {@code @SqlNullable} annotation, when placed on a parameter of a {@link ScalarFunction} or {@link ScalarOperator} method,
* indicates that the method should be called also when the parameter is NULL. In the absence of {@code @SqlNullable}
* annotation, the engine assumes the implemented SQL function or operator is supposed to return NULL when given parameter is NULL
* and does not call the implementing method.
* <p>
* {@code @SqlNullable} placed on a {@link ScalarFunction} method indicates that the implementation may return NULL.
*/
@Retention(RUNTIME)
@Target({METHOD, PARAMETER})
public @interface SqlNullable
Expand Down

0 comments on commit d148de2

Please sign in to comment.