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/04/27 05:06:00 UTC

[jira] [Created] (DRILL-6362) typeof() lies about types

Paul Rogers created DRILL-6362:
----------------------------------

             Summary: typeof() lies about types
                 Key: DRILL-6362
                 URL: https://issues.apache.org/jira/browse/DRILL-6362
             Project: Apache Drill
          Issue Type: Improvement
    Affects Versions: 1.13.0
            Reporter: Paul Rogers


Drill provides a {{typeof()}} function that returns the type of a column. But, it seems to make up types. Consider the following input file:

{noformat}
{a: true}
{a: false}
{a: null}
{noformat}

Consider the following two queries:
{noformat}
SELECT a FROM `json/boolean.json`;
+--------+
|   a    |
+--------+
| true   |
| false  |
| null   |
+--------+
> SELECT typeof(a) FROM `json/boolean.json`;
+---------+
| EXPR$0  |
+---------+
| BIT     |
| BIT     |
| NULL    |
+---------+
{noformat}

Notice that the values are reported as BIT. But, I believe the actual type is UInt1 (the bit vector is, I believe, deprecated.) Then, the function reports NULL instead of the actual type for the null value.

Since Drill has an {{isnull()}} function, there is no reason for {{typeof()}} to muddle the type.



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