Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
0.6.0
-
None
Description
The following query worked before, but fails with the latest master (#Fri Sep 12 14:08:02 PDT 2014
git.commit.id.abbrev=9e16466)
0: jdbc:drill:schema=dfs> select convert_from(convert_to(rl[1], 'JSON'), 'JSON') from `input2.json`;
Query failed: Failure while running fragment. Failure while parsing JSON. Found token of [VALUE_NULL] Drill currently only supports parsing json strings that contain either lists or maps. The root object cannot be a scalar.
at [Source: java.io.StringReader@3d552116; line: 1, column: 9] [8752d761-4ed4-4314-b621-e9f061849a11]
Error: exception while executing query: Failure while trying to get next result batch. (state=,code=0)
The input2.json file looks like this:
[root@qa-node120 ~]# hadoop fs -cat /user/root/mondrian/input2.json
{ "integer" : 2010,
"float" : 17.4,
"x":
,
"z": [
,
{"pink" : "purple" } ],
"l": [4,2],
"rl": [ [2,1], [4,6] ]
}
{ "integer" : -2002,
"float" : -1.2
}
{ "integer" : 2001,
"float" : 1.2,
"x":
,
"z": [
],
"l": [4,2],
"rl": [ [2,1], [4,6] ]
}
{ "integer" : 6005,
"float" : 1.2,
"x":
,
"z": [
],
"l": [4,2],
"rl": [ [2,1], [4,6] ]
}
The convert_to appears working:
0: jdbc:drill:schema=dfs> select convert_to(rl[1], 'JSON') from `input2.json`;
------------
EXPR$0 |
------------
[B@3a8a8b88 |
[B@5dceabbe |
[B@2b6d770f |
[B@1fa3900f |
------------
4 rows selected (0.116 seconds)