I have an issue that confuses me:
Your tutorial (Flex Tables Guide, 12/18/2013) explains how to load JSON files into Vertica 7. Your example (p. 7f., mountains.json) works fine.
Some days ago, I also tried to load the following example (from Standford Online) into Vertica. This didn't work (validated with www.jsonlint.com). This example is a bit more complex (e.g. "authors" array with 2/3 authors and an additional key "Remark") but my understanding of semi-structured data includes such complexicity.
{ "Books":[
{ "ISBN":"ISBN-0-13-713526-2", "Price":85, "Edition":3, "Title":"A First Course in Database Systems", "Authors":[
{"First_Name":"Jeffrey", "Last_Name":"Ullman"}, {"First_Name":"Jennifer", "Last_Name":"Widom"} ] },
{ "ISBN":"ISBN-0-13-815504-6", "Price":100, "Remark":"Buy this book bundled with 'A First Course' - a great deal!", "Title":"Database Systems:The Complete Book", "Authors":[
{"First_Name":"Hector", "Last_Name":"Garcia-Molina"}, {"First_Name":"Jeffrey", "Last_Name":"Ullman"}, {"First_Name":"Jennifer", "Last_Name":"Widom"} ] }
}]}Today, I tried to import simplier JSON file. Unfortunately, the import wasn't successful neither. Although there was no error, "0 rows" were imported. I retried and rechecked it twice but the result was still the same. The JSON file contains also hierarchy which might be the problem?! This is a simplified extract of the GPS tracking file file (also validated):
{"track": [
{"lon": "8.5987119674682617", "lat": "50.2353782653808594", "ele": "246.0", "time": "2014-01-17T15:57:28.000Z"},
{"lon": "8.5986804962158203", "lat": "50.2353210449218750", "ele": "242.0", "time": "2014-01-17T15:57:30.000Z"}
] }Consequently, I tried to find an error in my JSON file. But then, I realized that the syntax of the tutorial's example is not correct:This is your example (p.7):
{"name": "Everest", "type":"mountain", "height":29029, "hike_safety": 34.1}
{"name": "Mt St Helens", "type":"volcano", "height":29029, "hike_safety": 15.4}
{"name": "Denali", "type":"mountain", "height":17000, "hike_safety": 12.2}
{"name": "Kilimanjaro", "type":"mountain", "height":14000 }
{"name": "Mt Washington", "type":"mountain", "hike_safety": 50.6}The correct syntax should contain separators " , " within the arrays and an object, here "mountains". Hence, the syntax looks as follows, validated via jsonlint.com
{"mountains": [
{"name": "Everest", "type":"mountain", "height":29029, "hike_safety": 34.1} ,
{"name": "Mt St Helens", "type":"volcano", "height":29029, "hike_safety": 15.4} ,
{"name": "Denali", "type":"mountain", "height":17000, "hike_safety": 12.2} ,
{"name": "Kilimanjaro", "type":"mountain", "height":14000 } ,
{"name": "Mt Washington", "type":"mountain", "hike_safety": 50.6}
] }
Since your example isn't proper JSON in my eyes, I'm really confused and don't know how to go on because testing the import of different "semi-structured data levels" of JSON to Vertica is the main goal of my current task.The main purpose of this thread is not to tell you that your example is incorrect. It's rather to ask you how I can load my data (which is mainly hierarchical) into Vertica.Finally, this is the question:
What kind of JSON files (hierarchy, arrays, also syntax) can be loaded into Vertica 7? Do you have other examples or maybe advices how to "modify" the JSON files before importing them?
If you answer this question to me, I'll be very happy

Thank you in advance.
Adrian
PS: I've also read this thread (https://community.vertica.com/vertica/topics/flex_table) but it didn't help
