Talend - Binary object

One Star

Talend - Binary object

Hello,
Does talend allow ETL operations on binary objects like sql-server varbinay, oracle - BLOB or we need to provide some workarounds?
Thanks
One Star

Re: Talend - Binary object

Hi
Step1:
Let's create a user routine called 'MyRoutineDemo'. It has a ByteArrayFromFile function, that is used to read a file and convert it to a byte array. As seen below:
package routines;

public class MyRoutineDemo {

public static byte[] ByteArrayFromFile(String filepath) {
try
{ java.io.File file=new java.io.File(filepath);
java.io.FileInputStream fis = new java.io.FileInputStream(file);
int fileLength = (int) file.length();
byte[] incoming_file_data = new byte; // allocate byte array of right size
fis.read(incoming_file_data, 0, fileLength ); // read into byte array
fis.close();
return incoming_file_data;
}
catch(Exception err)
{
err.printStackTrace();
return null;
}
}
}
Step2:
Create a job to iterate each picture in the "D:/image/" folder and insert them into the 'blobdemo' table. The job design is detailed in the pictures below.
Regards,
Pedro

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 Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download