Copy input row to output row with tJavaRow

One Star

Copy input row to output row with tJavaRow

Hey all,
when I do this : output_row = input_row; (much like in perl doing @output_row = @input_row);
I get this error: Type mismatch: cannot convert from load_my_draw.row1Struct to load_my_draw.row2Struct
Is there a way to copy teh complete row from input row to output row?
Ries
Community Manager

Re: Copy input row to output row with tJavaRow

Hello
It is not available in Java now. Can you report a new feature on our bugtracker? In Java, you have to work filed by filed like:
(for example)
output_row.id = input_row.id;

Best regards
shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: Copy input row to output row with tJavaRow

there is a readData and writeData on each row so perhaps it's possible to do write a java routine to do something like this
in the tJavaRow
// write data
ByteArrayOutputStream myBytes = new ByteArrayOutputStream();
ObjectOutputStream dos = new ObjectOutputStream(myBytes);
input_row.writeData(dos);

// read data
ByteArrayInputStream myReadBytes =new ByteArrayInputStream(myBytes.toByteArray());
ObjectInputStream dis = new ObjectInputStream(myReadBytes);
output_row.readData(dis);

but i didn't manage to debug it !
Highlighted
One Star

Re: Copy input row to output row with tJavaRow

Hi,
How does it work now? Can we make a complete copy by using output_row=input_row? I try this but it seems I have a conversion problem.
One Star

Re: Copy input row to output row with tJavaRow

Hi,
How does it work now? Can we make a complete copy by using output_row=input_row? I try this but it seems I have a conversion problem.

Same question here. Any hints?

Calling Talend Open Studio Users

The first 100 community members completing the Open Studio survey win a $10 gift voucher.

Start the survey

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

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Download