[
https://issues.apache.org/jira/browse/CALCITE-6711?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17902472#comment-17902472
]
xiong duan commented on CALCITE-6711:
-------------------------------------
After fix these function, I will remove
`{{{}checkNullValueWithNullableType{}}}`. And enhance the 'checkNull' method
to test the return date type should be nullable.
> 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)