fixed id prefix creation for the fosnodoi records

This commit is contained in:
Claudio Atzori 2024-05-03 14:14:18 +02:00
parent 69c5efbd8b
commit e1a0fb8933
1 changed files with 4 additions and 3 deletions

View File

@ -80,9 +80,10 @@ public class PrepareFOSSparkJob implements Serializable {
fosDataset fosDataset
.groupByKey((MapFunction<FOSDataModel, String>) v -> v.getOaid().toLowerCase(), Encoders.STRING()) .groupByKey((MapFunction<FOSDataModel, String>) v -> v.getOaid().toLowerCase(), Encoders.STRING())
.mapGroups((MapGroupsFunction<String, FOSDataModel, Result>) (k, it) -> { .mapGroups(
return getResult(ModelSupport.getIdPrefix(Result.class) + "|" + k, it); (MapGroupsFunction<String, FOSDataModel, Result>) (k,
}, Encoders.bean(Result.class)) it) -> getResult(ModelSupport.entityIdPrefix.get(Result.class.getSimpleName()) + "|" + k, it),
Encoders.bean(Result.class))
.write() .write()
.mode(SaveMode.Overwrite) .mode(SaveMode.Overwrite)
.option("compression", "gzip") .option("compression", "gzip")