You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Arina Ielchiieva (JIRA)" <ji...@apache.org> on 2019/04/02 17:13:00 UTC

[jira] [Resolved] (DRILL-6377) typeof() does not return DECIMAL scale, precision

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

Arina Ielchiieva resolved DRILL-6377.
-------------------------------------
       Resolution: Fixed
    Fix Version/s: 1.16.0

> typeof() does not return DECIMAL scale, precision
> -------------------------------------------------
>
>                 Key: DRILL-6377
>                 URL: https://issues.apache.org/jira/browse/DRILL-6377
>             Project: Apache Drill
>          Issue Type: Bug
>    Affects Versions: 1.13.0
>            Reporter: Paul Rogers
>            Priority: Minor
>             Fix For: 1.16.0
>
>
> The {{typeof()}} function returns the type of a column:
> {noformat}
> SELECT typeof(CAST(a AS DOUBLE)) FROM (VALUES (1)) AS T(a);
> +---------+
> | EXPR$0  |
> +---------+
> | FLOAT8  |
> +---------+
> {noformat}
> In Drill, the {{DECIMAL}} type is parameterized with scale and precision. However, {{typeof()}} does not return this information:
> {noformat}
> ALTER SESSION SET `planner.enable_decimal_data_type` = true;
> SELECT typeof(CAST(a AS DECIMAL)) FROM (VALUES (1)) AS T(a);
> +------------------+
> |      EXPR$0      |
> +------------------+
> | DECIMAL38SPARSE  |
> +------------------+
> SELECT typeof(CAST(a AS DECIMAL(6, 3))) FROM (VALUES (1)) AS T(a);
> +-----------+
> |  EXPR$0   |
> +-----------+
> | DECIMAL9  |
> +-----------+
> {noformat}
> Expected something of the form {{DECIMAL<suffix>(<scale>, <precision>)}}.



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