You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Jason Altekruse (JIRA)" <ji...@apache.org> on 2014/10/24 20:20:35 UTC

[jira] [Commented] (DRILL-1575) kvgen function should eliminate keys with null values

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

Jason Altekruse commented on DRILL-1575:
----------------------------------------

+1

> kvgen function should eliminate keys with null values
> -----------------------------------------------------
>
>                 Key: DRILL-1575
>                 URL: https://issues.apache.org/jira/browse/DRILL-1575
>             Project: Apache Drill
>          Issue Type: Bug
>            Reporter: Neeraja
>            Assignee: Jason Altekruse
>            Priority: Critical
>         Attachments: DRILL-1575.patch
>
>
> Here is the same JSON I am trying to query and use kvgen function with.
> {
>         "name":"test",
>         "myarray":{
>                 "key1":2,
>                 "key4":3,
>                 "key2":4
>         }
> }{
>         "name":"mytest",
>         "myarray":{
>                 "key3":2,
>                 "key5":3,
>                 "key6":4
>         }
> }
> Currently , when I apply kvgen a list of 'unioned' columns are returned as keys in the result. For ex: both the result rows below have keys 1-6.
> The expected result is only the keys that actually have values associated with them.
> 0: jdbc:drill:zk=local> SELECT name, kvgen(myarray) FROM dfs.`default`.`/Users/nrentachintala/Downloads/apache-drill-0.7.0-incubating-SNAPSHOT/sample-data/mytest.json`;
> +------------+------------+
> |    name    |   EXPR$1   |
> +------------+------------+
> | test       | [{"key":"key1","value":2},{"key":"key4","value":3},{"key":"key2","value":4},{"key":"key3"},{"key":"key5"},{"key":"key6"}] |
> | mytest     | [{"key":"key1"},{"key":"key4"},{"key":"key2"},{"key":"key3","value":2},{"key":"key5","value":3},{"key":"key6","value":4}] |
> +------------+------------+



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)