Vitalii Diravka created DRILL-5757:
--------------------------------------

             Summary: CONVERT_TO_JSON function is failed while using 
non-existence field as a parameter.
                 Key: DRILL-5757
                 URL: https://issues.apache.org/jira/browse/DRILL-5757
             Project: Apache Drill
          Issue Type: Bug
          Components: Execution - Data Types
    Affects Versions: 1.11.0
            Reporter: Vitalii Diravka
            Assignee: Vitalii Diravka
             Fix For: 1.12.0


Using of non-existence field as parameter (or field with null values across a 
whole batch) of CONVERT_TO_JSON function leads to failure.

simple.json
{code}
{"id": 0}
{code}
{code}
0: jdbc:drill:zk=local> select `id`, convert_to(`complex_field`, 'JSON') from 
dfs.`/tmp/simple.json`;
Error: SYSTEM ERROR: UnsupportedOperationException: Unable to get holder type 
for minor type [LATE] and mode [OPTIONAL]

Fragment 0:0

[Error Id: a13a1ed0-f8fe-4d4a-ba35-ab17c3a2f171 on vitalii-pc:31010] 
(state=,code=0)
{code}

The root cause of the issue and fix:
If there isn't a particular vector for the field, "NullExpression" is created 
as an argument for the Drill function. That argument can be replaced later in 
"ExpressionTreeMaterializer.visitFunctionCall()" with "TypedNullConstant" 
logical expression, but LATE type shouldn't be used for this case, the data 
type of the field is still unknown.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to