[ 
https://issues.apache.org/jira/browse/DRILL-6362?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17006251#comment-17006251
 ] 

Paul Rogers commented on DRILL-6362:
------------------------------------

DRILL-7502 fixes this issues, along with several related issues.

> 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
>            Assignee: Paul Rogers
>            Priority: Major
>
> 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
(v8.3.4#803005)

Reply via email to