apache_beam.testing.benchmarks.nexmark.queries.query6 module

Query 6, ‘Average Selling Price by Seller’. Select the average selling price over the last 10 closed auctions by the same seller. In CQL syntax:

SELECT Istream(AVG(Q.final), Q.seller)
FROM (SELECT Rstream(MAX(B.price) AS final, A.seller)
  FROM Auction A [ROWS UNBOUNDED], Bid B [ROWS UNBOUNDED]
  WHERE A.id=B.auction
    AND B.datetime < A.expires AND A.expires < CURRENT_TIME
  GROUP BY A.id, A.seller) [PARTITION BY A.seller ROWS 10] Q
GROUP BY Q.seller;
apache_beam.testing.benchmarks.nexmark.queries.query6.load(events, metadata=None)[source]
class apache_beam.testing.benchmarks.nexmark.queries.query6.MovingMeanSellingPriceFn(max_num_bids)[source]

Bases: apache_beam.transforms.core.CombineFn

Combiner to keep track of up to max_num_bids of the most recent wining bids and calculate their average selling price.

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