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

Pavel Pereslegin updated IGNITE-21827:
--------------------------------------
    Description: 
Union returns incorrect result for NUMERIC/DECIMAL and INT columns

Simple reproducer:
{code:java}
    sql("CREATE TABLE t0(id INT PRIMARY KEY, val INT)");
    sql("CREATE TABLE t1(id INT PRIMARY KEY, val DECIMAL)");
    sql("INSERT INTO t0 VALUES (1, 10)");
    sql("INSERT INTO t1 VALUES (1, 10)");

    assertQuery("SELECT id, val from t0 UNION select id, val from t1")
            .returns(1, new BigDecimal(10))
            .ordered()
            .check();
{code}
Check fails:
{noformat}
java.lang.AssertionError: Collections sizes are not equal:
    Expected: 1
      Actual: 2
{noformat}
 

The actual result for such a query contains duplicate values.
{noformat}
 1  10
 1  10
{noformat}

  was:
Union returns incorrect result for NUMERIC/DECIMAL and INT columns

Simple reproducer:
{code:java}
    sql("CREATE TABLE t0(id INT PRIMARY KEY, val INT)");
    sql("CREATE TABLE t1(id INT PRIMARY KEY, val DECIMAL)");
    sql("INSERT INTO t0 VALUES (1, 10)");
    sql("INSERT INTO t1 VALUES (1, 10)");

    assertQuery("SELECT id, val from t0 UNION select id, val from t1")
            .returns(1, new BigDecimal(10))
            .ordered()
            .check();
{code}
Produces the following error:
{noformat}
java.lang.AssertionError: Collections sizes are not equal:
    Expected: 1
      Actual: 2
{noformat}
 

The actual result for such a query contains duplicate values.
{noformat}
 1  10
 1  10
{noformat}


> Sql. Union returns incorrect result for DECIMAL and INT columns
> ---------------------------------------------------------------
>
>                 Key: IGNITE-21827
>                 URL: https://issues.apache.org/jira/browse/IGNITE-21827
>             Project: Ignite
>          Issue Type: Bug
>          Components: sql
>            Reporter: Pavel Pereslegin
>            Priority: Major
>              Labels: ignite-3
>
> Union returns incorrect result for NUMERIC/DECIMAL and INT columns
> Simple reproducer:
> {code:java}
>     sql("CREATE TABLE t0(id INT PRIMARY KEY, val INT)");
>     sql("CREATE TABLE t1(id INT PRIMARY KEY, val DECIMAL)");
>     sql("INSERT INTO t0 VALUES (1, 10)");
>     sql("INSERT INTO t1 VALUES (1, 10)");
>     assertQuery("SELECT id, val from t0 UNION select id, val from t1")
>             .returns(1, new BigDecimal(10))
>             .ordered()
>             .check();
> {code}
> Check fails:
> {noformat}
> java.lang.AssertionError: Collections sizes are not equal:
>     Expected: 1
>       Actual: 2
> {noformat}
>  
> The actual result for such a query contains duplicate values.
> {noformat}
>  1  10
>  1  10
> {noformat}



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

Reply via email to