drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vitalii Diravka (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (DRILL-5757) CONVERT_TO_JSON function is failed while using non-existence field as a parameter.
Date Fri, 01 Sep 2017 13:19:00 GMT

     [ https://issues.apache.org/jira/browse/DRILL-5757?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Vitalii Diravka updated DRILL-5757:
-----------------------------------
    Description: 
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.

Note: the issue is reproduced not only for json (for example mongo or mapr-db json tables
have the same issue)

  was:
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.

Note: the issue is appliciable not only for json (for example mongo or mapr-db json tables
have the same issue)


> 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
>              Labels: ready-to-commit
>             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.
> Note: the issue is reproduced not only for json (for example mongo or mapr-db json tables
have the same issue)



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

Mime
View raw message