Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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..
Labels (2)
1 Reply
Anonymous
Not applicable
Author

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");
}