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

Julian Hyde edited comment on CALCITE-6982 at 4/24/25 3:28 PM:
---------------------------------------------------------------

This is a logical rewrite rule, not something that should be done during SQL 
generation. The same rewrite rule would apply to many other operators where 
{{f\(x) IS NULL}} iff {{x IS NULL}}. Use {{class Strong}}. 


was (Author: julianhyde):
This is a logical rewrite rule, not something that should be done during SQL 
generation. The same rewrite rule would apply to many other operators where 
{{f(x) IS NULL}} iff {{x IS NULL}}. Use {{class Strong}}. 

> Removes cast from string support with IS_NULL/IS_NOT_NULL
> ---------------------------------------------------------
>
>                 Key: CALCITE-6982
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6982
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.39.0
>            Reporter: Yu Xu
>            Assignee: Yu Xu
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.40.0
>
>
> SQL
> {code:java}
> select \"employee_id\" from \"foodmart\".\"employee\"
> where 10 is distinct from cast('10' as int){code}
> would covert to
> {code:java}
> SELECT \"employee_id\"\nFROM \"foodmart\".\"employee\"\nWHERE (10 IS NOT NULL 
> OR CAST('10' AS INTEGER) IS NOT NULL) AND 10 = '10' IS NOT TRUE {code}
> here CAST('10' AS INTEGER) IS NOT NULL : cast is not necessary
> should convert to:
> {code:java}
> SELECT \"employee_id\"\n FROM \"foodmart\".\"employee\"\n WHERE (10 IS NOT 
> NULL OR '10' IS NOT NULL) AND 10 = '10' IS NOT TRUE{code}



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

Reply via email to