You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CREATE EXTERNAL TABLE IF NOT EXISTS mytable (
value:map<string,int>,
end_time:string
)
ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe'
STORED AS TEXTFILE
LOCATION 'my location';
Then I get the error:
org.openx.data.jsonserde.json.JSONArray cannot be cast to org.openx.data.jsonserde.json.JSONObject
I would prefer you provide a way to flag this issue as ignorable. I'd prefer not to ignore the entire json file, but just rather null out that particular value. And ignore.malformed.json=true doesn't skip this error anyway.
Another possible fix would be to implement a uniontype complex type so I could declare that it could be an array or a map.
The text was updated successfully, but these errors were encountered:
Mm...making it ignore an empty array should not be hard to do. I want to code support for union types too since several people have been asking for it.
My JSON is usually this format:
But sometimes Facebook makes value an empty array not a map:
If I declare my table as a map as follows:
Then I get the error:
org.openx.data.jsonserde.json.JSONArray cannot be cast to org.openx.data.jsonserde.json.JSONObject
I would prefer you provide a way to flag this issue as ignorable. I'd prefer not to ignore the entire json file, but just rather null out that particular value. And ignore.malformed.json=true doesn't skip this error anyway.
Another possible fix would be to implement a uniontype complex type so I could declare that it could be an array or a map.
The text was updated successfully, but these errors were encountered: