You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by Alexandre Krabbe <al...@gmail.com> on 2018/06/15 18:01:01 UTC
How to read JSON as a field using Apache Pig?
Please, can someone help me with this issue?
Here is the link to my question in Stack Overflow:
https://stackoverflow.com/questions/50878374/how-to-read-a-json-column-as-a-field-in-apache-pig
sincerely,
Alexandre Krabbe.
Re: How to read JSON as a field using Apache Pig?
Posted by Eyal Allweil <ey...@yahoo.com.INVALID>.
Hi Alex,
I've posted an answer for you on Stack Overflow - I'm pasting it below, so if anyone wants to offer any corrections, here or there, please do:
I think you need to use Twitter's Elephant Bird to parse a single json column in Pig. (If you wanted to parse files that are json-only, you could simply use Pig's JsonLoader API).
Here is a related question - it looks like your json is also an array, so what's written there will apply for you, too.
In case that doesn't work, here's a blog post describing how to write a Python UDF for a more specific case of JSON parsing. You can of course do the same thing with a Java UDF.
Regards,Eyal
On Friday, June 15, 2018, 10:00:47 PM GMT+3, Alexandre Krabbe <al...@gmail.com> wrote:
Please, can someone help me with this issue?
Here is the link to my question in Stack Overflow:
https://stackoverflow.com/questions/50878374/how-to-read-a-json-column-as-a-field-in-apache-pig
sincerely,
Alexandre Krabbe.