refactoring

This commit is contained in:
Miriam Baglioni 2021-03-30 12:53:07 +02:00
parent e5463fea01
commit 08f8dd9454
1 changed files with 9 additions and 15 deletions

View File

@ -57,16 +57,12 @@ public class CommunitySplit implements Serializable {
Dataset<CommunityResult> community_products = result
.filter((FilterFunction<CommunityResult>) r -> containsCommunity(r, c));
// try {
// community_products.first();
community_products
.write()
.option("compression", "gzip")
.mode(SaveMode.Overwrite)
.json(outputPath + "/" + c);
// } catch (Exception e) {
//
// }
community_products
.write()
.option("compression", "gzip")
.mode(SaveMode.Overwrite)
.json(outputPath + "/" + c);
}
@ -75,11 +71,9 @@ public class CommunitySplit implements Serializable {
return r
.getContext()
.stream()
.map(con -> con.getCode())
.collect(Collectors.toList()).contains(c);
// .filter(con -> con.getCode().equals(c))
// .collect(Collectors.toList())
// .size() > 0;
.map(con -> con.getCode())
.collect(Collectors.toList())
.contains(c);
}
return false;
}