Details
-
Improvement
-
Status: Reopened
-
Major
-
Resolution: Unresolved
-
1.13.0
-
None
-
None
-
None
Description
Drill provides a typeof() function that returns the type of a column. But, it seems to make up types. Consider the following input file:
{a: true} {a: false} {a: null}
Consider the following two queries:
SELECT a FROM `json/boolean.json`; +--------+ | a | +--------+ | true | | false | | null | +--------+ > SELECT typeof(a) FROM `json/boolean.json`; +---------+ | EXPR$0 | +---------+ | BIT | | BIT | | NULL | +---------+
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.
Attachments
Attachments
Issue Links
- is duplicated by
-
DRILL-5189 There's no documentation for the typeof() function
-
- Resolved
-
- is part of
-
DRILL-7502 Incorrect/invalid codegen for typeof() with UNION
-
- Resolved
-