You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Rahul Challapalli (JIRA)" <ji...@apache.org> on 2014/11/07 03:03:33 UTC

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

Rahul Challapalli created DRILL-1653:
----------------------------------------

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