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/11/07 03:36:33 UTC

[jira] [Commented] (DRILL-1653) flatten function over kvgen gives wrong output when kvgen returns an empty map

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

Jason Altekruse commented on DRILL-1653:
----------------------------------------

Just a quick update this is not actually private, its just on my personal github fork as I'm working on a couple of flatten fixes and making sure they all are passing tests and not conflicting with one another. https://github.com/jaltekruse/incubator-drill/commits/flatten-bugs-11-4-14

> flatten function over kvgen gives wrong output when kvgen returns an empty map
> ------------------------------------------------------------------------------
>
>                 Key: DRILL-1653
>                 URL: https://issues.apache.org/jira/browse/DRILL-1653
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Functions - Drill, Storage - JSON
>            Reporter: Rahul Challapalli
>
> git.commit.id.abbrev=60aa446
> I ran the below test against the private branch of Jason which has some patches for bugs related to flatten which are not yet merged into the master.
> Dataset used:
> {code}
> {
>     "id": 1,
>     "m": {"a":1,"b":2}
> }
> {
>     "id": 2
> }
> {
>     "id": 3,
>     "m": {"c":3,"d":4}
> }
> {code}
> kvgen works as expected
> {code}
> select id, kvgen(m) from `json_kvgenflatten/missing-map.json`;
> +------------+------------+
> |     id     |   EXPR$1   |
> +------------+------------+
> | 1          | [{"key":"a","value":1},{"key":"b","value":2}] |
> | 2          | []         |
> | 3          | [{"key":"c","value":3},{"key":"d","value":4}] |
> {code}
> Applying a flatten on top of kvgen returns wrong results
> {code}
> select id, flatten(kvgen(m)) from `json_kvgenflatten/missing-map.json`;
> +------------+------------+
> |     id     |   EXPR$1   |
> +------------+------------+
> | 1          | {"key":"\u0001","value":3} |
> | 1          | {"key":"\u0001","value":4} |
> | 3          | {}         |
> | 3          | {}         |
> +------------+------------+
> {code}



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