calculations.matches_5_score
Parses short_score (e.g. '2-1') into separate home / away / total / difference integers and a score_winner side. Carries league_id, team_home_id, team_away_id forward as keys for downstream window functions.
Lineage
Section titled “Lineage”flowchart LR ee[/sources.ended_events/] --> me[/calculations.matches_5_score/] me --> m6[/matches_6_team_stats_window/] me --> m10[/matches_10_overperformance/] me --> m17[/matches_17_strat_predicted/] me --> mart[/mart.matches/] click ee "/sources/ended_events/" "Open" click m6 "/calculations/matches_6_team_stats_window/" "Open" click m10 "/calculations/matches_10_overperformance/" "Open" click m17 "/calculations/matches_17_strat_predicted/" "Open" click mart "/mart/matches/" "Open"
Columns
Section titled “Columns”| Column | Description | Formula |
|---|---|---|
event_id | Bet365 event identifier. | passthrough |
event_date | Event date. | passthrough |
event_partition_key | ClickHouse partition key. | passthrough |
league_id | League identifier (key for windows). | passthrough |
team_home_id | Home-team identifier (key for windows). | passthrough |
team_away_id | Away-team identifier (key for windows). | passthrough |
short_score | Raw score string. | passthrough |
score_home | Home goals. | if(valid, toInt32OrNull(substring(short_score, 1, position(short_score,'-')-1)), NULL) where valid = match(short_score, '^[0-9]+-[0-9]+$') |
score_away | Away goals. | if(valid, toInt32OrNull(substring(short_score, position(short_score,'-')+1)), NULL) |
score_total | score_home + score_away. | if(valid, score_home + score_away, NULL) |
score_difference | score_home − score_away. | if(valid, score_home − score_away, NULL) |
score_winner | 'home' / 'draw' / 'away' / NULL. | case when home>away then 'home' when home=away then 'draw' when home<away then 'away' end (after the validity check above) |