reverted filters in the clening process

This commit is contained in:
Claudio Atzori 2020-11-25 10:24:42 +01:00
parent e1a1bb3ee4
commit 36173c13a5
1 changed files with 0 additions and 6 deletions

View File

@ -103,15 +103,9 @@ public class CleanGraphSparkJob {
return spark
.read()
.textFile(inputEntityPath)
.filter((FilterFunction<String>) s -> isEntityType(s, clazz))
.map((MapFunction<String, String>) s -> StringUtils.substringAfter(s, "|"), Encoders.STRING())
.map(
(MapFunction<String, T>) value -> OBJECT_MAPPER.readValue(value, clazz),
Encoders.bean(clazz));
}
private static <T extends Oaf> boolean isEntityType(final String s, final Class<T> clazz) {
return StringUtils.substringBefore(s, "|").equals(clazz.getName());
}
}