flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Flavio Pompermaier <pomperma...@okkam.it>
Subject Re: Read every file in a directory at once
Date Thu, 18 Feb 2016 15:02:43 GMT
My current solution is:

List<String> paths = new ArrayList<String>();
File dir = new File(BASE_DIR);
for (File f : dir.listFiles()) {
      paths.add(f.getName());
}
 DataSet<String> mail = env.fromCollection(paths).map(new
FileToString(BASE_DIR)).

The FileToString does basically a map that return FileUtils.toString(new
File(baseDir, filePath));

I hope this could help someone else..


On Thu, Feb 18, 2016 at 3:48 PM, Flavio Pompermaier <pompermaier@okkam.it>
wrote:

> Hi to all,
> I want to apply a map function to every file in a folder. Is there an easy
> way (or an already existing InputFormat) to do that?
>
> Best,
> Flavio
>

Mime
View raw message