[ https://issues.apache.org/jira/browse/DRILL-1653?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Rahul Challapalli closed DRILL-1653. ------------------------------------ Verified and added the below testcase Functional/Passing/json_kvgenflatten/combo/kvgenflatten_DRILL-1653.q > 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 > Fix For: 0.7.0 > > > 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)