How to load mapping into a tjavarow for generic code

Highlighted
Six Stars

How to load mapping into a tjavarow for generic code

Hello, 

I have a requirement where in a generic talend extract job i have a tJavarow to perform input-output mapping.

Is there any way where we can read all the mappings from a text file and load to tJavarow component.

please note this is a big data job.

 

Thanks

Badri Nair

Tags (2)
Highlighted
Community Manager

Re: How to load mapping into a tjavarow for generic code

Technically you could do something like this with a lot of Java code. But when it comes to your input schema and output schemas you cannot change them dynamically during a job. You can use the Dynamic schema to deal with unknown schemas if you have Data Fabric. 

 

This sounds like you are trying to recreate something done in a different integration tool. Maybe if you give your use case we can help point you in a way of doing it that is better suited to Talend.

Highlighted
Six Stars

Re: How to load mapping into a tjavarow for generic code

Hi, 

Thank you for the response. THis is in relation to the other question that I had " genric job to run on AWS and CDH".

The schema is fixed and it is stored. We would just like to load  the input output mappings into a tJavaRow component .

Can you please show us how that is possible.

 

Thanks

BAdri Nair 

Highlighted
Community Manager

Re: How to load mapping into a tjavarow for generic code

Examples of how to use the tJava components is given here...

https://help.talend.com/reader/NFGUc8bs6NnLij6GaHwLEg/AJeBU6YQ6Q1j~ENrb2w8YQ

 

You might find that using the tJavaFlex may be more useful to you in some situations as it gives you a bit more control.

 

The thing to remember with the tJavaRow is that the input and output rows are NOT the same as those actually feeding or coming out of the component. They are used like this.... 

output_row.id = input_row.id;

 ....assuming the input row is "row1", the output row is "row2" and the column is "id", you would pass the data through as above. This is not the same with the tJavaFlex which uses the input and output row names as supplied. 

You can set the schemas using the schema button or can simply connect your adjoining components to have the schema set that way.

2019 GARTNER 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

Self-service Talend Migration: Moving from On-Premises to the Cloud

Move from On-Premises to the Cloud by following the advice of experts

Read 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