You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/08/31 17:13:00 UTC

[jira] [Commented] (DRILL-5757) CONVERT_TO_JSON function is failed while using non-existence field as a parameter.

    [ https://issues.apache.org/jira/browse/DRILL-5757?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16149280#comment-16149280 ] 

ASF GitHub Bot commented on DRILL-5757:
---------------------------------------

GitHub user vdiravka opened a pull request:

    https://github.com/apache/drill/pull/929

    DRILL-5757: CONVERT_TO_JSON function is failed while using non-existe…

    …nce field as a parameter.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/vdiravka/drill DRILL-5757

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/drill/pull/929.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #929
    
----
commit ad860593040bc2ad26d90ddf1d8158ae5c45810b
Author: Vitalii Diravka <vi...@gmail.com>
Date:   2017-08-31T13:24:37Z

    DRILL-5757: CONVERT_TO_JSON function is failed while using non-existence field as a parameter.

----


> 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)