You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (Jira)" <ji...@apache.org> on 2019/11/04 20:58:00 UTC

[jira] [Commented] (CALCITE-3433) EQUALS operator between date/timestamp types returns false if the type is nullable

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

Julian Hyde commented on CALCITE-3433:
--------------------------------------

This is an improvement but it doesn't seem fully right. I can't help wondering how we get away with it for other comparison operators (e.g. {{<}}). The problem seems more to do with our use of {{eq}} than the fact that the logical operator is {{EQUALS}} or {{NOT_EQUALS}}.

For example, tuple comparison {{t1 < t2}} will do something like {{(x1 < x2) or (x1 = x2) and (y1 < y2)}} and may run afoul of {{eq}}.

> 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
>             Fix For: 1.22.0
>
>          Time Spent: 2h 20m
>  Remaining Estimate: 0h
>
> sql
> {code: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)
> {code}
> answer is false
> but 
> sql
> {code:sql}
> select time0 = time1
> from
> (select
>   timestamp'2000-12-30 21:07:32' as time0,
>   timestamp'2000-12-30 21:07:32'as time1)
> {code}
> answer is true
>  



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