[ 
https://issues.apache.org/jira/browse/DRILL-1741?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Chun Chang closed DRILL-1741.
-----------------------------
    Assignee: Chun Chang  (was: Mehant Baid)

verified fix.

{code}
0: jdbc:drill:schema=dfs.drillTestDirAdvanced> select t.id, kvgen(t.ooos) from 
`complex.json` t limit 1;
+------------+------------+
|     id     |   EXPR$1   |
+------------+------------+
| 1          | [{"key":"oa","value":{"oab":{"oabc":"ooos string 1"}}}] |
+------------+------------+
{code}

test case exist - complex40.q

> 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: Chun Chang
>             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)

Reply via email to