Nifi init
This commit is contained in:
16
nifi/sql/extract/06_fact_medal_award.sql
Normal file
16
nifi/sql/extract/06_fact_medal_award.sql
Normal file
@@ -0,0 +1,16 @@
|
||||
-- Returns one row per player-medal with natural keys and pre-computed measures.
|
||||
SELECT
|
||||
t.game_id,
|
||||
m.country_id,
|
||||
m.organization_id,
|
||||
m.medal AS medal_type,
|
||||
CAST(DATE_FORMAT(t.start_date, '%Y%m%d') AS UNSIGNED) AS date_key,
|
||||
m.player_name,
|
||||
1 AS medal_count,
|
||||
CASE m.medal
|
||||
WHEN 'Gold' THEN 3
|
||||
WHEN 'Silver' THEN 2
|
||||
ELSE 1
|
||||
END AS medal_points
|
||||
FROM medalist m
|
||||
JOIN tournament t ON m.tournament_id = t.tournament_id;
|
||||
Reference in New Issue
Block a user