Quantcast
Channel: Escaping child operator in the HIVE function get_json_object - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Escaping child operator in the HIVE function get_json_object

$
0
0

I have table with a string column which contains data in JSON format. Then, I'm using the function get_json_object to parse some data from it. The problem is that one of my fields contains a . in its name. So, if write the field name in plain text, the function will interpret it like a child operator.

Here is a sample code that works:

select get_json_object(col, '$.rootkey')from (select '{"rootkey":15,"key.a":16,"key.b":17}' as col) test;

But this one fails:

select get_json_object(col, '$.key.a')from (select '{"rootkey":15,"key.a":16,"key.b":17}' as col) test;

Is there any way escape . in the get_json_object function?


Viewing all articles
Browse latest Browse all 2

Trending Articles