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

Vladimir Steshin updated IGNITE-23308:
--------------------------------------
    Release Note: Fixed incorrect result in unions in case of different types 
of numeric results.

> Calcite. Wrong numeric type coercion with set-op operations.
> ------------------------------------------------------------
>
>                 Key: IGNITE-23308
>                 URL: https://issues.apache.org/jira/browse/IGNITE-23308
>             Project: Ignite
>          Issue Type: Bug
>    Affects Versions: 2.14
>            Reporter: Vladimir Steshin
>            Priority: Major
>              Labels: calcite, ignite-2, ise
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Wrong numers cast with operators like _UNION_ / _INTERSECT_ / EXCEPT. 
> Reproducer:
> {code:java}
>     public void testUnionWithNumerics() {
>         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(ignite(0), "SELECT val from t0 UNION select val from t1")
>             .returns(new BigDecimal(10))
>             .ordered()
>             .check();
>     }
> {code}
> Error:
> {code:java}
> java.lang.AssertionError: Collections sizes are not equal:
> Expected: [[10]]
> Actual:   [[10], [10]] 
> {code}
> Or:
> {code:java}
>     public void testIntersectWithNumerics() {
>         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), (2, 20), (3, 30), (4, 40), (5, 
> 50)");
>         sql("INSERT INTO t1 VALUES (1, 10), (2, 20), (3, 300), (4, 400), (5, 
> 50)");
>         assertQuery(ignite(0), "SELECT val from t0 INTERSECT select val from 
> t1")
>             .returns(new BigDecimal(10))
>             .returns(new BigDecimal(20))
>             .returns(new BigDecimal(50))
>             .ordered()
>             .check();
>     }
> {code}
> Error:
> {code:java}
> java.lang.AssertionError: Collections sizes are not equal:
> Expected: [[10], [20], [50]]
> Actual:   [] 
> {code}
> Adoption of #IGNITE-21827 and #IGNITE-20649



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

Reply via email to