Skip to content

calculations.inplay_1_by_minute

Builds a complete minute-by-minute matrix for every match: minutes 1 → max(observed minute, 90), with odds/score forward-filled then backward-filled so every cell has a value. Events with no in-play odds get 90 empty minutes.

flowchart LR
ee[/sources.ended_events/] --> me[/calculations.inplay_1_by_minute/]
od[/sources.odds/] --> me
sm[(seeds__minutes)] --> me
me --> i2[/calculations.inplay_2_score/]
me --> m2[/calculations.matches_2_odds_inplay_home/]
me --> m3[/calculations.matches_3_odds_inplay_draw/]
me --> m4[/calculations.matches_4_odds_inplay_away/]
me --> mart[/mart.inplay/]
click ee "/sources/ended_events/" "Open"
click od "/sources/odds/" "Open"
click i2 "/calculations/inplay_2_score/" "Open"
click m2 "/calculations/matches_2_odds_inplay_home/" "Open"
click m3 "/calculations/matches_3_odds_inplay_draw/" "Open"
click m4 "/calculations/matches_4_odds_inplay_away/" "Open"
click mart "/mart/inplay/" "Open"
ColumnDescriptionFormula
event_idBet365 event identifier.passthrough from sources.ended_events
event_dateEvent date.passthrough
event_partition_keyClickHouse partition key.passthrough
minute_idMatch minute (1 … total_minutes_elapsed, min 90).cross join seeds__minutes filtered to 1 ≤ minute_id ≤ max(minute_elapsed, 90)
short_scoreLast-known score at this minute.last_value(short_score) over (partition by event_id, minute_elapsed order by odd_add_time), then forward-fill, then backward-fill
home_oddLast-known home odd at this minute.same forward/backward fill as short_score
draw_oddLast-known draw odd at this minute.same
away_oddLast-known away odd at this minute.same

Odds are taken only from in-play snapshots (is_in_play = 1, home_odd is not null, minute_elapsed > 0).