apache_beam.testing.benchmarks.nexmark.queries.query5 module

Query 5, ‘Hot Items’. Which auctions have seen the most bids in the last hour (updated every minute). In CQL syntax:

SELECT Rstream(auction)
FROM (SELECT B1.auction, count(*) AS num
      FROM Bid [RANGE 60 MINUTE SLIDE 1 MINUTE] B1
      GROUP BY B1.auction)
WHERE num >= ALL (SELECT count(*)
                  FROM Bid [RANGE 60 MINUTE SLIDE 1 MINUTE] B2
                  GROUP BY B2.auction);

To make things a bit more dynamic and easier to test we use much shorter windows, and we’ll also preserve the bid counts.

apache_beam.testing.benchmarks.nexmark.queries.query5.load(events, metadata=None, pipeline_options=None)[source]
class apache_beam.testing.benchmarks.nexmark.queries.query5.MostBidCombineFn(*unused_args, **unused_kwargs)[source]

Bases: CombineFn

combiner function to find auctions with most bid counts

create_accumulator()[source]
add_input(accumulator, element)[source]
merge_accumulators(accumulators)[source]
extract_output(accumulator)[source]