forked from D-Net/dnet-hadoop
Merge pull request '[UsageCount] fixed error' (#415) from UsageStatsRecordDS into beta
Reviewed-on: D-Net/dnet-hadoop#415
This commit is contained in:
commit
4bb504e693
|
@ -111,12 +111,12 @@ public class SparkAtomicActionUsageJob implements Serializable {
|
||||||
resultModel
|
resultModel
|
||||||
.joinWith(datasource, resultModel.col("datasourceId").equalTo(datasource.col("id")), "left")
|
.joinWith(datasource, resultModel.col("datasourceId").equalTo(datasource.col("id")), "left")
|
||||||
.map((MapFunction<Tuple2<UsageStatsResultModel, Datasource>, UsageStatsResultModel>) t2 -> {
|
.map((MapFunction<Tuple2<UsageStatsResultModel, Datasource>, UsageStatsResultModel>) t2 -> {
|
||||||
|
UsageStatsResultModel usrm = t2._1();
|
||||||
if(Optional.ofNullable(t2._2()).isPresent())
|
if(Optional.ofNullable(t2._2()).isPresent())
|
||||||
usrm.setDatasourceId(usrm.getDatasourceId() + "||" + t2._2().getOfficialname().getValue());
|
usrm.setDatasourceId(usrm.getDatasourceId() + "||" + t2._2().getOfficialname().getValue());
|
||||||
else
|
else
|
||||||
usrm.setDatasourceId(usrm.getDatasourceId() + "||NO_MATCH_FOUND");
|
usrm.setDatasourceId(usrm.getDatasourceId() + "||NO_MATCH_FOUND");
|
||||||
return usrm;
|
return usrm;
|
||||||
return usrm;
|
|
||||||
}, Encoders.bean(UsageStatsResultModel.class))
|
}, Encoders.bean(UsageStatsResultModel.class))
|
||||||
.write()
|
.write()
|
||||||
.mode(SaveMode.Overwrite)
|
.mode(SaveMode.Overwrite)
|
||||||
|
|
Loading…
Reference in New Issue