drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Rogers (JIRA)" <j...@apache.org>
Subject [jira] [Created] (DRILL-6377) typeof() does not return DECIMAL scale, precision
Date Wed, 02 May 2018 05:23:00 GMT
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)

Mime
View raw message