You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "Taras Bobrovytsky (JIRA)" <ji...@apache.org> on 2018/04/30 23:37:00 UTC

[jira] [Updated] (IMPALA-6518) Fix the output type of a decimal union for decimal_v2

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

Taras Bobrovytsky updated IMPALA-6518:
--------------------------------------
    Fix Version/s: Impala 2.13.0

> Fix the output type of a decimal union for decimal_v2
> -----------------------------------------------------
>
>                 Key: IMPALA-6518
>                 URL: https://issues.apache.org/jira/browse/IMPALA-6518
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Frontend
>    Affects Versions: Impala 3.0
>            Reporter: Taras Bobrovytsky
>            Assignee: Taras Bobrovytsky
>            Priority: Major
>             Fix For: Impala 3.0, Impala 2.13.0
>
>
> In the following query, the type of c1 is decimal(38, 38) for both decimal v1 and v2.
> {code:java}
> select c1 from (
> select cast(1 as decimal(38, 0)) as c1
> union all
> select cast(0.1 as decimal(38, 38)) as c1) t{code}
> This means that we are truncating from the front. It would make more sense to truncate from the back and round when decimal v2 is enabled. The output type should be (38, 6). This is what we do for other mathematical operations, such as addition.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org