Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.15.0
-
None
Description
*TypeOf functions works when request on files but doesn't work on "generated" data
This works :
SELECT typeof(md5), drillTypeOf(md5), sqlTypeOf(md5) FROM dfs.tmp.`mytable.csv` LIMIT 2; => (OK) +----------+----------+--------------------+ | EXPR$0 | EXPR$1 | EXPR$2 | +----------+----------+--------------------+ | VARCHAR | VARCHAR | CHARACTER VARYING | | VARCHAR | VARCHAR | CHARACTER VARYING | +----------+----------+--------------------+
But not :
SELECT typeOf(a) FROM (SELECT CAST (5 as int) AS a) x;
=> (NOK)
Error: SYSTEM ERROR: IllegalArgumentException: Can not set org.apache.drill.exec.vector.complex.reader.FieldReader field org.apache.drill.exec.expr.fn.impl.UnionFunctions$GetType.input to org.apache.drill.exec.expr.holders.IntHolder
And in a surprising way the next query works :
SELECT md5, typeof(t), drillTypeOf(t), sqlTypeOf(t) FROM ((SELECT 'foo' AS t ) union (SELECT 'far' AS t)) x; => (OK) +-------+----------+----------+--------------------+ | md5 | EXPR$1 | EXPR$2 | EXPR$3 | +-------+----------+----------+--------------------+ | foo | VARCHAR | VARCHAR | CHARACTER VARYING | | bar | VARCHAR | VARCHAR | CHARACTER VARYING | +-------+----------+----------+--------------------+
Attachments
Issue Links
- relates to
-
DRILL-6533 (type|sqlType|drillType|mode)Of functions fail when used with constants
- Resolved