drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rahul Challapalli (JIRA)" <j...@apache.org>
Subject [jira] [Created] (DRILL-1653) flatten function over kvgen gives wrong output when kvgen returns an empty map
Date Fri, 07 Nov 2014 02:03:33 GMT
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)

Mime
View raw message