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

Steven Phillips commented on DRILL-1767:
----------------------------------------

I think this is expected, based on how Drill nested data support is designed. 
Drill does not have the concept of a nullable Map, but scalars can be null.

Of course, this is something we could potentially revisit if it there were a 
good reason to add it.

> kvgen ignores null scalars but not empty maps in the output
> -----------------------------------------------------------
>
>                 Key: DRILL-1767
>                 URL: https://issues.apache.org/jira/browse/DRILL-1767
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Functions - Drill, Storage - JSON
>            Reporter: Rahul Challapalli
>
> git.commit.id.abbrev=108d29f
> Dataset :
> {code}
> {
>  "id":1,
>  "keys":{"m1":{"v7":{"k1":"k2"}},"m2":{"v1":"abc","v2":{"w1":0.24}}}
> }
> {
>  "id":1,
>  "keys":{"m1":{"v7":{"k1":"k3"}},"m2":{"v1":"abc","v2":{"w1":0.2}}}
> }
> {code}
> Query :
> {code}
> select kvgen(keys) from `json_kvgenflatten/temp.json`;
> +------------+
> |   EXPR$0   |
> +------------+
> | 
> [{"key":"m1","value":{"v7":{"k1":"k2"},"v2":{}}},{"key":"m2","value":{"v7":{},"v1":"abc","v2":{"w1":0.24}}}]
>  |
> | 
> [{"key":"m1","value":{"v7":{"k1":"k3"},"v2":{}}},{"key":"m2","value":{"v7":{},"v1":"abc","v2":{"w1":0.2}}}]
>  |
> +------------+
> 2 rows selected (0.508 seconds)
> {code}
> In the above output , drill seems to be ignoring the empty scalars (v1) but 
> not empty maps (v2)



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

Reply via email to