Extraction of image files using talend

Highlighted
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 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog