DataExpert-io/data-engineer-handbook

Fix the script players.sql script - wrong type definition

Closed this issue · 2 comments

Within the script lecture-lab/players.sql the column name and the field this is switched, so the scripts fails while running:

...

 CREATE TYPE scoring_class AS
     ENUM ('bad', 'average', 'good', 'star');
     
 CREATE TABLE players (
     player_name TEXT,
     height TEXT,
     college TEXT,
     country TEXT,
     draft_year TEXT,
     draft_round TEXT,
     draft_number TEXT,
     seasons season_stats[],
     scoring_class scorer_class, # <--- here the field name and data type are switched
     is_active BOOLEAN,
     current_season INTEGER,
     PRIMARY KEY (player_name, current_season)
 );

...

CREATE TYPE scoring_class AS
ENUM ('bad', 'average', 'good', 'star');

CREATE TABLE players (
player_name TEXT,
height TEXT,
college TEXT,
country TEXT,
draft_year TEXT,
draft_round TEXT,
draft_number TEXT,
seasons season_stats[],
scorer_class scoring_class, # <--- here the field name and data type are switched
is_active BOOLEAN,
current_season INTEGER,
PRIMARY KEY (player_name, current_season)
);

This should be scorer_class scoring_class, instead of scoring_class scorer_class,