Generate and Split XML

Seven Stars

Generate and Split XML

Hello all,

 

I am generating an XML file which is approximately 1.5 Gb and as far as now its works perfectly.

 

In order to avoid, outofmemory exception (reap size or garbage collector) if ever there is an increase in my input files, i want to implement the process below:

 

Here is my idea :

Instead of generating a large file, i want to generate multiple xml file but it should be according to a size limit.

I also want to make sure that each file has its opening and closing root tag.

 

In other words, if the file generated has come to the size limit declared then process the last row along with its closing tag....repeat...

 

Can this be done via TOS Big Data v6.4 ?

Can you please advice ?

 

Here is my job : 

 

Capturea.PNG

 

My tFileInputDelimited_1 contains 88,900 rows.

 

Best regards,

asadasing


Accepted Solutions
Community Manager

Re: Generate and Split XML

This tutorial is not exactly what you want, but it is pretty close and you can probably use the theory behind it to achieve your goal. Essentially you can group your data into batches and produce an XML per batch. So, if you can guesstimate the number of records in a batch which meets you size criteria, you can produce XML chunks to that size.

 

The key thing here is using a tLoop (or maybe an iterator if you can batch and group in your database) to produce different files.

 

Take a look: https://www.rilhia.com/tutorials/load-xml-files-batches-records


All Replies
Community Manager

Re: Generate and Split XML

This tutorial is not exactly what you want, but it is pretty close and you can probably use the theory behind it to achieve your goal. Essentially you can group your data into batches and produce an XML per batch. So, if you can guesstimate the number of records in a batch which meets you size criteria, you can produce XML chunks to that size.

 

The key thing here is using a tLoop (or maybe an iterator if you can batch and group in your database) to produce different files.

 

Take a look: https://www.rilhia.com/tutorials/load-xml-files-batches-records

Seven Stars

Re: Generate and Split XML

Genius

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Put Massive Amounts of Data to Work

Learn how to make your data more available, reduce costs and cut your build time

Watch Now

How OTTO Utilizes Big Data to Deliver Personalized Experiences

Read about OTTO's experiences with Big Data and Personalized Experiences

Blog

Talend Integration with Databricks

Take a look at this video about Talend Integration with Databricks

Watch Now