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

Ramana Inukonda Nagaraj commented on DRILL-451:
-----------------------------------------------

Sorry,

The bug is different from what I thought.

{"c": 21.8, "humidity": 57.5, "sensor": "Bedroom", "dt": "2013-08-10", "tm": 
"09:25:02.686738", "f": 71.2}
{"c": 22.5, "humidity": 94.7, "sensor": "Outside", "dt": "2013-08-10", "tm": 
"09:25:06.340759", "f": 72.5}
{"c": "22.20", "f": "71.96", "altitude": "-0.42", "dt": "2013-08-10", "tm": 
"09:25:06.425669", "pressure_in": "29.92", "sensor": "Basement", "pressure_mb": 
"1013.30"}

If you notice the fields c are of different types in the rows. 

message: "Failure while running fragment. < ClassCastException:[ 
org.apache.drill.exec.vector.NullableFloat4Vector cannot be cast to 
org.apache.drill.exec.vector.NullableVarCharVector ]"


> JSON read fails if rows have different number of fields
> -------------------------------------------------------
>
>                 Key: DRILL-451
>                 URL: https://issues.apache.org/jira/browse/DRILL-451
>             Project: Apache Drill
>          Issue Type: Bug
>            Reporter: Ramana Inukonda Nagaraj
>
> Query: 
> 0: jdbc:drill:> select * from dfs.`/user/root/employeeObject.json`;
> Notice the input file has different fields. 
> Json file:
> {
>  "first": "Jimmy1",
>  "age": 29,
>  "sex": "M",
>  "salary": 6300.10
> }
> {
>  "first": "Jimmy",
>  "last": "James",
>  "age": 29,
>  "sex": "M",
>  "salary": 6300.10
> }
> {
>  "first": "Jimmy",
>   "sex": "M",
>  "salary": 6300.10
>  "wealth":100000
> }
> This works though:
> {
>  "first": "Jimmy1",
>  "age": 29,
>  "sex": "M",
>  "salary": 6300.10
> }
> {
>  "first": "Jimmy",
>  "last": "James",
>  "age": 29,
>  "sex": "M",
>  "mom": "testString",
>  "salary": 6300.10
> }
> 0: jdbc:drill:> select * from dfs.`/user/root/employeeObject.json`;
> +------------+------------+------------+------------+------------+------------+
> |   first    |    age     |    sex     |   salary   |    last    |    mom     
> |
> +------------+------------+------------+------------+------------+------------+
> | Jimmy1     | 29         | M          | 6300.1     | null       | null       
> |
> | Jimmy      | 29         | M          | 6300.1     | James      | testString 
> |
> +------------+------------+------------+------------+------------+------------+
> After playing around a bit, looks like this only happens if the extra field 
> is a float. Works perfectly if extra fields are int or string.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to