'Parse json array and load into a table

I'm having issues with parsing a json array and loading into a hive table.

Json array lives in table dmetrics and in column metrics

The json looks like this"

{"impressions":8256,"requests":67.....

I keep getting the following error :

{"cannot resolve 'get_json_object(dmetrics.metrics, '$.imppressions')' due to data type mismatch: argument 1 requires string type, however, 'dmetrics.metrics' is of struct<confirmedimpressions:bigint,requests:bigint,....

I'm using the following code:

get_json_object(dmetrics.metrics, '$.impression.included)


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source