You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Ruben Q L (Jira)" <ji...@apache.org> on 2020/09/17 09:11:00 UTC

[jira] [Resolved] (CALCITE-4258) SqlToRelConverter: SELECT 1 IS [NOT] DISTINCT FROM NULL fails with AssertionError

     [ https://issues.apache.org/jira/browse/CALCITE-4258?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ruben Q L resolved CALCITE-4258.
--------------------------------
    Resolution: Fixed

Fixed via https://github.com/apache/calcite/commit/ea2b32e11dc6a0744fc93b8d33d7dfa1da70e674

> SqlToRelConverter: SELECT 1 IS [NOT] DISTINCT FROM NULL fails with AssertionError
> ---------------------------------------------------------------------------------
>
>                 Key: CALCITE-4258
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4258
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>            Reporter: Ruben Q L
>            Assignee: Ruben Q L
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.26.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Problem can be reproduced with the following tests (in core\src\test\resources\sql\misc.iq):
> {code}
> # [CALCITE-4258]
> SELECT 1 IS DISTINCT FROM NULL;
> +--------+
> | EXPR$0 |
> +--------+
> | true   |
> +--------+
> (1 row)
> !ok
> # [CALCITE-4258]
> SELECT 1 IS NOT DISTINCT FROM NULL;
> +--------+
> | EXPR$0 |
> +--------+
> | false  |
> +--------+
> (1 row)
> !ok
> {code}
> These tests fail with:
> {code}
> > java.lang.AssertionError: Conversion to relational algebra failed to preserve datatypes:
> > validated type:
> > RecordType(BOOLEAN NOT NULL EXPR$0) NOT NULL
> > converted type:
> > RecordType(BOOLEAN EXPR$0) NOT NULL
> > rel:
> > LogicalProject(EXPR$0=[null:BOOLEAN])
> >   LogicalValues(tuples=[[{ 0 }]])
> 44a47,109
> > 	at org.apache.calcite.sql2rel.SqlToRelConverter.checkConvertedType(SqlToRelConverter.java:466)
> > 	at org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery(SqlToRelConverter.java:581)
> > 	at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:242)
> > 	at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:208)
> ...
> {code}
> These queries used to work fine until recently, so this regression must have occurred not so long ago.



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