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

Parth Chandra commented on DRILL-2872:
--------------------------------------

This is an issue with converting from a repeated type to JSON.  

select interests from dfs.`complex_student.json`
+------------+
| interests  |
+------------+
| ["Reading","Mountain Biking","Hacking"] |
| ["Soccer","Mountain Biking","C#"] |
| ["Tennis","Mountain Biking","Painting"] |
| ["Hockey","Mountain Biking","Singing"] |
| ["Swimming","Mountain Biking","Sking"] |
| ["Badminton","Hiking","Hacking"] |
| ["Cricket","Mountain Biking","Cooking"] |
| ["Table Tennis","Running","Hacking"] |
| ["Surfing","Mountain Biking","Music"] |
| ["Fencing","Mountain Biking","Writing"] |
+------------+

The following query returns nulls.

select cast(convert_to(interests, 'JSON') as varchar(0)) from 
dfs.`complex_student.json`

+------------+
|   EXPR$0   |
+------------+
| [ null, null, null ] |
| [ null, null, null ] |
| [ null, null, null ] |
| [ null, null, null ] |
| [ null, null, null ] |
| [ null, null, null ] |
| [ null, null, null ] |
| [ null, null, null ] |
| [ null, null, null ] |
| [ null, null, null ] |
+------------+



> Result from json file returns data from map type fields as "null"
> -----------------------------------------------------------------
>
>                 Key: DRILL-2872
>                 URL: https://issues.apache.org/jira/browse/DRILL-2872
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Execution - Data Types
>            Reporter: Krystal
>            Assignee: Parth Chandra
>            Priority: Critical
>             Fix For: 1.0.0
>
>         Attachments: complex_student.json
>
>
> git.commit.id=9ec257efb7992209e27c82e6f4ee8a5b12cc95e4
> select from a json file from ODBC returns data for map fields as "null". For 
> example:
> select * from `dfs.drillTestDirJson`.`complex_student.json`
> 1 fred ovid 76 1.55 692315658449 2014-05-27 00:26:07 [ null, null, null ]
> { "color" : "Blue", "sport" : "Soccer", "food" : "Spaghetti" }
> 2 bob brown 63 3.18 650706039334 2014-12-04 21:43:14 [ null, null, null ]
> { "color" : "Green", "sport" : "Soccer", "food" : "Pizza" }
> 3 bob hernandez 28 1.09 293612255322 2014-05-31 14:33:06 [ null, null, null ]
> { "color" : "Red", "sport" : "Tennis", "food" : "Hamburger" }
> 4 ulysses xylophone 31 1.67 896547822355 2014-06-12 11:27:33 [ null, null, 
> null ]
> { "color" : "Yellow", "sport" : "Hockey", "food" : "Pizza" }
> sqlline returns correct data for the same query.



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

Reply via email to