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

Mihai Budiu commented on CALCITE-6712:
--------------------------------------

I cannot speak for [~julianhyde], but one thing which is a bit weird is that 
the fix mixes static and dynamic semantics in the same check.

The type of an expression is known statically; it an expression has "free 
variables" (e.g., x in SELECT from_base64(x)), the type is always the same no 
matter what the input data is. The runtime value of x can be null or not if x 
is nullable.

SqlOperatorTest has different test methods to check the type and the return 
value of an expression.

> FROM_BASE64 and PARSE_URL's return data type should always be nullable
> ----------------------------------------------------------------------
>
>                 Key: CALCITE-6712
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6712
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: xiong duan
>            Assignee: xiong duan
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.39.0
>
>
> The return values of these two functions are related to the specific 
> parameter value.
> If the parameter is not nullable, then the return type is still nullable
> {code:java}
> from_base64('-1');
> return null
> parse_url('http://calcite.apache.org/path1/p.phpk1=v1&k2=v2#Ref1','QUERY', 
> 'k3');
> return null
> {code}



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

Reply via email to