I'm using Apache beam with Python and I have a ppl file which looks something like this:
FileExample.ppl:
{"name":"Julio"}
{"name":"Angel", "Age":35}
{"name":"Maria","cellphone":NULL}
{"name":NULL,"cellphone":"3451-14-12"}
etc...
I need to split the file not for each line but for each json (in the real file the jsons are not only of one line but multiple and undefined amount of lines).
And then I need to validate the content of each json (because in the file there are 6 types of jsons, the ones that have all the keys with a value, the ones that don't, etc.). After that I need different pcollection for each type of json. I'm thinking about using beam.flatmap() to achieve this last step but first I need to have something like this:
jsons = pipeline | "splitElements" >> ReadFromText(file)
Thank you in advance, Keep in mind that I am new to this.