You can translate the question and the replies:

Using JSON data source from file, when the root is array

Hi, I tried to use the JSON data source, when the root json type is array. Let's take for example a file containing the following data : [{"id" : 3, "name" : "xxx", "color" : "blue", "available" : false},{"id" : 13, "name" : "yyy", "color" : "green", "available" : true}] I was able to point the data source of JSON type to the file containing the above, using Local. Then, while creating the base view, I used the TUPLEROOT=/JSONfile/jsonarray which seems to be what Denodo understand as the type of the array. Now, in this point denodo knows how to understand the schema of the json (even when it contains complex types). The view is created o.k. Let's say I called the view : json_test_array_flatten Then, I am trying to use the VQL shell with : "select * from json_test_array_flatten" however, the number of rows returning in 0. I expected that I'll be able to query all the array elements as row in the created view, but it seems like nothing is returning. Meaning, I expected that I'll get the 2 lines, with rows as Denodo was able to understand the schema. Can somebody shed some light over what is happening there ? Regards, Rani
user
01-03-2017 05:51:07 -0500

2 Answers

Hi, I tried the following way and it worked for me perfect, While creating the base view, I used tuple root as “TUPLEROOT = /JSONFile/JSONArray” instead of “TUPLEROOT = /JSONFile/jsonarray” for flattening the array type JSON file. Then, when I queried the base view, as expected the number of rows returned was 2. Hope this helps!!
Denodo Team
03-03-2017 04:26:06 -0500
OK, that worked, thanx. It seems like there was an issue with the case sensitivity.
user
05-03-2017 04:48:34 -0500
You must sign in to add an answer. If you do not have an account, you can register here