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

Vladimir Steshin updated IGNITE-23179:
--------------------------------------
    Description: 
The test

{code:java}
@Test
    public void testIsNotDistinctFrom() {
        executeSql("CREATE TABLE t1(i1 INTEGER, i2 INTEGER)");
        executeSql("INSERT INTO t1 VALUES (1, null), (2, 2), (null, 3), (3, 
null)");

        executeSql("CREATE TABLE t2(i3 DECIMAL, i4 INTEGER)");
        executeSql("INSERT INTO t2 VALUES (1, 1), (2, 2), (null, 3), (4, 
null)");

        String sql = "SELECT i1, i4 FROM t1 JOIN t2 ON i1 IS NOT DISTINCT FROM 
i3";

        assertQuery(sql)
            .returns(1, 1)
            .returns(2, 2)
            .returns(null, 3)
            .check();
    }
{code}

fails with:

{code:java}
java.lang.AssertionError: Collections sizes are not equal:
Expected: [[1, 1], [2, 2], [null, 3]]
Actual:   [[null, 3]] 
{code}

The is an incorrect numeric types coercion with _IS NOT DISTINCT_. Works is the 
column type is the same: _INTEGER_.

Adoption of IGNITE-18163.



  was:
The test

{code:java}
@Test
    public void testIsNotDistinctFrom() {
        executeSql("CREATE TABLE t1(i1 INTEGER, i2 INTEGER)");
        executeSql("INSERT INTO t1 VALUES (1, null), (2, 2), (null, 3), (3, 
null)");

        executeSql("CREATE TABLE t2(i3 DECIMAL, i4 INTEGER)");
        executeSql("INSERT INTO t2 VALUES (1, 1), (2, 2), (null, 3), (4, 
null)");

        String sql = "SELECT i1, i4 FROM t1 JOIN t2 ON i1 IS NOT DISTINCT FROM 
i3";

        assertQuery(sql)
            .returns(1, 1)
            .returns(2, 2)
            .returns(null, 3)
            .check();
    }
{code}

fails with:

{code:java}
java.lang.AssertionError: Collections sizes are not equal:
Expected: [[1, 1], [2, 2], [null, 3]]
Actual:   [[null, 3]] 
{code}

The is an incirrect numeric types coercion with _IS NOT DISTINCT_. Works is the 
column type is the same: _INTEGER_.

Adoption of IGNITE-18163.




> Calcite. Wrong numeric type coercion with 'IS DISTINCT FROM'
> ------------------------------------------------------------
>
>                 Key: IGNITE-23179
>                 URL: https://issues.apache.org/jira/browse/IGNITE-23179
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Vladimir Steshin
>            Assignee: Vladimir Steshin
>            Priority: Major
>              Labels: calcite, ise
>         Attachments: IsNotDistinctFromTest.java
>
>
> The test
> {code:java}
> @Test
>     public void testIsNotDistinctFrom() {
>         executeSql("CREATE TABLE t1(i1 INTEGER, i2 INTEGER)");
>         executeSql("INSERT INTO t1 VALUES (1, null), (2, 2), (null, 3), (3, 
> null)");
>         executeSql("CREATE TABLE t2(i3 DECIMAL, i4 INTEGER)");
>         executeSql("INSERT INTO t2 VALUES (1, 1), (2, 2), (null, 3), (4, 
> null)");
>         String sql = "SELECT i1, i4 FROM t1 JOIN t2 ON i1 IS NOT DISTINCT 
> FROM i3";
>         assertQuery(sql)
>             .returns(1, 1)
>             .returns(2, 2)
>             .returns(null, 3)
>             .check();
>     }
> {code}
> fails with:
> {code:java}
> java.lang.AssertionError: Collections sizes are not equal:
> Expected: [[1, 1], [2, 2], [null, 3]]
> Actual:   [[null, 3]] 
> {code}
> The is an incorrect numeric types coercion with _IS NOT DISTINCT_. Works is 
> the column type is the same: _INTEGER_.
> Adoption of IGNITE-18163.



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

Reply via email to