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

Andrey Mashenkov commented on IGNITE-23512:
-------------------------------------------

I've found similar issue, while working on different ticket.
Creating VALUES from literal also returns an integer instead of long.
```
RelNode singleValue = call.builder().values(singleRel.getRowType(), 0L).build();
```
 
During debugging I saw default RexBuilder derives type from numeric value 
instead of provided row type.
Due to the value belongs to INT type range, it creates a INT literal instead of 
BIGINT.

Hope this observation will be useful.

> Calcite. Wrong scale and cast of NUMERIC type
> ---------------------------------------------
>
>                 Key: IGNITE-23512
>                 URL: https://issues.apache.org/jira/browse/IGNITE-23512
>             Project: Ignite
>          Issue Type: Bug
>    Affects Versions: 2.14
>            Reporter: Vladimir Steshin
>            Priority: Minor
>              Labels: calcite, ignite-2, ise
>
> Reproducer:
> {code:java}
>     @Test
>     public void testDecimalLiteral() {
>          // Fails. Returns an integer, not a BigDecimal.
>          assertQuery("SELECT DECIMAL '10'").returns(new 
> BigDecimal(("10"))).check();
>         // Fails. Returns 0.00 instead of 0.0.
>         assertQuery("SELECT CASE WHEN false THEN DECIMAL '1.00' ELSE DECIMAL 
> '0.0' END")
>             .returns(new BigDecimal("0.0")).check();
>     }
> {code}



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

Reply via email to