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

Feng Zhu commented on CALCITE-3433:
-----------------------------------

Hey [~danny0405] :
Sure, the code "_inp0_ == null || inp1_ == null_" can be optimized with some 
efforts.
Binary operators like _Equals/NotEquals/Add_ are implemented in 
_BinaryImplementor_, before which null check is a general phase.
But for my personal opinion, it requires work on the whole codegen framework, 
not only for the problem in this case.
As discussed and illustrated in previous JIRAs (e.g., CALCITE-3224), I inclined 
to refactor current codegen framework to guarantee 
*{color:#FF0000}correctness{color}* first.
After that, we can then focus on optimizing redundant and unnecessary code 
patterns.

How about your idea?

> EQUALS operator between date/timestamp types returns false if the type is 
> nullable
> ----------------------------------------------------------------------------------
>
>                 Key: CALCITE-3433
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3433
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.17.0, 1.18.0, 1.19.0, 1.20.0, 1.21.0
>            Reporter: jiezouSH
>            Assignee: Feng Zhu
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> sql
> select time0=time1 from (select timestamp'2000-12-30 21:07:32'as 
> time0,timestamp'2000-12-30 21:07:32'as time1 union all select cast(null as 
> timestamp) as time0,cast(null as timestamp) as time1) calcs
> answer is false
> but 
> sql
> select time0=time1 from (select timestamp'2000-12-30 21:07:32'as 
> time0,timestamp'2000-12-30 21:07:32'as time1) calcs
> answer is true
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to