03-27-2021 03:51 PM
Hi,
I have a requirement to read multiple XML files data and load into Oracle table. I am using Directory browser to read the list of XML files and passing the path to File reader and then XML Parser, from XML parser the output is given to mapper there i am splitting the data on a column using xx.split(‘\n’). The output from mapper is given to JSON Splitter to split on xxx, this is working good for one XML file, if i try to process for multiple XML files the JSON split is not working as excepted.
Even i tried by creating child pipeline and passing path value, but i am getting same results. it is splitting one XML properly and other XML with only one record.
Please some one can advice here.
As per my understanding, the Directory browser will execute one file at a time, please correct me if i am wrong.
Solved! Go to Solution.
03-29-2021 02:50 PM
Thanks for the help. i didnt do any changes but now the JSON splitter is working as excepted. i just delete every thing and re created.
Thanks again
03-29-2021 07:35 AM
Hi Ptaylor,
As i mentioned above, i am applying split function on the xx column and that is generating an array. i am very sure the JSON is getting Array as input. i checked multiple times and as said above it is working if i execute the job for single file.
Thanks
03-29-2021 07:47 AM
I applied sl.ensureArray function and the column become an array, but still the problem exist as shown in above images
Note: The interesting part here is, i am passing file names to Directory browser which are saved in Excel file. if i remove excel file input and configure the Direcotry browser to read two files the problem is not coming the splitter is working as excepted. so is there any problem to pass file names from excel?
03-29-2021 07:53 AM
It’s not about whether there is one file or multiple files. The files will be parsed individually. It’s about what the data looks like in a single file. I’m guessing that things work fine when the data contains multiple elements at that path, since that will be parsed as an array, but fails when the data contains a single element at that path. You haven’t provided any detail about the failures – what errors are you seeing and what does the data look like for the failure cases?
03-29-2021 08:10 AM
Hi,
Ok, the data before JSON splitter… it has two rows
row1, row 2
The excepted output should be atleast more than one row in out put for two rows, but i am getting only one document as output for one of the xml
the excepted output is other columns also like version number,etc.
other xml is splitting as excepted.
As said earlier i didn’t find any issue if i execute pipeline for single files… i know as per logic it has to work because it is an array but i don’t know why it not splitting as excepted when i am trying to execute with multiple files…
03-29-2021 11:29 AM
Are you able to share some sample input files and an export of your pipeline?
It might help us understand what you’re trying to do and the issue you are running into.