[UsageCount] fixed error

(cherry picked from commit 9c9a9562ae)
This commit is contained in:
Miriam Baglioni 2024-04-02 16:56:37 +02:00 committed by Claudio Atzori
parent 191fc3a461
commit 7e6d12fa77
1 changed files with 1 additions and 1 deletions

View File

@ -111,12 +111,12 @@ public class SparkAtomicActionUsageJob implements Serializable {
resultModel
.joinWith(datasource, resultModel.col("datasourceId").equalTo(datasource.col("id")), "left")
.map((MapFunction<Tuple2<UsageStatsResultModel, Datasource>, UsageStatsResultModel>) t2 -> {
UsageStatsResultModel usrm = t2._1();
if(Optional.ofNullable(t2._2()).isPresent())
usrm.setDatasourceId(usrm.getDatasourceId() + "||" + t2._2().getOfficialname().getValue());
else
usrm.setDatasourceId(usrm.getDatasourceId() + "||NO_MATCH_FOUND");
return usrm;
return usrm;
}, Encoders.bean(UsageStatsResultModel.class))
.write()
.mode(SaveMode.Overwrite)