apache_beam.testing.benchmarks.nexmark.queries.winning_bids module¶
A transform to find winning bids for each closed auction. In pseudo CQL syntax:
SELECT Rstream(A.*, B.auction, B.bidder, MAX(B.price), B.dateTime) 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
We will also check that the winning bid is above the auction reserve. Note that we ignore the auction opening bid value since it has no impact on which bid eventually wins, if any.
Our implementation will use a custom windowing function in order to bring bids and auctions together without requiring global state.
- class apache_beam.testing.benchmarks.nexmark.queries.winning_bids.AuctionOrBidWindow(start, end, auction_id, is_auction_window)[source]¶
Bases:
IntervalWindow
Windows for open auctions and bids.
- class apache_beam.testing.benchmarks.nexmark.queries.winning_bids.AuctionOrBidWindowCoder[source]¶
Bases:
FastCoder
- class apache_beam.testing.benchmarks.nexmark.queries.winning_bids.AuctionOrBidWindowCoderImpl[source]¶
Bases:
StreamCoderImpl
- class apache_beam.testing.benchmarks.nexmark.queries.winning_bids.AuctionOrBidWindowFn(expected_duration_micro)[source]¶
Bases:
WindowFn
- class apache_beam.testing.benchmarks.nexmark.queries.winning_bids.JoinAuctionBidFn(*unused_args, **unused_kwargs)[source]¶
Bases:
DoFn
- class apache_beam.testing.benchmarks.nexmark.queries.winning_bids.WinningBids[source]¶
Bases:
PTransform