Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Convert CSV containing JSON value into pure JSON

Highlighted

Convert CSV containing JSON value into pure JSON

Contributor

Hi!

Could you please help with converting CSV file containing JSON values into JSON:

1|portout|Donor Reject Accepted|719dfa55b8dd42be8f64d55ddee0c805|10000001518591|2018-09-26 22:00:00|2018-09-25 17:18:53|0|89011122244|Satish Chippa|200003530|1|{"xxxxxxx98009":[{"subscription_state":{"status":"Terminated","reason_code":4001}},{"subscription_early_portout":{"status":"Early Portout","reason_code":4005}}]}||2|
2|portout|Donor Reject Accepted|554a2faa9bb548dc848915e95938fe22|10000001518592|2018-09-26 22:00:00|2018-09-25 17:30:25|0|67811122233|Satish Chippa|200003528|1|{"xxxxxxx38009":[{"subscription_state":{"status":"Terminated","reason_code":4001}}]}||2|
3|portout|Donor Reject Accepted|3732aa2495ce4f37844716848e88c989|10000001518596|2018-09-28 04:00:00|2018-09-26 17:31:09|0|99001990981|Aman PortOut|200003523|2|{"xxxxxxx69009":[{"subscription_state":{"status":"Terminated","reason_code":4001}},{"subscription_early_portout":{"status":"Early Portout","reason_code":4005}},{"customer_open_invoices":{"status":"Customer has open invoices","reason_code":4002}}]}||2|


I've tried with ConvertRecord and InferAvroSchema processors, but they fail to process the field with json value.

Thanks in advance!


1 REPLY 1

Re: Convert CSV containing JSON value into pure JSON

@Gulshan Agivetova

Have you tried extracting the CVS values from the files and convert them separately?