Nifi init

This commit is contained in:
2026-05-17 16:54:29 +02:00
parent 6203332841
commit 9cc58c20f4
15 changed files with 161 additions and 0 deletions

View 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;