Quantcast
Viewing latest article 2
Browse Latest Browse All 2

Escaping child operator in the HIVE function get_json_object

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 latest article 2
Browse Latest Browse All 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>