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.

static for_auction(timestamp, auction)[source]
static for_bid(expected_duration_micro, timestamp, bid)[source]
is_auction_window_fn()[source]
class apache_beam.testing.benchmarks.nexmark.queries.winning_bids.AuctionOrBidWindowCoder[source]

Bases: FastCoder

is_deterministic()[source]
class apache_beam.testing.benchmarks.nexmark.queries.winning_bids.AuctionOrBidWindowCoderImpl[source]

Bases: StreamCoderImpl

encode_to_stream(value, stream, nested)[source]
decode_from_stream(stream, nested)[source]
class apache_beam.testing.benchmarks.nexmark.queries.winning_bids.AuctionOrBidWindowFn(expected_duration_micro)[source]

Bases: WindowFn

assign(assign_context)[source]
merge(merge_context)[source]
get_window_coder()[source]
get_transformed_output_time(window, input_timestamp)[source]
class apache_beam.testing.benchmarks.nexmark.queries.winning_bids.JoinAuctionBidFn(*unused_args, **unused_kwargs)[source]

Bases: DoFn

static higher_bid(bid, other)[source]
process(element)[source]
class apache_beam.testing.benchmarks.nexmark.queries.winning_bids.WinningBids[source]

Bases: PTransform

expand(pcoll)[source]