Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ParquetQuery<HadoopProfile> query = ParquetQuery.model(HadoopProfile.class)
- .field(HadoopProfile::getCommon, c -> c
- .field(HadoopCommon::getHomeCountry)
- .field(HadoopCommon::getEthnicityWithPrediction))
- .collection(HadoopProfile::getEvents, e -> e
- .field(HadoopEvent::getCampaignId)
- .field(HadoopEvent::getReceivedAt)
- .field(HadoopEvent::getCountry)
- .field(HadoopEvent::getMetricName));
- parquetService.readRDD(query, sparkContext)
- .foreach(p -> {
- counters.inc("country " + p.getCommon().getHomeCountry());
- if (p.getEvents() != null) {
- counters.inc("total events", p.getEvents().size());
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement