[ https://issues.apache.org/jira/browse/DRILL-6362?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul Rogers reopened DRILL-6362: -------------------------------- > 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)