Extraction of image files using talend

One Star

Extraction of image files using talend

Hi,
  I want to extract JPEG files using talend and then store it to HDFS and to hive external table. Is it possible.? What Datatype should i use? how to proceed?
Thanks in advance..
Six Stars

Re: Extraction of image files using talend

I think maybe you can read the binary content of each file in Talend to String, so use tFileList to list file -> and then some tFileInputRaw. Then you store it by tHDFSOutput component.
The pure Java way here is quite straight forward:
try{
Path pt=new Path("hdfs:/jp./myserver.com:9000/user/someuser/out/somepath");
FileSystem fs = FileSystem.get(new Configuration());
BufferedWriter br=new BufferedWriter(new OutputStreamWriter(fs.create(pt,true)));
// TO append data to a file, use fs.append(Path f)
String line;
line="This is BINARY content fo JPEG in String form";
System.out.println(line);
br.write(line);
br.close();
}catch(Exception e){
System.out.println("File not found");
}

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

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch