[ https://issues.apache.org/jira/browse/FLINK-31902?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17727389#comment-17727389 ]
jackylau commented on FLINK-31902: ---------------------------------- i will fix it in calcite first https://issues.apache.org/jira/browse/CALCITE-5731 > 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)