when I import a JSON file with the json parser into a flex zone, many arrays are automatically put in one column. So far no problem. But the data type is often long varbinary and the actual content gets lost.
I use - on purpose - flatten_arrays=0.
Extract from JSON file (source):
"salience": {
"content": { "entities": [{ "about": 1, "name": "Chris Dunbar", "sentiment": 1, "evidence": 7, "themes": ["guy walking", "absolute treat", "much talent"], "confident": 1, "label": "Person", "type": "Person" }, { "about": 1, "name": "Jerry", "sentiment": -21, "evidence": 7, "themes": ["video section feeding", "absolute treat", "much talent"], "confident": 1, "label": "Person", "type": "Person" }, { "about": 0, "name": "Audrey", "sentiment": -18, "evidence": 5, "themes": ["video section feeding", "absolute treat", "much talent"], "confident": 1, "label": "Person", "type": "Person" }], "sentiment": 2 } }
After having computed the flex table keys, the content of e.g. "salience.content.entities" looks as follows (tool: DBeaver); data type: long varbinaryWithin batch on the VM of Vertica 7 Community Edition, it loos a bit better but still: it contains wrong values and is nearly unreadable
MyFirstDatabase=> select "salience.content.entities" from facebook; salience.content.entities
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
� defgmyz��������9 ? @ A B H N Q � 117PersonChris Dunbar1 4 )guy walkingabsolute treatmuch talent 012Person117PersonJerry-21 > %3video section feedingabsolute treatmuch talent 012Person015PersonAudrey-18 > %3video section feedingabsolute treatmuch talent 012Person dkv����������������
$ 0.about0.confident0.evidence0.label0.name0.sentiment0.themes0.type1.about1.confident1.evidence1.label1.name1.sentiment1.themes1.type2.about2.confident2.evidence2.label2.name2.sentiment2.themes2.type
(1 row)
Is there any solution how to avoid this or to "re-convert" it to the actual content? The best solution may be a proper import.
Please note, flatten_arrays=1 (resp. true) works fine but this is not what I want to do.
Thank you!