[ 
https://issues.apache.org/jira/browse/CALCITE-6711?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17903103#comment-17903103
 ] 

Julian Hyde commented on CALCITE-6711:
--------------------------------------

Completely orthogonal to dialect. (Except that different function libraries - 
e.g. mysql and postgres - might have different functions with the same name and 
different behaviors. But those are really different functions.)

> Functions whose output value can be null should return a nullable type
> ----------------------------------------------------------------------
>
>                 Key: CALCITE-6711
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6711
>             Project: Calcite
>          Issue Type: Bug
>    Affects Versions: 1.38.0
>            Reporter: xiong duan
>            Priority: Major
>             Fix For: 1.39.0
>
>
> Functions whose output value can be null should return a nullable type.
> These functions can be tested by adding null type judgments:
> {code:java}
> @Override public void checkNull(String expression) {
>   tester.forEachQuery(factory, expression, sql ->
>       tester.check(factory, sql, SqlTests.ANY_TYPE_NULL_CHECKER, 
> isNullValue()));
> }
> public static final TypeChecker ANY_TYPE_NULL_CHECKER = (sql, type) -> {
>   if(!type.isNullable()) {
>     fail("Should be nullable");
>   }
> };{code}
> Some functions, such as:
>  # regexp_extract_all
>  # to_code_points
>  # code_points_to_bytes
>  # REGEXP_EXTRACT
>  # REGEXP_SUBSTR
>  # NVL2
>  # from_base64
>  # parse_url



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to