You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Paul Rogers (JIRA)" <ji...@apache.org> on 2018/05/02 05:23:00 UTC

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

Paul Rogers created DRILL-6377:
----------------------------------

             Summary: 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


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)