Search in sources :

Example 1 with AuctionPrice

use of org.apache.beam.sdk.nexmark.model.AuctionPrice in project beam by apache.

the class Query2 method expand.

@Override
public PCollection<AuctionPrice> expand(PCollection<Event> events) {
    return events.apply(NexmarkQueryUtil.JUST_BIDS).apply(Filter.by(bid -> bid.auction % this.auctionSkip == 0)).apply(name + ".Project", ParDo.of(new DoFn<Bid, AuctionPrice>() {

        @ProcessElement
        public void processElement(ProcessContext c) {
            Bid bid = c.element();
            c.output(new AuctionPrice(bid.auction, bid.price));
        }
    }));
}
Also used : DoFn(org.apache.beam.sdk.transforms.DoFn) Bid(org.apache.beam.sdk.nexmark.model.Bid) AuctionPrice(org.apache.beam.sdk.nexmark.model.AuctionPrice)

Aggregations

AuctionPrice (org.apache.beam.sdk.nexmark.model.AuctionPrice)1 Bid (org.apache.beam.sdk.nexmark.model.Bid)1 DoFn (org.apache.beam.sdk.transforms.DoFn)1