You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "jackylau (Jira)" <ji...@apache.org> on 2023/04/24 06:56:00 UTC

[jira] [Commented] (FLINK-31902) cast expr to type with not null should throw exception like calcite

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

jackylau commented on FLINK-31902:
----------------------------------

hi [~danny0405] [~snuyanzin]  please have a look

> cast expr to type with not null should throw exception like calcite
> -------------------------------------------------------------------
>
>                 Key: FLINK-31902
>                 URL: https://issues.apache.org/jira/browse/FLINK-31902
>             Project: Flink
>          Issue Type: Improvement
>    Affects Versions: 1.18.0
>            Reporter: jackylau
>            Priority: Major
>
> {code:java}
> // calcite cast type  not null, will throw exception
> expr("cast(x as int ^not^ null)")
>         .fails("(?s).*Encountered \"not\" at .*");
> expr("cast(x as int ^not^ null array)")
>         .fails("(?s).*Encountered \"not\" at .*");
> expr("cast(x as int array ^not^ null)")
>         .fails("(?s).*Encountered \"not\" at .*"); 
> // while  the flink not
> expr("cast(x as array<int not null>)")
>         .ok("(?s).*Encountered \"not\" at .*");
> expr("cast(x as array<int> not null)")
>         .ok("(?s).*Encountered \"not\" at .*");{code}
> the reason is flink add extended type, which will supports not null
> {code:java}
> // code placeholder
> <#-- additional types are included here -->
> <#-- put custom data types in front of Calcite core data types -->
> <#list (parser.dataTypeParserMethods!default.parser.dataTypeParserMethods) as method>
>         LOOKAHEAD(2)
>         typeNameSpec = ${method}
>     |
> </#list> {code}



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