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/21 02:33:33 UTC

[jira] [Commented] (DRILL-1741) kvgen does not work with nested map/unions

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

Jason Altekruse commented on DRILL-1741:
----------------------------------------

I think we should add one more test case for calling kvgen on a map, where the values are maps that contain maps themselves.

So are you have the case where we have values of type lists, maps, lists in lists, maps in lists, lists in maps

I think we should just go ahead and have a 6th case for a map in map.

> kvgen does not work with nested map/unions
> ------------------------------------------
>
>                 Key: DRILL-1741
>                 URL: https://issues.apache.org/jira/browse/DRILL-1741
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Functions - Drill
>    Affects Versions: 0.7.0
>            Reporter: Hao Zhu
>            Assignee: Mehant Baid
>             Fix For: 0.7.0
>
>         Attachments: DRILL-1741.patch
>
>
> Tested on latest 0.7.0.
> kvgen function does not work well with nested maps/unions.
> 1. This works fine:
> {code}
> $ cat test_work.json
> {
>   "data" : {
>     "col1" :  "aaa"
>   }
> }
> {code} 
> {code} 
> 0: jdbc:drill:zk=local> select kvgen(tab.data) from `test_work.json` tab;
> +------------+
> |   EXPR$0   |
> +------------+
> | [{"key":"col1","value":"aaa"}] |
> +------------+
> 1 row selected (0.034 seconds)
> {code} 
> 2. This failed:
> {code}
> $ cat test7.json
> {
>   "data" : {
>     "col1" : {
>       "one" : "aaa" 
>     }
>   }
> }
> {code}
> {code}
> 0: jdbc:drill:zk=local> select kvgen(tab.data) from `test7.json` tab;
> +------------+
> |   EXPR$0   |
> +------------+
> Query failed: Failure while running fragment., Mappify does not support input of type: MAP [ d2bfea52-9935-4d63-8ecc-52315a3c7c7b on 10.250.0.115:31010 ]
> java.lang.RuntimeException: java.sql.SQLException: Failure while executing query.
> 	at sqlline.SqlLine$IncrementalRows.hasNext(SqlLine.java:2514)
> 	at sqlline.SqlLine$TableOutputFormat.print(SqlLine.java:2148)
> 	at sqlline.SqlLine.print(SqlLine.java:1809)
> 	at sqlline.SqlLine$Commands.execute(SqlLine.java:3766)
> 	at sqlline.SqlLine$Commands.sql(SqlLine.java:3663)
> 	at sqlline.SqlLine.dispatch(SqlLine.java:889)
> 	at sqlline.SqlLine.begin(SqlLine.java:763)
> 	at sqlline.SqlLine.start(SqlLine.java:498)
> 	at sqlline.SqlLine.main(SqlLine.java:460)
> {code}



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